Commit 44337ea4 authored by ESTERIE Pierre's avatar ESTERIE Pierre
Browse files

Remove CMake dependencies

parent d6fcf4d9
......@@ -19,6 +19,11 @@ set(${CMAKE_PROJECT_NAME}_MINOR_VERSION 0)
set(${CMAKE_PROJECT_NAME}_PATCH_VERSION 0-pre-alpha)
set(${CMAKE_PROJECT_NAME}_VERSION "${${CMAKE_PROJECT_NAME}_MAJOR_VERSION}.${${CMAKE_PROJECT_NAME}_MINOR_VERSION}.${${CMAKE_PROJECT_NAME}_PATCH_VERSION}" )
#
# Update cmake path with morse
# ----------------------------
include(cmake/morse.cmake)
#
# Default build type
# ------------------
......@@ -30,7 +35,6 @@ if(NOT CMAKE_BUILD_TYPE)
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
#
# Creating main lib
# -----------------
......@@ -68,7 +72,10 @@ include(cmake/flags.cmake)
target_compile_options(${CMAKE_PROJECT_NAME} INTERFACE "${${CMAKE_PROJECT_NAME}_CXX_FLAGS}")
# -----------------
#
# Options for scalfmm
# -------------------
include(cmake/options.cmake)
#
# Set ${CMAKE_PROJECT_NAME} compile definitions
......@@ -85,6 +92,12 @@ target_compile_definitions(${CMAKE_PROJECT_NAME} INTERFACE "${${CMAKE_PROJECT_NA
# ----------------
include(cmake/modules.cmake)
#
# Dependencies for the lib
# ------------------------
include(cmake/dependencies.cmake)
set(${CMAKE_PROJECT_NAME}_LIBRARIES "${${CMAKE_PROJECT_NAME}_LIBRARIES}" CACHE STRING "${CMAKE_PROJECT_NAME} libraries dependencies")
message(STATUS "${CMAKE_PROJECT_NAME} dependencies : ${FUSE_LIST}")
# DEPRECATED
# Generate ScalFmmConfig.h
......@@ -92,6 +105,22 @@ include(cmake/modules.cmake)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/scalfmm/config/scalfmm-config.hpp.cmake
# ${CMAKE_CURRENT_BINARY_DIR}/include/scalfmm/config/scalfmm-config.hpp)
#
# Modules required
# ----------------
include(cmake/analysis.cmake)
#
# Export Library
# --------------
include(cmake/export.cmake)
#
# Set FUSE LIST
# -------------
set(FUSE_DEP_AVAILABLE "MPI;CUDA;STARPU;OMP4;BLAS;CBLAS;FFTW;OPENCL") # List to compare against when compiling tests, etc...
#
# Build Tools
# --------------
......@@ -109,14 +138,14 @@ option(${CMAKE_PROJECT_NAME}_BUILD_EXAMPLES "Set to ON to build scalfmm3 example
message(STATUS "${CMAKE_PROJECT_NAME}_BUILD_EXAMPLES = ${${CMAKE_PROJECT_NAME}_BUILD_EXAMPLES}" )
if( ${CMAKE_PROJECT_NAME}_BUILD_EXAMPLES )
# Build - Examples and drivers
#add_subdirectory(examples)
add_subdirectory(examples)
endif()
#
# Build - Unitary and numerical Tests
# -----------------------------------
option(${CMAKE_PROJECT_NAME}_BUILD_UNITS "Set to ON to build scalfmm3 unit tests." OFF)
message( STATUS "${CMAKE_PROJECT_NAME}_BUILD_UTESTS = ${${CMAKE_PROJECT_NAME}_BUILD_UTESTS}" )
message( STATUS "${CMAKE_PROJECT_NAME}_BUILD_UNITS = ${${CMAKE_PROJECT_NAME}_BUILD_UNITS}" )
if( ${CMAKE_PROJECT_NAME}_BUILD_UNITS )
enable_testing()
include(CTest)
......@@ -132,9 +161,4 @@ if(${CMAKE_PROJECT_NAME}_BUILD_DOC)
add_subdirectory(docs)
endif()
#
# Export Library
# --------------
include(cmake/export.cmake)
......@@ -8,7 +8,7 @@ include(cmake/dependencies/blas.cmake)
include(cmake/dependencies/fftw.cmake)
include(cmake/dependencies/starpu.cmake)
if(SCALFMM_USE_CATALYST)
if(${CMAKE_PROJECT_NAME}_USE_CATALYST)
find_package(catalyst REQUIRED)
if(catalyst_FOUND)
message(STATUS "Catalyst found.")
......
#
# Blas options
# ------------
if(SCALFMM_USE_BLAS)
if(${CMAKE_PROJECT_NAME}_USE_BLAS)
if( SCALFMM_USE_MKL_AS_BLAS )
set(BLA_VENDOR "Intel10_64lp_seq")
find_package(BLAS REQUIRED)
elseif(SCALFMM_USE_ESSL_AS_BLAS)
set(BLA_VENDOR "IBMESSL")
find_package(BLAS REQUIRED)
#find_package(LAPACK QUIET)
elseif(SCALFMM_USE_EXTERNAL_BLAS)
message(STATUS "BLAS SET BY EXTERNAL PROGRAM = ${BLAS_LIBRARIES}")
list(APPEND BLASLAPACK_LIBRARIES "${BLAS_LIBRARIES}")
else()
find_package(CBLAS)
if( ${CMAKE_PROJECT_NAME}_USE_MKL_AS_BLAS )
set(BLA_VENDOR "Intel10_64lp_seq")
find_package(BLAS REQUIRED)
if(BLAS_FOUND)
target_link_libraries(${CMAKE_PROJECT_NAME} INTERFACE MORSE::CBLAS)
list(APPEND SCALFMM_LIBRARIES BLAS)
list(APPEND BLAS_TARGET BLAS::BLAS)
list(APPEND ${CMAKE_PROJECT_NAME}_LIBRARIES BLAS CBLAS)
list(APPEND FUSE_LIST BLAS CBLAS)
elseif()
message(ERROR "CBLAS and BLAS required for uniform interpolator.")
endif()
else()
find_package(CBLAS REQUIRED)
if(CBLAS_FOUND)
list(APPEND CBLAS_TARGET MORSE::CBLAS)
list(APPEND ${CMAKE_PROJECT_NAME}_LIBRARIES CBLAS)
list(APPEND FUSE_LIST CBLAS)
elseif()
message(ERROR "CBLAS required for uniform interpolator.")
endif()
find_package(BLAS REQUIRED)
if(BLAS_FOUND)
list(APPEND BLAS_TARGET BLAS::BLAS)
list(APPEND ${CMAKE_PROJECT_NAME}_LIBRARIES BLAS)
list(APPEND FUSE_LIST BLAS)
endif()
endif()
elseif()
message(ERROR "BLAS required for chebyshev interpolator.")
endif()
if(BLAS_FOUND)
target_link_libraries(${CMAKE_PROJECT_NAME} INTERFACE BLAS::BLAS)
list(APPEND SCALFMM_LIBRARIES BLAS)
list(APPEND FUSE_LIST BLAS)
endif()
#if(LAPACK_FOUND)
# target_link_libraries(${CMAKE_PROJECT_NAME} INTERFACE LAPACK::LAPACK)
# list(APPEND SCALFMM_LIBRARIES LAPACK)
#endif()
endif(${CMAKE_PROJECT_NAME}_USE_BLAS)
#message (STATUS "Check BLAS Fortran mangling")
## add options to let the user be able to force a behavior
......@@ -80,13 +87,12 @@ if(SCALFMM_USE_BLAS)
# message (STATUS "SCALFMM_BLAS_NOCHANGE is set to ON")
# endif()
#endif (NOT SCALFMM_BLAS_ADD_ AND NOT SCALFMM_BLAS_UPCASE AND NOT SCALFMM_BLAS_NOCHANGE)
else()
MESSAGE(WARNING "BLAS: ${BLAS_FOUND}")
#else()
# MESSAGE(WARNING "BLAS: ${BLAS_FOUND}")
message(WARNING "BLAS has not been found, SCALFMM will continue to compile but some applications will be disabled.")
message(WARNING "If you have BLAS set BLAS_LIBDIR, BLAS_INCDIR or BLAS_DIR (CMake variables using -D or environment variables).")
set(SCALFMM_USE_BLAS OFF)
endif()
# message(WARNING "BLAS has not been found, SCALFMM will continue to compile but some applications will be disabled.")
# message(WARNING "If you have BLAS set BLAS_LIBDIR, BLAS_INCDIR or BLAS_DIR (CMake variables using -D or environment variables).")
# set(SCALFMM_USE_BLAS OFF)
#endif()
endif(SCALFMM_USE_BLAS)
#
# FFT options
# -----------
include(CMakeDependentOption)
if(${CMAKE_PROJECT_NAME}_USE_FFTW)
message(STATUS "${CMAKE_PROJECT_NAME} USE FFTW Configure:")
# The package find_package(FFTW) can be used with the following COMPONENTS:
# MKL, ESSL, THREADS|OMP and/or SIMPLE|LONG|QUAD
# Default will find the real double precision fftw library version without THREADS|OMP
if(${CMAKE_PROJECT_NAME}_USE_MKL_AS_FFTW)
message(STATUS "${CMAKE_PROJECT_NAME} USE FFT from MKL")
find_package(FFTW REQUIRED COMPONENTS MKL)
elseif (${CMAKE_PROJECT_NAME}_USE_ESSL_AS_FFTW)
message(STATUS "${CMAKE_PROJECT_NAME} USE FFT from ESSL")
find_package(FFTW REQUIRED COMPONENTS ESSL)
else()
message(STATUS "${CMAKE_PROJECT_NAME} USE FFTW")
find_package(FFTW REQUIRED COMPONENTS SIMPLE LONG)
endif()
if(FFTW_FOUND)
list(APPEND ${CMAKE_PROJECT_NAME}_LIBRARIES FFTW)
list(APPEND FUSE_LIST FFTW)
list(APPEND FFTW_TARGET MORSE::FFTW)
else(FFTW_FOUND)
message(WARNING "FFTW has not been found, ${CMAKE_PROJECT_NAME} will continue to compile but some applications will be disabled.")
message(WARNING "If you have FFTW set FFTW_LIBDIR, FFTW_INCDIR or FFTW_DIR (CMake variables using -D or environment variables).")
set(${CMAKE_PROJECT_NAME}_USE_FFT OFF)
endif(FFTW_FOUND)
endif(${CMAKE_PROJECT_NAME}_USE_FFTW)
#
# MPI
# ---
if(SCALFMM_USE_MPI)
if(NOT MPI_FOUND)
if(${CMAKE_PROJECT_NAME}_USE_MPI)
if(NOT MPI_CXX_FOUND)
find_package(MPI REQUIRED)
if(MPI_CXX_FOUND)
target_include_directories(${CMAKE_PROJECT_NAME} INTERFACE ${MPI_INCLUDE_DIRS})
target_link_libraries(${CMAKE_PROJECT_NAME} INTERFACE MPI::MPI_CXX)
list(APPEND SCALFMM_LIBRARIES MPI)
list(APPEND FUSE_LIST MPI)
list(APPEND MPI_TARGET MPI::MPI_CXX)
list(APPEND ${CMAKE_PROJECT_NAME}_LIBRARIES MPI)
list(APPEND MPI_COMPILE_DEFINITIONS SCALFMM_USE_MPI)
list(APPEND FUSE_LIST MPI)
else(MPI_CXX_FOUND)
message(FATAL_ERROR "MPI_CXX is required but was not found. "
"Please provide an MPI compiler in your environment."
"Note that you can give the path to your MPI installation "
"by setting MPI_DIR cmake variable.")
endif(MPI_CXX_FOUND)
endif(NOT MPI_FOUND)
endif(SCALFMM_USE_MPI)
endif(NOT MPI_CXX_FOUND)
endif(${CMAKE_PROJECT_NAME}_USE_MPI)
#
# OpenMP
# ------
if(NOT OpenMP_CXX_FOUND)
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
list(APPEND BLAS_TARGET OpenMP::OpenMP_CXX)
list(APPEND ${CMAKE_PROJECT_NAME}_LIBRARIES OpenMP)
list(APPEND FUSE_LIST OMP)
else(OpenMP_CXX_FOUND)
message(WARNING "OPENMP NOT FOUND")
endif(OpenMP_CXX_FOUND)
endif()
#
# STARPU Section
# --------------
if( ${CMAKE_PROJECT_NAME}_USE_STARPU )
# TODO
#enable_language(C)
## Find StarPU with a list of optional components
#set(SCALFMM_STARPU_VERSION "1.2.8" CACHE STRING " STARPU version desired")
## create list of components in order to make a single call to find_package(starpu...)
#set(STARPU_COMPONENT_LIST "HWLOC")
#if(SCALFMM_USE_CUDA)
# message(WARNING "This release doest not include a full support for CUDA/OpenCl.")
# #list(APPEND STARPU_COMPONENT_LIST "CUDA")
#endif()
#if(SCALFMM_USE_MPI)
# list(APPEND STARPU_COMPONENT_LIST "MPI")
#endif()
#if(SCALFMM_USE_OPENCL)
# message(WARNING "This release doest not include a full support for CUDA/OpenCl.")
# #list(APPEND STARPU_COMPONENT_LIST "OPENCL")
#endif()
#find_package(STARPU ${SCALFMM_STARPU_VERSION} REQUIRED
# COMPONENTS ${STARPU_COMPONENT_LIST})
#if(STARPU_FOUND)
# target_link_libraries(${CMAKE_PROJECT_NAME} INTERFACE starpu::starpu_dep)
# list(APPEND FUSE_LIST "STARPU")
# list(APPEND SCALFMM_LIBRARIES "STARPU")
# if(SCALFMM_USE_CUDA)
# #list(APPEND FUSE_LIST "CUDA")
# endif()
# if(SCALFMM_USE_OPENCL)
# #list(APPEND FUSE_LIST "OPENCL")
# endif()
#else(STARPU_FOUND)
# message(FATAL_ERROR "StarPU not found.")
#endif(STARPU_FOUND)
endif(${CMAKE_PROJECT_NAME}_USE_STARPU)
......@@ -2,10 +2,12 @@
# Export Library
# --------------
install(TARGETS ${CMAKE_PROJECT_NAME}
EXPORT ${CMAKE_PROJECT_NAME}-targets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
EXPORT ${CMAKE_PROJECT_NAME}-targets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
install(DIRECTORY ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/include
DESTINATION ${CMAKE_INSTALL_PREFIX}
......@@ -29,26 +31,34 @@ install(DIRECTORY ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/modules/internal/xtensor-b
install(DIRECTORY ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/modules/internal/xtensor-fftw/include/
DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
#install(FILES ${${CMAKE_PROJECT_NAME}_BINARY_DIR}/include/scalfmm/config/scalfmm-config.hpp
# DESTINATION include/scalfmm/config/scalfmm-config.hpp)
install(EXPORT ${CMAKE_PROJECT_NAME}-targets
FILE ${CMAKE_PROJECT_NAME}-targets.cmake
NAMESPACE ${CMAKE_PROJECT_NAME}::
DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})
FILE ${CMAKE_PROJECT_NAME}Config.cmake
NAMESPACE ${CMAKE_PROJECT_NAME}::
DESTINATION ${CMAKE_BINARY_DIR}
)
include(CMakePackageConfigHelpers)
configure_file(${CMAKE_PROJECT_NAME}Config.cmake.in ${CMAKE_PROJECT_NAME}Config.cmake @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
DESTINATION lib/cmake/${CMAKE_PROJECT_NAME}
)
write_basic_package_version_file("${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
VERSION ${${CMAKE_PROJECT_NAME}_VERSION}
COMPATIBILITY SameMajorVersion)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${CMAKE_PROJECT_NAME}/)
#configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}Config.cmake.in
# "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
# INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${CMAKE_PROJECT_NAME}/)
#install(FILES "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
# "${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake"
# DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})
install(FILES "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
"${PROJECT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake"
DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})
foreach(file ${TOOLS_TO_INSTALL})
install(PROGRAMS "${CMAKE_BINARY_DIR}/tools/${file}"
......
......@@ -3,9 +3,9 @@
# -------------------
# Cmake options for dependencies
option( ${CMAKE_PROJECT_NAME}_USE_MPI "Set to ON to build ScaFMM with MPI" OFF )
option( ${CMAKE_PROJECT_NAME}_USE_BLAS "Set to ON to build ScaFMM with BLAS" ON )
option( ${CMAKE_PROJECT_NAME}_USE_FFT "Set to ON to build ScaFMM with FFTW" ON )
option( ${CMAKE_PROJECT_NAME}_USE_MPI "Set to ON to build ScalFMM with MPI" OFF )
option( ${CMAKE_PROJECT_NAME}_USE_BLAS "Set to ON to build ScalFMM with BLAS" ON )
option( ${CMAKE_PROJECT_NAME}_USE_FFTW "Set to ON to build ScalFMM with FFTW" ON )
option( ${CMAKE_PROJECT_NAME}_USE_STARPU "Set to ON to build ${CMAKE_PROJECT_NAME} with StarPU" OFF )
# Cmake options related to trace, logging and statistics
......@@ -22,8 +22,8 @@ endif(${CMAKE_PROJECT_NAME}_USE_BLAS)
include(CMakeDependentOption)
cmake_dependent_option(${CMAKE_PROJECT_NAME}_USE_MKL_AS_FFTW "Set to ON to use MKL FFTW" ON "${CMAKE_PROJECT_NAME}_USE_FFT;${CMAKE_PROJECT_NAME}_USE_MKL_AS_BLAS" OFF )
cmake_dependent_option(${CMAKE_PROJECT_NAME}_USE_ESSL_AS_FFTW "Set to ON to use ESSL FFTW" ON "${CMAKE_PROJECT_NAME}_USE_FFT;${CMAKE_PROJECT_NAME}_USE_ESSL_AS_BLAS" OFF )
cmake_dependent_option(${CMAKE_PROJECT_NAME}_USE_MKL_AS_FFTW "Set to ON to use MKL FFTW" ON "${CMAKE_PROJECT_NAME}_USE_FFTW;${CMAKE_PROJECT_NAME}_USE_MKL_AS_BLAS" OFF )
cmake_dependent_option(${CMAKE_PROJECT_NAME}_USE_ESSL_AS_FFTW "Set to ON to use ESSL FFTW" ON "${CMAKE_PROJECT_NAME}_USE_FFTW;${CMAKE_PROJECT_NAME}_USE_ESSL_AS_BLAS" OFF )
cmake_dependent_option(${CMAKE_PROJECT_NAME}_USE_OPENCL "Set to ON to use OPENCL with StarPU" OFF "${CMAKE_PROJECT_NAME}_USE_STARPU" OFF)
cmake_dependent_option(${CMAKE_PROJECT_NAME}_USE_CUDA "Set to ON to use OPENCL with StarPU" OFF "${CMAKE_PROJECT_NAME}_USE_STARPU" OFF)
cmake_dependent_option(${CMAKE_PROJECT_NAME}_USE_STATIC_ANALYSIS "Set to ON to use static analysis tools" ON "${CMAKE_PROJECT_NAME}_ONLY_DEVEL" OFF )
......@@ -61,31 +61,31 @@ if( ${CMAKE_PROJECT_NAME}_ONLY_DEVEL )
cmake_dependent_option(${CMAKE_PROJECT_NAME}_USE_STARPU_EXTRACT "Set to ON to enable extract with StarPU mpi implicit" ON "${CMAKE_PROJECT_NAME}_USE_STARPU" OFF)
endif()
message( STATUS "${CMAKE_PROJECT_NAME}_USE_MPI = " ${CMAKE_PROJECT_NAME}_USE_MPI )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_BLAS = " ${CMAKE_PROJECT_NAME}_USE_BLAS )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_FFT = " ${CMAKE_PROJECT_NAME}_USE_FFT )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_STARPU = " ${CMAKE_PROJECT_NAME}_USE_STARPU)
message( STATUS "${CMAKE_PROJECT_NAME}_USE_MPI = ${${CMAKE_PROJECT_NAME}_USE_MPI}")
message( STATUS "${CMAKE_PROJECT_NAME}_USE_BLAS = ${${CMAKE_PROJECT_NAME}_USE_BLAS}")
message( STATUS "${CMAKE_PROJECT_NAME}_USE_FFTW = ${${CMAKE_PROJECT_NAME}_USE_FFTW}")
message( STATUS "${CMAKE_PROJECT_NAME}_USE_STARPU = ${${CMAKE_PROJECT_NAME}_USE_STARPU}")
# Cmake options related to trace, logging and statistics
message( STATUS "${CMAKE_PROJECT_NAME}_USE_LOG = " ${CMAKE_PROJECT_NAME}_USE_LOG )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_MEM_STATS = " ${CMAKE_PROJECT_NAME}_USE_MEM_STATS)
message( STATUS "${CMAKE_PROJECT_NAME}_ONLY_DEVEL = " ${CMAKE_PROJECT_NAME}_ONLY_DEVEL )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_LOG = ${${CMAKE_PROJECT_NAME}_USE_LOG}")
message( STATUS "${CMAKE_PROJECT_NAME}_USE_MEM_STATS = ${${CMAKE_PROJECT_NAME}_USE_MEM_STATS}")
message( STATUS "${CMAKE_PROJECT_NAME}_ONLY_DEVEL = ${${CMAKE_PROJECT_NAME}_ONLY_DEVEL}")
if(${CMAKE_PROJECT_NAME}_USE_BLAS)
message( STATUS "${CMAKE_PROJECT_NAME}_USE_MKL_AS_BLAS = " ${CMAKE_PROJECT_NAME}_USE_MKL_AS_BLAS )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_ESSL_AS_BLAS = " ${CMAKE_PROJECT_NAME}_USE_ESSL_AS_BLAS )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_EXTERNAL_BLAS = " ${CMAKE_PROJECT_NAME}_USE_EXTERNAL_BLAS)
message( STATUS "${CMAKE_PROJECT_NAME}_USE_MKL_AS_BLAS = ${${CMAKE_PROJECT_NAME}_USE_MKL_AS_BLAS}")
message( STATUS "${CMAKE_PROJECT_NAME}_USE_ESSL_AS_BLAS = ${${CMAKE_PROJECT_NAME}_USE_ESSL_AS_BLAS}")
message( STATUS "${CMAKE_PROJECT_NAME}_USE_EXTERNAL_BLAS = ${${CMAKE_PROJECT_NAME}_USE_EXTERNAL_BLAS}")
endif(${CMAKE_PROJECT_NAME}_USE_BLAS)
if(${CMAKE_PROJECT_NAME}_USE_STARPU)
message( STATUS "${CMAKE_PROJECT_NAME}_USE_CUDA = " ${CMAKE_PROJECT_NAME}_USE_CUDA )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_OPENCL = " ${CMAKE_PROJECT_NAME}_USE_OPENCL )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_CUDA = ${${CMAKE_PROJECT_NAME}_USE_CUDA}")
message( STATUS "${CMAKE_PROJECT_NAME}_USE_OPENCL = ${${CMAKE_PROJECT_NAME}_USE_OPENCL}")
endif(${CMAKE_PROJECT_NAME}_USE_STARPU)
if(${CMAKE_PROJECT_NAME}_ONLY_DEVEL)
message( STATUS "${CMAKE_PROJECT_NAME}_USE_STATIC_ANALYSIS = " ${CMAKE_PROJECT_NAME}_USE_STATIC_ANALYSIS )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_CPPCHECK = " ${CMAKE_PROJECT_NAME}_USE_CPPCHECK )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_CLANGTIDY = " ${CMAKE_PROJECT_NAME}_USE_CLANGTIDY )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_IWYU = " ${CMAKE_PROJECT_NAME}_USE_IWYU )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_STATIC_ANALYSIS = ${${CMAKE_PROJECT_NAME}_USE_STATIC_ANALYSIS }" )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_CPPCHECK = ${${CMAKE_PROJECT_NAME}_USE_CPPCHECK}" )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_CLANGTIDY = ${${CMAKE_PROJECT_NAME}_USE_CLANGTIDY}" )
message( STATUS "${CMAKE_PROJECT_NAME}_USE_IWYU = ${${CMAKE_PROJECT_NAME}_USE_IWYU}" )
endif(${CMAKE_PROJECT_NAME}_ONLY_DEVEL)
# Examples
#---------
cmake_minimum_required (VERSION 3.15.0 FATAL_ERROR)
#
# Project Declaration
#--------------------
project(scalfmm3-examples CXX)
#
# Update cmake path with morse
# ----------------------------
#include(cmake/morse.cmake)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
#
# Set FUSE LIST
# -------------
set(FUSE_LIST "") # Construct during configure
set(FUSE_DEP_AVAILABLE "MPI;CUDA;STARPU;OMP4;BLAS;FFT;OPENCL") # List to compare against when compiling tests, etc...
#
# Options for scalfmm
# -------------------
include(cmake/options.cmake)
#
# Dependencies for the lib
# ------------------------
include(cmake/dependencies.cmake)
set(${CMAKE_PROJECT_NAME}_LIBRARIES "${${CMAKE_PROJECT_NAME}_LIBRARIES}" CACHE STRING "${CMAKE_PROJECT_NAME} libraries dependencies")
message(STATUS "${CMAKE_PROJECT_NAME} dependencies : ${${CMAKE_PROJECT_NAME}_LIBRARIES}")
#
# Print configure status
# ----------------------
message(STATUS "${CMAKE_PROJECT_NAME}_USE_MEM_STATS = ${${CMAKE_PROJECT_NAME}_USE_MEM_STATS}" )
message(STATUS "${CMAKE_PROJECT_NAME}_USE_LOG = ${${CMAKE_PROJECT_NAME}_USE_LOG}" )
message(STATUS "${CMAKE_PROJECT_NAME}_USE_MPI = ${${CMAKE_PROJECT_NAME}_USE_MPI}" )
message(STATUS "${CMAKE_PROJECT_NAME}_USE_BLAS = ${${CMAKE_PROJECT_NAME}_USE_BLAS}")
message(STATUS "${CMAKE_PROJECT_NAME}_USE_FFT = ${${CMAKE_PROJECT_NAME}_USE_FFT}")
if(${CMAKE_PROJECT_NAME}_USE_STARPU)
message(STATUS "${CMAKE_PROJECT_NAME}_USE_STARPU = ${${CMAKE_PROJECT_NAME}_USE_STARPU}" )
message(STATUS "STARPU_LIBRARIES = ${STARPU_LIBRARIES}")
message(STATUS "${CMAKE_PROJECT_NAME}_USE_CUDA = ${${CMAKE_PROJECT_NAME}_USE_CUDA}" )
MESSAGE(STATUS "${CMAKE_PROJECT_NAME}_USE_OPENCL = ${${CMAKE_PROJECT_NAME}_USE_OPENCL}" )
endif(${CMAKE_PROJECT_NAME}_USE_STARPU)
message(STATUS "FUSE_LIST = ${FUSE_LIST}")
#
# Modules required
# ----------------
include(cmake/analysis.cmake)
# List of source files
set(source_tests_files
# test
......@@ -59,13 +7,7 @@ set(source_tests_files
test-morton-sort.cpp
test-morton-index.cpp
test_dimension.cpp
# tools
sort_particles.cpp
compare_files.cpp
change_file_format.cpp
generate_distribution.cpp
# FMM
direct_computation.cpp
test_laplace_kernels.cpp
test-like-mrhs.cpp
# debug & check
......@@ -77,41 +19,32 @@ set(source_tests_files
# test to move in compose/sandox project
test-compose.cpp
)
#if(SCALFMM_USE_MPI)
# set(source_tests_files ${source_tests_files}
# test-build-let.cpp)
#endif()
# Add execs - 1 cpp = 1 exec
foreach(exec ${source_tests_files})
set(compile_exec TRUE)
get_filename_component( execname ${exec} NAME_WE )
foreach(fuse_key ${FUSE_DEP_AVAILABLE})
file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
if(lines_fuse AND NOT ${fuse_key} IN_LIST FUSE_LIST)
message( STATUS "This needs ${fuse_key} = ${exec}" )
set(compile_exec FALSE)
set(compile_exec TRUE)
get_filename_component( execname ${exec} NAME_WE )
foreach(fuse_key ${FUSE_DEP_AVAILABLE})
file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
if(lines_fuse AND NOT ${fuse_key} IN_LIST FUSE_LIST)
message( STATUS "${exec} needs ${fuse_key}, dependencies are not met." )
set(compile_exec FALSE)
else()
list(APPEND TARGETS_TO_LINK ${${fuse_key}_TARGET})
if(${fuse_key}_COMPILE_DEFINITIONS)
list(APPEND COMPILE_DEFINITIONS_TO_ADD ${${fuse_key}_COMPILE_DEFINITIONS})
endif()
endif()
endforeach()
# Dependency are OK
if( compile_exec )
add_executable( ${execname} ${exec})
list(APPEND SCALFMM_EXAMPLES_TARGETS ${execname})
target_link_libraries( ${execname} ${CMAKE_PROJECT_NAME} ${TARGETS_TO_LINK})
target_compile_definitions( ${execname} PRIVATE ${COMPILE_DEFINITIONS_TO_ADD})
endif()
endforeach()
# Dependency are OK
if( compile_exec )
add_executable( ${execname} ${exec})
list(APPEND SCALFMM_EXAMPLES_TARGETS ${execname})
list(APPEND SCALFMM_TESTS_TARGETS ${execname})
set_target_properties(${execname}
PROPERTIES
ENABLE_EXPORTS TRUE
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BUILD_TYPE}
)
target_compile_definitions(${execname} PUBLIC -DXTENSOR_USE_XSIMD)
target_link_libraries( ${execname} ${CMAKE_PROJECT_NAME})
# TODO: Remove these include derectories, ust temporary to reuse old components
target_include_directories( ${execname} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
#target_compile_definitions( ${execname} PRIVATE BYPASS_CONFIG)
#install(TARGETS ${execname} RUNTIME DESTINATION bin)
endif()
endforeach(exec)
add_custom_target(examples ALL DEPENDS ${SCALFMM_EXAMPLES_TARGETS})
......
#
# FFT options
# -----------
include(CMakeDependentOption)
if(SCALFMM_USE_FFT)
message(STATUS "SCALFMM USE FFT Configure:")
# The package find_package(FFTW) can be used with the following COMPONENTS: