pflotran: init at 6.0.1
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
diff --git a/src/pflotran/makefile b/src/pflotran/makefile
|
||||
index 17587c91d..7caf73e8c 100644
|
||||
--- a/src/pflotran/makefile
|
||||
+++ b/src/pflotran/makefile
|
||||
@@ -51,7 +51,7 @@ PETSC_MAKE_STOP_ON_ERROR=
|
||||
# so that PFLOTRAN will be built with the same options as
|
||||
# the petsc configured in $PETSC_DIR/$PETSC_ARCH
|
||||
|
||||
-MYFLAGS = -I.
|
||||
+MYFLAGS = -I. -L@HDF5_FORTRAN_LIBS@ -I@HDF5_FORTRAN_INCLUDE@
|
||||
|
||||
###############################################################################
|
||||
# Preprocessor flags for special PFLOTRAN features/hacks
|
||||
@@ -183,7 +183,7 @@ ifdef ug_mpi_scatter_ghost
|
||||
endif
|
||||
|
||||
ifdef have_hdf5
|
||||
-LIBS += -L${HDF5_LIB} -lhdf5_fortran -lhdf5 -lz
|
||||
+LIBS += -L${HDF5_LIB} -lhdf5 -lhdf5_fortran -lhdf5_hl_fortran -lhdf5_f90cstub -lz
|
||||
endif
|
||||
|
||||
# Set this accordingly on your platform
|
||||
@@ -273,7 +273,7 @@ pflotran_rxn_obj = ${pflotran_src}pflotran_rxn.o
|
||||
|
||||
# PFLOTRAN executable
|
||||
pflotran : $(pflotran_obj)
|
||||
- ${FLINKER} -o pflotran $(pflotran_obj) ${PETSC_LIB} ${LIBS}
|
||||
+ ${FLINKER} -o pflotran $(pflotran_obj) ${PETSC_LIB} ${LIBS} -lhdf5 -lhdf5_fortran -lhdf5_hl_fortran -lhdf5_f90cstub
|
||||
|
||||
# PFLOTRAN as a library
|
||||
libpflotran.a : $(pflotran_obj)
|
||||
@@ -286,11 +286,11 @@ libpflotranchem.a : $(chem_obj) $(shared_mode_aux_obj) $(util_obj)
|
||||
# object files lists below.... This is a workaround.
|
||||
pflotran_rxn : libpflotranchem.a $(pflotran_rxn_obj)
|
||||
${FLINKER} -o $@ $(pflotran_rxn_obj) $(chem_obj) $(shared_mode_aux_obj) \
|
||||
- $(util_obj) ${PETSC_LIB} ${LIBS}
|
||||
+ $(util_obj) ${PETSC_LIB} ${LIBS} -lhdf5 -lhdf5_fortran -lhdf5_hl_fortran -lhdf5_f90cstub
|
||||
|
||||
# PFLOTRAN derivative test
|
||||
pflotran_derivative : $(pflotran_base_obj) pflotran_derivative.o
|
||||
- ${FLINKER} -o pflotran_derivative $(pflotran_base_obj) pflotran_derivative.o ${PETSC_LIB} ${LIBS}
|
||||
+ ${FLINKER} -o pflotran_derivative $(pflotran_base_obj) pflotran_derivative.o ${PETSC_LIB} ${LIBS} -lhdf5 -lhdf5_fortran -lhdf5_hl_fortran -lhdf5_f90cstub
|
||||
|
||||
$(SRC_DIR)/pflotran_provenance.F90 : FORCE
|
||||
ifeq ($(UPDATE_PROVENANCE),1)
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromBitbucket,
|
||||
gfortran,
|
||||
mpi,
|
||||
petsc,
|
||||
blas,
|
||||
lapack,
|
||||
parmetis,
|
||||
hdf5,
|
||||
mpiCheckPhaseHook,
|
||||
python3,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "PFLOTRAN";
|
||||
version = "6.0.1";
|
||||
|
||||
src = fetchFromBitbucket {
|
||||
owner = "pflotran";
|
||||
repo = "pflotran";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-AZXzay6GWbnxONB8Slg8gV0KN1CxGCXbJ45ZeWL1034=";
|
||||
};
|
||||
|
||||
patches = [ ./make.patch ];
|
||||
|
||||
nativeBuildInputs = [ gfortran ];
|
||||
|
||||
buildInputs = [
|
||||
petsc
|
||||
blas
|
||||
lapack
|
||||
hdf5
|
||||
parmetis
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ mpi ];
|
||||
propagatedUserEnvPkgs = [ mpi ];
|
||||
passthru = { inherit mpi; };
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
/*
|
||||
Pflotran does not use a "real" autotools configure script, but a simple bash
|
||||
script, that is merely named configure. Consequently, many common mechanism
|
||||
don't work. Thus, we need to help make to figure out some include and library
|
||||
paths.
|
||||
*/
|
||||
preConfigure = ''
|
||||
substituteInPlace src/pflotran/makefile \
|
||||
--subst-var-by "HDF5_FORTRAN_LIBS" "${lib.getLib hdf5}/lib" \
|
||||
--subst-var-by "HDF5_FORTRAN_INCLUDE" "${lib.getDev hdf5}/include"
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--with-petsc-dir=${petsc}"
|
||||
"--with-petsc-arch=linux-gnu-c-release"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Parallel, multi-physics simulation code for subsurface flow and transport";
|
||||
homepage = "https://pflotran.org/";
|
||||
license = licenses.lgpl3Only;
|
||||
maintainers = [ maintainers.sheepforce ];
|
||||
};
|
||||
})
|
||||
@@ -3611,6 +3611,12 @@ with pkgs;
|
||||
|
||||
hdf5-fortran = hdf5.override { fortranSupport = true; };
|
||||
|
||||
hdf5-fortran-mpi = hdf5.override {
|
||||
fortranSupport = true;
|
||||
mpiSupport = true;
|
||||
cppSupport = false;
|
||||
};
|
||||
|
||||
hdf5-threadsafe = hdf5.override { threadsafe = true; };
|
||||
|
||||
heaptrack = libsForQt5.callPackage ../development/tools/profiling/heaptrack { };
|
||||
@@ -17058,6 +17064,15 @@ with pkgs;
|
||||
|
||||
### SCIENCE/PROGRAMMING
|
||||
|
||||
### SCIENCE/GEOLOGY
|
||||
pflotran = callPackage ../by-name/pf/pflotran/package.nix {
|
||||
petsc = petsc.override {
|
||||
hdf5-support = true;
|
||||
hdf5 = hdf5-fortran-mpi;
|
||||
petsc-optimized = true;
|
||||
};
|
||||
};
|
||||
|
||||
### SCIENCE/LOGIC
|
||||
|
||||
abella = callPackage ../applications/science/logic/abella {
|
||||
|
||||
Reference in New Issue
Block a user