diff --git a/flake.lock b/flake.lock index 46aeb0e..f93c442 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,15 @@ { "nodes": { "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "lastModified": 1687709756, + "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", "owner": "numtide", "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7", "type": "github" }, "original": { @@ -17,18 +20,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1672505534, - "narHash": "sha256-ntaHfT53P4DtP3nW2mTmq5MQP3gqeut+ByPLHRkipcc=", - "owner": "bgamari", + "lastModified": 1687886075, + "narHash": "sha256-PeayJDDDy+uw1Ats4moZnRdL1OFuZm1Tj+KiHlD67+o=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "48dcea17d21e1b7ebcda2baa9fa2ea1beef00a3d", + "rev": "a565059a348422af5af9026b5174dc5c0dcefdae", "type": "github" }, "original": { - "owner": "bgamari", - "ref": "wip/vtk-egg-info", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "type": "indirect" } }, "openfoam": { @@ -49,6 +50,21 @@ "nixpkgs": "nixpkgs", "openfoam": "openfoam" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 492c28e..2101032 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs.flake-utils.url = "github:numtide/flake-utils"; - inputs.nixpkgs.url = "github:bgamari/nixpkgs/wip/vtk-egg-info"; + #inputs.nixpkgs.url = "github:bgamari/nixpkgs/wip/vtk-egg-info"; inputs.openfoam = { url = "https://develop.openfoam.com/Development/openfoam/-/archive/OpenFOAM-v2212/openfoam-OpenFOAM-v2212.tar.gz"; diff --git a/openfoam.nix b/openfoam.nix index af733dd..f9b2e03 100644 --- a/openfoam.nix +++ b/openfoam.nix @@ -1,7 +1,7 @@ { stdenv, src, bash, m4, flex, bison, - fftw, mpi, scotch, boost, cgal, zlib + fftw, mpi, scotch, boost, cgal, zlib, pkg-config, gmp, cmake, python3 }: stdenv.mkDerivation { @@ -9,8 +9,8 @@ stdenv.mkDerivation { inherit src; - nativeBuildInputs = [ bash m4 flex bison ]; - buildInputs = [ fftw mpi scotch boost cgal zlib ]; + nativeBuildInputs = [ bash m4 flex bison pkg-config cmake ]; + buildInputs = [ fftw mpi scotch boost cgal zlib gmp ]; patches = [ ./fix-bash.patch ]; postPatch = '' @@ -24,52 +24,11 @@ stdenv.mkDerivation { do substituteInPlace $f --replace /bin/bash ${bash}/bin/bash done + cp ../bashrc etc/bashrc ''; - configurePhase = '' - set -x - build="$(pwd)" - export FOAM_APP=$build/applications - export FOAM_SOLVERS=$build/applications/solvers - export FOAM_APPBIN=$build/platforms/linux64Gcc/bin - export FOAM_LIBBIN=$build/platforms/linux64Gcc/lib - export FOAM_EXT_LIBBIN=$build/platforms/linux64Gcc/lib - export FOAM_MPI=openmpi-system - export FOAM_RUN=$build/run - export FOAM_SRC=$build/src - export FOAM_ETC=$build/etc - export FOAM_USER_APPBIN=$build/platforms/linux64Gcc/bin - export FOAM_USER_LIBBIN=$build/platforms/linux64Gcc/lib - export FOAM_EXTRA_CXXFLAGS="-DFOAM_CONFIGURED_PROJECT_DIR=\\\"${placeholder "out"}\\\"" - export MPI_ARCH_PATH=/usr/include/openmpi - export WM_ARCH=linux64 - export WM_LABEL_SIZE=32 - export WM_LABEL_OPTION=Int32 - export WM_COMPILER=Gcc - export WM_COMPILER_LIB_ARCH=64 - export WM_COMPILE_OPTION=Opt - export WM_DIR=$build/wmake - export WM_OPTIONS=linux64Gcc - export WM_PRECISION_OPTION=DP - export WM_PROJECT=OpenFOAM - export WM_PROJECT_DIR=$build - export WM_PROJECT_USER_DIR=$build/debian/tmp - export WM_PROJECT_VERSION="$(bin/foamEtcFile -show-api)" - export WM_NCOMPPROCS=$CORES - export gperftools_install=$build/platforms/linux64Gcc - export WM_MPLIB=SYSTEMOPENMPI - unset FOAMY_HEX_MESH - - bin/tools/foamConfigurePaths \ - -boost boost-system \ - -cgal cgal-system \ - -fftw fftw-system \ - -kahip kahip-none \ - -scotch scotch-system - ''; buildPhase = '' - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$build/platforms/linux64Gcc/lib/openmpi-system:$build/platforms/linux64Gcc/lib:$build/platforms/linux64Gcc/lib/dummy" \ - PATH="$PATH:$build/wmake" \ + source etc/bashrc ./Allwmake -j$CORES -q ''; installPhase = ''