Skip to content
Snippets Groups Projects
Commit a55af8ab authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

try to find Gmsh lib in standard directories first, before testing the...

try to find Gmsh lib in standard directories first, before testing the hardcoded path and the env variable
parent 910145d9
No related branches found
Tags v0.1.0
2 merge requests!2small fix to compile with gmsh master,!1try to find Gmsh lib in standard directories first, before testing the...
......@@ -28,9 +28,23 @@ set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH})
find_package(Eigen3 REQUIRED)
set(LINK_LIBS ${LINK_LIBS} Eigen3::Eigen)
set(GMSH_DIR "/opt/uliege/gmsh" CACHE PATH "GMSH install path")
if (DEFINED ENV{GMSH_DIR})
find_library(GMSH_LIB gmsh)
find_path(GMSH_INC gmsh.h)
if(GMSH_LIB AND GMSH_INC)
set(LINK_LIBS ${LINK_LIBS} ${GMSH_LIB})
include_directories(${GMSH_INC})
else()
set(GMSH_DIR "/opt/uliege/gmsh" CACHE PATH "GMSH install path")
if (DEFINED ENV{GMSH_DIR})
set (GMSH_DIR $ENV{GMSH_DIR})
endif()
if (GMSH_DIR STREQUAL "" OR NOT EXISTS ${GMSH_DIR})
message(FATAL_ERROR "GMSH not found")
else()
set(LINK_LIBS ${LINK_LIBS} gmsh)
include_directories(${GMSH_DIR}/include)
link_directories(${GMSH_DIR}/lib)
endif()
endif()
find_package(SILO)
......@@ -47,23 +61,6 @@ set(SOL2_BUILD_LUA OFF CACHE BOOL "Override sol2 build lua option")
add_subdirectory(contrib/sol2)
include_directories(contrib/sol2/include)
######################################################################
## Set GMSH paths
if (GMSH_DIR STREQUAL "" OR NOT EXISTS ${GMSH_DIR})
message(FATAL_ERROR "GMSH not found")
else()
set(GMSH_INCLUDE ${GMSH_DIR}/include)
set(GMSH_LIB ${GMSH_DIR}/lib)
set(LINK_LIBS ${LINK_LIBS} gmsh)
endif()
include_directories(${GMSH_INCLUDE})
link_directories(${GMSH_LIB})
######################################################################
## Use or not use GPU solvers
option(OPT_ENABLE_GPU_SOLVER "Enable GPU solvers" OFF)
......@@ -108,7 +105,7 @@ if (OPT_ENABLE_GPU_SOLVER)
add_definitions(-DHAVE_HIP)
include_directories("/opt/rocm/include")
set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
if (DEFINED ENV{HIP_PLATFORM})
if (DEFINED ENV{HIP_PLATFORM})
if ($ENV{HIP_PLATFORM} STREQUAL "nvcc")
#set(HIP_NVCC_FLAGS "-ccbin g++-7" ${HIP_NVCC_FLAGS})
set(CMAKE_HIP_LINK_EXECUTABLE "${CUDAToolkit_NVCC_EXECUTABLE} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
......@@ -253,7 +250,7 @@ if (OPT_GMSH_484_BEFORE_SPLIT)
endif()
######################################################################
## Configure targets
## Configure targets
include_directories(contrib/sgr)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment