diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b97a9ce..e66b50be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,10 +21,46 @@ cmake_minimum_required(VERSION 3.13) project(rayleigh LANGUAGES C Fortran) +# load in version info and export it +file(STRINGS "${CMAKE_SOURCE_DIR}/VERSION" RAYLEIGH_PACKAGE_VERSION LIMIT_COUNT 1) + + +message(STATUS "") +message(STATUS "====================================================") +message(STATUS "===== Configuring Rayleigh ${RAYLEIGH_PACKAGE_VERSION}") +message(STATUS "====================================================") +message(STATUS "") + +# Set up CMAKE_BUILD_TYPE to Debug if it is not set by the user. +if ("${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_BUILD_TYPE + "Release" + CACHE STRING + "Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel." + FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "RelWithDebInfo" "MinSizeRel") +endif() + +message(STATUS "Configuring in \"" ${CMAKE_BUILD_TYPE} "\" mode.") +message(STATUS "") + +# Set the default install directory, if run for the first time +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "${CMAKE_SOURCE_DIR}") +endif() + +message(STATUS "Installing executable in ${CMAKE_INSTALL_PREFIX}/bin") +message(STATUS "") + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +message(STATUS "===== Configuring external libraries ===============") +message(STATUS "") + find_package(MPI COMPONENTS C REQUIRED Fortran REQUIRED) find_package(LAPACK COMPONENTS Fortran REQUIRED) find_package(FFTW REQUIRED) diff --git a/cmake/FindMKL.cmake b/cmake/FindMKL.cmake index 09a1feb7..b8f5fb4e 100644 --- a/cmake/FindMKL.cmake +++ b/cmake/FindMKL.cmake @@ -19,8 +19,6 @@ # MKL_PATH - root directory of the MKL installation # MKL_ROOT - root directory of the MKL installation -option( MKL_PARALLEL "if mkl shoudl be parallel" OFF ) - if( MKL_PARALLEL ) set( __mkl_lib_par MKL_LIB_INTEL_THREAD ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e45db9a..01255ad4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,6 +45,8 @@ if (RAYLEIGH_CPU_OPTIMIZATIONS STREQUAL "native") message(STATUS "enabling native optimizations") elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") target_compile_options(rayleigh PRIVATE -xHost) + elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM") + target_compile_options(rayleigh PRIVATE -xHost) else() message(FATAL_ERROR "For your compiler no native optimizations are automatically detected. Please specify compiler flags manually and set 'CPU_OPTIMIZATIONS' to 'none'") endif() @@ -70,4 +72,6 @@ target_link_libraries(rayleigh MPI::MPI_Fortran) target_link_libraries(rayleigh LAPACK::LAPACK) target_link_libraries(rayleigh FFTW::fftw3) -install(TARGETS rayleigh DESTINATION ${CMAKE_SOURCE_DIR}/bin) +message(STATUS "") + +install(TARGETS rayleigh RUNTIME DESTINATION bin COMPONENT runtime)