Skip to content

Commit

Permalink
Merge branch 'guix-deps' into 'master'
Browse files Browse the repository at this point in the history
[guix] Include or package dependencies

See merge request ogs/ogs!4781
  • Loading branch information
endJunction committed Nov 1, 2023
2 parents 980e84e + 6efeef5 commit 29e4abf
Show file tree
Hide file tree
Showing 14 changed files with 877 additions and 186 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@
[submodule "ThirdParty/bilke/cmake-modules"]
path = ThirdParty/bilke/cmake-modules
url = https://github.com/bilke/cmake-modules.git
[submodule "ThirdParty/collection"]
path = ThirdParty/collection
url = https://gitlab.opengeosys.org/ogs/libs/collection.git
120 changes: 116 additions & 4 deletions .guix/modules/ogs-package.scm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#:use-module (guix)
#:use-module (guix packages)
#:use-module (guix build-system cmake)
#:use-module (guix build-system copy)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
Expand All @@ -44,7 +45,7 @@
(define vcs-file?
;; Return true if the given file is under version control.
(or (git-predicate "../..") ; (current-source-directory)
(const #t))) ;not in a Git checkout
(const #t))) ; not in a Git checkout

(define-public ogs
(package
Expand All @@ -70,18 +71,22 @@
#:cmake ,cmake)) ;for newer CMake version
(inputs (list boost
eigen
googletest
exprtk
hdf5
iphreeqc
json-modern-cxx
libxml2
metis
pybind11-2.10.4
python
range-v3
spdlog
tclap
tetgen
zlib
vtk))
(native-inputs (list git ninja googletest nss-certs)) ; TODO: cpm
vtk
xmlpatch))
(native-inputs (list git ninja nss-certs)) ; TODO: cpm
(synopsis "OpenGeoSys")
(description
"Simulation of thermo-hydro-mechanical-chemical (THMC) processes in porous and fractured media")
Expand Down Expand Up @@ -192,6 +197,113 @@
(sha256
(base32
"0rbcfvl7y472sykzdq3vrkw83kar0lpzhk3wq9yj9cdydl8cpfcz"))))))

(define tetgen
(package
(name "tetgen")
(synopsis "A Quality Tetrahedral Mesh Generator and a 3D Delaunay Triangulator")
(license license:agpl3)
(description "TetGen is a program to generate tetrahedral meshes of any 3D polyhedral domains. TetGen generates exact constrained Delaunay tetrahedralizations, boundary conforming Delaunay meshes, and Voronoi partitions.")
(home-page "http://www.tetgen.org/")
(version "1.5.1-1")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ufz/tetgen")
(commit version)))
(sha256
(base32
"1xp1qibm0q4z5qx0h178qpas3n7pqbladkxdalq9j4l98hdws46j"))))
(build-system cmake-build-system)
(arguments
`(#:tests? #f)
)))

(define tclap
(package
(name "tclap")
(synopsis "Templatized Command Line Argument Parser")
(license license:expat)
(description "This is a simple C++ library that facilitates parsing command line arguments in a type independent manner.")
(home-page "https://sourceforge.net/p/tclap/discussion/")
(version "1.2.4-1")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ufz/tclap")
(commit version)))
(sha256
(base32
"0bijzfc9c8zny3m74y53i8m3f41kd8klcnmr9chy536syr9vdr5p"))))
(build-system cmake-build-system)
(arguments
`(#:tests? #f)
)))

(define iphreeqc
(package
(name "iphreeqc")
(synopsis "Modules Based on the Geochemical Model PHREEQC for use in scripting and programming languages")
(license license:public-domain)
(description "")
(home-page "https://www.usgs.gov/software/phreeqc-version-3")
(version "3.5.0-1")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ufz/iphreeqc")
(commit version)))
(sha256
(base32
"1liwp6hkl2dbrl8bki9gzsw77s3prv12sdikmwz5h8ffxwdrnwli"))))
(build-system cmake-build-system)
(arguments
`(#:tests? #f)
)))

(define xmlpatch
(package
(name "xmlpatch")
(synopsis "An XML Patch library")
(license license:lgpl2.1)
(description "")
(home-page "https://xmlpatch.sourceforge.net")
(version "0.4.3")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.opengeosys.org/ogs/libs/xmlpatch")
(commit (string-append "v" version))))
(sha256
(base32
"0872g9w1jd5r4c5a1s8ga4x1plg608b7rxyqjs6zv8ghjq9qlkvg"))))
(build-system cmake-build-system)
(inputs (list libxml2))
(arguments
`(#:tests? #f)
)))

