-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add Intel ICC 18 detection/support to CMakeLists.txt #1841
base: dev
Are you sure you want to change the base?
Conversation
Fresh on the heels of ICC-19 release, here is ICC-18 support... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to test it by my self. Some changes looks like workarounds for a not correct configured icc.
@@ -28,6 +28,25 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") | |||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) | |||
message(FATAL_ERROR "g++ version must be at least 5.1!") | |||
endif() | |||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") | |||
include_directories(BEFORE "/opt/intel/include") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not hard code any path's. It could be that the compiler is installed somewhere else even if this path is the default path.
get_filename_component(ICC_GXX ${ICC_GXX} NAME) | ||
find_program(ICC_GCC NAMES "gcc-${ICC_GCCVER}" "gcc-7" "gcc-6" "gcc") | ||
get_filename_component(ICC_GCC ${ICC_GCC} NAME) | ||
set(ICC_COMPILERS "-gxx-name=${ICC_GXX} -gcc-name=${ICC_GCC}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the correct way, because if I install icc I select already an gcc version. This looks like a workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What, where? I run the installer, remove everything but the C++, it never asks it only seeks whatever /usr/bin/gcc
points to... system default
I also use this to generate test binaries made with every permutation of ICC+GCC regardless what was configured or what the system defaults are. So yes, it is a workaround, for having to use the ICC environment at all (I don't use their shell scripts or whatever). I also don't have ICC in the system path.
Example of what happens otherwise:
It has picked up gcc-8 and crashes out. You probably have never had gcc-8 on the same system as icc-18? This compiler test box has gcc 5,6,7,8 and clang 3.8,3.9,4.0,5.0,6.0,7,8 and icc-18. icc by itself is too stupid to avoid gcc-8 even though it does not work. |
Confirmed, I set my system compiler back to gcc-7 and icc works without these mods. I will rework this patch so it is more generic. |
Detect ICC-18, add their header and lib paths
Select newest available and compatible GCC and pass to ICC to avoid built-in default of using
/usr/bin/gcc
which in some distro revisions is too oldUse
-DICC_GCCVER=N
to force specificgcc-N
Link to Intel lib