Skip to content
Merged
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
96 changes: 12 additions & 84 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,9 @@ core_a := $(plib)onedal_core$d.$a
core_y := $(plib)onedal_core$d$(if $(OS_is_win),.$(MAJORBINARY),).$y
oneapi_a := $(plib)onedal$d.$a
oneapi_y := $(plib)onedal$d$(if $(OS_is_win),.$(MAJORBINARY),).$y
oneapi_a.dpc := $(plib)onedal_dpc$d.$a
oneapi_y.dpc := $(plib)onedal_dpc$d$(if $(OS_is_win),.$(MAJORBINARY),).$y
parameters_a := $(plib)onedal_parameters$d.$a
parameters_y := $(plib)onedal_parameters$d$(if $(OS_is_win),.$(MAJORBINARY),).$y
parameters_a.dpc := $(plib)onedal_parameters_dpc$d.$a
parameters_y.dpc := $(plib)onedal_parameters_dpc$d$(if $(OS_is_win),.$(MAJORBINARY),).$y

thr_tbb_a := $(plib)onedal_thread$d.$a
Expand All @@ -376,24 +374,18 @@ release.ONEAPI.LIBS_A := $(oneapi_a) \
$(if $(OS_is_win),$(foreach ilib,$(oneapi_a),$(ilib:%.lib=%_dll.lib)),)
release.ONEAPI.LIBS_Y := $(oneapi_y)

# DPC++ static library is only built on Windows
release.ONEAPI.LIBS_Y.dpc := $(oneapi_y.dpc)
ifdef OS_is_win
release.ONEAPI.LIBS_A.dpc := $(oneapi_a.dpc) \
$(if $(OS_is_win),$(foreach ilib,$(oneapi_a.dpc),$(ilib:%.lib=%_dll.lib)),)
else
release.ONEAPI.LIBS_A.dpc :=
release.ONEAPI.LIBS_Y.import.dpc := \
$(oneapi_y.dpc:.$(MAJORBINARY).dll=_dll.lib)
endif
release.ONEAPI.LIBS_Y.dpc := $(oneapi_y.dpc)

release.PARAMETERS.LIBS_A := $(parameters_a) \
$(if $(OS_is_win),$(foreach ilib,$(parameters_a),$(ilib:%.lib=%_dll.lib)),)
release.PARAMETERS.LIBS_Y := $(parameters_y)

ifdef OS_is_win
release.PARAMETERS.LIBS_A.dpc := $(parameters_a.dpc) \
$(if $(OS_is_win),$(foreach ilib,$(parameters_a.dpc),$(ilib:%.lib=%_dll.lib)),)
else
release.PARAMETERS.LIBS_A.dpc :=
release.PARAMETERS.LIBS_Y.import.dpc := $(parameters_y.dpc:.$(MAJORBINARY).dll=_dll.lib)
endif
release.PARAMETERS.LIBS_Y.dpc := $(parameters_y.dpc)

Expand Down Expand Up @@ -605,9 +597,7 @@ ONEAPI.tmpdir_a := $(WORKDIR)/oneapi_static
ONEAPI.tmpdir_y := $(WORKDIR)/oneapi_dynamic
PARAMETERS.tmpdir_a := $(WORKDIR)/parameters_static
PARAMETERS.tmpdir_y := $(WORKDIR)/parameters_dynamic
ONEAPI.tmpdir_a.dpc := $(WORKDIR)/oneapi_dpc_static
ONEAPI.tmpdir_y.dpc := $(WORKDIR)/oneapi_dpc_dynamic
PARAMETERS.tmpdir_a.dpc := $(WORKDIR)/parameters_dpc_static
PARAMETERS.tmpdir_y.dpc := $(WORKDIR)/parameters_dpc_dynamic

ONEAPI.incdirs.common := $(CPPDIR)
Expand Down Expand Up @@ -650,15 +640,8 @@ ONEAPI.srcs.mangled.dpc := $(subst /,-,$(ONEAPI.srcs.dpc))

ONEAPI.objs_a := $(ONEAPI.srcs.mangled:%.cpp=$(ONEAPI.tmpdir_a)/%.$o)
ONEAPI.objs_y := $(ONEAPI.srcs.mangled:%.cpp=$(ONEAPI.tmpdir_y)/%.$o)
# DPC++ static library is only built on Windows
ifdef OS_is_win
ONEAPI.objs_a.dpc := $(ONEAPI.srcs.mangled.dpc:%.cpp=$(ONEAPI.tmpdir_a.dpc)/%.$o)
else
ONEAPI.objs_a.dpc :=
endif

