summaryrefslogtreecommitdiffstats
path: root/etc/env.sunhpc
diff options
context:
space:
mode:
authorxiubuzhe <xiubuzhe@sina.com>2023-10-08 20:59:00 +0800
committerxiubuzhe <xiubuzhe@sina.com>2023-10-08 20:59:00 +0800
commit1dac2263372df2b85db5d029a45721fa158a5c9d (patch)
tree0365f9c57df04178a726d7584ca6a6b955a7ce6a /etc/env.sunhpc
parentb494be364bb39e1de128ada7dc576a729d99907e (diff)
downloadsunhpc-1dac2263372df2b85db5d029a45721fa158a5c9d.tar.gz
sunhpc-1dac2263372df2b85db5d029a45721fa158a5c9d.tar.bz2
sunhpc-1dac2263372df2b85db5d029a45721fa158a5c9d.zip
first add files
Diffstat (limited to 'etc/env.sunhpc')
-rw-r--r--etc/env.sunhpc35
1 files changed, 35 insertions, 0 deletions
diff --git a/etc/env.sunhpc b/etc/env.sunhpc
new file mode 100644
index 0000000..6fc6588
--- /dev/null
+++ b/etc/env.sunhpc
@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+#SunHPC Env Configure
+#
+
+command -v vim > /dev/null
+if [ $? -eq 0 ]
+then
+ alias vi=vim
+ VICONF="$HOME/.vimrc"
+ [ ! -f "$VICONF" ] && echo -e "set ts=4\nset expandtab" > "$VICONF"
+fi
+
+export SUNHPC_HOME=/opt/sunhpc
+export SUNHPC_PYTHON=/opt/sunpy3
+
+if [ `id -g` == 0 ];then
+ export PATH=$SUNHPC_HOME/bin:$SUNHPC_HOME/sbin:$SUNHPC_PYTHON/bin:$SUNHPC_PYTHON/sbin$PATH
+else
+ export PATH=$SUNHPC_HOME/bin:$PATH
+fi
+
+# python .pth config
+SUNHPC_PTH=/opt/sunpy3/lib/python3.10/site-packages/sunhpc.pth
+[ ! -e $SUNHPC_PTH ] && echo "$SUNHPC_HOME/lib" > $SUNHPC_PTH
+
+# pip
+[ ! -d ~/.pip ] && mkdir -p ~/.pip
+
+cat > ~/.pip/pip.conf << 'EOF'
+[global]
+index-url = https://pypi.tuna.tsinghua.edu.cn/simple
+[install]
+trusted-host = https://pypi.tuna.tsinghua.edu.cn/simple
+EOF