diff --git a/LifeSciences/README.md b/LifeSciences/README.md index e56c1b83afbdbc65ca2e7d792ac35978dc6f5c86..73cdbf8e133fa189b956e6a10a0dbba89f08cca9 100644 --- a/LifeSciences/README.md +++ b/LifeSciences/README.md @@ -27,3 +27,4 @@ Life Sciences Software List: - repositories: Augustus-3.4.0 - repositories: rMATs-4.1.2 - repositories: fsl-6.0.5.2 +- repositories: SimpleITK-2.1.1.1 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..f75606b1d8ee273b292face3cf17d48cd222aa43 --- /dev/null +++ b/LifeSciences/SimpleITK-2.1.1.1/SimpleITK-2.1.1.1.sh @@ -0,0 +1,52 @@ +#!/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 $buildpath && rm -rf $buildpath/SimpleITK-2.1.1.1.tar.gz +mkdir $buildpath/SimpleITK-build +cd $buildpath/SimpleITK-build +cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS_RELEASE=-O0 -DCMAKE_CXX_FLAGS_RELEASE=-O0 -DCMAKE_INSTALL_PREFIX=$installpath/SimpleITK-2.1.1.1 -DPYTHON_EXECUTABLE=$installpath/Python-3.9.0/bin/python3.9 -DPYTHON_INCLUDE_DIR=$installpath/Python-3.9.0/include/python3.9/ -DPYTHON_LIBRARY=$installpath/Python-3.9.0/lib/python3.9/ ../SimpleITK-2.1.1.1 +make -j$(nproc) +make install +cd Wrapping/Python +python3.9 setup.py install +cd ../R/Packaging +R CMD INSTALL SimpleITK + +cat >$installpath/SimpleITK-2.1.1.1/SimpleITK_modulefiles<"pkg/SimpleITK-2.1.1.1-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 + +sed -i "4cR_HOME_DIR=\$R_PATH/lib/R" \$R_PATH/bin/R +sed -i "5cif test "\${R_HOME_DIR}" = "\$R_PATH/lib/R"; then +" \$R_PATH/bin/R +sed -i "19c if [ -x "\$R_PATH/\${libnn}/R/bin/exec/R" ]; then" \$R_PATH/bin/R +sed -i "20c R_HOME_DIR="\$R_PATH/\${libnn}/R"" \$R_PATH/bin/R +sed -i "21c elif [ -x "\$R_PATH/\${libnn_fallback}/R/bin/exec/R" ]; then" \$R_PATH/bin/R +sed -i "22c R_HOME_DIR="\$R_PATH/\${libnn_fallback}/R"" \$R_PATH/bin/R +sed -i "35cR_SHARE_DIR=\$R_PATH/lib/R/share" \$R_PATH/bin/R +sed -i "37cR_INCLUDE_DIR=\$R_PATH/lib/R/include" \$R_PATH/bin/R +sed -i "39cR_DOC_DIR=\$R_PATH/lib/R/doc" \$R_PATH/bin/R + +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..e6e1c8c9bb4d53cf0efef4db4fe8c75b1f4f1cf0 --- /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 $buildpath && rm -rf $buildpath/InsightToolkit-5.2.1.tar.gz +cd $buildpath/InsightToolkit-5.2.1 +mkdir build +cd build +cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS_RELEASE=-O0 -DCMAKE_CXX_FLAGS_RELEASE=-O0 -DModule_SimpleITKFilters=ON -DCMAKE_INSTALL_PREFIX=$installpath/ITK-5.2.1/ ../ +make -j$(nproc) +make install + +cat >$installpath/ITK-5.2.1/ITK_modulefiles<$installpath/Python-3.9.0/Python_modulefiles<$installpath/R-4.1.0/R_modulefiles<$installpath/SWIG-4.0.2/SWIG_modulefiles<"$installpath/bisheng-compiler-2.1.0/bisheng_modulefiles"< /dev/null ); then + chmod 600 "$errfile" + [ -x /sbin/restorecon ] && /sbin/restorecon $errfile + exec > "$errfile" 2>&1 + else + errfile=$(mktemp -q /tmp/xses-$USER.XXXXXX) + if [ $? -eq 0 ]; then + exec > "$errfile" 2>&1 + fi + fi +fi + +SWITCHDESKPATH=/usr/share/switchdesk + +# Mandatorily source xinitrc-common, which is common code shared between the +# Xsession and xinitrc scripts which has been factored out to avoid duplication +. /etc/X11/xinit/xinitrc-common + +# This Xsession.d implementation, is intended to obsolte and replace the +# various mechanisms present in the 'case' statement which follows, and to +# eventually be able to easily remove all hard coded window manager specific +# content from this script. See bug #142260 for additional explanation and +# details. All window manager rpm packages and desktop environment +# packages should be modified to provide the Xsession.d/Xsession.$wm scripts +# to start themselves up. In the future, the legacy switchdesk mechanisms +# and hard coded window managers and desktop environments will be removed from +# this script. +XCLIENTS_D=/etc/X11/xinit/Xclients.d +if [ "$#" -eq 1 ] && [ -x "$XCLIENTS_D/Xclients.$1.sh" ]; then + exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $XCLIENTS_D/Xclients.$1.sh" +else +# now, we see if xdm/gdm/kdm has asked for a specific environment +case $# in +1) + if [ -x "$SWITCHDESKPATH/Xclients.$1" ]; then + exec -l $SHELL -c "$SWITCHDESKPATH/Xclients.$1"; + fi; + + case "$1" in + failsafe) + exec -l $SHELL -c "xterm -geometry 80x24-0-0" + ;; + gnome|gnome-session) + # lack of SSH_AGENT is intentional, see #441123. though + # the whole thing should really happen in xinitrc.d anyway. + exec -l $SHELL -c gnome-session + exec /bin/sh -c "exec -l $SHELL -c \"gnome-session\"" + ;; + kde|kde1|kde2) + exec $CK_XINIT_SESSION $SSH_AGENT /bin/sh -c "exec -l $SHELL -c \"startkde\"" + ;; + twm) + # fall back to twm + exec $CK_XINIT_SESSION $SSH_AGENT /bin/sh -c "exec -l $SHELL -c \"twm\"" + ;; + *) + # GDM provies either a command line as the first argument or + # provides 'failsafe', 'default' or 'custom'. KDM will do the + # same at some point + if [ "$1" != "default" -a "$1" != "custom" ]; then + exec $CK_XINIT_SESSION $SSH_AGENT /bin/sh -c "exec -l $SHELL -c \"$1\"" + fi + ;; + esac +esac +fi + +# otherwise, take default action +if [ -x "$HOME/.xsession" ]; then + exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $HOME/.xsession" +elif [ -x "$HOME/.Xclients" ]; then + exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT $HOME/.Xclients" +elif [ -x /etc/X11/xinit/Xclients ]; then + exec -l $SHELL -c "$CK_XINIT_SESSION $SSH_AGENT /etc/X11/xinit/Xclients" +else + # should never get here; failsafe fallback + exec -l $SHELL -c "xsm" +fi + diff --git "a/LifeSciences/SimpleITK-2.1.1.1/doc/SimpleITK-2.1.1.1\345\272\224\347\224\250\346\265\213\350\257\225\346\212\245\345\221\212.docx" "b/LifeSciences/SimpleITK-2.1.1.1/doc/SimpleITK-2.1.1.1\345\272\224\347\224\250\346\265\213\350\257\225\346\212\245\345\221\212.docx" new file mode 100644 index 0000000000000000000000000000000000000000..962a00e9eba96f4d63b853318e0681df0f72e66a Binary files /dev/null and "b/LifeSciences/SimpleITK-2.1.1.1/doc/SimpleITK-2.1.1.1\345\272\224\347\224\250\346\265\213\350\257\225\346\212\245\345\221\212.docx" differ diff --git "a/LifeSciences/SimpleITK-2.1.1.1/doc/SimpleITK-2.1.1.1\345\272\224\347\224\250\347\247\273\346\244\215\346\214\207\345\215\227 .docx" "b/LifeSciences/SimpleITK-2.1.1.1/doc/SimpleITK-2.1.1.1\345\272\224\347\224\250\347\247\273\346\244\215\346\214\207\345\215\227 .docx" new file mode 100644 index 0000000000000000000000000000000000000000..964acf57c30ea7d0c911f501d0ea02aa61d30ab1 Binary files /dev/null and "b/LifeSciences/SimpleITK-2.1.1.1/doc/SimpleITK-2.1.1.1\345\272\224\347\224\250\347\247\273\346\244\215\346\214\207\345\215\227 .docx" differ diff --git "a/LifeSciences/SimpleITK-2.1.1.1/doc/\351\262\262\351\271\217\345\237\272\345\272\247\350\275\257\344\273\266\346\220\255\345\273\272\346\214\207\345\215\227.docx" "b/LifeSciences/SimpleITK-2.1.1.1/doc/\351\262\262\351\271\217\345\237\272\345\272\247\350\275\257\344\273\266\346\220\255\345\273\272\346\214\207\345\215\227.docx" new file mode 100644 index 0000000000000000000000000000000000000000..adcfd36244790a0df44e9410d069a8240faaaf17 Binary files /dev/null and "b/LifeSciences/SimpleITK-2.1.1.1/doc/\351\262\262\351\271\217\345\237\272\345\272\247\350\275\257\344\273\266\346\220\255\345\273\272\346\214\207\345\215\227.docx" differ diff --git a/README.md b/README.md index c10dde4caf7bf0262161f8bc4838ba3fb162427c..0f7ea9746c71052f97cc09f1e26b7209976d723b 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,4 @@ HPC Software List: - repositories: LifeSciences/Augustus-3.4.0 - repositories: LifeSciences/rMATs-4.1.2 - repositories: LifeSciences/FSL-6.0.5.2 +- repositories: LifeSciences/SimpleITK-2.1.1.1