ONEAPI.objs_y.dpc := $(ONEAPI.srcs.mangled.dpc:%.cpp=$(ONEAPI.tmpdir_y.dpc)/%.$o)
ONEAPI.objs_a.all := $(ONEAPI.objs_a) $(ONEAPI.objs_a.dpc)
ONEAPI.objs_y.all := $(ONEAPI.objs_y) $(ONEAPI.objs_y.dpc)

# Populate _cpu files -> _cpu_%cpu_name%, where %cpu_name% is $(USECPUS.files)
# $1 Output variable name
Expand All @@ -676,18 +659,12 @@ endef

$(eval $(call .populate_cpus,ONEAPI.objs_a,$(ONEAPI.objs_a)))
$(eval $(call .populate_cpus,ONEAPI.objs_y,$(ONEAPI.objs_y)))
# DPC++ static library is only built on Windows
ifdef OS_is_win
$(eval $(call .populate_cpus,ONEAPI.objs_a.dpc,$(ONEAPI.objs_a.dpc)))
endif


$(eval $(call .populate_cpus,ONEAPI.objs_y.dpc,$(ONEAPI.objs_y.dpc)))

-include $(ONEAPI.tmpdir_a)/*.d
-include $(ONEAPI.tmpdir_y)/*.d
# DPC++ static library is only built on Windows
ifdef OS_is_win
-include $(ONEAPI.tmpdir_a.dpc)/*.d
endif
-include $(ONEAPI.tmpdir_y.dpc)/*.d

# Declares target for object file compilation
Expand Down Expand Up @@ -724,11 +701,6 @@ $(ONEAPI.tmpdir_a)/inc_a_folders.txt: | $(ONEAPI.tmpdir_a)/.
$(ONEAPI.tmpdir_y)/inc_y_folders.txt: | $(ONEAPI.tmpdir_y)/.
$(call WRITE.PREREQS,$(ONEAPI.include_options),$(space))

# DPC++ static library is only built on Windows
ifdef OS_is_win
$(ONEAPI.tmpdir_a.dpc)/inc_a_folders.txt: | $(ONEAPI.tmpdir_a.dpc)/.
$(call WRITE.PREREQS,$(ONEAPI.include_options),$(space))
endif

$(ONEAPI.tmpdir_y.dpc)/inc_y_folders.txt: | $(ONEAPI.tmpdir_y.dpc)/.
$(call WRITE.PREREQS,$(ONEAPI.include_options),$(space))
Expand All @@ -745,27 +717,6 @@ $(ONEAPI.objs_a): COPT += $(-fPIC) $(-cxx17) $(-optlevel) $(-Zl) $(-sanitize) $(

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

# DPC++ static library is only built on Windows
ifdef OS_is_win
$(ONEAPI.objs_a.dpc): $(ONEAPI.dispatcher_cpu) $(ONEAPI.tmpdir_a.dpc)/inc_a_folders.txt
$(ONEAPI.objs_a.dpc): COPT += $(-fPIC) $(-cxx17) $(-optlevel.dpcpp) \
$(-Zl_DPCPP) $(-sanitize) $(-DMKL_LP64) \
$(-EHsc) $(pedantic.opts.dpcpp) \
-DDAAL_NOTHROW_EXCEPTIONS \
-DDAAL_HIDE_DEPRECATED \
-DONEDAL_DATA_PARALLEL \
-D__TBB_NO_IMPLICIT_LINKAGE \
-D_ENABLE_ATOMIC_ALIGNMENT_FIX \
-DTBB_USE_ASSERT=0 \
@$(ONEAPI.tmpdir_a.dpc)/inc_a_folders.txt

ifndef OS_is_win
$(ONEAPI.objs_a.dpc): COPT += $(-DEBC_DPCPP)
endif

$(eval $(call update_copt_from_dispatcher_tag,$(ONEAPI.objs_a.dpc),.dpcpp))
endif

# Set compilation options to the object files which are part of DYNAMIC lib
$(ONEAPI.objs_y): $(ONEAPI.dispatcher_cpu) $(ONEAPI.tmpdir_y)/inc_y_folders.txt
$(ONEAPI.objs_y): COPT += $(-fPIC) $(-cxx17) $(-optlevel) $(-Zl) $(-visibility) $(-sanitize) $(-DMKL_ILP64) $(-DEBC) $(-EHsc) $(pedantic.opts) \
Expand Down Expand Up @@ -803,14 +754,7 @@ PARAMETERS.objs_a.filtered := $(filter %parameters.$(o) %parameters_impl.$(o),$(
ONEAPI.objs_a.filtered := $(filter-out %parameters.$(o) %parameters_impl.$(o),$(ONEAPI.objs_a))
PARAMETERS.objs_y.filtered := $(filter %parameters.$(o) %parameters_impl.$(o),$(ONEAPI.objs_y))
ONEAPI.objs_y.filtered := $(filter-out %parameters.$(o) %parameters_impl.$(o),$(ONEAPI.objs_y))
# DPC++ static library is only built on Windows
ifdef OS_is_win
PARAMETERS.objs_a.dpc.filtered := $(filter %parameters.$(o) %parameters_impl.$(o) %parameters_dpc.$(o),$(ONEAPI.objs_a.dpc))
ONEAPI.objs_a.dpc.filtered := $(filter-out %parameters.$(o) %parameters_impl.$(o) %parameters_dpc.$(o),$(ONEAPI.objs_a.dpc))
else
PARAMETERS.objs_a.dpc.filtered :=
ONEAPI.objs_a.dpc.filtered :=
endif

PARAMETERS.objs_y.dpc.filtered := $(filter %parameters.$(o) %parameters_impl.$(o) %parameters_dpc.$(o),$(ONEAPI.objs_y.dpc))
ONEAPI.objs_y.dpc.filtered := $(filter-out %parameters.$(o) %parameters_impl.$(o) %parameters_dpc.$(o),$(ONEAPI.objs_y.dpc))

Expand All @@ -819,36 +763,22 @@ $(foreach x,$(ONEAPI.objs_a.filtered),$(eval $(call .ONEAPI.compile,$x,$(ONEAPI.
$(foreach x,$(ONEAPI.objs_y.filtered),$(eval $(call .ONEAPI.compile,$x,$(ONEAPI.tmpdir_y),C)))
$(foreach x,$(PARAMETERS.objs_a.filtered),$(eval $(call .ONEAPI.compile,$x,$(ONEAPI.tmpdir_a),C)))
$(foreach x,$(PARAMETERS.objs_y.filtered),$(eval $(call .ONEAPI.compile,$x,$(ONEAPI.tmpdir_y),C)))
# DPC++ static library is only built on Windows
ifdef OS_is_win
$(foreach x,$(ONEAPI.objs_a.dpc.filtered),$(eval $(call .ONEAPI.compile,$x,$(ONEAPI.tmpdir_a.dpc),DPC)))
$(foreach x,$(PARAMETERS.objs_a.dpc.filtered),$(eval $(call .ONEAPI.compile,$x,$(ONEAPI.tmpdir_a.dpc),DPC)))
endif
$(foreach x,$(ONEAPI.objs_y.dpc.filtered),$(eval $(call .ONEAPI.compile,$x,$(ONEAPI.tmpdir_y.dpc),DPC)))
$(foreach x,$(PARAMETERS.objs_y.dpc.filtered),$(eval $(call .ONEAPI.compile,$x,$(ONEAPI.tmpdir_y.dpc),DPC)))

# Create Host and DPC++ oneapi libraries
ifeq ($(BUILD_PARAMETERS_LIB),yes)
$(eval $(call .ONEAPI.declare_static_lib,$(WORKDIR.lib)/$(oneapi_a),$(ONEAPI.objs_a.filtered)))
# DPC++ static library is only built on Windows
ifdef OS_is_win
$(eval $(call .ONEAPI.declare_static_lib,$(WORKDIR.lib)/$(oneapi_a.dpc),$(ONEAPI.objs_a.dpc.filtered)))
endif
$(eval $(call .ONEAPI.declare_static_lib,$(WORKDIR.lib)/$(parameters_a),$(PARAMETERS.objs_a.filtered)))
ifdef OS_is_win
$(eval $(call .ONEAPI.declare_static_lib,$(WORKDIR.lib)/$(parameters_a.dpc),$(PARAMETERS.objs_a.dpc.filtered)))
endif
else
$(eval $(call .ONEAPI.declare_static_lib,$(WORKDIR.lib)/$(oneapi_a),$(ONEAPI.objs_a)))
$(if $(OS_is_win),$(eval $(call .ONEAPI.declare_static_lib,$(WORKDIR.lib)/$(oneapi_a.dpc),$(ONEAPI.objs_a.dpc))))
endif

ONEAPI.objs_y.lib := $(ONEAPI.objs_y.filtered)
ifeq ($(BUILD_PARAMETERS_LIB),no)
ONEAPI.objs_y.lib += $(PARAMETERS.objs_y.filtered)
endif

# TODO: replace MKL usage with one of the suggested apporach in 'common.mk'.
$(ONEAPI.tmpdir_y)/$(oneapi_y:%.$y=%_link.txt): \
$(ONEAPI.objs_y.lib) $(if $(OS_is_win),$(ONEAPI.tmpdir_y)/dll.res,) | $(ONEAPI.tmpdir_y)/. ; $(WRITE.PREREQS)
$(WORKDIR.lib)/$(oneapi_y): \
Expand Down Expand Up @@ -884,7 +814,6 @@ ifeq ($(BUILD_PARAMETERS_LIB),no)
ONEAPI.objs_y.dpc.lib += $(PARAMETERS.objs_y.dpc.filtered)
endif

# TODO: replace MKL usage with one of the suggested apporach in 'common.mk'.
$(ONEAPI.tmpdir_y.dpc)/$(oneapi_y.dpc:%.$y=%_link.txt): \
$(ONEAPI.objs_y.dpc.lib) $(if $(OS_is_win),$(ONEAPI.tmpdir_y.dpc)/dll.res,) | $(ONEAPI.tmpdir_y.dpc)/. ; $(WRITE.PREREQS)
$(WORKDIR.lib)/$(oneapi_y.dpc): \
Expand Down Expand Up @@ -1016,8 +945,7 @@ _parameters_c: info.building.parameters.C++.part
_parameters_c: $(WORKDIR.lib)/$(parameters_a) $(WORKDIR.lib)/$(parameters_y)

_parameters_dpc: info.building.parameters.DPC++.part
# DPC++ static library is only built on Windows
_parameters_dpc: $(if $(OS_is_win),$(WORKDIR.lib)/$(parameters_a.dpc),) $(WORKDIR.lib)/$(parameters_y.dpc)
_parameters_dpc: $(WORKDIR.lib)/$(parameters_y.dpc)

_release_parameters_c: _parameters_c
_release_parameters_dpc: _parameters_dpc
Expand All @@ -1030,7 +958,7 @@ _oneapi_c: info.building.oneapi.C++.part
_oneapi_c: $(WORKDIR.lib)/$(oneapi_a) $(WORKDIR.lib)/$(oneapi_y)

_oneapi_dpc: info.building.oneapi.DPC++.part
_oneapi_dpc: $(if $(OS_is_win),$(WORKDIR.lib)/$(oneapi_a.dpc),) $(WORKDIR.lib)/$(oneapi_y.dpc)
_oneapi_dpc: $(WORKDIR.lib)/$(oneapi_y.dpc)

_release_oneapi_c: _release_oneapi_c_h
_release_oneapi_dpc: _release_oneapi_c
Expand Down Expand Up @@ -1089,13 +1017,13 @@ $(foreach x,$(release.LIBS_A),$(eval $(call .release.a_win,$x,$(RELEASEDIR.libia
$(foreach x,$(release.LIBS_Y),$(eval $(call .release.y_win,$x,$(RELEASEDIR.soia),_release_c)))
$(foreach x,$(release.ONEAPI.LIBS_A),$(eval $(call .release.a_win,$x,$(RELEASEDIR.libia),_release_oneapi_c)))
$(foreach x,$(release.ONEAPI.LIBS_Y),$(eval $(call .release.y_win,$x,$(RELEASEDIR.soia),_release_oneapi_c)))
$(foreach x,$(release.ONEAPI.LIBS_A.dpc),$(eval $(call .release.a_win,$x,$(RELEASEDIR.libia),_release_oneapi_dpc)))
$(foreach x,$(release.ONEAPI.LIBS_Y.import.dpc),$(eval $(call .release.a_win,$x,$(RELEASEDIR.libia),_release_oneapi_dpc)))
$(foreach x,$(release.ONEAPI.LIBS_Y.dpc),$(eval $(call .release.y_win,$x,$(RELEASEDIR.soia),_release_oneapi_dpc)))

ifeq ($(BUILD_PARAMETERS_LIB),yes)
$(foreach x,$(release.PARAMETERS.LIBS_A),$(eval $(call .release.a_win,$x,$(RELEASEDIR.libia),_release_parameters_c)))
$(foreach x,$(release.PARAMETERS.LIBS_Y),$(eval $(call .release.y_win,$x,$(RELEASEDIR.soia),_release_parameters_c)))
$(foreach x,$(release.PARAMETERS.LIBS_A.dpc),$(eval $(call .release.a_win,$x,$(RELEASEDIR.libia),_release_parameters_dpc)))
$(foreach x,$(release.PARAMETERS.LIBS_Y.import.dpc),$(eval $(call .release.a_win,$x,$(RELEASEDIR.libia),_release_parameters_dpc)))
$(foreach x,$(release.PARAMETERS.LIBS_Y.dpc),$(eval $(call .release.y_win,$x,$(RELEASEDIR.soia),_release_parameters_dpc)))
endif
endif
Expand Down
Loading