Skip to content

Commit 71c19df

Browse files
committed
first try
1 parent 7cc1c9b commit 71c19df

File tree

5 files changed

+58
-16
lines changed

5 files changed

+58
-16
lines changed

.ci/scripts/build.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ show_help() {
3636
--tbb-dir:The TBB installation directory to use to build oneDAL with in the case that the backend is given as `ref`. If the installation directory does not exist, attempts to build this from source
3737
--use-openrng:Set this to yes if openrng is to be used as RNG backend. Use this only with the `ref` backend.
3838
--sysroot:The sysroot to use, in the case that clang is used as the cross-compiler
39+
--debug:Set build debug mode flag
40+
--jobs:The number of parallel threads to use for oneDAL building
3941
'
4042
}
4143

@@ -76,6 +78,12 @@ while [[ $# -gt 0 ]]; do
7678
--use-openrng)
7779
use_openrng="$2"
7880
shift;;
81+
--debug)
82+
use_debug="$2"
83+
shift;;
84+
--jobs)
85+
jobs="$2"
86+
shift;;
7987
--help)
8088
show_help
8189
exit 0
@@ -128,7 +136,9 @@ else
128136
fi
129137

130138
#setting build parallelization based on number of threads
131-
if [ "$(uname)" == "Linux" ]; then
139+
if [[ -n "${jobs}" ]]; then
140+
make_op="-j${jobs}"
141+
elif [ "$(uname)" == "Linux" ]; then
132142
make_op="-j$(nproc --all)"
133143
else
134144
make_op="-j$(sysctl -n hw.physicalcpu)"
@@ -247,6 +257,10 @@ if [ "${use_openrng}" == "yes" ]; then
247257
make_options+=(RNG_BACKEND=openrng)
248258
fi
249259

260+
if [ -n "${use_debug}" ]; then
261+
make_options+=(REQDBG="${use_debug}")
262+
fi
263+
250264
echo "Calling make"
251265
echo "CXX=$CXX"
252266
echo "CC=$CC"

.ci/scripts/test.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function show_help_text {
3232
--backend:The backend C library to use. Must be one of [mkl, ref]
3333
--platform:Explicitly pass the platform. This is the same as is passed to the top-level oneDAL build script
3434
--cross-compile:Indicates whether cross-compilation is being performed
35+
--jobs:The number of parallel threads to use for test building
3536
'
3637
}
3738

@@ -74,6 +75,10 @@ while [[ $# -gt 0 ]]; do
7475
--cross-compile)
7576
cross_compile="yes"
7677
;;
78+
--jobs)
79+
jobs="$2"
80+
shift
81+
;;
7782
--help)
7883
show_help_text
7984
exit 0
@@ -133,7 +138,9 @@ else
133138
exit 1
134139
fi
135140

136-
if [ "$(uname)" == "Linux" ]; then
141+
if [[ -n "${jobs}" ]]; then
142+
make_op="-j${jobs}"
143+
elif [ "$(uname)" == "Linux" ]; then
137144
make_op="-j$(nproc --all)"
138145
else
139146
make_op="-j$(sysctl -n hw.physicalcpu)"

.github/workflows/ci.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,37 @@ jobs:
5656
run: |
5757
source /opt/intel/oneapi/setvars.sh
5858
.ci/scripts/describe_system.sh
59-
- name: Make daal
59+
- name: Make daal debug
6060
run: |
6161
source /opt/intel/oneapi/setvars.sh
62-
.ci/scripts/build.sh --compiler icx --optimizations avx2 --target daal
62+
.ci/scripts/build.sh --compiler icx --optimizations avx512 --target daal --debug symbols
63+
- name: Make onedal debug
64+
run: |
65+
source /opt/intel/oneapi/setvars.sh
66+
cp __work __work_daal
67+
.ci/scripts/build.sh --compiler icx --optimizations avx512 --target onedal --debug symbols
68+
cp __release_lnx __release_lnx_debug
69+
mv __work_daal __work
6370
- name: Make onedal
6471
run: |
72+
# generate new onedal portion for use in examples testing (due to issues with dpc debug build)
6573
source /opt/intel/oneapi/setvars.sh
66-
.ci/scripts/build.sh --compiler icx --optimizations avx2 --target onedal
74+
.ci/scripts/build.sh --compiler icx --optimizations avx512 --target onedal
75+
- name: Prepare Cache
76+
run: |
77+
gh extensions install actions/gh-actions-cache
78+
gh actions-cache delete __release_lnx_main --confirm
79+
- name: Cache build
80+
uses: actions/cache/save@v4
81+
with:
82+
key: __release_lnx_main
83+
path: ./__release_lnx_debug
6784
- name: Archive build
85+
if: github.event_name == 'pull_request'
6886
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
6987
with:
7088
name: __release_lnx
71-
path: ./__release_lnx
72-
- name: Archive oneDAL environment
73-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
74-
with:
75-
name: oneDAL_env
76-
path: .ci/env
89+
path: ./__release_lnx_debug
7790
- name: daal/cpp examples
7891
run: |
7992
source /opt/intel/oneapi/setvars.sh

