Skip to content

Commit

Permalink
Merge pull request #64 from ghammond86/master
Browse files Browse the repository at this point in the history
Updates to make interface compatible with PFLOTRAN v3.0 + PETSc v3.11
  • Loading branch information
smolins authored Aug 7, 2020
2 parents 04e72f8 + d19bc3a commit e4f37d2
Show file tree
Hide file tree
Showing 12 changed files with 285 additions and 181 deletions.
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ branches:
compiler:
- gcc

install: travis_wait 60 ./.install-$TRAVIS_OS_NAME-deps.sh
install: travis_wait 60 ./.travis/install-$TRAVIS_OS_NAME-deps.sh

env:
- BUILD_TYPE=Debug PETSC_DIR=$PWD/petsc PETSC_ARCH=petsc_debug DEBUG=1
- BUILD_TYPE=Release PETSC_DIR=$PWD/petsc PETSC_ARCH=petsc_opt DEBUG=0
global:
- ALQUIMIA_DIR=$PWD
- THIRD_PARTY_LIB_DIR=$HOME
- CRUNCHTOPE_DIR=$THIRD_PARTY_LIB_DIR/crunchtope-dev
- PETSC_DIR=$THIRD_PARTY_LIB_DIR/petsc
- PFLOTRAN_DIR=$THIRD_PARTY_LIB_DIR/pflotran
jobs:
- BUILD_TYPE=Debug PETSC_ARCH=petsc_debug DEBUG=1
- BUILD_TYPE=Release PETSC_ARCH=petsc_opt DEBUG=0

script:
- mkdir build && cd build
- ls $PETSC_DIR
- ls $PETSC_DIR/$PETSC_ARCH
- ls $PETSC_DIR/$PETSC_ARCH/lib
- export TMPDIR=/tmp
- cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../alquimia-install -DCMAKE_C_COMPILER=`which mpicc` -DCMAKE_CXX_COMPILER=`which mpicxx` -DCMAKE_Fortran_COMPILER=`which mpif90` -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DXSDK_WITH_PFLOTRAN=ON -DTPL_PFLOTRAN_LIBRARIES=$PETSC_DIR/$PETSC_ARCH/externalpackages/git.pflotran/src/pflotran/libpflotranchem.a -DTPL_PFLOTRAN_INCLUDE_DIRS=$PETSC_DIR/$PETSC_ARCH/externalpackages/git.pflotran/src/pflotran -DXSDK_WITH_CRUNCHFLOW=ON -DTPL_CRUNCHFLOW_LIBRARIES=$PETSC_DIR/$PETSC_ARCH/externalpackages/crunchtope-dev/source/libcrunchchem.a -DTPL_CRUNCHFLOW_INCLUDE_DIRS=$PETSC_DIR/$PETSC_ARCH/externalpackages/crunchtope-dev/source
- make -j4
- make test
- make install
- make test_install
- cd ..
- ./.travis/install-petsc.sh
- ./.travis/install-crunchtope.sh
- ./.travis/install-pflotran.sh
- ./.travis/install-alquimia.sh

after_failure:
- cat build/Testing/Temporary/LastTest.log
- cat $ALQUIMIA_DIR/build/Testing/Temporary/LastTest.log
20 changes: 20 additions & 0 deletions .travis/install-alquimia.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

cd $ALQUIMIA_DIR
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../alquimia-install \
-DCMAKE_C_COMPILER=`which mpicc` \
-DCMAKE_CXX_COMPILER=`which mpicxx` \
-DCMAKE_Fortran_COMPILER=`which mpif90` \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DXSDK_WITH_PFLOTRAN=ON \
-DTPL_PFLOTRAN_LIBRARIES=$PFLOTRAN_DIR/src/pflotran/libpflotranchem.a \
-DTPL_PFLOTRAN_INCLUDE_DIRS=$PFLOTRAN_DIR/src/pflotran \
-DXSDK_WITH_CRUNCHFLOW=ON \
-DTPL_CRUNCHFLOW_LIBRARIES=$CRUNCHTOPE_DIR/source/libcrunchchem.a \
-DTPL_CRUNCHFLOW_INCLUDE_DIRS=$CRUNCHTOPE_DIR/source
make -j4
make test
make install
make test_install
6 changes: 6 additions & 0 deletions .travis/install-crunchtope.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

git clone https://bitbucket.org/crunchflow/crunchtope-dev.git --branch petsc-upgrade $CRUNCHTOPE_DIR
cd $CRUNCHTOPE_DIR/source
git apply MakefileForAlquimia.patch
make libcrunchchem.a
4 changes: 4 additions & 0 deletions .travis/install-linux-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Install necessary software.
sudo apt-get update -qq
sudo apt-get install -y cmake gcc libopenmpi-dev openmpi-bin liblapack-dev gfortran git

20 changes: 20 additions & 0 deletions .travis/install-osx-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Install required software
brew cask uninstall oclint
brew update
brew install openmpi
export TMPDIR=/tmp

# Make sure the weird gfortran library links are in place.
ln -s /usr/local/lib/gcc/7/libgfortran.dylib /usr/local/lib/libgfortran.dylib
ln -s /usr/local/lib/gcc/7/libgfortran.a /usr/local/lib/libgfortran.a

# Go get PETSc 3.6.x and build it.
git clone https://bitbucket.org/petsc/petsc petsc
pushd $PETSC_DIR
./configure --with-mpi=1 --download-hdf5 --with-debug=$DEBUG --with-shared-libraries=1 --download-pflotran --download-pflotran-commit=origin/master
make
make test
popd

# Go get pflotran and build it.
# -already installed under PETSc
7 changes: 7 additions & 0 deletions .travis/install-petsc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

git clone https://gitlab.com/petsc/petsc.git $PETSC_DIR
cd $PETSC_DIR
git checkout v3.11.3
./configure --with-mpi=1 --with-debug=1 --with-shared-libraries=1 --download-fblaslapack=1 --with-debug=$DEBUG
make
7 changes: 7 additions & 0 deletions .travis/install-pflotran.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

git clone https://bitbucket.org/pflotran/pflotran $PFLOTRAN_DIR
cd $PFLOTRAN_DIR/src/pflotran
git checkout v3.0
git apply $ALQUIMIA_DIR/.travis/pflotran_version_patch.txt
make libpflotranchem.a
13 changes: 13 additions & 0 deletions .travis/pflotran_version_patch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/pflotran/pflotran_constants.F90 b/src/pflotran/pflotran_constants.F90
index dd88e7265..86d0816c4 100644
--- a/src/pflotran/pflotran_constants.F90
+++ b/src/pflotran/pflotran_constants.F90
@@ -16,7 +16,7 @@ module PFLOTRAN_Constants_module
PetscInt, parameter :: PFLOTRAN_VERSION_PATCH = 0 ! (alpha < -1; beta = -1)

#define VMAJOR 3
-#define VMINOR 13
+#define VMINOR 11
#define VSUBMINOR 0
#if (PETSC_VERSION_MAJOR < VMAJOR || \
(PETSC_VERSION_MAJOR == VMAJOR && \
Loading

0 comments on commit e4f37d2

Please sign in to comment.