{"id":5917,"date":"2022-09-01T14:15:30","date_gmt":"2022-09-01T18:15:30","guid":{"rendered":"https:\/\/labs.icahn.mssm.edu\/minervalab\/?page_id=5917"},"modified":"2022-09-01T14:15:33","modified_gmt":"2022-09-01T18:15:33","slug":"software-build-and-compile-on-minerva","status":"publish","type":"page","link":"https:\/\/labs.icahn.mssm.edu\/minervalab\/documentation\/software-build-and-compile-on-minerva\/","title":{"rendered":"Software Build and Compile on Minerva"},"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 _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243; admin_label=&#8221;Breadcrumb&#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 Build and Compile on Minerva<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221;][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 _builder_version=&#8221;4.9.0&#8243; _module_preset=&#8221;default&#8221; header_font=&#8221;|600|||||||&#8221; header_text_color=&#8221;#221f72&#8243; header_font_size=&#8221;26px&#8221; header_2_text_color=&#8221;#221f72&#8243; header_2_font_size=&#8221;24px&#8221; hover_enabled=&#8221;0&#8243; sticky_enabled=&#8221;0&#8243;]<\/p>\n<h1>Software Build and Compile on Minerva<\/h1>\n<h2>Building Third-Party Applications<\/h2>\n<p>You should be able to find many applications already installed on Minerva as system modules using <code>module spider <\/code>or <code>module avail <\/code>on the command line. These system modules are there just for the sake of convenience for the users and in no event imply an absolute requirement of using them on Minerva. You may use your own software installed in your local area and can even set up your own modules if you prefer.<\/p>\n<p>In most cases you&#8217;ll want to download the source code and build the software so that it&#8217;s compatible with the Minerva software environment. You cannot use yum or any other installation process that requires root privileges, but this is almost never necessary. The key is to specify a target installation directory for which you have write permissions. Details vary; you should consult the package&#8217;s documentation and be prepared to experiment. When using the popular <a href=\"http:\/\/www.gnu.org\/software\/automake\/manual\/html_node\/Autotools-Introduction.html\">autotools<\/a> build process, the standard approach is to use the <code>--prefix <\/code>option to specify a non-default, user-owned installation directory at the time you execute <code>configure <\/code>or <code>make<\/code>:<\/p>\n<blockquote>\n<pre><code>$ export INSTALLDIR=\/sc\/arion\/work\/MyUserID\/my_apps\n$ .\/configure <strong>--prefix<\/strong>=$INSTALLDIR\n$ make\n$ make install<\/code><\/pre>\n<\/blockquote>\n<p>Other languages, frameworks, and build systems generally have equivalent mechanisms for installing software in user space. In most cases a web search like &#8220;<i>Software_Name<\/i> Linux install local&#8221; will get you the information you need.<br \/>\n&nbsp;<\/p>\n<h2>Compiling<\/h2>\n<p>The programming environment is centered on the compiler. Minerva supports C\/C++ and Fortran compilers from INTEL, and GNU Compiler Collection (GCC). Only one compiler module should be loaded at a time to avoid ambiguity. Compiling code for parallel execution on Minerva must use the proper implementation of MPI and link against the proper libraries. The MPI implementation currently supported by Minerva is OpenMPI and INTEL MPI. In particular, note that OpenMPI is not part of the MPICH family of MPI implementations.<\/p>\n<p>For each supported compiler suite, a version of OpenMPI that is compatible with that compiler is loaded by using the module command. For example, to use the GCC compilers with OpenMPI:<\/p>\n<pre><code>module load openmpi<\/code><\/pre>\n<p>To use the INTEL MPI:<\/p>\n<pre><code>module load intel<\/code><\/pre>\n<p>When compiling non-MPI programs, modules for compilers without MPI support can be loaded instead:<\/p>\n<pre><code>module load gcc<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2>Compiler Names<\/h2>\n<p>Compiler \u201cwrappers\u201d provided by OpenMPI and INTEL MPI supply the correct compiler and linker flags for MPI applications. For non-MPI codes the \u201cnative\u201d compilers may be used directly.<\/p>\n<table style=\"height: 79px\" width=\"1012\">\n<tbody>\n<tr style=\"background-color: #00aeef\">\n<td style=\"width: 246px\"><strong><span style=\"color: #ffffff\">Language<\/span><\/strong><\/td>\n<td style=\"width: 246px\"><strong><span style=\"color: #ffffff\">MPI<\/span><\/strong><\/td>\n<td style=\"width: 246px\"><strong><span style=\"color: #ffffff\">Native GCC<\/span><\/strong><\/td>\n<td style=\"width: 246px\"><strong><span style=\"color: #ffffff\">Native Intel<\/span><\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 246px\">Fortran<\/td>\n<td style=\"width: 246px\">mpiff77, mpif90<\/td>\n<td style=\"width: 246px\">gfortran<\/td>\n<td style=\"width: 246px\">ifort<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 246px\">C\/C++<\/td>\n<td style=\"width: 246px\">mpicc<\/td>\n<td style=\"width: 246px\">gcc<\/td>\n<td style=\"width: 246px\">icc<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2>Basic Examples<\/h2>\n<p><b>Serial Code<\/b><\/p>\n<pre><code>gfortran -O2 -o test test.f<\/code><\/pre>\n<p><b>MPI<\/b><\/p>\n<pre><code>mpicc -O2 -o MPItest MPItest.c<\/code><\/pre>\n<p><b>OpenMP<\/b><\/p>\n<pre><code>icc -O2 -qopenmp -o OpenMPtest OpenMPtest.c\ngcc -O2 -fopenmp -o OpenMPtest OpenMPtest.c<\/code><\/pre>\n<p>Available compiler options depend on the underlying native compiler; complete descriptions are available via the \u201cman\u201d command.[\/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 Build and Compile on MinervaSoftware Build and Compile on Minerva Building Third-Party Applications You should be able to find many applications already installed on Minerva as system modules using module spider or module avail on the command line. These system modules are there [&hellip;]<\/p>\n","protected":false},"author":600,"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-5917","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/pages\/5917","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\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/comments?post=5917"}],"version-history":[{"count":3,"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/pages\/5917\/revisions"}],"predecessor-version":[{"id":5921,"href":"https:\/\/labs.icahn.mssm.edu\/minervalab\/wp-json\/wp\/v2\/pages\/5917\/revisions\/5921"}],"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=5917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}