Skip to content

Commit

Permalink
Fix compilation for Intel Classic compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
do-jason committed Oct 18, 2023
1 parent 069537c commit 6e7bbf3
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ elseif(SYCL)
message(STATUS "Setting fallback SYCL_HIP_TARGET: gfx906")
set(SYCL_HIP_TARGET "gfx906")
endif(DEFINED SYCL_HIP_TARGET)
endif()
endif(DEFINED SYCL_HIP_COMPILE)
elseif(ALTCPU)
option(CUDA "Enable CUDA GPU acceleration" OFF)
if(ALTCPU AND CUDA)
Expand Down Expand Up @@ -385,14 +385,25 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" OR "${CMAKE_CXX_COMPILER}" MATCHES
endif()

if(MKLFFT)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -qopenmp -qmkl=parallel -limf")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -qopenmp -qmkl=parallel -limf")
else()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -diag-disable=10441,10412")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -qopenmp -mkl=parallel -limf -diag-disable=10441,10412")
endif()
endif(MKLFFT)

if(INTEL_IPP OR DEFINED ENV{IPPROOT})
if(EXISTS "$ENV{IPPROOT}/include/ipps.h" AND EXISTS "$ENV{IPPROOT}/lib/intel64/libipps.a")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qipp")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -qipp -qipp-link=static")
else()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -diag-disable=10441,10412")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ipp -diag-disable=10441,10412")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ipp -ipp-link=static")
endif()
add_definitions(-DUSE_IPP)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qipp")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -qipp -qipp-link=static")
message(STATUS "Using Intel IPP library: $ENV{IPPROOT}")
endif()
endif()
Expand Down

0 comments on commit 6e7bbf3

Please sign in to comment.