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

fix(make): enabling debug build #2946

Merged
15 changes: 8 additions & 7 deletions cpp/daal/src/algorithms/dtrees/dtrees_feature_type_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ struct BinParams
{}
BinParams(const BinParams & o) : maxBins(o.maxBins), minBinSize(o.minBinSize), binningStrategy(o.binningStrategy) {}

/* Strategy to create bins for feature values. Default: quantiles */
BinningStrategy binningStrategy = BinningStrategy::quantiles;
/* Maximum number of bins for indexed data. Default: 256 */
size_t maxBins = 256;
/* Minimum bin width (number of data points per bin). Default: 5*/
size_t minBinSize = 5;
/* Strategy to create bins for feature values. Default: quantiles */
BinningStrategy binningStrategy = BinningStrategy::quantiles;
};

//////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -100,16 +100,17 @@ class IndexedFeatures
struct FeatureEntry
{
DAAL_NEW_DELETE();
IndexType numIndices = 0; //number of indices or bins
ModelFPType * binBorders = nullptr; //right bin borders
ModelFPType min = 0; //used for random splitter, since all borders are known but min.
IndexType numIndices = 0; // number of indices or bins
ModelFPType * binBorders = nullptr; // right bin borders
ModelFPType min = 0; // used for random splitter, since all borders are known but min.

services::Status allocBorders();
~FeatureEntry();
};

public:
IndexedFeatures() : _data(nullptr), _entries(nullptr), _sizeOfIndex(sizeof(IndexType)), _nCols(0), _nRows(0), _capacity(0), _maxNumIndices(0) {}
IndexedFeatures() : _data(nullptr), _entries(nullptr), _sizeOfIndex(sizeof(IndexType)), _nRows(0), _nCols(0), _capacity(0), _maxNumIndices(0) {}

~IndexedFeatures();

//initialize the feature indices, i.e. bins
Expand All @@ -133,7 +134,7 @@ class IndexedFeatures
ModelFPType binRightBorder(size_t iCol, size_t iBin) const
{
DAAL_ASSERT(isBinned(iCol));
DAAL_ASSERT(iBin < numIndices(iCol));
DAAL_ASSERT(iBin < static_cast<size_t>(numIndices(iCol)));
return _entries[iCol].binBorders[iBin];
}

Expand Down
10 changes: 8 additions & 2 deletions dev/make/compiler_definitions/dpcpp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ CMPLRDIRSUFF.dpcpp = _dpcpp

CORE.SERV.COMPILER.dpcpp = generic

-Zl.dpcpp =
-DEBC.dpcpp = -g
-Zl.dpcpp = $(if $(OS_is_win),-Zl,) $(-Q)no-intel-lib
-DEBC.dpcpp = $(if $(OS_is_win),-debug:all -Z7,-g) -fno-system-debug

COMPILER.lnx.dpcpp = icpx -fsycl -m64 -stdlib=libstdc++ -fgnu-runtime -fwrapv \
-Werror -Wreturn-type -fsycl-device-code-split=per_kernel
Expand All @@ -39,6 +39,12 @@ link.dynamic.win.dpcpp = icx -fsycl -m64 -fsycl-device-code-split=per_kernel -fs
pedantic.opts.lnx.dpcpp = -pedantic \
-Wall \
-Wextra \
-Wwritable-strings \
-Wno-unused-parameter

pedantic.opts.win.dpcpp = -Wall \
-Wextra \
-Wwritable-strings \
-Wno-unused-parameter

p4_OPT.dpcpp = -march=nocona
Expand Down
23 changes: 10 additions & 13 deletions dev/make/compiler_definitions/icx.mkl.32e.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CORE.SERV.COMPILER.icx = generic


-Zl.icx = $(if $(OS_is_win),-Zl,) $(-Q)no-intel-lib
-DEBC.icx = $(if $(OS_is_win),-debug:all -Z7,-g)
-DEBC.icx = $(if $(OS_is_win),-debug:all -Z7,-g) -fno-system-debug

-Qopt = $(if $(OS_is_win),-Qopt-,-qopt-)

Expand All @@ -37,19 +37,16 @@ COMPILER.win.icx = icx $(if $(MSVC_RT_is_release),-MD -Qopenmp-simd, -MDd) -nolo

