Commit 89816af2 authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille

Change in CMakList in order to try to compile checkAVXpe with avx flags (was...

Change in CMakList in order to try to compile checkAVXpe with avx flags (was working with gcc >= 4.9, but not with gcc 4.8.*)
parent c93d2bb7
......@@ -13,12 +13,12 @@ SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
#
# MPI option has to be set before project, cannot be changed in the cache!
if( ScalFMM_USE_MPI )
include(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(mpicc "MPI C Compiler")
CMAKE_FORCE_CXX_COMPILER(mpicxx "MPI C++ Compiler")
set(ScalFMM_USE_MPI ON CACHE BOOL "ScalFmm use MPI")
include(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(mpicc "MPI C Compiler")
CMAKE_FORCE_CXX_COMPILER(mpicxx "MPI C++ Compiler")
set(ScalFMM_USE_MPI ON CACHE BOOL "ScalFmm use MPI")
else()
MESSAGE(STATUS "Remove CMake cache and run cmake .. -DScalFMM_USE_MPI=ON to enable MPI" )
MESSAGE(STATUS "Remove CMake cache and run cmake .. -DScalFMM_USE_MPI=ON to enable MPI" )
endif(ScalFMM_USE_MPI)
#
......@@ -40,8 +40,8 @@ SET(ScalFMM_VERSION "${ScalFMM_MAJOR_VERSION}.${ScalFMM_MINOR_VERSION}.${ScalFM
ENABLE_LANGUAGE(CXX )
#
if( ScalFMM_USE_MPI )
TRY_COMPILE(COMPILE_INTEL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_MODULE_PATH}/compileTestIntel.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS}")
if (COMPILE_INTEL)
TRY_COMPILE(COMPILE_INTEL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_MODULE_PATH}/compileTestIntel.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS}")
if (COMPILE_INTEL)
SET(CMAKE_CXX_COMPILER_ID "Intel")
endif()
endif()
......@@ -49,10 +49,10 @@ MESSAGE(STATUS " CXX ${CMAKE_CXX_COMPILER_ID}" )
#
# Options
OPTION( ScalFMM_USE_BLAS "Set to ON to build ScaFMM with BLAS" OFF )
OPTION( ScalFMM_USE_FFT "Set to ON to build ScaFMM with FFTW" OFF )
OPTION( ScalFMM_BUILD_TESTS "Set to ON to build functionalities Tests" OFF )
OPTION( ScalFMM_BUILD_UTESTS "Set to ON to build UTests" OFF )
OPTION( ScalFMM_USE_BLAS "Set to ON to build ScaFMM with BLAS" OFF )
OPTION( ScalFMM_USE_FFT "Set to ON to build ScaFMM with FFTW" OFF )
OPTION( ScalFMM_BUILD_TESTS "Set to ON to build functionalities Tests" OFF )
OPTION( ScalFMM_BUILD_UTESTS "Set to ON to build UTests" OFF )
OPTION( ScalFMM_BUILD_DEBUG "Set to ON to build in Debug" OFF )
OPTION( ScalFMM_USE_LOG "Set to ON to print output debug information" OFF )
OPTION( ScalFMM_USE_MEM_STATS "Set to ON to profile memory" OFF )
......@@ -65,8 +65,8 @@ OPTION( ScalFMM_USE_ASSERT "Set to ON to enable safe tests during exec
OPTION( ScalFMM_USE_MIC_NATIVE "Set to ON to compile in native mode for MIC" OFF )
OPTION( ScalFMM_BUILD_ONLY_LIB "Set to ON to compile only the lib (examples are not compiled) " OFF )
OPTION( ScalFMM_ONLY_DEVEL "Set to ON to compile Development tools (only scalfmm team)" ON )
if( ScalFMM_ONLY_DEVEL )
OPTION( ScalFMM_USE_STARPU "Set to ON to build ScaFMM with StarPU" OFF )
if( ScalFMM_ONLY_DEVEL )
OPTION( ScalFMM_USE_STARPU "Set to ON to build ScaFMM with StarPU" OFF )
endif()
# Set scalfmm to default libraries
SET(SCALFMM_LIBRARIES "")
......@@ -75,13 +75,13 @@ SET(ScaLFMM_CXX_FLAGS "-std=c++11 -fpic -Wall")
#
# Test if openmp is here
#
find_package (OpenMP)
find_package (OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
else(OPENMP_FOUND)
MESSAGE(WARNING "OPENMP NOT FOUND")
MESSAGE(WARNING "OPENMP NOT FOUND")
endif(OPENMP_FOUND)
MESSAGE(STATUS "ScalFMM_BUILD_DEBUG = ${ScalFMM_BUILD_DEBUG}" )
#
......@@ -92,7 +92,7 @@ endif()
# Compile options #
##############################################################################
# -xHost -mfpmath=sse
# -Wall Wnosign-conversion
# -Wall Wnosign-conversion
#
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
# INTEL
......@@ -131,7 +131,7 @@ if( ScalFMM_BUILD_DEBUG )
#
SET(CMAKE_BUILD_TYPE Debug)
ADD_DEFINITIONS(-O0)
IF( APPLE )
IF( APPLE )
SET(SCALFMM_FLAGS_OPTI_DEBUG "-m64 -funroll-loops" CACHE STRING "Set your optimization flags for debug mode.")
ELSE(APPLE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
......@@ -142,7 +142,7 @@ if( ScalFMM_BUILD_DEBUG )
ENDIF(APPLE)
# ADD_DEFINITIONS(${SCALFMM_FLAGS_OPTI_DEBUG})
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} ${SCALFMM_FLAGS_OPTI_DEBUG}")
SET(CMAKE_CXX_FLAGS_TYPE "${CMAKE_CXX_FLAGS_DEBUG}")
SET(CMAKE_CXX_FLAGS_TYPE "${CMAKE_CXX_FLAGS_DEBUG}")
else()
##############################################################################
......@@ -152,17 +152,17 @@ else()
# force -O3 in release
# SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
STRING(REPLACE "-O2" "-O3" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} )
SET(CMAKE_CXX_FLAGS_TYPE "${CMAKE_CXX_FLAGS_RELEASE}")
SET(CMAKE_CXX_FLAGS_TYPE "${CMAKE_CXX_FLAGS_RELEASE}")
# if compiler is intel add -ip
IF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} -ip")
# SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} -ip -no-prec-div -no-prec-sqrt")
ENDIF()
# Compile optimization
IF( APPLE )
IF( APPLE )
SET(SCALFMM_FLAGS_OPTI_RELEASE "-m64 -funroll-loops" CACHE STRING "Set your optimization flags for release mode.")
ELSE(APPLE)
# Not apple system - Check the compiler flags
# Not apple system - Check the compiler flags
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
# SET(SCALFMM_FLAGS_OPTI_RELEASE "-fp-model precise -fp-model source -fimf-precision=low -funroll-loops -ftree-vectorize" CACHE STRING "Set your optimization flags for release mode.")
SET(SCALFMM_FLAGS_OPTI_RELEASE " " CACHE STRING "Set your optimization flags for release mode.")
......@@ -184,9 +184,9 @@ if( ScalFMM_ATTACHE_SOURCE )
endif(ScalFMM_ATTACHE_SOURCE)
#
##############################################################################
# Blas option #
# Blas option #
##############################################################################
#
#
if( ScalFMM_USE_BLAS )
OPTION( ScalFMM_USE_MKL_AS_BLAS "Set to ON to use MKL CBLAS" OFF )
MESSAGE(STATUS "CMAKE_CXX_COMPILER_ID STREQUAL ${CMAKE_CXX_COMPILER_ID}")
......@@ -199,15 +199,15 @@ if( ScalFMM_USE_BLAS )
ENDIF()
UNSET(LAPACK_LIBRARIES)
SET(BLASLAPACK_LIBRARIES ${BLAS_LIBRARIES})
elseif(ScalFMM_USE_EXTERNAL_BLAS)
elseif(ScalFMM_USE_EXTERNAL_BLAS)
MESSAGE(STATUS "BLAS SET BY EXTERNAL PROGRAM = ${BLAS_LIBRARIES}")
else()
INCLUDE(FindBLAS)
if (NOT BLAS_FOUND)
MESSAGE(FATAL_ERROR : "NO BLAS LIBRARY FOUND")
endif()
INCLUDE(FindLAPACK)
SET(BLASLAPACK_LIBRARIES "${BLAS_LIBRARIES};${LAPACK_LIBRARIES}")
INCLUDE(FindBLAS)
if (NOT BLAS_FOUND)
MESSAGE(FATAL_ERROR : "NO BLAS LIBRARY FOUND")
endif()
INCLUDE(FindLAPACK)
SET(BLASLAPACK_LIBRARIES "${BLAS_LIBRARIES};${LAPACK_LIBRARIES}")
endif()
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${BLASLAPACK_LIBRARIES}")
MESSAGE(STATUS "SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
......@@ -219,22 +219,22 @@ if( ScalFMM_USE_FFT )
OPTION( ScalFMM_USE_MKL_AS_FFTW "Set to ON to use MKL FFTW" OFF )
MESSAGE(STATUS "SCALFMM USE FFT Configure:")
if( ScalFMM_USE_MKL_AS_FFTW )
MESSAGE(STATUS " SCALFMM USE MKL ")
MESSAGE(STATUS " SCALFMM USE MKL ")
if( ScalFMM_USE_MKL_AS_BLAS )
UNSET(FFT_LIBRARIES CACHE)
MESSAGE(STATUS " SCALFMM USE MKL already defined")
MESSAGE(STATUS " SCALFMM USE MKL already defined")
SET(FFT_INCLUDES "$ENV{MKLROOT}/include/fftw" CACHE STRING "Set your MKL flags")
ELSE(ScalFMM_USE_MKL_AS_BLAS)
SET(FFT_LIBRARIES "-L$ENV{MKLROOT}/lib; -lmkl_intel_lp64; -lmkl_sequential; -lmkl_core; -lpthread; -lm" CACHE STRING "Set your MKL flags")
SET(FFT_INCLUDES "$ENV{MKLROOT}/include/fftw" CACHE STRING "Set your MKL flags")
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}; ${FFT_LIBRARIES}")
ENDIF(ScalFMM_USE_MKL_AS_BLAS)
ENDIF(ScalFMM_USE_MKL_AS_BLAS)
else(ScalFMM_USE_MKL_AS_FFTW)
MESSAGE(STATUS " SCALFMM USE FFTW ")
SET(FFT_LIBRARIES "-lfftw3" CACHE STRING "Use LIBFFTW")
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}; ${FFT_LIBRARIES}")
MESSAGE(STATUS " SCALFMM USE FFTW ")
SET(FFT_LIBRARIES "-lfftw3" CACHE STRING "Use LIBFFTW")
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}; ${FFT_LIBRARIES}")
endif(ScalFMM_USE_MKL_AS_FFTW)
SET(SCALFMM_INCLUDES "${SCALFMM_INCLUDES}; ${FFT_INCLUDES}")
MESSAGE(STATUS " SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
MESSAGE(STATUS " SCALFMM_INCLUDES = ${SCALFMM_INCLUDES}")
......@@ -242,7 +242,7 @@ endif(ScalFMM_USE_FFT)
# Compile option
#ADD_DEFINITIONS(-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wconversion -fpic )
#
#
# C++ 2011
MESSAGE( STATUS "CMAKE_SYSTEM: ${CMAKE_SYSTEM} CMAKE_CXX_COMPILER_ID ${CMAKE_CXX_COMPILER_ID} CMAKE_CXX_COMPILER ${NAME}")
IF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
......@@ -251,11 +251,11 @@ IF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
IF(APPLE)
string(FIND ${CMAKE_CXX_COMPILER} "icl++" NAME)
if( ${NAME} GREATER 0)
if( ${INTEL_VERSION} EQUAL 15. OR ${INTEL_VERSION} GREATER 15.0.0)
MESSAGE( STATUS " Intel compiler is icl++ ( version >= 15.0.0)")
if( ${INTEL_VERSION} EQUAL 15. OR ${INTEL_VERSION} GREATER 15.0.0)
MESSAGE( STATUS " Intel compiler is icl++ ( version >= 15.0.0)")
SET(INTEL_ICL_COMPILER "ON")
else()
MESSAGE(FATAL_ERROR " Intel compiler should be icl++ ( version >= 15.0.0)")
MESSAGE(FATAL_ERROR " Intel compiler should be icl++ ( version >= 15.0.0)")
endif()
else()
MESSAGE(FATAL_ERROR " Intel compiler should be icl++ ( version >= 15.0.0)")
......@@ -268,14 +268,14 @@ endif()
#
if( ScalFMM_USE_STARPU )
SET(STARPU_LIBRARIES " -L$ENV{STARPU_LIB}; -lstarpu-1.1") # CACHE STRING "Set your STARPU flags"
if(ScalFMM_USE_MPI)
SET(STARPU_LIBRARIES "${STARPU_LIBRARIES} -lstarpumpi-1.1")
endif()
SET(STARPU_INCLUDES "$ENV{STARPU_INC}" ) # CACHE STRING "Set your STARPU flags"
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}; ${STARPU_LIBRARIES}")
# SET(SCALFMM_INCLUDES "${SCALFMM_INCLUDES}; ${STARPU_INCLUDES}")
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES}; ${STARPU_LIBRARIES}")
# SET(SCALFMM_INCLUDES "${SCALFMM_INCLUDES}; ${STARPU_INCLUDES}")
include_directories(${STARPU_INCLUDES})
endif(ScalFMM_USE_STARPU)
#
......@@ -285,24 +285,24 @@ endif(ScalFMM_USE_STARPU)
MESSAGE( STATUS "ScalFMM_USE_SSE = ${ScalFMM_USE_SSE}" )
if( ScalFMM_USE_SSE )
if(NOT EXISTS ${CMAKE_MODULE_PATH}/compileTestSse.cpp)
message(FATAL_ERROR "The CompileTestSseFile does not exist (${CMAKE_MODULE_PATH}/compileTestSse.cpp)" )
endif()
MESSAGE( STATUS "SSE_FLAGS ${SSE_FLAGS} -- ${CMAKE_CXX_FLAGS} ")
TRY_COMPILE(COMPILE_SSE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_MODULE_PATH}/compileTestSse.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}" OUTPUT_VARIABLE COMPILE_SSE_OUTPUT)
IF(${COMPILE_SSE})
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} ${SSE_FLAGS}")
TRY_COMPILE(COMPILE_RESULT_VAR ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_MODULE_PATH}/checkSSEpe.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
IF( NOT ${COMPILE_RESULT_VAR})
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} -D__SSEPE_INTEL_COMPILER")
ENDIF()
if(NOT EXISTS ${CMAKE_MODULE_PATH}/compileTestSse.cpp)
message(FATAL_ERROR "The CompileTestSseFile does not exist (${CMAKE_MODULE_PATH}/compileTestSse.cpp)" )
endif()
MESSAGE( STATUS "SSE_FLAGS ${SSE_FLAGS} -- ${CMAKE_CXX_FLAGS} ")
TRY_COMPILE(COMPILE_SSE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_MODULE_PATH}/compileTestSse.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}" OUTPUT_VARIABLE COMPILE_SSE_OUTPUT)
IF(${COMPILE_SSE})
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} ${SSE_FLAGS}")
TRY_COMPILE(COMPILE_RESULT_VAR ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_MODULE_PATH}/checkSSEpe.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
IF( NOT ${COMPILE_RESULT_VAR})
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} -D__SSEPE_INTEL_COMPILER")
ENDIF()
# SET(ScalFMM_USE_AVX OFF)
ELSE(${COMPILE_SSE})
MESSAGE(FATAL_ERROR "SSE NOT SUPPORTED ; Set ScalFMM_USE_SSE to OFF \n Output from test is : ${COMPILE_SSE_OUTPUT}")
ENDIF(${COMPILE_SSE})
ELSE(${COMPILE_SSE})
MESSAGE(FATAL_ERROR "SSE NOT SUPPORTED ; Set ScalFMM_USE_SSE to OFF \n Output from test is : ${COMPILE_SSE_OUTPUT}")
ENDIF(${COMPILE_SSE})
endif()
##################################################################
# Use AVX #
......@@ -310,23 +310,23 @@ endif()
MESSAGE(STATUS "ScalFMM_USE_AVX = ${ScalFMM_USE_AVX}")
if(ScalFMM_USE_AVX)
if(NOT EXISTS ${CMAKE_MODULE_PATH}/compileTestAvx.cpp)
message(FATAL_ERROR "The CompileTestSseFile does not exist (${CMAKE_MODULE_PATH}/compileTestAvx.cpp)" )
endif()
TRY_COMPILE(COMPILE_AVX ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_MODULE_PATH}/compileTestAvx.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS} ${AVX_FLAGS}" OUTPUT_VARIABLE COMPILE_AVX_OUTPUT)
IF(${COMPILE_AVX})
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} ${AVX_FLAGS}")
# SET( ScalFMM_USE_SSE OFF FORCE) # ne marche pas
TRY_COMPILE(COMPILE_RESULT_AVSPE ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_MODULE_PATH}/checkAVXpe.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS} ")
IF( NOT ${COMPILE_RESULT_AVSPE})
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} -D__AVXPE_INTEL_COMPILER")
ENDIF()
MESSAGE(STATUS ${CMAKE_CXX_FLAGS} )
if(NOT EXISTS ${CMAKE_MODULE_PATH}/compileTestAvx.cpp)
message(FATAL_ERROR "The CompileTestSseFile does not exist (${CMAKE_MODULE_PATH}/compileTestAvx.cpp)" )
endif()
TRY_COMPILE(COMPILE_AVX ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_MODULE_PATH}/compileTestAvx.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS} ${AVX_FLAGS}" OUTPUT_VARIABLE COMPILE_AVX_OUTPUT)
IF(${COMPILE_AVX})
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} ${AVX_FLAGS}")
# SET( ScalFMM_USE_SSE OFF FORCE) # ne marche pas
TRY_COMPILE(COMPILE_RESULT_AVSPE ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_MODULE_PATH}/checkAVXpe.cpp COMPILE_DEFINITIONS "${CMAKE_CXX_FLAGS} ${AVX_FLAGS}")
IF( NOT ${COMPILE_RESULT_AVSPE})
SET(ScaLFMM_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} -D__AVXPE_INTEL_COMPILER")
ENDIF()
MESSAGE(STATUS ${CMAKE_CXX_FLAGS} )
ELSE(${COMPILE_AVX})
MESSAGE(FATAL_ERROR "AVX NOT SUPPORTED ; Set ScalFMM_USE_AVX to OFF \n Output from test is : ${COMPILE_AVX_OUTPUT} ")
MESSAGE(FATAL_ERROR "AVX NOT SUPPORTED ; Set ScalFMM_USE_AVX to OFF \n Output from test is : ${COMPILE_AVX_OUTPUT} ")
ENDIF(${COMPILE_AVX})
endif(ScalFMM_USE_AVX)
#
......@@ -338,7 +338,7 @@ ENDIF(ScalFMM_USE_AVX AND ScalFMM_USE_SSE)
##################################################################
# Use native MIC compilation #
##################################################################
if( ScalFMM_USE_MIC_NATIVE )
if( ScalFMM_USE_MIC_NATIVE )
include(CheckCCompilerFlag)
check_c_compiler_flag(-mmic HAS_MMIC_FLAG)
IF(NOT HAS_MMIC_FLAG)
......@@ -349,29 +349,29 @@ else()
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xhost")
ENDIF()
##################################################################
#
#
##################################################################
#
# Add CBLAS
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CBLAS_LIBRARIES}")
# SI CBLAS necessaire utiliser la ligne cidessous
# SI CBLAS necessaire utiliser la ligne cidessous
#SET(SCALFMM_LIBRARIES "${CBLAS_LIBRARIES} ${SCALFMM_LIBRARIES} ")
#
##################################################################
# #
# END SETTING VARIABLES #
# #
# #
# END SETTING VARIABLES #
# #
##################################################################
#
# Generate ScalFmmConfig.h
# Generate ScalFmmConfig.h
#
SET(ScalFMM_COMPILE_FLAGS "${ScaLFMM_CXX_FLAGS} ${CMAKE_CXX_FLAGS_TYPE} ${CMAKE_CXX_FLAGS}")
SET(ScalFMM_COMPILE_LIBS "${SCALFMM_LIBRARIES} ")
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/Src/ScalFmmConfig.h.cmake
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/Src/ScalFmmConfig.h.cmake
${CMAKE_BINARY_DIR}/Src/ScalFmmConfig.h )
#
##################################################################
# Build - lib #
# Build - lib #
##################################################################
#
add_subdirectory(Src)
......@@ -379,39 +379,39 @@ add_subdirectory(Src)
set(scalfmm_lib scalfmm)
#
##################################################################
# Remove compilation of the drivers #
# Remove compilation of the drivers #
##################################################################
if( NOT ScalFMM_BUILD_ONLY_LIB )
if( NOT ScalFMM_BUILD_ONLY_LIB )
# Build - Examples and drivers
add_subdirectory(Examples)
endif()
##################################################################
# Build tools (Internal use) #
# Build tools (Internal use) #
##################################################################
# Build - UTILs
if( ScalFMM_ONLY_DEVEL )
#if( NOT ScalFMM_BUILD_ONLY_LIB )
if( ScalFMM_ONLY_DEVEL )
#if( NOT ScalFMM_BUILD_ONLY_LIB )
add_subdirectory(Utils)
endif()
##################################################################
# Build -Tests to see examples #
# Build -Tests to see examples #
##################################################################
# Build - Tests
MESSAGE( STATUS "ScalFMM_BUILD_TESTS = ${ScalFMM_BUILD_TESTS}" )
if( ScalFMM_BUILD_TESTS )
add_subdirectory(Tests)
add_subdirectory(Tests)
endif()
##################################################################
# Build - Unitary and numerical Tests #
# Build - Unitary and numerical Tests #
##################################################################
#
#
MESSAGE( STATUS "ScalFMM_BUILD_UTESTS = ${ScalFMM_BUILD_UTESTS}" )
if( ScalFMM_BUILD_UTESTS )
INCLUDE(CTest)
ENABLE_TESTING()
add_subdirectory(UTests)
INCLUDE(CTest)
ENABLE_TESTING()
add_subdirectory(UTests)
endif()
##################################################################
......@@ -424,50 +424,50 @@ add_subdirectory(Doc)
##################################################################
#
if( ScalFMM_USE_ADDONS )
file(GLOB all_addons ./Addons/*)
file(GLOB all_addons ./Addons/*)
foreach(addon_name ${all_addons})
MESSAGE(STATUS "Addons += ${addon_name}" )
add_subdirectory(${addon_name})
endforeach()
foreach(addon_name ${all_addons})
MESSAGE(STATUS "Addons += ${addon_name}" )
add_subdirectory(${addon_name})
endforeach()
endif()
# Add custom clean command
if("${CMAKE_GENERATOR}" MATCHES "Make")
ADD_CUSTOM_TARGET(reset
COMMAND ${CMAKE_MAKE_PROGRAM} clean && rm -r ./CMake* && cmake ..
WORKING_DIRECTORY ${CMAKE_CURRENT_DIR}
COMMENT "Cleaning Build dir and CMake cache, then do cmake.."
)
ADD_CUSTOM_TARGET(reset
COMMAND ${CMAKE_MAKE_PROGRAM} clean && rm -r ./CMake* && cmake ..
WORKING_DIRECTORY ${CMAKE_CURRENT_DIR}
COMMENT "Cleaning Build dir and CMake cache, then do cmake.."
)
endif()
#
##################################################################
# #
# Build and export cmake files #
# #
# #
# Build and export cmake files #
# #
##################################################################
#
MESSAGE(STATUS "ScalFMM_BINARY_DIR: " ${ScalFMM_BINARY_DIR})
CONFIGURE_FILE(${ScalFMM_SOURCE_DIR}/ScalFMMConfig.cmake.in
${ScalFMM_BINARY_DIR}/ScalFMMConfig.cmake
${ScalFMM_BINARY_DIR}/ScalFMMConfig.cmake
@ONLY IMMEDIATE
)
#
INSTALL(FILES
INSTALL(FILES
${ScalFMM_BINARY_DIR}/ScalFMMConfig.cmake
DESTINATION lib/
)
IF( NOT ScalFMM_BUILD_ONLY_LIB)
INSTALL(FILES
${ScalFMM_SOURCE_DIR}/Data/test20k.fma
IF( NOT ScalFMM_BUILD_ONLY_LIB)
INSTALL(FILES
${ScalFMM_SOURCE_DIR}/Data/test20k.fma
DESTINATION Data/
)
)
endif()
#################################################################
# #
# build a CPack driven installer package #
# #
# #
# build a CPack driven installer package #
# #
##################################################################
#
# Use git commit number as CPACK_PACKAGE_VERSION_PATCH
......@@ -487,7 +487,7 @@ SET(CPACK_PACKAGE_VERSION_MINOR "${ScalFMM_MINOR_VERSION}")
#
SET(PACK_PACKAGE_VERSION "${ScalFMM_MAJOR_VERSION}.${ScalFMM_MINOR_VERSION}-${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "ScalFMM-${ScalFMM_MAJOR_VERSION}.${ScalFMM_MINOR_VERSION}-${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "ScalFMM-${ScalFMM_MAJOR_VERSION}.${ScalFMM_MINOR_VERSION}-${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_IGNORE_FILES "\\\\.git;.DS_Store;.*~;/*.aux;/*.idx;/*.log;/*.out;/*.toc;/*.ilg;/*.ind;scalfmm.pro*;org.eclipse.core.resources.prefs;.cproject;.project")
LIST(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/Utils/;Notes;Deprecated;/Build*;/noDist/;/Bench;ToRemove;Olivier")
# Uniform;GroupTree;Adaptive;testUnif*;/*Lagrange*")
......@@ -497,9 +497,9 @@ INCLUDE(CPack)
#
#
##################################################################
# #
# PRINT MESSAGES #
# #
# #
# PRINT MESSAGES #
# #
##################################################################
message(STATUS "CPACK_SOURCE_IGNORE_FILES = ${CPACK_SOURCE_IGNORE_FILES}")
message(STATUS "CPACK_SOURCE_PACKAGE_FILE_NAME = ${CPACK_SOURCE_PACKAGE_FILE_NAME}")
......@@ -513,12 +513,11 @@ MESSAGE( STATUS "ScalFMM_USE_ASSERT = ${ScalFMM_USE_ASSERT}" )
#
#MESSAGE(STATUS "CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
#SET(CMAKE_CXX_FLAGS "${ScaLFMM_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
MESSAGE(STATUS "CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
MESSAGE(STATUS "SCALFMM_CXX_FLAGS = ${ScaLFMM_CXX_FLAGS}")
MESSAGE(STATUS "SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
MESSAGE(STATUS "SCALFMM_INCLUDES = ${SCALFMM_INCLUDES}")
##################################################################
# END #
# END #
##################################################################
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