1 Star 0 Fork 0

白落提/EFDC-MPI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
setup.sh 2.89 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
# This file is only used by the Vagrantfile to configure installations
# If one would like additional software installed, one can edit this file
# (either to install from package manager or source)
# USER=efdc
# HOME=/home/${USER}
apt-get install sudo
echo "Provisioning virtual machine..."
sudo apt-get update
echo "Installing required packages"
sudo apt-get update -y ; \
sudo apt-get install automake apt-utils gcc gfortran openssh-server wget -y ; \
sudo apt-get install git make m4 zlib1g-dev -y ; \
sudo apt-get install libopenmpi-dev openmpi-bin libhdf5-openmpi-dev openmpi-common -y ; \
sudo apt-get install libnetcdf-dev libblas-dev liblapack-dev -y ; \
sudo apt-get install libfreetype6-dev pkg-config libpng-dev -y ; \
sudo apt-get install libxml2-dev -y ; \
sudo apt-get install libbsd-dev -y ; \
sudo apt install build-essential -y ; \
sudo apt install g++ -y ; \
export PATH=$PATH:/usr/bin/ ;
# 修改文件权限
chmod -R 700 ./Dependence
# 切换到依赖目录
cd ./Dependence || exit
# Add NetCDF & OpenBlas libraries
# 1) We need HDF
#Required for NetCDF integration; source is supported at http://www.hdfgroup.org/ftp/HDF5/current/src
HDF_VERSION="1.12.0"
# Download build and install HDF5
cd ./hdf5-gcc || exit; \
tar -xvf hdf5-${HDF_VERSION}.tar.gz; \
cd hdf5-${HDF_VERSION}; \
./configure --enable-shared --enable-hl --prefix=/usr/local/hdf5 \
make; \
sudo make install; \
cd ../;
# 2)
#Build netcdf
# First we need to build NetCDF C version
# (http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html)
# Download and install netcdf C
NCD_VERSION="4.8.1"
tar -xvf netcdf-c-${NCD_VERSION}.tar.gz; \
cd netcdf-c-${NCD_VERSION} || exit; \
./configure --prefix=/usr/local/netcdf CC=gcc LDFLAGS="-L/usr/local/hdf5/lib -lbsd" CFLAGS="-I/usr/local/hdf5/include" --disable-dap \
make ; \
sudo make install; \
# shellcheck disable=SC2103
cd .. ; \
# 3) Build NetCDF fortran version
# (http://www.unidata.ucar.edu/software/netcdf/docs/building_netcdf_fortran.html)
# Download and install NetCDF fortran
NCF_VERSION="4.5.4"
tar -xvf netcdf-fortran-${NCF_VERSION}.tar.gz;
cd netcdf-fortran-${NCF_VERSION} || exit;
./configure --prefix=/usr/local/netcdf --disable-fortran-type-check CC=gcc FC=gfortran LDFLAGS="$(nc-config --libs)" CFLAGS="$(nc-config --cflags)"
make ;
sudo make install;
cd ../../ ;
## Add netcdf path to vagrant machine
# shellcheck disable=SC2129
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/netcdf/lib" >> ~/.bashrc
echo "export PATH=$PATH:/usr/local/netcdf/bin" >> ~/.bashrc
export LDFLAGS="-L/usr/local/netcdf/lib"
export CFLAGS="-I/usr/local/netcdf/include"
export LIBS="-lnetcdf"
# shellcheck disable=SC1090
source ~/.bashrc
# Update any python requirements
make
make install
ln -s /root/opt/efdc-mpi/Src/EFDC /usr/bin/EFDC
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bailuoti/efdc-mpi.git
git@gitee.com:bailuoti/efdc-mpi.git
bailuoti
efdc-mpi
EFDC-MPI
master

搜索帮助