欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 养生 > Environment Modules安装配置

Environment Modules安装配置

2025/4/30 13:10:56 来源:https://blog.csdn.net/weixin_45613751/article/details/144365504  浏览:    关键词:Environment Modules安装配置

Environment Modules安装配置

Environment Modules是一款用来管理计算机软件环境的软件,通过简单的命令来控制计算机环境变量。本文接受该软件的安装和配置方法

系统: Linux OpenSUSE 15.6
软件版本: modules 5.5
依赖: gcc 7.5.0 以及 tcl 8.5

tcl以及gcc安装

省略

modules安装

#下载软件安装包
curl -LJO https://github.com/cea-hpc/modules/releases/download/v5.5.0/modules-5.5.0.tar.gz
#解压缩
tar xfz modules-5.5.0.tar.gz
#进入原码目录
cd modules-5.5.0
#配置安装信息
#/soft/modules是用户打算安装modules软件的目录
#/soft/tcl/lib是tcl程序的地址,该地址需要包括tclConfig.sh文件
./configure --prefix=/soft/modules --with-tcl=/soft/tcl/lib
#软件编译
make
#软件安装
sudo make install

设置软件自启动

#方法一:
ln -s /soft/modules/init/profile.sh /etc/profile.d/modules.sh
#方法二:
echo `source /soft/modules/init/profile.sh` >> ~/.bashrc

重启计算机以使得上面的配置生效

环境文件配置

首先查看modulefiles的地址
使用module avail命令查看当前的环境地址文件有哪些,并且存储在哪里。在我的系统之下,modulefiles文件在/soft/modules/modulefiles目录下面。

新建配置文件:
例子1(openmpi):

#%Module 1.0
#
#  OpenMPI module for use with 'environment-modules' package:
#
module-whatis "openmpi 4.1.0"
conflict                openmpisetenv                  MPI_DIR         /soft/openmpi/4.1.0
setenv                  MPI_BIN         $MPI_DIR/bin
setenv                  MPI_INCLUDE     $MPI_DIR/include
setenv                  MPI_LIB         $MPI_DIR/lib
setenv                  MPI_MAN         $MPI_DIR/share/man
setenv                  MPI_COMPILER    openmpi-x86_64
setenv                  MPI_SUFFIX      _openmpiprepend-path            PATH            $MPI_DIR/bin
prepend-path            LD_LIBRARY_PATH $MPI_DIR/lib
prepend-path            MANPATH         $MPI_DIR/share/man

例子2(GNU Version 7):

#%Module1.0#####################################################################proc ModulesHelp { } {puts stderr " "
puts stderr "This module loads the GNU compiler collection"
puts stderr " "
puts stderr "Consult the man pages for detailed information"
puts stderr "on the commandline syntax and compiler options."
puts stderr " "puts stderr "\nVersion 7\n"}
module-whatis "Name: GNU Compiler Collection"
module-whatis "Version: 1.4"
module-whatis "Category: compiler, runtime support"
module-whatis "Description: GNU Compiler Family (C/C++/Fortran for x86_64)"
module-whatis "URL: http://gcc.gnu.org"set     version                     7
prepend-path    MODULEPATH          /usr/share/lmod/moduledeps/gnu-7
prepend-path    PATH    /usr/lib/hpc/compiler/gnu/7/bin
# nothing to do since gcc is in the default pathfamily "compiler"

基本命令

#查看环境
module avail
#加载环境
module load gnu
#退出环境
module unload gnu
#显示已经加载的环境
module list

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词