Loading CMakeLists.txt +15 −10 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ set( tnlVersion "0.1" ) option(OFFLINE_BUILD "Offline build (i.e. without downloading libraries such as pybind11)" OFF) option(WITH_CUDA "Build with CUDA support" ON) set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures") option(WITH_HIP "Build with HIP support" ON) set(WITH_HIP_PLATFORM "nvcc" CACHE STRING "HIP backend compiler." ) option(WITH_OPENMP "Build with OpenMP support" ON) option(WITH_MPI "Build with MPI support" ON) option(WITH_GMP "Build with GMP support" OFF) Loading @@ -33,14 +35,15 @@ option(BUILD_MATRIX_TESTS "Build tests for matrix formats" OFF) option(BUILD_PYTHON "Compile the Python bindings" OFF) option(BUILD_DOC "Build examples included in the documentation" OFF) # install paths relative to the cmake's prefix set( TNL_TARGET_INCLUDE_DIRECTORY "include/TNL" ) set( TNL_TARGET_DATA_DIRECTORY "share/TNL" ) # set cmake's include path so that we can include modules from # the cmake directory in the TNL repository set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ) # install paths relative to the cmake's prefix set( TNL_TARGET_INCLUDE_DIRECTORY "include/TNL" ) set( TNL_TARGET_DATA_DIRECTORY "share/TNL" ) # Note that in cmake 3.10 the FindOpenMP and FindMPI modules are broken - they do not work when # CMAKE_EXECUTABLE_SUFFIX is not empty, see https://www.mail-archive.com/cmake@cmake.org/msg56886.html # Hence, we find OpenMP and MPI before setting CMAKE_EXECUTABLE_SUFFIX. Loading Loading @@ -109,7 +112,7 @@ elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Intel" ) endif() # disable GCC's infamous "maybe-uninitialized" warning (it produces mostly false positives) if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ${WITH_HIP} ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized" ) endif() Loading Loading @@ -256,21 +259,22 @@ if( ${WITH_CUDA} ) endif() ##### # Check for HIP # Check for HIP - TODO: Put this after CUDA check when we do not need to build # everything with hipcc ... or we can just build everything with HIP ... who knows? :) # if( ${WITH_HIP} ) find_package(HIP) if(HIP_FOUND) set(BUILD_HIP TRUE) set(CMAKE_HIPCXX_FLAGS ${CMAKE_HIPCXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -DHIP_PLATFORM=nvcc ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -I/usr/lib/llvm-8/include/openmp -L/usr/lib/llvm-8/lib -lomp -fopenmp") #set(CMAKE_HIPCXX_FLAGS ${CMAKE_HIPCXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -DHIP_PLATFORM=nvcc ) set(CMAKE_HIPCXX_FLAGS ${CMAKE_HIPCXX_FLAGS} -DHAVE_HIP -DHIP_PLATFORM=nvcc ) #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -I/usr/lib/llvm-8/include/openmp -L/usr/lib/llvm-8/lib -lomp -fopenmp") #set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} -L/usr/lib/llvm-8/lib} ) set(CMAKE_CXX_COMPILER "${HIP_ROOT_DIR}/bin/hipcc" ) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/lib/llvm-8/lib -lomp") #set(CMAKE_CXX_COMPILER "${HIP_ROOT_DIR}/bin/hipcc" ) #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/lib/llvm-8/lib -lomp") endif() endif() find_package( DCMTK ) if( DCMTK_FOUND ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_DCMTK_H" ) Loading Loading @@ -396,6 +400,7 @@ message( " OFFLINE_BUILD = ${OFFLINE_BUILD}" ) message( " WITH_CUDA = ${WITH_CUDA}" ) message( " WITH_CUDA_ARCH = ${WITH_CUDA_ARCH}" ) message( " WITH_HIP = ${WITH_HIP}" ) message( " WITH_HIP_PLATFORM = ${WITH_HIP_PLATFORM}" ) message( " WITH_OPENMP = ${WITH_OPENMP}" ) message( " WITH_MPI = ${WITH_MPI}" ) message( " WITH_GMP = ${WITH_GMP}" ) Loading Loading
CMakeLists.txt +15 −10 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ set( tnlVersion "0.1" ) option(OFFLINE_BUILD "Offline build (i.e. without downloading libraries such as pybind11)" OFF) option(WITH_CUDA "Build with CUDA support" ON) set(WITH_CUDA_ARCH "auto" CACHE STRING "Build for these CUDA architectures") option(WITH_HIP "Build with HIP support" ON) set(WITH_HIP_PLATFORM "nvcc" CACHE STRING "HIP backend compiler." ) option(WITH_OPENMP "Build with OpenMP support" ON) option(WITH_MPI "Build with MPI support" ON) option(WITH_GMP "Build with GMP support" OFF) Loading @@ -33,14 +35,15 @@ option(BUILD_MATRIX_TESTS "Build tests for matrix formats" OFF) option(BUILD_PYTHON "Compile the Python bindings" OFF) option(BUILD_DOC "Build examples included in the documentation" OFF) # install paths relative to the cmake's prefix set( TNL_TARGET_INCLUDE_DIRECTORY "include/TNL" ) set( TNL_TARGET_DATA_DIRECTORY "share/TNL" ) # set cmake's include path so that we can include modules from # the cmake directory in the TNL repository set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ) # install paths relative to the cmake's prefix set( TNL_TARGET_INCLUDE_DIRECTORY "include/TNL" ) set( TNL_TARGET_DATA_DIRECTORY "share/TNL" ) # Note that in cmake 3.10 the FindOpenMP and FindMPI modules are broken - they do not work when # CMAKE_EXECUTABLE_SUFFIX is not empty, see https://www.mail-archive.com/cmake@cmake.org/msg56886.html # Hence, we find OpenMP and MPI before setting CMAKE_EXECUTABLE_SUFFIX. Loading Loading @@ -109,7 +112,7 @@ elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Intel" ) endif() # disable GCC's infamous "maybe-uninitialized" warning (it produces mostly false positives) if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT ${WITH_HIP} ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized" ) endif() Loading Loading @@ -256,21 +259,22 @@ if( ${WITH_CUDA} ) endif() ##### # Check for HIP # Check for HIP - TODO: Put this after CUDA check when we do not need to build # everything with hipcc ... or we can just build everything with HIP ... who knows? :) # if( ${WITH_HIP} ) find_package(HIP) if(HIP_FOUND) set(BUILD_HIP TRUE) set(CMAKE_HIPCXX_FLAGS ${CMAKE_HIPCXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -DHIP_PLATFORM=nvcc ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -I/usr/lib/llvm-8/include/openmp -L/usr/lib/llvm-8/lib -lomp -fopenmp") #set(CMAKE_HIPCXX_FLAGS ${CMAKE_HIPCXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -DHIP_PLATFORM=nvcc ) set(CMAKE_HIPCXX_FLAGS ${CMAKE_HIPCXX_FLAGS} -DHAVE_HIP -DHIP_PLATFORM=nvcc ) #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${HIP_ROOT_DIR}/include -DHAVE_HIP -I/usr/lib/llvm-8/include/openmp -L/usr/lib/llvm-8/lib -lomp -fopenmp") #set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} -L/usr/lib/llvm-8/lib} ) set(CMAKE_CXX_COMPILER "${HIP_ROOT_DIR}/bin/hipcc" ) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/lib/llvm-8/lib -lomp") #set(CMAKE_CXX_COMPILER "${HIP_ROOT_DIR}/bin/hipcc" ) #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/lib/llvm-8/lib -lomp") endif() endif() find_package( DCMTK ) if( DCMTK_FOUND ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_DCMTK_H" ) Loading Loading @@ -396,6 +400,7 @@ message( " OFFLINE_BUILD = ${OFFLINE_BUILD}" ) message( " WITH_CUDA = ${WITH_CUDA}" ) message( " WITH_CUDA_ARCH = ${WITH_CUDA_ARCH}" ) message( " WITH_HIP = ${WITH_HIP}" ) message( " WITH_HIP_PLATFORM = ${WITH_HIP_PLATFORM}" ) message( " WITH_OPENMP = ${WITH_OPENMP}" ) message( " WITH_MPI = ${WITH_MPI}" ) message( " WITH_GMP = ${WITH_GMP}" ) Loading