link.dynamic.lnx.icx = icx -m64 -no-intel-lib

pedantic.opts.icx = -pedantic \
-Wall \
-Wextra \
-Wwritable-strings \
-Wno-unused-parameter
pedantic.opts.lnx.icx = -pedantic \
-Wall \
-Wextra \
-Wwritable-strings \
-Wno-unused-parameter

pedantic.opts.icx_win = -Wall \
-Wextra \
-Wwritable-strings \
-Wno-unused-parameter

pedantic.opts.lnx.icx = $(pedantic.opts.icx)
pedantic.opts.win.icx = $(pedantic.opts.icx_win)
pedantic.opts.win.icx = -Wall \
-Wextra \
-Wwritable-strings \
-Wno-unused-parameter

p4_OPT.icx = -march=nocona
mc3_OPT.icx = -march=nehalem
Expand Down
48 changes: 26 additions & 22 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,27 @@ AR_is_$(subst $(space),_,$(origin AR)) := yes

OSList := lnx win mac

o := $(if $(OS_is_win),obj,o)
a := $(if $(OS_is_win),lib,a)
d := $(if $(OS_is_win),$(if $(MSVC_RT_is_debug),d,),)
dtbb := $(if $(OS_is_win),$(if $(MSVC_RT_is_debug),_debug,),)
plib := $(if $(OS_is_win),,lib)
scr := $(if $(OS_is_win),bat,sh)
y := $(notdir $(filter $(_OS)/%,lnx/so win/dll mac/dylib))
-Fo := $(if $(OS_is_win),-Fo,-o)
-Q := $(if $(OS_is_win),$(if $(COMPILER_is_vc),-,-Q),-)
-cxx17 := $(if $(COMPILER_is_vc),/std:c++17,$(-Q)std=c++17)
-fPIC := $(if $(OS_is_win),,-fPIC)
o := $(if $(OS_is_win),obj,o)
a := $(if $(OS_is_win),lib,a)
d := $(if $(OS_is_win),$(if $(MSVC_RT_is_debug),d,),)
dtbb := $(if $(OS_is_win),$(if $(MSVC_RT_is_debug),_debug,),)
plib := $(if $(OS_is_win),,lib)
scr := $(if $(OS_is_win),bat,sh)
y := $(notdir $(filter $(_OS)/%,lnx/so win/dll mac/dylib))
-Fo := $(if $(OS_is_win),-Fo,-o)
-Q := $(if $(OS_is_win),$(if $(COMPILER_is_vc),-,-Q),-)
-cxx17 := $(if $(COMPILER_is_vc),/std:c++17,$(-Q)std=c++17)
-fPIC := $(if $(OS_is_win),,-fPIC)
-DMKL_ILP64 := $(if $(filter mkl,$(BACKEND_CONFIG)),-DMKL_ILP64)
-Zl := $(-Zl.$(COMPILER))
-DEBC := $(if $(REQDBG),$(-DEBC.$(COMPILER)) -DDEBUG_ASSERT -DONEDAL_ENABLE_ASSERT) -DTBB_SUPPRESS_DEPRECATED_MESSAGES -D__TBB_LEGACY_MODE
-DEBJ := $(if $(REQDBG),-g,-g:none)
-DEBL := $(if $(REQDBG),$(if $(OS_is_win),-debug,))
-EHsc := $(if $(OS_is_win),-EHsc,)
-isystem := $(if $(OS_is_win),-I,-isystem)
-sGRP = $(if $(OS_is_lnx),-Wl$(comma)--start-group,)
-eGRP = $(if $(OS_is_lnx),-Wl$(comma)--end-group,)
-Zl := $(-Zl.$(COMPILER))
-Zl_DPCPP := $(-Zl.dpcpp)
-DEBC := $(if $(REQDBG),$(-DEBC.$(COMPILER)) -DDEBUG_ASSERT -DONEDAL_ENABLE_ASSERT) -DTBB_SUPPRESS_DEPRECATED_MESSAGES -D__TBB_LEGACY_MODE
-DEBC_DPCPP := $(if $(REQDBG),$(-DEBC.dpcpp) -DDEBUG_ASSERT -DONEDAL_ENABLE_ASSERT) -DTBB_SUPPRESS_DEPRECATED_MESSAGES -D__TBB_LEGACY_MODE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that -DTBB_SUPPRESS_DEPRECATED_MESSAGES -D__TBB_LEGACY_MODE are needed here.
Please check.
Other parts of the PR look good to me.

