Get Started Guide

  • 2020
  • 07/15/2020
  • Public Content

Get Started with Intel® Data Analytics Acceleration Library for
macOS*

Intel® Data Analytics Acceleration Library (Intel® DAAL) is the library of Intel® architecture optimized building blocks covering all stages of data analytics: data acquisition from a data source, preprocessing, transformation, data mining, modeling, validation, and decision making.
Intel DAAL is
installed standalone and
a
s
part of the following suites:
Intel DAAL is also provided as a standalone package under the Community Licensing Program.

Prerequisites

Install Intel DAAL on Your System
Intel DAAL installs in the directory
<install-dir>
/
daal
.
By default, when DAAL is installed as a part of Intel® Parallel Studio XE,
<install-dir>
is
/opt/intel/compilers_and_libraries_
2020
.x.xxx/
mac
.
For installation details, refer to Intel DAAL Installation Guide.
Set Environment Variables
  1. Run the
    <install-dir>
    /
    daal
    /
    bin
    /
    daalvars
    .sh
    or
    .csh
    script
    as appropriate to your target architecture
    :
    • IA-32 architecture:
      daalvars
      .sh
      ia32
    • Intel® 64 architecture:
      daalvars
      .sh
      intel64
  2. Optionally: Specify the Java* compiler different from the default compiler:
    export
    JAVA_HOME=
    $
    PATH_TO_JAVA_SDK
    export
    PATH=
    $
    JAVA_HOME
    /
    bin
    :
    $
    PATH

C++ Language

Step 1: Choose the Compiler Option for Automatic Linking of Your Application with Intel DAAL
Decide on the variant of the
the
-
daal
option of the Intel® C++ Compiler 16 or higher or configure your project in the
Integrated Development Environment (IDE)
:
Compiler Option
IDE Equivalent
daal
or
‑daal=parallel
Tells the compiler to link with standard threaded Intel DAAL.
Eclipse*:
  1. Go to
    Project
    >
    Properties
    >
    C/C++ Build
    >
    Settings
    >
    Intel C++ Compiler
    >
    Performance Library Build Components
    >
    Use Intel(R) Data Analytics Acceleration Library
    .
  2. Select
    Use threaded Intel DAAL (‑daal=parallel)
    or
    Use non-threaded Intel DAAL (‑daal=sequential)
    , as appropriate.
Xcode*:
  1. Go to
    Project
    >
    Build Settings
    >
    ICC InteL C++ Compiler XE yy.y
    >
    Performance Library Build Components
    >
    Use Intel Data Analytics Acceleration Library
    .
  2. Select
    Use threaded Intel Data Analytics Acceleration Library
    or
    Use non-threaded Intel Data Analytics Acceleration Library
    , as appropriate.
