{"id":10519,"date":"2025-07-10T14:38:25","date_gmt":"2025-07-10T18:38:25","guid":{"rendered":"https:\/\/labs.icahn.mssm.edu\/minervalab\/?page_id=10519"},"modified":"2025-08-27T10:03:26","modified_gmt":"2025-08-27T14:03:26","slug":"software-environment-lmod","status":"publish","type":"page","link":"https:\/\/labs.icahn.mssm.edu\/minervalab\/documentation\/software-environment-lmod\/","title":{"rendered":"Software Environment: Lmod"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; fullwidth=&#8221;on&#8221; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221;][et_pb_fullwidth_menu menu_id=&#8221;15&#8243; menu_style=&#8221;centered&#8221; fullwidth_menu=&#8221;on&#8221; active_link_color=&#8221;#d80b8c&#8221; dropdown_menu_line_color=&#8221;#221f72&#8243; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221; menu_font=&#8221;|600|||||||&#8221; menu_text_color=&#8221;#FFFFFF&#8221; menu_font_size=&#8221;16px&#8221; background_color=&#8221;#221f72&#8243; background_layout=&#8221;dark&#8221; sticky_position=&#8221;top&#8221;][\/et_pb_fullwidth_menu][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.9.0&#8243; custom_padding=&#8221;0px||0px||false|false&#8221;][et_pb_row _builder_version=&#8221;4.9.0&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; custom_padding=&#8221;||0px||false|false&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text admin_label=&#8221;Breadcrumb&#8221; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221;]<\/p>\n<p><a href=\"https:\/\/labs.icahn.mssm.edu\/minervalab\/scientific-computing-and-data\/\">Scientific Computing and Data<\/a> \/ <a href=\"https:\/\/labs.icahn.mssm.edu\/minervalab\/\">High Performance Computing<\/a> \/ <a title=\"Documentation\" href=\"https:\/\/labs.icahn.mssm.edu\/minervalab\/documentation\/\">Documentation<\/a> \/ Software Environment: Lmod<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221;][et_pb_text admin_label=&#8221;Lmod Introduction&#8221; _builder_version=&#8221;4.9.0&#8243; header_font=&#8221;|600|||||||&#8221; header_text_color=&#8221;#221f72&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;]<\/p>\n<h1>Software Environment: Lmod<\/h1>\n<p>We have implemented the Lmod modules software package to manage nearly all software installed in Minerva and the associated user environment. Modules provide an easy mechanism for updating a user\u2019s environment, especially the PATH, MANPATH, NLSPATH, and LD_LIBRARY_PATH environment variables, to name a few. The distinct advantage of the modules approach is that the user is no longer required to explicitly specify paths for different software versions nor need to try to keep the related environment variables coordinated. With the modules approach, users simply \u201cload\u201d and \u201cunload\u201d modules to control their environment.<\/p>\n<h2>Module Command<\/h2>\n<p>The &#8220;<i>module avail<\/i>&#8221; or &#8220;<i>ml avail<\/i>&#8221; command lists all the modules available on Minerva.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/scpublic.dmz.hpc.mssm.edu\/HPC\/Lmod\/module_avail.png&#8221; align=&#8221;center&#8221; admin_label=&#8221;module avail command&#8221; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221; width=&#8221;60%&#8221; max_width=&#8221;60%&#8221; module_alignment=&#8221;center&#8221; custom_margin=&#8221;10px||20px||false|false&#8221; custom_padding=&#8221;10px||20px||false|false&#8221;][\/et_pb_image][et_pb_text admin_label=&#8221;module switch&#8221; _builder_version=&#8221;4.9.0&#8243; header_font=&#8221;|600|||||||&#8221; header_text_color=&#8221;#221f72&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;]<\/p>\n<p>&nbsp;<\/p>\n<p>Another way to search for modules is with the &#8220;<em>module spider<\/em>&#8221; or &#8220;<em>ml spider<\/em>&#8221; command:<\/p>\n<blockquote>\n<p style=\"padding-left: 30px\"><code>$ ml spider<\/code><\/p>\n<\/blockquote>\n<p>This will show a compact listing of all available modules on the system.<\/p>\n<p>The &#8220;<em>module avail<\/em>&#8221; and &#8220;<em>module spider<\/em>&#8221; commands have search capabilities:<\/p>\n<blockquote>\n<p style=\"padding-left: 30px\"><code>$ ml avail lib<\/code><\/p>\n<\/blockquote>\n<p>will list for any modulefile where the name contains the string &#8220;lib&#8221;.<\/p>\n<p>To have a module loaded to your current environment:<\/p>\n<blockquote>\n<p style=\"padding-left: 30px\"><code>$ module load modulefile [modulefile2]...<\/code><\/p>\n<\/blockquote>\n<p>Alternatively, you can specify:<\/p>\n<blockquote>\n<p style=\"padding-left: 30px\"><code>$ ml modulefile [modulefile2]...<\/code><\/p>\n<\/blockquote>\n<p>To load a specific version of a package to your environment, load the module using its full name with the version explicitly specified, e.g,<\/p>\n<blockquote>\n<pre style=\"padding-left: 30px\"><code>$ ml python\/3.12.5<\/code><\/pre>\n<\/blockquote>\n<p>Otherwise the default version will be loaded.<\/p>\n<p>To remove a module from your current environment:<\/p>\n<blockquote>\n<pre style=\"padding-left: 30px\"><code>$ module unload modulefile\r\nor\r\n$ ml -modulefile<\/code><\/pre>\n<\/blockquote>\n<p>To remove all the modules from your current environment:<\/p>\n<blockquote>\n<pre style=\"padding-left: 30px\"><code>$ module purge\r\nor\r\n$ ml purge<\/code><\/pre>\n<\/blockquote>\n<p>The following command demonstrated the true advantage of using modules. Different versions of entire software packages can be replaced with a single module command:<\/p>\n<blockquote>\n<pre style=\"padding-left: 30px\"><code>$ module switch [modulefile_old] [modulefile_new]<\/code><\/pre>\n<\/blockquote>\n<p>Alternatively, you can simply load the new module:<\/p>\n<blockquote>\n<pre style=\"padding-left: 30px\"><code>$ module load modulefile_new\r\nor\r\n$ ml modulefile_new<\/code><\/pre>\n<\/blockquote>\n<p>This will replace the old version and the \u201c<i>module list<\/i>\u201d or \u201c<i>ml<\/i>\u201d command will list all the modules which are currently loaded in your environment.<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/scpublic.dmz.hpc.mssm.edu\/HPC\/Lmod\/module_switch.png&#8221; align=&#8221;center&#8221; admin_label=&#8221;module switch image&#8221; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221; width=&#8221;60%&#8221; max_width=&#8221;60%&#8221; module_alignment=&#8221;center&#8221; custom_margin=&#8221;10px||20px||false|false&#8221; custom_padding=&#8221;10px||20px||false|false&#8221;][\/et_pb_image][et_pb_text admin_label=&#8221;module save introduction&#8221; _builder_version=&#8221;4.9.0&#8243; header_font=&#8221;|600|||||||&#8221; header_text_color=&#8221;#221f72&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;]<\/p>\n<p>Frequently used collection of modules can be saved using the \u201d<i>module save<\/i>\u201d command so that they can be restored in your environment later using the \u201c<i>module restore<\/i>\u201d command:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/scpublic.dmz.hpc.mssm.edu\/HPC\/Lmod\/module_save.png&#8221; align=&#8221;center&#8221; admin_label=&#8221;module save image&#8221; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221; width=&#8221;60%&#8221; max_width=&#8221;60%&#8221; module_alignment=&#8221;center&#8221; custom_margin=&#8221;10px||20px||false|false&#8221; custom_padding=&#8221;10px||20px||false|false&#8221;][\/et_pb_image][et_pb_text admin_label=&#8221;module help introduction&#8221; _builder_version=&#8221;4.9.0&#8243; header_font=&#8221;|600|||||||&#8221; header_text_color=&#8221;#221f72&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;]<\/p>\n<p>To get more information about a specific module use the module help command to display the \u201chelp\u201d information contained within the given module file.<\/p>\n<p>&nbsp;<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/scpublic.dmz.hpc.mssm.edu\/HPC\/Lmod\/module_help.png&#8221; align=&#8221;center&#8221; admin_label=&#8221;module help image&#8221; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221; width=&#8221;60%&#8221; max_width=&#8221;60%&#8221; module_alignment=&#8221;center&#8221; custom_margin=&#8221;10px||20px||false|false&#8221; custom_padding=&#8221;10px||20px||false|false&#8221;][\/et_pb_image][et_pb_text admin_label=&#8221;module show introduction&#8221; _builder_version=&#8221;4.9.0&#8243; header_font=&#8221;|600|||||||&#8221; header_text_color=&#8221;#221f72&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;]<\/p>\n<p>The module show command allows you to see exactly what a given \u201cmodulefile\u201d will do to your environment, such as what will be added to the PATH, MANPATH, etc. environment variables:<\/p>\n<p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/scpublic.dmz.hpc.mssm.edu\/HPC\/Lmod\/module_show.png&#8221; align=&#8221;center&#8221; admin_label=&#8221;module show image&#8221; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221; width=&#8221;60%&#8221; max_width=&#8221;60%&#8221; module_alignment=&#8221;center&#8221; custom_margin=&#8221;10px||20px||false|false&#8221; custom_padding=&#8221;10px||20px||false|false&#8221;][\/et_pb_image][et_pb_text admin_label=&#8221;module show after image&#8221; _builder_version=&#8221;4.9.0&#8243; header_font=&#8221;|600|||||||&#8221; header_text_color=&#8221;#221f72&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<\/p>\n<p>To get a usage list of module options type the \u201c<i>ml help<\/i>\u201d command.<\/p>\n<p>&nbsp;<\/p>\n<h2>Setting Up Your Own Modules<\/h2>\n<p>You can point the module command to your own modulefiles using the \u201cmodule use\u201d command. This command updates the environment variable MODULEPATH, which defines where modulefiles are to be found. Documentation on preparing modulefiles can be found online (but feel free to poke around our modulefiles for some examples. They live in \/hpc\/packages\/minerva-XYZ\/modulefiles, where XYZ is rocky9, centos7 or common.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scientific Computing and Data \/ High Performance Computing \/ Documentation \/ Software Environment: LmodSoftware Environment: Lmod We have implemented the Lmod modules software package to manage nearly all software installed in Minerva and the associated user environment. Modules provide an easy mechanism for updating a user\u2019s environment, especially the PATH, MANPATH, NLSPATH, and LD_LIBRARY_PATH environment [&hellip;]<\/p>\n","protected":false},"author":624,"featured_media":0,"parent":35,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-10519","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/pages\/10519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/users\/624"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/comments?post=10519"}],"version-history":[{"count":12,"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/pages\/10519\/revisions"}],"predecessor-version":[{"id":11781,"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/pages\/10519\/revisions\/11781"}],"up":[{"embeddable":true,"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/pages\/35"}],"wp:attachment":[{"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/media?parent=10519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}