Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
734 Discussions

icpx 2023.2.0 replaces -march=x86-64-v3 flag with -march=core-avx2. How can this be avoided?

samfux84
New Contributor I
527 Views

Hi,

 

I am using icpx 2023.2.0 to build CMake 3.27.7 and it fails because icpx is replacing the march flag:

 

 

gmake[1]: Entering directory '/cluster/home/sfux/spack/spack/var/spack/stage/spack-stage-cmake-3.27.7-3jrulbgowh2p32lq23e4uavdklq5hmjm/spack-src/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_9d2a2.dir/cm_cxx_make_unique.cxx.o
/cluster/home/sfux/spack/spack/lib/spack/env/oneapi/icpx    -MD -MT CMakeFiles/cmTC_9d2a2.dir/cm_cxx_make_unique.cxx.o -MF CMakeFiles/cmTC_9d2a2.dir/cm_cxx_make_unique.cxx.o.d -o CMakeFiles/cmTC_9d2a2.dir/cm_cxx_make_unique.cxx.o -c /cluster/home/sfux/spack/spack/var/spack/stage/spack-stage-cmake-3.27.7-3jrulbgowh2p32lq23e4uavdklq5hmjm/spack-src/Source/Checks/cm_cxx_make_unique.cxx
icpx: warning: overriding '-march=x86-64-v3' option with '-march=core-avx2' [-Woverriding-t-option]
Linking CXX executable cmTC_9d2a2
/cluster/home/sfux/spack/spack/var/spack/stage/spack-stage-cmake-3.27.7-3jrulbgowh2p32lq23e4uavdklq5hmjm/spack-src/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_9d2a2.dir/link.txt --verbose=1
/cluster/home/sfux/spack/spack/lib/spack/env/oneapi/icpx CMakeFiles/cmTC_9d2a2.dir/cm_cxx_make_unique.cxx.o -o cmTC_9d2a2
gmake[1]: Leaving directory '/cluster/home/sfux/spack/spack/var/spack/stage/spack-stage-cmake-3.27.7-3jrulbgowh2p32lq23e4uavdklq5hmjm/spack-src/CMakeFiles/CMakeTmp'

 

 

According to the documentation icpx supports -march=x86-64-v3:

 

https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2023-2/march.html

 

So if set -march=x86-64-v3 then I would expect that icpx compiles the code for this option, or is the documentation wrong on icpx 2023.2.0 supporting x86-64-v3?

 

This behavior is a problem, because the CMake bootstrapping process runs some tests to check the available C++ features and every warning is interpreted as failure.

 

 

 

'./bootstrap' '--prefix=/cluster/home/sfux/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/cmake-3.27.7-3jrulbgowh2p32lq23e4uavdklq5hmjm' '--parallel=4' '--no-system-libs' '--system-curl' '--no-qt-gui' '--' '-DCMAKE_BUILD_TYPE=Release' '-DCMake_TEST_INSTALL=OFF' '-DBUILD_CursesDialog=ON' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON' '-DCMAKE_INSTALL_RPATH=/cluster/home/sfux/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/cmake-3.27.7-3jrulbgowh2p32lq23e4uavdklq5hmjm/lib;/cluster/home/sfux/spack/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/cmake-3.27.7-3jrulbgowh2p32lq23e4uavdklq5hmjm/lib64;/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/curl-8.4.0-irbfhrxd3kexufqjc4tam5crqao6g65t/lib;/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/nghttp2-1.57.0-r7tjctyj4vtrn4x3bx5gljy4m5xpchww/lib;/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/zlib-ng-2.1.4-k6453hzxdf2qwnmy6amb5p3ub22u544b/lib;/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/ncurses-6.4-sge5rh6opmiqtflsukablne7il7nbn7a/lib;/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/openssl-3.1.3-obxu74ztxs5xh6m66jbgcsypdgs4v675/lib64' '-DCMAKE_PREFIX_PATH=/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/curl-8.4.0-irbfhrxd3kexufqjc4tam5crqao6g65t;/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/openssl-3.1.3-obxu74ztxs5xh6m66jbgcsypdgs4v675;/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/zlib-ng-2.1.4-k6453hzxdf2qwnmy6amb5p3ub22u544b;/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/ncurses-6.4-sge5rh6opmiqtflsukablne7il7nbn7a;/cluster/software/stacks/2024-05/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/oneapi-2023.2.0/nghttp2-1.57.0-r7tjctyj4vtrn4x3bx5gljy4m5xpchww'

2 errors found in build log:
586 -- Checking if compiler supports C++ make_unique
587 -- Checking if compiler supports C++ make_unique - no
588 -- Checking if compiler supports C++ unique_ptr
589 -- Checking if compiler supports C++ unique_ptr - no
590 -- Checking if compiler supports C++ filesystem
591 -- Checking if compiler supports C++ filesystem - no
>> 592 CMake Error at CMakeLists.txt:93 (message):
593 The C++ compiler does not support C++11 (e.g. std::unique_ptr).
594
595
596 -- Configuring incomplete, errors occurred!
597 ---------------------------------------------
>> 598 Error when bootstrapping CMake:
599 Problem while running initial CMake
600 ---------------------------------------------

 

 

 

CMake developers try to solve this issue by filtering intel compiler warnings when testing for C++ features:

 

https://gitlab.kitware.com/cmake/cmake/-/issues/20664

 

The easiest straight forward solution would be if icpx would not replace a flag that is according to the documentation supported. Then there be no warning and CMake would build.

 

I am planning to build a software stack based on Intel OneAPI 2023.2.0, but if I can't even build CMake, then I can also not build any package depending on CMake.

 

Is there any way to enforce -march=x86-64-v3 with icpx 2023.2.0? Any help is appreciated.

 

Best regards

 

Sam

0 Kudos
1 Reply
Alex_Y_Intel
Moderator
482 Views

In order to investigate further, please provide us a reproducer and exact reproducing steps to demonstrate your issue. 

Have you tried 2024.1 compiler? 

0 Kudos
Reply