‑daal=sequential
Tells the compiler to link with sequential version of Intel DAAL.
For more information on the
daal
compiler option, see the Intel® Compiler User and Reference Guide.
Step 2: Create and Run Your First Application with Intel DAAL
This short application computes Cholesky decomposition with Intel DAAL.
/******************************************************************************* ! Copyright(C) 2014-2020 Intel Corporation. All Rights Reserved. ! ! The source code, information and material ("Material") contained herein is ! owned by Intel Corporation or its suppliers or licensors, and title to such ! Material remains with Intel Corporation or its suppliers or licensors. The ! Material contains proprietary information of Intel or its suppliers and ! licensors. The Material is protected by worldwide copyright laws and treaty ! provisions. No part of the Material may be used, copied, reproduced, ! modified, published, uploaded, posted, transmitted, distributed or disclosed ! in any way without Intel's prior express written permission. No license ! under any patent, copyright or other intellectual property rights in the ! Material is granted to or conferred upon you, either expressly, by ! implication, inducement, estoppel or otherwise. Any license under such ! intellectual property rights must be express and approved by Intel in ! writing. ! ! *Third Party trademarks are the property of their respective owners. ! ! Unless otherwise agreed by Intel in writing, you may not remove or alter ! this notice or any other notice embedded in Materials by Intel or Intel's ! suppliers or licensors in any way. ! !******************************************************************************* ! Content: ! Cholesky decomposition sample program. !******************************************************************************/ #include "daal.h" #include <iostream> using namespace daal; using namespace daal::algorithms; using namespace daal::data_management; using namespace daal::services; const size_t dimension = 3; double inputArray[dimension *dimension] = { 1.0, 2.0, 4.0, 2.0, 13.0, 23.0, 4.0, 23.0, 77.0 }; int main(int argc, char *argv[]) { /* Create input numeric table from array */ SharedPtr<NumericTable> inputData = SharedPtr<NumericTable>(new Matrix<double>(dimension, dimension, inputArray)); /* Create the algorithm object for computation of the Cholesky decomposition using the default method */ cholesky::Batch<> algorithm; /* Set input for the algorithm */ algorithm.input.set(cholesky::data, inputData); /* Compute Cholesky decomposition */ algorithm.compute(); /* Get pointer to Cholesky factor */ SharedPtr<Matrix<double> > factor = staticPointerCast<Matrix<double>, NumericTable>(algorithm.getResult()->get(cholesky::choleskyFactor)); /* Print the first element of the Cholesky factor */ std::cout << "The first element of the Cholesky factor: " << (*factor)[0][0]; return 0; }
  1. Paste the application code into the editor of your choice.
  2. Save the file as
    my_first_daal_program.cpp
    .
  3. Compile with the following command, providing the selected variant of the
    ‑daal
    compiler option, for example,
    ‑daal=parallel
    :
    icc my_first_daal_program.cpp -daal=parallel -o my_first_daal_program
  4. Run the application.
Step 3 (Optional): Build Your Application with Different Compilers
List the following Intel DAAL libraries on a link line
, depending on Intel DAAL threading mode and linking method:
Single-threaded (non-threaded) Intel DAAL
Multi-threaded (internally threaded) Intel DAAL
Static linking
lib
daal_core.
a
lib
daal_sequential.
a
lib
daal_core.
a
lib
daal_thread.
a
Dynamic linking
lib
daal_core
.
dylib
libdaal_sequential.
dylib
lib
daal_core
.
dylib
libdaal_thread.
dylib
These libraries are located in the directory
<install-dir>
/daal/lib
.
Regardless of the linking method,
also add to your link line
the library on which Intel DAAL libraries depend:
  • Intel® Threading Building Blocks run-time library of the Intel® compiler
    lib
    tbb
    .
    dylib
For example, to build your application by statically linking with multi-threaded Intel DAAL:
icc my_first_daal_program.cpp ‑o my_first_daal_program
$DAALROOT/lib/libdaal_core.a $DAALROOT/lib/libdaal_thread.a ‑ltbb -ldl
Step 4: Build and Run Intel DAAL Code Examples
  1. Build an example:
    Go to the C++ examples directory and execute the
    make
    command:
    cd
    <install-dir>
    /daal/examples/cpp
    make {libia32|dylibia32|libintel64|dylibintel64}
            example=
    <example_name>
            compiler={intel|gnu
    |clang
    }
            threading={parallel|sequential}
            mode=build
    Among the
    {libia32|dylibia32|libintel64|dylibintel64}
    parameters, choose the one that matches the architecture parameter you provided to the
    daalvars
    .sh
    script and has the prefix that matches the type of executables you want to build:
    lib
    for static and
    dylib
    for dynamic executables.
    The names of the examples are available in the
    daal.lst
    file.
    The command creates a directory for the chosen compiler, architecture, and library extension (
    a
    or
    dylib
    ). For example:
    _results/intel_intel64_a
    .
  2. Run an example:
    Go to the C++ examples directory and execute the
    make
    command in the run mode. For example, if you ran the
    daalvars
    script with the
    intel64
    target:
    cd
    <install-dir>
    /daal/examples/cpp
    make libintel64 example=cholesky_batch.cpp mode=run
    The
    make
    command builds the static library for the Intel 64 architecture and
    cholesky_batch.cpp
    example with Intel® compiler, assumed by default, and runs the executable.

Java* Language

