From 33be9295a593022cb5a939505d55af585235f2d8 Mon Sep 17 00:00:00 2001 From: "g.t" Date: Mon, 6 Nov 2023 21:20:37 +0100 Subject: [PATCH 1/2] Intel oneAPI DPC++/C++ Compiler support --- .conan/profiles/compiler/intel | 19 +++++++++++++++++++ .conan/profiles/intel/2023.2/compiler | 4 ++++ .../profiles/intel/2023.2/x64-libstdc++-debug | 7 +++++++ .../profiles/intel/2023.2/x64-libstdc++-msr | 7 +++++++ .../intel/2023.2/x64-libstdc++-release | 7 +++++++ .../profiles/intel/2023.2/x64-libstdc++-rwdi | 7 +++++++ .conan/profiles/packages/settings | 2 +- CMakeLists.txt | 1 + cmake/compiler.cmake | 8 ++++++++ cmake/linker.cmake | 2 +- conanfile.py | 4 ++-- 11 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 .conan/profiles/compiler/intel create mode 100644 .conan/profiles/intel/2023.2/compiler create mode 100644 .conan/profiles/intel/2023.2/x64-libstdc++-debug create mode 100644 .conan/profiles/intel/2023.2/x64-libstdc++-msr create mode 100644 .conan/profiles/intel/2023.2/x64-libstdc++-release create mode 100644 .conan/profiles/intel/2023.2/x64-libstdc++-rwdi diff --git a/.conan/profiles/compiler/intel b/.conan/profiles/compiler/intel new file mode 100644 index 00000000..980581be --- /dev/null +++ b/.conan/profiles/compiler/intel @@ -0,0 +1,19 @@ +[settings] +compiler=intel-cc +compiler.mode=icx + +{% set os = detect_api.detect_os() %} +{% if os == "Linux" %} +[conf] +tools.intel:installation_path=/opt/intel/oneapi/ +[buildenv] +CC=icx +CXX=icpx +{% endif %} +{% if os == "Windows" %} +[conf] +tools.intel:installation_path=C:\Program Files (x86)\Intel\oneAPI +[buildenv] +CC=icx +CXX=icx +{% endif %} \ No newline at end of file diff --git a/.conan/profiles/intel/2023.2/compiler b/.conan/profiles/intel/2023.2/compiler new file mode 100644 index 00000000..4b925818 --- /dev/null +++ b/.conan/profiles/intel/2023.2/compiler @@ -0,0 +1,4 @@ +include(../../compiler/intel) + +[settings] +compiler.version=2023.2 diff --git a/.conan/profiles/intel/2023.2/x64-libstdc++-debug b/.conan/profiles/intel/2023.2/x64-libstdc++-debug new file mode 100644 index 00000000..ea92b135 --- /dev/null +++ b/.conan/profiles/intel/2023.2/x64-libstdc++-debug @@ -0,0 +1,7 @@ +include(../../default) +include(../../arch/x64) +include(../../cpp/23) +include(../../config/debug) +include(../../os/current) +include(../../packages/settings) +include(compiler) diff --git a/.conan/profiles/intel/2023.2/x64-libstdc++-msr b/.conan/profiles/intel/2023.2/x64-libstdc++-msr new file mode 100644 index 00000000..b22ba5f6 --- /dev/null +++ b/.conan/profiles/intel/2023.2/x64-libstdc++-msr @@ -0,0 +1,7 @@ +include(../../default) +include(../../arch/x64) +include(../../cpp/23) +include(../../config/min-size-rel) +include(../../os/current) +include(../../packages/settings) +include(compiler) diff --git a/.conan/profiles/intel/2023.2/x64-libstdc++-release b/.conan/profiles/intel/2023.2/x64-libstdc++-release new file mode 100644 index 00000000..1ef22129 --- /dev/null +++ b/.conan/profiles/intel/2023.2/x64-libstdc++-release @@ -0,0 +1,7 @@ +include(../../default) +include(../../arch/x64) +include(../../cpp/23) +include(../../config/release) +include(../../os/current) +include(../../packages/settings) +include(compiler) diff --git a/.conan/profiles/intel/2023.2/x64-libstdc++-rwdi b/.conan/profiles/intel/2023.2/x64-libstdc++-rwdi new file mode 100644 index 00000000..4c9c3641 --- /dev/null +++ b/.conan/profiles/intel/2023.2/x64-libstdc++-rwdi @@ -0,0 +1,7 @@ +include(../../default) +include(../../arch/x64) +include(../../cpp/23) +include(../../config/rel-with-deb-info) +include(../../os/current) +include(../../packages/settings) +include(compiler) diff --git a/.conan/profiles/packages/settings b/.conan/profiles/packages/settings index af10ac42..1f512378 100644 --- a/.conan/profiles/packages/settings +++ b/.conan/profiles/packages/settings @@ -1,5 +1,5 @@ {% set os = detect_api.detect_os() %} -{% if os == "Linux" -%} +{% if os == "Linux" %} [settings] mold*:build_type=Release onetbb*:build_type=Release diff --git a/CMakeLists.txt b/CMakeLists.txt index c7c94275..87d3c03f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ include(GNUInstallDirs) include(CMakeDependentOption) include(CMakePackageConfigHelpers) +option(MORPHEUS_BUILD_WITH_INTEL "Enable Intel oneAPI DPC++/C++ Compiler" ON) option(MORPHEUS_LINK_WITH_MOLD "Enable the mold linker" ON) cmake_dependent_option(MORPHEUS_CODE_COVERAGE "Enable code coverage" ON "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\" OR \"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\"" OFF) cmake_dependent_option(MORPHEUS_INCLUDE_NATVIS "Enable inclusion of a natvis files for debugging" ON "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"MSVC\"" OFF) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index 93323d71..60ceb34b 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -33,4 +33,12 @@ target_compile_options(MorpheusConfig $<$:${MSVC_WARNINGS}> $<$:${GCC_WARNINGS}> $<$,$>:${CLANG_WARNINGS}> + <$:${CLANG_WARNINGS}> ) + +if (${MORPHEUS_BUILD_WITH_INTEL}) + find_package(IntelSYSCL REQUIRED) + message(STATUS "Morpheus: found Intel One API DPC++/C++ Compiler.") + set(CMAKE_C_COMPILER icx PARENT_SCOPE) + set(CMAKE_CXX_COMPILER icpx PARENT_SCOPE) +endif() diff --git a/cmake/linker.cmake b/cmake/linker.cmake index 6d9871aa..520c73de 100644 --- a/cmake/linker.cmake +++ b/cmake/linker.cmake @@ -17,7 +17,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR include_guard(GLOBAL) -if (${MORPHEUS_LINK_WITH_MOLD}) +if (${MORPHEUS_LINK_WITH_MOLD} AND NOT ${MORPHEUS_BUILD_WITH_INTEL}) find_program(MOLD_BIN mold REQUIRED) if(MOLD_BIN) message(STATUS "Morpheus: Mold linker found: ${MOLD_BIN}. Enabling mold as active linker.") diff --git a/conanfile.py b/conanfile.py index 572978be..7ec18e35 100644 --- a/conanfile.py +++ b/conanfile.py @@ -75,7 +75,7 @@ class Morpheus(ConanFile): "glew/2.2.0", "gtest/1.13.0", "magic_enum/0.8.2", - "ms-gsl/4.0.0", + #"ms-gsl/4.0.0", "rapidjson/cci.20220822", "range-v3/0.12.0", "tl-expected/20190710", @@ -135,7 +135,7 @@ def _minimum_cpp_standard(self): @property def _minimum_compilers_version(self): return { -# "intel-cc": "??" + "intel-cc": "2023.2", "msvc": "16", "gcc": "11", "clang": "13", From f022b14b308ffe79c78ca0c01c05e8c53f053a34 Mon Sep 17 00:00:00 2001 From: jakeheke75 Date: Wed, 22 Nov 2023 22:52:10 +0100 Subject: [PATCH 2/2] restore ms-gsl package dependency --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 7ec18e35..28cdcabd 100644 --- a/conanfile.py +++ b/conanfile.py @@ -75,7 +75,7 @@ class Morpheus(ConanFile): "glew/2.2.0", "gtest/1.13.0", "magic_enum/0.8.2", - #"ms-gsl/4.0.0", + "ms-gsl/4.0.0", "rapidjson/cci.20220822", "range-v3/0.12.0", "tl-expected/20190710",