This repository has been archived by the owner on Oct 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
machine instructions ubuntu gfortran
Xylar Asay-Davis edited this page Jul 25, 2017
·
9 revisions
sudo apt-get install gfortran libhdf5-dev m4 cmake mpich
Download and untar the latest netcdf
, netcdf-fortran
, netcdf-cxx
(not netcdf-cxx4
) and parallel-netcdf
source. These are the latest at the time of this writing:
Modify /path/to/dependencies
to be a path where you would like to install the dependencies. I recommend that this not be a system path (e.g. not /usr
or /usr/local
) to make it easier to make changes later on.
export NETCDF=/path/to/dependencies
export PNETCDF=$NETCDF
export PIO=$NETCDF
export HDF5_INCLUDE=/usr/include/hdf5/serial/
export HDF5_LIB=/usr/lib/x86_64-linux-gnu/hdf5/serial/
export LD_LIBRARY_PATH=$HDF5_LIB:${NETCDF}/lib:${LD_LIBRARY_PATH}
export CPPFLAGS="-I$HDF5_INCLUDE -I${NETCDF}/include"
export LDFLAGS="-L$HDF5_LIB -L${NETCDF}/lib"
cd netcdf-4.4.1.1
./configure --disable-dap --enable-netcdf-4 --disable-cxx --enable-shared --disable-static --enable-fortran \
--enable-hdf5 --prefix=$NETCDF
make
make check
make install
cd ..
cd netcdf-fortran-4.4.4
./configure --disable-static --prefix=$NETCDF
make
make check
make install
cd ..
cd netcdf-cxx-4.2
./configure --disable-static --prefix=$NETCDF
make
make check
make install
cd ..
cd parallel-netcdf-1.8.1
./configure --prefix=$NETCDF
make
make check
make install
cd ..
git clone [email protected]:NCAR/ParallelIO.git
cd ParallelIO
export PIOSRC=`pwd`
cd ..
rm -rf pio
mkdir pio
cd pio
export CC=mpicc
export FC=mpif90
cmake -DNetCDF_C_PATH=$NETCDF -DNetCDF_Fortran_PATH=$NETCDF \
-DPnetCDF_PATH=$PNETCDF -DPIO_ENABLE_TIMING=OFF \
-DCMAKE_INSTALL_PREFIX=$NETCDF $PIOSRC
make
make check
make install
cd ..
To load dependencies before compiling MPAS, it is useful to create a bash file (e.g. setup_mpas_dependencies.bash
) that can be sourced before compiling MPAS. Here is an exmaple:
export CORE=ocean
export USE_PIO2=true
export NETCDF=/path/to/dependencies
export PNETCDF=$NETCDF
export PIO=$NETCDF
export HDF5_INCLUDE=/usr/include/hdf5/serial/
export HDF5_LIB=/usr/lib/x86_64-linux-gnu/hdf5/serial/
export LD_LIBRARY_PATH=$HDF5_LIB:${NETCDF}/lib:${LD_LIBRARY_PATH}
make gfortran