diff --git a/LifeSciences/README.md b/LifeSciences/README.md index 0fbae3f8c71f4f843628c6f1469a0b5e2d7ead3a..c5841db879bf3efec9c9b08b41fe349b1b0ceaff 100644 --- a/LifeSciences/README.md +++ b/LifeSciences/README.md @@ -6,4 +6,5 @@ Life Sciences Software List: - repositories: RepeatMasker-4.1.2 - repositories: eigensoft-7.2.1 - repositories: redundans-v0.13c -- repositories: bamtools-2.5.2 \ No newline at end of file +- repositories: bamtools-2.5.2 +- repositories: amber-20 \ No newline at end of file diff --git a/LifeSciences/amber-20/amber20.sh b/LifeSciences/amber-20/amber20.sh new file mode 100644 index 0000000000000000000000000000000000000000..7836d11330f9b796c8e3ce9cf294095cecc1ee95 --- /dev/null +++ b/LifeSciences/amber-20/amber20.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "The format is as follows:" + echo "bash amber-20.sh buildpath installpath" + echo ":param buildpath: 应用构建绝对路径" + echo ":param installpath: 应用安装绝对路径" + exit 1 +fi + +[[ ! "$1" =~ ^/.* || ! -d "$1" || "$1" = "/" ]] && echo "请输入正确的构建路径" && exit 1 +[[ ! "$2" =~ ^/.* || ! -d "$2" || "$2" = "/" ]] && echo "请输入正确的安装路径" && exit 1 + +buildpath=$1 +installpath=$2 +[[ "$buildpath" =~ .*/$ ]] && buildpath=${buildpath%/*} +[[ "$installpath" =~ .*/$ ]] && installpath=${installpath%/*} +[[ "$buildpath" == "$installpath" ]] && echo "构建路径与安装路径需为不同路径" && exit 1 +yum -y install cmake boost bzip2 bzip2-devel bison flex libXt-devel libXext-devel libX11-devel libICE-devel libSM-devel +set -e +wget -t 0 -c "https://ambermd.org/cgi-bin/AmberTools21-get.pl?Name=test&Institution=test&City=test&State=ON&Country=AI" -O $buildpath/AmberTools21.tar.bz2 + +tar -xvf $buildpath/AmberTools21.tar.bz2 -C $buildpath && rm -rf $buildpath/AmberTools21.tar.bz2 + +cp cmake.defaults.patch $buildpath/amber20_src + +cd $buildpath/amber20_src + +./update_amber --update +patch -p2 < ./cmake.defaults.patch +cd build/ +export CMAKE_PREFIX_PATH=$installpath/openblas +FLAGS="-mcpu=tsv110 -I$installpath/hmpi-1.1.1/hmpi-1.1.1-huawei/include" +cmake .. \ + -DCMAKE_INSTALL_PREFIX=$installpath/amber20 \ + -DCOMPILER=AUTO \ + -DCMAKE_C_FLAGS="$FLAGS" \ + -DFORCE_EXTERNAL_LIBS=blas \ + -DCMAKE_CXX_FLAGS="$FLAGS" \ + -DCMAKE_Fortran_FLAGS="$FLAGS" \ + -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang \ + -DMPI=TRUE -DCUDA=FALSE -DOPENMP=TRUE -DINSTALL_TESTS=TRUE \ + -DDOWNLOAD_MINICONDA=FALSE -DMINICONDA_USE_PY3=FALSE + + + +sed -i "s/-o CMakeFiles\/cifparse.dir\/cifparse.c.o/-fcommon -o CMakeFiles\/cifparse.dir\/cifparse.c.o/g" AmberTools/src/cifparse/CMakeFiles/cifparse.dir/build.make +sed -i "s/-o CMakeFiles\/cifparse.dir\/cifp.tab.c.o/-fcommon -o CMakeFiles\/cifparse.dir\/cifp.tab.c.o/g" AmberTools/src/cifparse/CMakeFiles/cifparse.dir/build.make +make -j 8 +make -j install +echo './sander-16.0-py3.8-linux-aarch64.egg' >> $installpath/amber20/lib/python3.8/site-packages/easy-install.pth +echo './ParmEd-3.4.1-py3.8-linux-aarch64.egg' >> $installpath/amber20/lib/python3.8/site-packages/easy-install.pth +rm -rf $buildpath/amber20_src diff --git a/LifeSciences/amber-20/build.sh b/LifeSciences/amber-20/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..005466ea707b4c3a4015cada56210b9e2ded284a --- /dev/null +++ b/LifeSciences/amber-20/build.sh @@ -0,0 +1,66 @@ +#!/bin/bash +if [[ $# -ne 2 ]]; then + echo "The format is as follows:" + echo "bash build.sh buildpath installpath" + echo ":param buildpath: 应用构建绝对路径" + echo ":param installpath: 应用安装绝对路径" + exit 1 +fi + +[[ ! "$1" =~ ^/.* || "$1" = "/" ]] && echo "请输入正确的构建路径" && exit 1 +[[ ! "$2" =~ ^/.* || "$2" = "/" ]] && echo "请输入正确的安装路径" && exit 1 + +create_dir() +{ + local path=$1 + [[ "$path" =~ .*/$ ]] && path=${path%/*} + if [[ ! -d "$path" && ! -f "$path" ]]; then mkdir -p $path; else path=$path`date "+%y%m%d%H%M%S"` && mkdir -p $path; fi + echo $path +} + +buildpath=$(create_dir $1) +installpath=$(create_dir $2) + +yum install -y m4 environment-modules systemd-devel --nogpgcheck +source /etc/profile +module purge + +set -e +dep_dir="dependency" +bash $dep_dir/bisheng-compiler-2.1.0.sh $buildpath $installpath +module use $installpath/bisheng-compiler-2.1.0 +module load $installpath/bisheng-compiler-2.1.0/bisheng_modulefiles + +bash $dep_dir/hmpi-1.1.1.sh $buildpath $installpath +module use $installpath/hmpi-1.1.1 +module load $installpath/hmpi-1.1.1/hmpi_modulefiles + +bash $dep_dir/miniconda-py38_4.11.0-devel.sh $buildpath $installpath +module use $installpath/miniconda3 +module load $installpath/miniconda3/miniconda_py38_modulefiles + +bash $dep_dir/openblas-0.3.18.sh $buildpath $installpath +bash $dep_dir/lapack-3.8.0.sh $buildpath $installpath +module use $installpath/openblas +module load $installpath/openblas/OpenBLAS-0.3.18_modulefiles + +bash amber20.sh $buildpath $installpath + +mkdir -p pkg/amber-20-hpc && cp -r $installpath/* pkg/amber-20-hpc/ +cat>"pkg/amber-20-hpc/run.sh"< /dev/null +current_dir=\$(cd "\$(dirname "\${BASH_SOURCE[0]}")" &> /dev/null && pwd) +source \$current_dir/amber20/amber.sh +for d in \$(ls \$current_dir) +do + [[ ! \$d =~ "amber" && ! -f "\$current_dir/\$d" ]] && cd \$current_dir/\$d && module use \$(pwd) && module load \$(pwd)/*modulefiles +done +cd \$current_dir +[[ ! -d "$installpath/hmpi-1.1.1" ]] && mkdir -p $installpath/hmpi-1.1.1 && cp -r \$current_dir/hmpi-1.1.1/* $installpath/hmpi-1.1.1/ +EOF +cd pkg/ && tar zcvf amber-20-hpc.tar.gz amber-20-hpc + +rm -rf $buildpath $installpath diff --git a/LifeSciences/amber-20/cmake.defaults.patch b/LifeSciences/amber-20/cmake.defaults.patch new file mode 100644 index 0000000000000000000000000000000000000000..067035e8b7ca4819c66dea3aa6756c2760f9397a --- /dev/null +++ b/LifeSciences/amber-20/cmake.defaults.patch @@ -0,0 +1,64 @@ +diff -Nur modify/amber20_src/AmberTools/src/reduce/libpdb/pdb++.cpp base/amber20_src/AmberTools/src/reduce/libpdb/pdb++.cpp +--- modify/amber20_src/AmberTools/src/reduce/libpdb/pdb++.cpp 2018-06-18 22:24:05.000000000 +0800 ++++ base/amber20_src/AmberTools/src/reduce/libpdb/pdb++.cpp 2022-04-11 20:38:28.235163871 +0800 +@@ -19,7 +19,7 @@ + + #include "pdb++.h" + +-extern "C" { ++//extern "C" { + #ifdef OLD_STD_HDRS + #include + #else +@@ -27,7 +27,7 @@ + using std::memset; + using std::memcmp; + #endif +-} ++//} + + PDB::PDB() + { +diff -Nur modify/amber20_src/AmberTools/src/reduce/libpdb/pdb_type.cpp base/amber20_src/AmberTools/src/reduce/libpdb/pdb_type.cpp +--- modify/amber20_src/AmberTools/src/reduce/libpdb/pdb_type.cpp 2018-06-18 22:24:05.000000000 +0800 ++++ base/amber20_src/AmberTools/src/reduce/libpdb/pdb_type.cpp 2022-04-11 20:38:47.039378191 +0800 +@@ -20,7 +20,7 @@ + // + + # include "pdb++.h" +-extern "C" { ++//extern "C" { + #ifdef OLD_STD_HDRS + #include + #include +@@ -30,7 +30,7 @@ + using std::islower; + using std::toupper; + #endif +-} ++//} + #if defined(__DECCXX_VER) || defined(_MSC_VER) + #define NEEDSTRCASECMP + #endif +diff -Nur modify/amber20_src/AmberTools/src/sebomd/se_etimer.F base/amber20_src/AmberTools/src/sebomd/se_etimer.F +--- modify/amber20_src/AmberTools/src/sebomd/se_etimer.F 2018-08-15 19:33:54.000000000 +0800 ++++ base/amber20_src/AmberTools/src/sebomd/se_etimer.F 2022-04-11 20:38:06.450915586 +0800 +@@ -6,7 +6,7 @@ + #ifdef MPI + #include "mpif.h" + #endif +- ++ INTEGER :: mclock + double precision t + + double precision tnow, t0 +@@ -24,7 +24,7 @@ + # if (__GNUC__ == 4 && __GNUC_MINOR__ <= 1) + tnow = second() + # else +- tnow = 0.01*mclock() ++ tnow = 0.01*mclock() !gfortran + # endif + # endif + #endif + diff --git a/LifeSciences/amber-20/dependency/bisheng-compiler-2.1.0.sh b/LifeSciences/amber-20/dependency/bisheng-compiler-2.1.0.sh new file mode 100644 index 0000000000000000000000000000000000000000..1254ea4f78d28503a7e41da46946345f803752b3 --- /dev/null +++ b/LifeSciences/amber-20/dependency/bisheng-compiler-2.1.0.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "The format is as follows:" + echo "bash bisheng-compiler-2.1.0.sh buildpath installpath" + echo ":param buildpath: 应用构建绝对路径" + echo ":param installpath: 应用安装绝对路径" + exit 1 +fi + +[[ ! "$1" =~ ^/.* || ! -d "$1" || "$1" = "/" ]] && echo "请输入正确的构建路径" && exit 1 +[[ ! "$2" =~ ^/.* || ! -d "$2" || "$2" = "/" ]] && echo "请输入正确的安装路径" && exit 1 + +buildpath=$1 +installpath=$2 +[[ "$buildpath" =~ .*/$ ]] && buildpath=${buildpath%/*} +[[ "$installpath" =~ .*/$ ]] && installpath=${installpath%/*} +[[ "$buildpath" == "$installpath" ]] && echo "构建路径与安装路径需为不同路径" && exit 1 +set -e +yum install -y wget tar environment-modules libatomic --nogpgcheck + +wget -t 0 -c -P $buildpath https://mirrors.huaweicloud.com/kunpeng/archive/compiler/bisheng_compiler/bisheng-compiler-2.1.0-aarch64-linux.tar.gz +tar xf $buildpath/bisheng-compiler-2.1.0-aarch64-linux.tar.gz -C $buildpath && rm -rf $buildpath/bisheng-compiler-2.1.0-aarch64-linux.tar.gz +mkdir -p $installpath/bisheng-compiler-2.1.0 && cp -r $buildpath/bisheng-compiler-2.1.0-aarch64-linux/* $installpath/bisheng-compiler-2.1.0/ + +cat>"$installpath/bisheng-compiler-2.1.0/bisheng_modulefiles"<"$installpath/hmpi-1.1.1/hmpi_modulefiles"<"$installpath/miniconda3/miniconda_py38_modulefiles"<"$installpath/openblas/OpenBLAS-0.3.18_modulefiles"<