Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build instructions #3009

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
('cpp:identifier', 'dal'),
# method
('cpp:identifier', 'method'),
('cpp:identifier', 'method::by_default'),
('cpp:identifier', 'Method'),
# task
('cpp:identifier', 'task'),
Expand Down
46 changes: 31 additions & 15 deletions docs/source/get-started/build-and-run-examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ basic usage scenarios of |short_name| with DPCPP. Go to

.. group-tab:: Windows

To set up |short_name| environment, run ``source /env/vars.bat`` or ``source setvars.bat``.
To set up |short_name| environment, run ``call /env/vars.bat`` or ``call setvars.bat``.

#. Copy ``./examples/oneapi/dpc`` to a writable directory if necessary (since it creates temporary files):

Expand All @@ -76,9 +76,20 @@ basic usage scenarios of |short_name| with DPCPP. Go to

#. Set up oneMKL environment in case of static linking:

.. code-block:: bash
.. tabs::

.. group-tab:: Linux

.. code-block:: bash

source mkl/latest/env/vars.sh

.. group-tab:: Windows

.. code-block:: bash

call mkl/latest/env/vars.bat

source mkl/latest/env/vars.sh

#. Build and run examples:

Expand All @@ -89,37 +100,42 @@ basic usage scenarios of |short_name| with DPCPP. Go to
Otherwise, you need to copy :file:`examples/oneapi/dpc` and :file:`examples/oneapi/data` folders
to the directory with right permissions. These two folders must be retained
in the same directory level relative to each other.
If you want to build examples from /examples/oneapi/cpp you can set CC and CXX with other compliers as well.
david-cortes-intel marked this conversation as resolved.
Show resolved Hide resolved
david-cortes-intel marked this conversation as resolved.
Show resolved Hide resolved
avolkov-intel marked this conversation as resolved.
Show resolved Hide resolved

.. tabs::

.. group-tab:: Linux

.. code-block:: bash

# Navigate to examples directory and build examples
cd /examples/oneapi/dpc
cmake -G "Unix Makefiles" -DEXAMPLES_LIST=svm_two_class_thunder # This would generate makefiles for all svm examples matching passed name
make # This will compile and run generated svm examples
cmake -G "Unix Makefiles" -DONEDAL_LINK=static # This wouldgenerate make for static version
make # This will compile and run all the examples
# Navigate to examples directory and build examples
cd /examples/oneapi/dpc
export CC=icx
export CXX=icpx or export CXX=icx
cmake -G "Unix Makefiles" -DEXAMPLES_LIST=svm_two_class_thunder # This would generate makefiles for all svm examples matching passed name
make # This will compile and run generated svm examples
cmake -G "Unix Makefiles" -DONEDAL_LINK=static # This wouldgenerate make for static version
make # This will compile and run all the examples
avolkov-intel marked this conversation as resolved.
Show resolved Hide resolved

.. group-tab:: Windows

.. code-block:: bash

# Navigate to examples directory and build examples
cd /examples/oneapi/dpc
cmake -G "NMake Makefiles" -DEXAMPLES_LIST=svm_two_class_thunder # This would generate makefiles for all svm examples matching passed name
nmake # This will compile and run generated svm examples
cmake -G "NMake Makefiles" -DONEDAL_LINK=static # This wouldgenerate make for static version
nmake # This will compile and run all the examples
set CC=icx
avolkov-intel marked this conversation as resolved.
Show resolved Hide resolved
david-cortes-intel marked this conversation as resolved.
Show resolved Hide resolved
set CXX=icx
avolkov-intel marked this conversation as resolved.
Show resolved Hide resolved
david-cortes-intel marked this conversation as resolved.
Show resolved Hide resolved
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DEXAMPLES_LIST=svm_two_class_thunder # This would generate makefiles for all svm examples matching passed name
nmake # This will compile and run generated svm examples
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DONEDAL_LINK=static # This wouldgenerate make for static version
nmake # This will compile and run all the examples


#. The resulting example binaries and log files are written into the :file:`_results` directory.
#. The resulting example binaries and log files are written into the :file:`_cmake_results` directory.

.. note::

You should run the examples from :file:`examples/oneapi/dpc` folder, not from :file:`_results` folder.
You should run the examples from :file:`examples/oneapi/dpc` folder, not from :file:`_cmake_results` folder.
Most examples require data to be stored in :file:`examples/oneapi/data` folder and to have a relative link to it
started from :file:`examples/oneapi/dpc` folder.

Expand Down
Loading