如何为英特尔编译器自动生成模块文件 [英] How to automatically generate the modulefile for Intel compilers

查看:43
本文介绍了如何为英特尔编译器自动生成模块文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道一种无需使用 env2 脚本即可为英特尔编译器自动生成模块文件的方法吗?

Do you know a way to automatically generate the modulefile for Intel compilers without using the env2 script?

推荐答案

使用最新版本的模块 (v4.6+),module 命令获得了一个名为 sh-to-mod 翻译环境变化由给定的脚本执行到模块文件命令中.

Using latest version of Modules (v4.6+), the module command gets a new sub-command called sh-to-mod that translates the environment changes performed by a given script into modulefile commands.

$ module sh-to-mod sh /path/to/foo-1.2/foo-setup.sh arg1
#%Module
prepend-path    PATH /path/to/foo-1.2/bin
set-alias       foo {foobin -q -l}
setenv          FOOENV arg1

source-sh 模块文件Modules 4.6 版本中还引入了 Tcl 命令,以直接转换由给定脚本执行的环境更改,就好像它是当前正在评估的模块文件的内容一样.

The source-sh modulefile Tcl command is also introduced in version 4.6 of Modules to directly translate the environment changes performed by a given script as if it was the content of the modulefile currently being evaluated.

在旧版本的模块上,提供了一个名为 createmodule.py 的独立脚本来实现这种脚本到模块文件的转换.

On older version of Modules, a standalone script named createmodule.py is provided to achieve such script to modulefile translation.

这篇关于如何为英特尔编译器自动生成模块文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