diff --git a/LifeSciences/README.md b/LifeSciences/README.md index be58fcda9c55c61ba9f6cf4d2e006a8b0ba5e83c..0db92da2c5d8f2314e4cdbbae9eca9d5d77b229e 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: simpleitk-2.1.1.1 \ No newline at end of file diff --git a/LifeSciences/SimpleITK-2.1.1.1/SimpleITK-2.1.1.1.sh b/LifeSciences/SimpleITK-2.1.1.1/SimpleITK-2.1.1.1.sh new file mode 100644 index 0000000000000000000000000000000000000000..59e073b242107e8e03b350b1ab3fd94e7ae29e93 --- /dev/null +++ b/LifeSciences/SimpleITK-2.1.1.1/SimpleITK-2.1.1.1.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "The format is as follows:" + echo "bash SimpleITK-2.1.1.1.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://github.com/SimpleITK/SimpleITK/releases/download/v2.1.1.1/SimpleITK-2.1.1.1.tar.gz +tar xf $buildpath/SimpleITK-2.1.1.1.tar.gz -C $installpath && rm -rf $buildpath/SimpleITK-2.1.1.1.tar.gz +cd $installpath/SimpleITK-2.1.1.1 +mkdir SimpleITK-build +cd SimpleITK-build +cmake -DBUILD_EXAMPLES:BOOL=OFF -DWRAP_PYTHON:BOOL=OFF ../SimpleITK-2.1.1.1 +make -j$(nproc) +make install + +cat >$installpath/SimpleITK-2.1.1.1/SimpleITK_modulefiles<"pkg/wham-1.8.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;1mSimpleITK environment initialization completed.\033[0m" + +EOF +cd pkg/ && tar zcvf SimpleITK-2.1.1.1-hpc.tar.gz SimpleITK-2.1.1.1-hpc + +rm -rf "$buildpath" "$installpath" diff --git a/LifeSciences/SimpleITK-2.1.1.1/dependency/ITK-5.2.1.sh b/LifeSciences/SimpleITK-2.1.1.1/dependency/ITK-5.2.1.sh new file mode 100644 index 0000000000000000000000000000000000000000..b1230febccaa2b84a44cd5f514fd09c6db5c4b38 --- /dev/null +++ b/LifeSciences/SimpleITK-2.1.1.1/dependency/ITK-5.2.1.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "The format is as follows:" + echo "bash ITK-5.2.1.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://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.2.1/InsightToolkit-5.2.1.tar.gz +tar xf $buildpath/InsightToolkit-5.2.1.tar.gz -C $installpath && rm -rf $buildpath/InsightToolkit-5.2.1.tar.gz +cd $installpath/InsightToolkit-5.2.1 +mkdir build +cd build +cmake -D CMAKE_C_COMPILER=clang CMAKE_CXX_COMPILER=clang++ .. +make -j $(nproc) +make install + +cat >$installpath//ITK-5.2.1/ITK_modulefiles<"$installpath/bisheng-compiler-2.1.0/bisheng_modulefiles"<$installpath/cmake-3.17.3/cmake_modulefiles<$installpath/SWIG-4.0.2/SWIG_modulefiles<