INSTALL.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,14 @@ It is possible to build oneDAL libraries with selected set of algorithms and/or
155155

156156
On **Linux\*** it is possible to build debug version of oneDAL or the version that allows to do kernel profiling using <ittnotify.h>.
157157

158-
- To build debug version of oneDAL, run:
158+
- To build debug version of oneDAL (including debug symbols and asserts), run:
159159

160160
make -f makefile daal oneapi_c PLAT=lnx32e REQDBG=yes
161161

162+
To build oneDAL to include only debug symbols, run:
163+
164+
make -f makefile daal oneapi_c PLAT=lnx32e REQDBG=symbols
165+
162166
- To build oneDAL with kernel profiling information, run:
163167

164168
make -f makefile daal oneapi_c PLAT=lnx32e REQPROFILE=yes

makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#===============================================================================
1+
#===============================================================================
22
# Copyright 2014 Intel Corporation
33
# Copyright contributors to the oneDAL project
44
#
@@ -132,8 +132,10 @@ y := $(notdir $(filter $(_OS)/%,lnx/so win/dll mac/dylib))
132132
-DMKL_ILP64 := $(if $(filter mkl,$(BACKEND_CONFIG)),-DMKL_ILP64)
133133
-Zl := $(-Zl.$(COMPILER))
134134
-Zl_DPCPP := $(-Zl.dpcpp)
135-
-DEBC := $(if $(REQDBG),$(-DEBC.$(COMPILER)) -DDEBUG_ASSERT -DONEDAL_ENABLE_ASSERT) -DTBB_SUPPRESS_DEPRECATED_MESSAGES -D__TBB_LEGACY_MODE
136-
-DEBC_DPCPP := $(if $(REQDBG),$(-DEBC.dpcpp) -DDEBUG_ASSERT -DONEDAL_ENABLE_ASSERT)
135+
# if REQDBG set to 'symbols', it will disable assert checking
136+
# This greatly reduces compiling with the static library when only symbols are desired
137+
-DEBC := $(if $(REQDBG),$(if $(filter symbols,$(REQDBG)),$(-DEBC.$(COMPILER)),$(-DEBC.$(COMPILER)) -DDEBUG_ASSERT -DONEDAL_ENABLE_ASSERT)) -DTBB_SUPPRESS_DEPRECATED_MESSAGES -D__TBB_LEGACY_MODE
138+
-DEBC_DPCPP := $(if $(REQDBG),$(if $(filter symbols,$(REQDBG)),$(-DEBC.dpcpp),$(-DEBC.dpcpp) -DDEBUG_ASSERT -DONEDAL_ENABLE_ASSERT))
137139
-DEBL := $(if $(REQDBG),$(if $(OS_is_win),-debug,))
138140
-EHsc := $(if $(OS_is_win),-EHsc,)
139141
-isystem := $(if $(OS_is_win),-I,-isystem)
@@ -1116,7 +1118,9 @@ Flags:
11161118
possible values: $(CORE.ALGORITHMS.CUSTOM.AVAILABLE)
11171119
REQCPU - list of CPU optimizations to be included into library
11181120
possible values: $(CPUs)
1119-
REQDBG - flag that enables build in debug mode
1121+
REQDBG - flag that enables build in debug mode. Debug mode turns on oneDAL
1122+
assertions and adds debug symbols. For only debug symbols set flag to
1123+
special value: symbols
11201124
REQPROFILE - flag that enables kernel profiling using <ittnotify.h>
11211125
endef
11221126

0 commit comments

Comments
 (0)