[Installing Lua and Lmod¶](https://lmod.readthedocs.io/en/latest/030_installing.html) lmod 依賴於 tcl 和 lua NOTE: lua 別裝低於5.1的。 :::spoiler lua-5.1.4.9-rtm 安裝指令: 源碼 ``` sudo apt install rsync wget https://sourceforge.net/projects/lmod/files/lua-5.1.4.9.tar.bz2 tar xf lua-X.Y.Z.tar.bz2 rm lua-5.1.4.9.tar.bz2 cd lua-X.Y.Z ./configure --prefix=/opt/apps/lua/X.Y.Z make; make install cd /opt/apps/lua; ln -s X.Y.Z lua mkdir /usr/local/bin; ln -s /opt/apps/lua/lua/bin/lua /usr/local/bin ``` Verfiy by `which lua` ::: :::spoiler tcl-8.6 安裝: apt ``` tcl tcl-dev tcl8.6 tcl8.6-dev:amd64 libtcl8.6:amd64 ``` Verfiy by `dpkg -l | grep tcl`,這只適用於apt安裝的。如果你是從源碼或直接找編譯好的。 Verfiy by ``` tclsh puts $tcl_version exit ``` ::: :::spoiler lmod-8.7.53 安裝: 源碼 取得源碼 `git clone https://github.com/TACC/Lmod.git` 題外話: clone指定tag ``` git clone https://github.com/TACC/Lmod.git cd Lmod git tag git checkout tags/8.5.18 ``` 應當先用這個指定好版本:D。 編譯 ``` ./configure --prefix=/opt/apps make make install ``` 找個風水寶地來裝modulefile,我是`/media/hlajungo/D/linux/modulefiles/`,在裡面添加`/media/hlajungo/D/linux/modulefiles/*` 加 exec 和 modulefile 到 bashrc ``` export PATH=/opt/apps/lmod/8.7.53/libexec:$PATH export LMOD_MODULEPATH_INIT=/media/hlajungo/D/linux/modulefiles/modulefiles:$LMOD_MODULEPATH_INIT ``` 加軟鏈結到profile.d ``` ln -s /opt/apps/lmod/lmod/init/profile /etc/profile.d/z00_lmod.sh ln -s /opt/apps/lmod/lmod/init/cshrc /etc/profile.d/z00_lmod.csh ``` 把以下放入 `/etc/bash.bashrc` NOTE: 可能僅限ubuntu用戶。 ``` if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done fi ``` 弄好後重新登入(或開個新terminal?或source/etc/profile.d) Verify by `type module` module () { eval $($LMOD_CMD bash $*) } `echo $LMOD_CMD` /opt/apps/lmod/lmod/libexec/lmod `echo $MODULEPATH` /opt/apps/modulefiles/Linux:/opt/apps/modulefiles/Core :::
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up