Build and Run Intel DAAL Code Examples
To build and run Java code examples, use the version of the Java Virtual Machine* corresponding to the architecture parameter you provided to the
daalvars
.sh
script during setting environment variables.
  1. Free 4 gigabytes of memory on your system.
  2. Build examples:
    Go to the Java examples directory and execute the
    launcher
    command with the
    build
    parameter:
    cd
    <install-dir>
    /
    daal
    /
    examples
    /
    java
    launcher
    .sh
    build
    $
    PATH_TO_JAVAC
    The command builds executables
    *.class
    (for example,
    CholeskyBatch.class
    ) in the
    <install-dir>
    /
    daal
    /
    examples
    /
    java
    /
    com
    /
    intel
    /
    daal
    /
    examples
    /
    <example name>
    directory.
  3. Run examples:
    Go to the Java examples directory and execute the
    launcher
    command with the
    run
    parameter:
    cd
    <install-dir>
    /
    daal
    /
    examples
    /
    java
    launcher
    .sh
    {ia32|intel64} run
    $
    PATH_TO_JAVAC
    Choose the same architecture parameter as you provided to the
    daalvars
    .sh
    script.
    The output for each example is written to the file
    <example name>
    .res
    located in the
    .
    /
    _results
    /
    ia32
    or
    .
    /
    _results
    /
    intel64
    directory, depending on the specified architecture.

Python* Language

Deprecation Notice
: With the introduction of daal4py, a package that supersedes PyDAAL, Intel is deprecating PyDAAL and will discontinue support starting with Intel® DAAL 2021 and Intel® Distribution for Python 2021. Until then Intel will continue to provide compatible pyDAAL pip and conda packages for newer releases of Intel DAAL and make it available in open source. However, Intel will not add the new features of Intel DAAL to pyDAAL. Intel recommends developers switch to and use daal4py.
Step 1: Set Up the Build Environment
Set up the C++ build environment as explained under C++ Language.
Step 2: Install Intel DAAL for Python
Go to the directory with Python sources of Intel DAAL and run the install script:
cd
<install-dir>
/
pydaal_sources
<python home>
/
python setup.py install
This script compiles code using Intel DAAL for C++. It builds and installs the pyDAAL package for using Intel DAAL in Python programs.
Step 3: Run Intel DAAL Code Examples
To run Intel DAAL code examples, use the same version of Python as you used to install pyDAAL.
  • Go to the directory with Intel DAAL Python examples:
    cd
    <install-dir>
    /
    examples
    /
    python
  • To run all the examples, execute the command:
    <python home>
    /
    python run_examples.py
    The output for each example is written to the
    .
    /
    _results
    /
    intel64
    /
    <example name>
    .res
    file.
  • To run one specific example, execute the command:
    <python home>
    /
    python
    <algorithm name>
    /
    <example name>
    .py
    For example:
    /usr/local/bin/python3.5.1/
    python cholesky
    /
    cholesky_batch.py
    This command prints the output to your console.

Training and Documentation

To learn more about the product, see the following resources:
Resource
Description
Get access to Intel DAAL in-depth webinars and featured articles.
Developer Guide for Intel® Data Analytics Acceleration Library:
Find recommendations on programming with Intel DAAL, including performance tips. A Japanese version is available in the downloadable studio documentation bundle.
View detailed API descriptions for the following programming languages:
  • C++
  • Java*
  • Python*
Learn about installation options available for the product and get installation instructions.
Learn about:
  • New features of the product
  • Directory layout
  • Hardware and software requirements
<install-dir>
/
daal
/
examples
folder
Get access to the collection of programs that demonstrate usage of Intel DAAL application programming interfaces.
Get access to the collection of code samples for various algorithms that you can include in your program and immediately use with Hadoop*, Spark*, message-passing interface (MPI), or MySQL*.
View full documentation library for this and other Intel software products.
Intel technologies may require enabled hardware, software or service activation.
No product or component can be absolutely secure.
Your costs and results may vary.
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.
Optimization Notice
Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice revision #20110804
No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.
The products described may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.
Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804