美文网首页
Linux下好用的module管理工具

Linux下好用的module管理工具

作者: myth_0c21 | 来源:发表于2017-08-10 21:03 被阅读0次

1.What's module manager

environment-modules是一个用于管理用户不同应用的工具,可以动态的加载、移除所安装的应用。

2.How to install

在ubuntu系统下,安装十分简单:

sudo apt-cache search environment-modules #search the module 
sudo apt-get install environment-modules # install the module

3.How to use

安装environment-modules之后,需要在.bashrc里面设置一下环境变量,指定modulefiles的路径,module这个应用就是通过modulefiles来定位安装的软件的位置以及其他路径与环境变量的设置。

export MODULEPATH=/opt/modulefiles

下面就需要去该路径编辑modulefiles了,一个简单的modulefiles如下:

#%Module1.0
conflict caffe #指示冲突的程序名,其他的modulefiles不能再使用这个名字
set installdir /home/manager/caffe #tcl的局部变量,只在该tcl文件中生效
setenv CAFFE_ROOT    $installdir #使用局部变量进行全局环境变量的设置
setenv CAFFE_INCLUDE $installdir/include
setenv CAFFE_LIB     $installdir/build/lib
prepend-path PATH    $installdir/build/tools #前路径,一般设置prepend即可
prepend-path PYTHONPATH $installdir/python
# caffe需要第三方库的支持
prepend-path LD_LIBRARY_PATH /opt/intel/mkl/lib/intel64
prepend-path LD_LIBRARY_PATH $installdir/build/lib

编辑好了modulefiles之后,就可以动态的加载应用了:

root@artosyn-vision:/opt/modulefiles# module avail
----------------------------------------- /opt/modulefiles --------------------------------
anaconda3     HelloModule   caffe 

root@artosyn-vision:/opt/modulefiles# module load HelloModule

root@artosyn-vision:/opt/modulefiles# HelloModule
I use this bin file to test module
HelloModule ~~~~~~~~~~~

HelloModule.cpp的代码如下:

#include <stdio.h>
int main()
{
        printf("I use this bin file to test module\n");
        printf("HelloModule ~~~~~~~~~~~\n");
        return 0;
}

HelloModule对应的modulefiles如下:

#%Module1.0
conflict HelloModule
set installdir /opt/HelloModule
prepend-path PATH    $installdir

相关文章

  • Linux下好用的module管理工具

    1.What's module manager environment-modules是一个用于管理用户不同应用的...

  • Mac安装Homebrew

    Mac的包管理工具homebrew。相当于linux的yum方便好用常用命令搜索:brew search Soft...

  • sdkman 安装及使用

    sdkman 是个linux/unix平台超级好用的开发工具安装、管理工具,能够极大的方便工作。 安装 仅列举li...

  • mysql

    linux系统安装mysql数据库 Linux下安装mysql 这个比较好用 Linux 中设置 MySQL 字符...

  • Mac下Homebrew的安装和使用

    Homebrew - Mac下很好用的包管理工具 安装: 终端输入:/usr/bin/ruby -e "$(cur...

  • macOS 的 JDK 安装问题 (Homebrew)

    Homebrew 介绍 Homebrew 是 macOS 下的一个非常好用的包管理工具, caskroom 则是基...

  • Mac 中的包管理工具 homebrew

    homebrew 是 Mac 下的一个包管理工具,作用类似于 centos 下的 yum、linux 下的 apt...

  • linux的词典

    linux词典 2018-9-20 linux辞典虽然没有windows下多,但是功能强大、好用。大学时ubunt...

  • nacicat

    nacicat 数据库管理工具..很好用

  • GO语言学习之搭建环境

    1、下载Go:go语言中文网 2、开启Go module管理工具 GO111MODULE=off 禁用 go mo...

网友评论

      本文标题:Linux下好用的module管理工具

      本文链接:https://www.haomeiwen.com/subject/nhlkrxtx.html