-DEBL := $(if $(REQDBG),$(if $(OS_is_win),-debug,))
-EHsc := $(if $(OS_is_win),-EHsc,)
-isystem := $(if $(OS_is_win),-I,-isystem)
-sGRP := $(if $(OS_is_lnx),-Wl$(comma)--start-group,)
-eGRP := $(if $(OS_is_lnx),-Wl$(comma)--end-group,)
daalmake = make

$(eval $(call set_uarch_options_for_compiler,$(COMPILER)))
Expand Down Expand Up @@ -660,7 +661,7 @@ $(ONEAPI.tmpdir_y.dpc)/inc_y_folders.txt: | $(ONEAPI.tmpdir_y.dpc)/.

# Set compilation options to the object files which are part of STATIC lib
$(ONEAPI.objs_a): $(ONEAPI.dispatcher_cpu) $(ONEAPI.tmpdir_a)/inc_a_folders.txt
$(ONEAPI.objs_a): COPT += $(-fPIC) $(-cxx17) $(-Zl) $(-DEBC) $(-EHsc) $(pedantic.opts) \
$(ONEAPI.objs_a): COPT += $(-fPIC) $(-cxx17) $(-Zl) $(-DMKL_ILP64) $(-DEBC) $(-EHsc) $(pedantic.opts) \
-DDAAL_NOTHROW_EXCEPTIONS \
-DDAAL_HIDE_DEPRECATED \
-D_ENABLE_ATOMIC_ALIGNMENT_FIX \
Expand All @@ -671,7 +672,7 @@ $(ONEAPI.objs_a): COPT += $(-fPIC) $(-cxx17) $(-Zl) $(-DEBC) $(-EHsc) $(pedantic
$(eval $(call update_copt_from_dispatcher_tag,$(ONEAPI.objs_a)))

$(ONEAPI.objs_a.dpc): $(ONEAPI.dispatcher_cpu) $(ONEAPI.tmpdir_a.dpc)/inc_a_folders.txt
$(ONEAPI.objs_a.dpc): COPT += $(-fPIC) $(-cxx17) $(-DEBC) $(-EHsc) $(pedantic.opts.dpcpp) \
$(ONEAPI.objs_a.dpc): COPT += $(-fPIC) $(-cxx17) $(-Zl_DPCPP) $(-DMKL_ILP64) $(-DEBC_DPCPP) $(-EHsc) $(pedantic.opts.dpcpp) \
-DDAAL_NOTHROW_EXCEPTIONS \
-DDAAL_HIDE_DEPRECATED \
-DONEDAL_DATA_PARALLEL \
Expand All @@ -696,8 +697,11 @@ $(ONEAPI.objs_y): COPT += $(-fPIC) $(-cxx17) $(-Zl) $(-DMKL_ILP64) $(-DEBC) $(-E

$(eval $(call update_copt_from_dispatcher_tag,$(ONEAPI.objs_y)))

# Note: The libonedal_dpc.so library does not support debug mode.
# When compiling with the debug flag $(-DEBC_DPCPP), linking with libonedal_dpc.so may cause indefinite linking times
# due to the extensive processing of debug information. For debugging, please use the static library version (libonedal_dpc.a).
$(ONEAPI.objs_y.dpc): $(ONEAPI.dispatcher_cpu) $(ONEAPI.tmpdir_y.dpc)/inc_y_folders.txt
$(ONEAPI.objs_y.dpc): COPT += $(-fPIC) $(-cxx17) $(-DMKL_ILP64) $(-DEBC) $(-EHsc) $(pedantic.opts.dpcpp) \
$(ONEAPI.objs_y.dpc): COPT += $(-fPIC) $(-cxx17) $(-Zl_DPCPP) $(-DMKL_ILP64) $(-EHsc) $(pedantic.opts.dpcpp) \
-DDAAL_NOTHROW_EXCEPTIONS \
-DDAAL_HIDE_DEPRECATED \
-DONEDAL_DATA_PARALLEL \
Expand Down