Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add scotch support to openfoam build #31

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions precice-packages/openfoam/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
writeScript,
version,
hash,
scotch,
}:

let
Expand Down Expand Up @@ -65,6 +66,9 @@ let
export LD_LIBRARY_PATH=$FOAM_LIBBIN:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$FOAM_LIBBIN/dummy:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/run/current-system/sw/lib/:$LD_LIBRARY_PATH

export SCOTCH_VERSION=scotch_${scotch.version}
export SCOTCH_ARCH_PATH=${scotch}
'';
in
stdenv.mkDerivation rec {
Expand All @@ -86,6 +90,7 @@ stdenv.mkDerivation rec {
openmpi
zlib
flex
scotch
];

postPatch = ''
Expand All @@ -96,6 +101,11 @@ stdenv.mkDerivation rec {
'';

buildPhase = ''
cat <<EOF > etc/config.sh/scotch
export SCOTCH_VERSION=scotch_${scotch.version}
export SCOTCH_ARCH_PATH=${scotch}
EOF

cp ${set-vars-script} bin/set-openfoam-vars
source bin/set-openfoam-vars

Expand Down