Skip to content

Commit

Permalink
Update build instructions (#3009)
Browse files Browse the repository at this point in the history
* Update build instructions

* Fix build instructions
  • Loading branch information
avolkov-intel authored Jan 14, 2025
1 parent dda0682 commit 04ce57c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 15 deletions.
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
('cpp:identifier', 'base'),
# 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.

.. 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
.. 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
set CXX=icx
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

0 comments on commit 04ce57c

Please sign in to comment.