diff --git a/LifeSciences/README.md b/LifeSciences/README.md index be58fcda9c55c61ba9f6cf4d2e006a8b0ba5e83c..e2155152daf42edd6555f7720f7acf7d3921f003 100644 --- a/LifeSciences/README.md +++ b/LifeSciences/README.md @@ -12,3 +12,4 @@ Life Sciences Software List: - repositories: hmmer-3.3.2 - repositories: Muscle-5.1 - repositories: 3d-dna-180922 +- repositories: sratoolkit-3.0.0 \ No newline at end of file diff --git a/LifeSciences/sratoolkit-3.0.0/build.sh b/LifeSciences/sratoolkit-3.0.0/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..4a6c867eb9d93ce12ffc42def403f567c6b97e68 --- /dev/null +++ b/LifeSciences/sratoolkit-3.0.0/build.sh @@ -0,0 +1,60 @@ +#!/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 +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/cmake-3.17.3.sh $buildpath $installpath +module use $installpath/cmake-3.17.3 +module load $installpath/cmake-3.17.3/cmake_modulefiles + +bash $dep_dir/ncbi-vdb-3.0.0.sh $buildpath $installpath +module use $installpath/ncbi-vdb-3.0.0 +module load $installpath/ncbi-vdb-3.0.0/ncbi-vdb_modulefiles + +bash sratoolkit-3.0.0.sh $buildpath $installpath + +mkdir -p pkg/sratoolkit-3.0.0-hpc && cp -r $installpath/* pkg/sratoolkit-3.0.0-hpc/ +cat>"pkg/sratoolkit-3.0.0-hpc/run.sh"< /dev/null +current_dir="\$(cd "\$(dirname "\${BASH_SOURCE[0]}")" && pwd -P)" +for f in "\${current_dir}"/*; do + if [[ -d "\${f}" && -f "\$(ls "\${f}"/*modulefiles 2>&1)" ]]; then + module use "\${f}" && module load "\${f}"/*modulefiles + fi +done +echo -e "\033[1;32;1msratoolkit environment initialization completed.\033[0m" +EOF + +cd pkg/ && tar zcvf sratoolkit-3.0.0-hpc.tar.gz sratoolkit-3.0.0-hpc +rm -rf $buildpath $installpath diff --git a/LifeSciences/sratoolkit-3.0.0/ccsra.c.patch b/LifeSciences/sratoolkit-3.0.0/ccsra.c.patch new file mode 100644 index 0000000000000000000000000000000000000000..f5967b991571c57ec4310b61a9f8c29b5c975605 --- /dev/null +++ b/LifeSciences/sratoolkit-3.0.0/ccsra.c.patch @@ -0,0 +1,89 @@ +--- ccsra.c.old 2022-07-05 16:38:39.717343571 +0800 ++++ ccsra.c 2022-07-05 16:39:37.414039637 +0800 +@@ -209,9 +209,9 @@ + va_list args) + { + char path[4096]; +- int size = args ? +- vsnprintf ( path, sizeof path, path_fmt, args ) : +- snprintf ( path, sizeof path, "%s", path_fmt ); ++ ++ int size = vsnprintf ( path, sizeof path, path_fmt, args ); ++ + if ( size < 0 || size >= (int) sizeof path ) + return RC (rcFS, rcNoTarg, rcAccessing, rcPath, rcExcessive ); + if (absolute && (path[0] != '/')) +@@ -438,11 +438,9 @@ + assert (self != NULL); + assert (f != NULL); + assert (path_fmt != NULL); ++ size = vsnprintf ( path, sizeof path, path_fmt, args ); + +- size = args ? +- vsnprintf ( path, sizeof path, path_fmt, args ) : +- snprintf ( path, sizeof path, "%s", path_fmt ); +- if ( size < 0 || size >= (int) sizeof path ) ++ if ( size < 0 || size >= (int) sizeof path ) + return RC (rcFS, rcNoTarg, rcAccessing, rcPath, rcExcessive ); + + if (CCNodeSraDirLegalPath (self, path)) +@@ -541,10 +539,8 @@ + assert (self != NULL); + assert (locator != NULL); + assert (path_fmt != NULL); ++ size = vsnprintf ( path, sizeof path, path_fmt, args ); + +- size = args ? +- vsnprintf ( path, sizeof path, path_fmt, args ) : +- snprintf ( path, sizeof path, "%s", path_fmt ); + if ( size < 0 || size >= (int) sizeof path ) + return RC (rcFS, rcNoTarg, rcAccessing, rcPath, rcExcessive ); + +@@ -577,9 +573,7 @@ + assert (size != NULL); + assert (path_fmt != NULL); + +- path_size = args ? +- vsnprintf ( path, sizeof path, path_fmt, args ) : +- snprintf ( path, sizeof path, "%s", path_fmt ); ++ path_size = vsnprintf ( path, sizeof path, path_fmt, args ); + if ( path_size < 0 || path_size >= (int) sizeof path ) + return RC (rcFS, rcNoTarg, rcAccessing, rcPath, rcExcessive ); + +@@ -613,9 +607,7 @@ + assert (size != NULL); + assert (path_fmt != NULL); + +- path_size = args ? +- vsnprintf ( path, sizeof path, path_fmt, args ) : +- snprintf ( path, sizeof path, "%s", path_fmt ); ++ path_size = vsnprintf ( path, sizeof path, path_fmt, args ); + if ( path_size < 0 || path_size >= (int) sizeof path ) + return RC (rcFS, rcNoTarg, rcAccessing, rcPath, rcExcessive ); + +@@ -757,9 +749,7 @@ + assert (contiguous); + assert (path_fmt); + +- size = args ? +- vsnprintf ( path, sizeof path, path_fmt, args ) : +- snprintf ( path, sizeof path, "%s", path_fmt ); ++ size = vsnprintf ( path, sizeof path, path_fmt, args ); + if ( size < 0 || size >= (int) sizeof path ) + return RC (rcFS, rcNoTarg, rcAccessing, rcPath, rcExcessive ); + +@@ -1018,12 +1008,13 @@ + KPathType type = KDirectoryPathType (dir, "%s", path); + size_t pathlen = strlen (path); + size_t linklen = 0; ++ va_list null_list; + char link [2 * 4096]; /* we'll truncate? */ + + if (type & kptAlias) + { + rc = KDirectoryVResolveAlias (dir, false, link, sizeof (link), +- path, NULL); ++ path, null_list); + if (rc == 0) + linklen = strlen (link); + } diff --git a/LifeSciences/sratoolkit-3.0.0/dependency/bisheng-compiler-2.1.0.sh b/LifeSciences/sratoolkit-3.0.0/dependency/bisheng-compiler-2.1.0.sh new file mode 100644 index 0000000000000000000000000000000000000000..8992b332f1a7cbb9f4bd02f5408bea64d99c6713 --- /dev/null +++ b/LifeSciences/sratoolkit-3.0.0/dependency/bisheng-compiler-2.1.0.sh @@ -0,0 +1,43 @@ +#!/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 + +wget -t 10 -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/cmake-3.17.3/cmake_modulefiles<"$installpath/ncbi-vdb-3.0.0/ncbi-vdb_modulefiles"<"$installpath/sra-tools-3.0.0/sra-tools_modulefiles"<