代码拉取完成,页面将自动刷新
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。