diff --git a/LifeSciences/README.md b/LifeSciences/README.md index cffd101b6aec3700ed6736f799b17ef9502f3b25..49beb8bbc9d35bacb7ec2fc8af0cd30b0d921626 100644 --- a/LifeSciences/README.md +++ b/LifeSciences/README.md @@ -15,3 +15,4 @@ Life Sciences Software List: - repositories: 3d-dna-180922 - repositories: featureCounts-2.0.3 - repositories: ambertools-21 +- 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..60014e66f64f85c89af48f88768ef17a2f3e6135 --- /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..445391583df8d8bf131d9cde27c00f5c8944607b --- /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"<