cc_staff
156
edits
Line 118: | Line 118: | ||
===Running Software (Preferred): <code>apptainer run</code>=== | ===Running Software (Preferred): <code>apptainer run</code>=== | ||
The <code>apptainer run</code> command will launch an Apptainer container, | The <code>apptainer run</code> command will launch an Apptainer container, runs the <code>%runscript</code> defined for that container (if one is defined), and then runs the specific command (subject to the code in the <code>%runscript</code> script). Using this command is preferred over using the <code>apptainer exec</code> command (which directly runs a command within the specified container). | ||
For example, suppose you | For example, suppose you want to run the <code>g++</code> compiler inside your container to compile a C++ program called <code>myprog.cpp</code>. To this this you might use this command: | ||
apptainer run your-container-name.sif g++ -O2 -march=broadwell ./myprog.cpp | apptainer run your-container-name.sif g++ -O2 -march=broadwell ./myprog.cpp |