-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed linux build on travis Expanded the travis continuous integration: "manually build" netcdf-fortran using gfortran-6 this requires building szip, hdf5 and netcdf-c with the same compiler add expanded scripts for different stages of the compilation
- Loading branch information
1 parent
7061c7d
commit a7e3f14
Showing
3 changed files
with
140 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
sudo: false | ||
sudo: false # use container-based build | ||
language: fortran | ||
compiler: | ||
- gfortran | ||
os: | ||
- linux | ||
notifications: | ||
email: false | ||
|
||
compiler: gfortran-6 | ||
os: linux | ||
env: TESTID='summa_linux' | ||
addons: | ||
apt: | ||
source: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- libnetcdf-dev | ||
- liblapack-dev | ||
- gfortran | ||
- gfortran-6 | ||
before_install: | ||
- source ci/summa_install_utils | ||
- summa_before_install | ||
install: | ||
- summa_install | ||
script: | ||
- sed -i "s/FC =/FC = gfortran/" build/Makefile | ||
- sed -i "s|F_MASTER =|F_MASTER = ${TRAVIS_BUILD_DIR}|" build/Makefile | ||
- make -C build/ -f Makefile | ||
- ${TRAVIS_BUILD_DIR}/bin/summa.exe | ||
- summa_script | ||
after_success: | ||
- summa_after_success | ||
after_failure: | ||
- summa_after_failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
export CC=/usr/bin/gcc-6 | ||
export FC=/usr/bin/gfortran-6 | ||
|
||
if [ -z "$WORKDIR" ]; then | ||
export WORKDIR=$HOME/workdir | ||
mkdir -p $WORKDIR | ||
fi | ||
|
||
if [ -z "$INSTALLDIR" ]; then | ||
export INSTALLDIR=$HOME/installdir | ||
mkdir -p $INSTALLDIR | ||
fi | ||
|
||
function install_szip { | ||
echo install_szip | ||
cd $WORKDIR | ||
wget --no-check-certificate -q http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/szip-2.1.tar.gz | ||
tar -xzf szip-2.1.tar.gz | ||
cd szip-2.1 | ||
./configure --prefix=$INSTALLDIR &> config.log | ||
make &> make.log | ||
make install | ||
export CPPFLAGS="$CPPFLAGS -I${INSTALLDIR}/include" | ||
export LDFLAGS="$LDFLAGS -L${INSTALLDIR}/lib" | ||
} | ||
|
||
function install_hdf5 { | ||
echo install_hdf5 | ||
cd $WORKDIR | ||
wget --no-check-certificate -q http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.17.tar.gz | ||
tar -xzf hdf5-1.8.17.tar.gz | ||
cd hdf5-1.8.17 | ||
./configure --prefix=$INSTALLDIR &> config.log | ||
make &> make.log | ||
make install | ||
export LIBDIR=${INSTALLDIR}/lib | ||
} | ||
|
||
function install_netcdf_c { | ||
echo install_netcdf_c | ||
cd $WORKDIR | ||
wget --no-check-certificate -q ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.1.tar.gz | ||
tar -xzf netcdf-4.4.1.tar.gz | ||
cd netcdf-4.4.1 | ||
./configure --prefix=$INSTALLDIR &> config.log | ||
make &> make.log | ||
make install | ||
export LD_LIBRARY_PATH=${INSTALLDIR}/lib | ||
} | ||
|
||
function install_netcdf_fortran { | ||
echo install_netcdf_fortran | ||
cd $WORKDIR | ||
wget --no-check-certificate -q ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.4.4.tar.gz | ||
tar -xzf netcdf-fortran-4.4.4.tar.gz | ||
cd netcdf-fortran-4.4.4 | ||
./configure --prefix=$INSTALLDIR &> config.log | ||
make &> make.log | ||
make install | ||
} | ||
|
||
function summa_before_install { | ||
echo summa_before_install | ||
# Install szip (used by hdf5) | ||
install_szip | ||
# Install HDF5 | ||
install_hdf5 | ||
# Install NetCDF-C | ||
install_netcdf_c | ||
# Install NetCDF fortran | ||
install_netcdf_fortran | ||
} | ||
|
||
function summa_install { | ||
echo summa_install | ||
cd ${TRAVIS_BUILD_DIR} | ||
sed -i "s/FC =.*/FC = gfortran-6/" build/Makefile | ||
sed -i "s|F_MASTER =.*|F_MASTER = ${TRAVIS_BUILD_DIR}|" build/Makefile | ||
sed -i "s|NCDF_PATH =.*|NCDF_PATH = ${INSTALLDIR}|" build/Makefile | ||
make -C build/ -f Makefile &> make.log | ||
} | ||
|
||
function summa_script { | ||
echo summa_script | ||
${TRAVIS_BUILD_DIR}/bin/summa.exe | ||
} | ||
|
||
function summa_after_success { | ||
echo summa_after_success | ||
echo "SUMMA build succeeded" | ||
} | ||
|
||
function summa_after_failure { | ||
echo summa_after_failure | ||
echo "SUMMA build failed" | ||
} |