(define exprtk
(package
(name "exprtk")
(home-page "https://www.partow.net/programming/exprtk/index.html")
(synopsis "C++ Mathematical Expression Parsing And Evaluation Library")
(description "")
(license license:expat)
(version "0.0.2")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/ArashPartow/exprtk.git")
(commit version)))
(sha256
(base32
"1w92qlfjpcan38d88fak3avq81lkcpai5mqpbvrsfv04mi5nfpk5"))))
(build-system copy-build-system)
(arguments
'(#:install-plan '(("exprtk.hpp" "include/")))
)))

;; return package
ogs

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ repos:
- id: cmake-format
additional_dependencies: ["cmakelang[YAML]"]
args: [--config=.cmake-format.yaml]
exclude: "scripts/cmake/jedbrown/.*|PackagingMacros.cmake|conan.cmake|CPM.cmake|FindFilesystem.cmake|ConanSetup.cmake|Tests.cmake"
exclude: "scripts/cmake/jedbrown/.*|conan.cmake|CPM.cmake|FindFilesystem.cmake|FindMKL.cmake|JSONParser.cmake|ConanSetup.cmake|Tests.cmake"
- id: cmake-lint
additional_dependencies: ["cmakelang[YAML]"]
exclude: "scripts/cmake/jedbrown/.*|PackagingMacros.cmake|conan.cmake|CPM.cmake|FindFilesystem.cmake|ConanSetup.cmake|BuildExternalProject.cmake"
exclude: "scripts/cmake/jedbrown/.*|conan.cmake|CPM.cmake|FindFilesystem.cmake|FindMKL.cmake|JSONParser.cmake|ConanSetup.cmake|BuildExternalProject.cmake"
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
hooks:
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ if(OGS_BUILD_CLI OR OGS_BUILD_UTILS OR OGS_BUILD_TESTING)
add_subdirectory(ParameterLib)
add_subdirectory(MaterialLib)
add_subdirectory(ProcessLib)
endif()
if(TARGET OgsXdmf)
add_subdirectory(Tests/xdmfdiff)
endif()
if(OGS_BUILD_TESTING AND PROJECT_IS_TOP_LEVEL)
Expand Down
2 changes: 1 addition & 1 deletion ChemistryLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ append_source_files(SOURCES Common)
ogs_add_library(ChemistryLib ${SOURCES})

target_link_libraries(
ChemistryLib PUBLIC Eigen3::Eigen iphreeqc PRIVATE BaseLib MaterialLib
ChemistryLib PUBLIC Eigen3::Eigen IPhreeqc PRIVATE BaseLib MaterialLib
MathLib MeshLib NumLib
)

Expand Down
1 change: 0 additions & 1 deletion ThirdParty/collection
Submodule collection deleted from b24633
20 changes: 2 additions & 18 deletions scripts/cmake/CMakeSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,11 @@ if(WIN32 AND (NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
message(FATAL_ERROR "Wheels only build in Visual Studio!")
endif()

set(_collection ${PROJECT_SOURCE_DIR}/ThirdParty/collection)
# If submodules in ThirdParty/collection are initialized and this is a Guix
# build use submodule as CPM sources.
if(EXISTS ${_collection}/ufz/vtkdiff/CMakeLists.txt AND GUIX_BUILD)
include(${_collection}/Setup.cmake)
endif()

# Set additional CMake modules path To be replaced later. See
# https://gitlab.kitware.com/cmake/cmake/-/issues/22831
CPMAddPackage(
NAME findmkl_cmake
GITHUB_REPOSITORY bilke/findmkl_cmake
GIT_TAG ee49c4f973f66bb7bfd644658d14e43459f557fa
DOWNLOAD_ONLY YES
)
# Set additional CMake modules path
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${PROJECT_SOURCE_DIR}/scripts/cmake"
${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/scripts/cmake"
"${PROJECT_SOURCE_DIR}/scripts/cmake/jedbrown"
"${PROJECT_SOURCE_DIR}/scripts/cmake/vector-of-bool"
"${findmkl_cmake_SOURCE_DIR}/cmake"
)

list(
Expand Down
Loading

0 comments on commit 29e4abf

Please sign in to comment.