Commit d6733b26 authored by Berenger Bramas's avatar Berenger Bramas

CMake update -- make it works with intel (16)

parent deef67ed
......@@ -137,7 +137,7 @@ if(NOT INASTEMP_AS_SUBPROJECT)
SET( INASTEMP_EXTRA_CXX_FLAGS_DEBUG "-O0" CACHE STRING "These flags are added to the usual ones for DEBUG" )
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${INASTEMP_EXTRA_CXX_FLAGS_DEBUG}")
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} -fpic -Wextra -Wnon-virtual-dtor -Wshadow -Wpointer-arith -Wcast-qual -Wconversion -Wall -Wno-sign-conversion -pedantic -Wold-style-cast -Woverloaded-virtual -Wpointer-arith -Wcast-qual -Wconversion -Wno-error")
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} -fpic -Wextra -Wnon-virtual-dtor -Wshadow -Wpointer-arith -Wcast-qual -Wconversion -Wall -Wno-sign-conversion -pedantic -Woverloaded-virtual -Wpointer-arith -Wcast-qual -Wconversion -Wno-error")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} -m64")
......@@ -149,6 +149,12 @@ if(NOT INASTEMP_AS_SUBPROJECT)
endif(INASTEMP_ATTACHE_SOURCE)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "icpc.*$")
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} -diag-disable 2304 -diag-disable 10121 -diag-disable 10120")
else()
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} -Wold-style-cast")
endif()
#===========================================================================
# Generate config
#===========================================================================
......
......@@ -85,7 +85,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(SSSE3_FLAGS "-mssse3 ${ARCH_NATIVE_FLAG}")
set(SSE41_FLAGS "-msse4 -msse4.1 ${ARCH_NATIVE_FLAG}")
set(SSE42_FLAGS "-msse4 -msse4.2 ${ARCH_NATIVE_FLAG}")
set(AVX_FLAGS "-mAVX ${ARCH_NATIVE_FLAG}")
set(AVX_FLAGS "-march=core-avx-i ${ARCH_NATIVE_FLAG}")
set(AVX2_FLAGS "-march=core-avx2 ${ARCH_NATIVE_FLAG}")
set(AVX512KNL_FLAGS "-xCOMMON-AVX512 -xMIC-AVX512 ${ARCH_NATIVE_FLAG}")
endif()
......
......@@ -138,11 +138,18 @@ Such that, if one wants to compile only some files with these specific flags, it
### Compilers support
Inastemp was developed and tested using the following compilers on the x86_64 architecture.
- Gcc 6.1 (earlier versions if AVX512/KNL is not used)
- Gcc 6.1 (earlier versions if AVX512/KNL is not used, like 4.9)
- Clang 3.5
- Intel 16.0
Earlier versions may work as well.
- Intel special flags
We pass `-diag-disable 2304 -diag-disable 10121 -diag-disable 10120` to intel compiler to remove the implicit conversion warnings between Inastemp classes.
In fact, we voluntarily want implicit conversion because it helps us to factorize and reduce the number of lines drastically.
User can add the following flags to push for more inlining `-inline-forceinline -no-inline-max-total-size` for intel compiler.
However, it looks like such options do not work for several compiler versions, and thus we do not want to add them by default.
### Multiple hardwares compilation
Inastemp is not designed to compile a binary targeting multiple hardwares (like having an execution path for the different possibilities).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment