diff --git a/LifeSciences/README.md b/LifeSciences/README.md index 4cd10237658beb349546b28d0bb95f3b42dc0607..cffd101b6aec3700ed6736f799b17ef9502f3b25 100644 --- a/LifeSciences/README.md +++ b/LifeSciences/README.md @@ -14,4 +14,4 @@ Life Sciences Software List: - repositories: Muscle-5.1 - repositories: 3d-dna-180922 - repositories: featureCounts-2.0.3 - +- repositories: ambertools-21 diff --git a/LifeSciences/ambertools-21/ambertools-21.sh b/LifeSciences/ambertools-21/ambertools-21.sh new file mode 100644 index 0000000000000000000000000000000000000000..11e2b4304c2a6d27089efe9522edd4c1abbbd760 --- /dev/null +++ b/LifeSciences/ambertools-21/ambertools-21.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "The format is as follows:" + echo "bash ambertools-21.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 time boost bzip2 bzip2-devel bison flex libXt-devel libXext-devel tcsh make \ + which flex bison patch bc \ + perl perl-ExtUtils-MakeMaker util-linux wget \ + bzip2 bzip2-devel zlib-devel tar +set -e +wget -t 50 -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"/ambertools21 \ + -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"/ambertools21/lib/python3.8/site-packages/easy-install.pth +echo './ParmEd-3.4.1-py3.8-linux-aarch64.egg' >>"$installpath"/ambertools21/lib/python3.8/site-packages/easy-install.pth +rm -rf "$buildpath"/amber20_src diff --git a/LifeSciences/ambertools-21/build.sh b/LifeSciences/ambertools-21/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..8fff6d1e8f3a87f2822207657decc199308430c0 --- /dev/null +++ b/LifeSciences/ambertools-21/build.sh @@ -0,0 +1,65 @@ +#!/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 ambertools-21.sh "$buildpath" "$installpath" + +mkdir -p pkg/ambertools-21-hpc && cp -r "$installpath"/* pkg/ambertools-21-hpc/ +cat >"pkg/ambertools-21-hpc/run.sh" < /dev/null +current_dir=\$(cd "\$(dirname "\${BASH_SOURCE[0]}")" &> /dev/null && pwd) +source \$current_dir/ambertools21/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 ambertools-21-hpc.tar.gz ambertools-21-hpc + +rm -rf "$buildpath" "$installpath" diff --git a/LifeSciences/ambertools-21/cmake.defaults.patch b/LifeSciences/ambertools-21/cmake.defaults.patch new file mode 100644 index 0000000000000000000000000000000000000000..067035e8b7ca4819c66dea3aa6756c2760f9397a --- /dev/null +++ b/LifeSciences/ambertools-21/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/ambertools-21/dependency/bisheng-compiler-2.1.0.sh b/LifeSciences/ambertools-21/dependency/bisheng-compiler-2.1.0.sh new file mode 100644 index 0000000000000000000000000000000000000000..1691b5f801e07d4c9bc8d97927fccf50a0c085e6 --- /dev/null +++ b/LifeSciences/ambertools-21/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 gcc-c++ gcc-gfortran libatomic --nogpgcheck + +wget -t 30 -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" <