Commit 08501f3c authored by MARAIT Gilles's avatar MARAIT Gilles
Browse files

Update alya (add dep maphys)

parent 83aa47f8
......@@ -40,6 +40,7 @@ propagation, etc.")
(commit "74acfff3a94621f8b44fb5ca01431eb8e5a8c6a0")
(recursive? #f)))
(file-name (string-append name "-" version "-checkout"))
(patches (search-patches "bsc/maphys.patch"))
(sha256
(base32
"1p3a7sgmy5m2j28m1qnj70fzzmqn2qdrk1bsv4yzpk2a55hfrlqb"))))
......@@ -48,6 +49,7 @@ propagation, etc.")
(build-system cmake-build-system)
(inputs `(("openmpi" ,openmpi)
("ssh" ,openssh)
("maphys" ,maphys)
("openblas" ,openblas)))
(native-inputs `(("gfortran" ,gfortran)
("pkg-config" ,pkg-config)))
......
diff --git a/cmake/maphys.cmake b/cmake/maphys.cmake
index da18722ea..27ab84945 100644
--- a/cmake/maphys.cmake
+++ b/cmake/maphys.cmake
@@ -1,6 +1,20 @@
function(maphys)
if (WITH_MAPHYS MATCHES "ON")
- add_definitions(-DMAPHYS)
- target_link_libraries(${PROJECT_NAME} maphys)
+ if(NOT MAPHYS_FOUND)
+ # Seach for maphys using pkg-config
+ if(PKG_CONFIG_FOUND AND PKG_CONFIG_EXECUTABLE)
+ message(STATUS "Looking for MAPHYS - found using PkgConfig")
+ pkg_search_module(MAPHYS maphys)
+ endif()
+ if(MAPHYS_FOUND)
+ message(STATUS "Found MAPHYS")
+ add_definitions(-DMAPHYS)
+ target_include_directories(${PROJECT_NAME} PRIVATE ${MAPHYS_INCLUDE_DIRS})
+ target_link_libraries(${PROJECT_NAME} ${MAPHYS_LINK_LIBRARIES})
+ else()
+ message(FATAL_ERROR "MAPHYS NOT FOUND")
+ endif()
+
+ endif()
endif()
endfunction()
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