HPC FAQ - Compiling and Linking
Supercomputer documentation is always a work in progress! Please email questions, corrections, or suggestions to the HPC support team at firstname.lastname@example.org as usual. Thanks!
Frequently Asked Questions
- 1. What compilers should I use?
- 2. What versions of the Intel compilers are available?
- 3. How do I compile with the Open MPI libraries?
- 4. How do I compile with the Intel MPI libraries?
- 5. Is there any Intel documentation on the compilers?
- 6. Is there any documentation on the Intel Math Kernel Library (IMKL)?
- 7. How can I find out what library dependencies an application has?
- 8. Are the GNU compilers available?
The Intel compilers is the compilers of choice for most applications. Use icc for c and c++ programs and ifort for fortran 77 and 90 programs. Add the --help option to one of these to get more information. For example:
At this writing version 11.1 is current the default for all of the Intel compilers. You don't need to do anything special to use that version of any of them. Older and newer versions are sometimes installed for testing or other special special purposes. Use the command module avail to see all of the modules available, or the command module avail icc command to see just the icc modules. For example:
--------------- /usr/share/Modules/modulefiles --------------
icc/10.1 icc/11.1(default) icc/12.0 icc/12.0.3
If module avail shows that version icc/10.1 is available, then load it with the command module load icc/10.1/default command at the beginning of your session to make it the default for the rest of your session.
OpenMPI is the MPI of choice for most applications, and it is is the default. Use mpicc for c programs, mpiCC for c++, mpif77 for Fortran 77, and mpif90 for Fortran 90.
If you need the Intel MPI libraries, load them at the beginning of your session with the module command. Use the module avail command to see all of the modules available, or the command module avail mpi/intel command to see just the mpi/intel modules. For example:
--------------- /usr/share/Modules/modulefiles ---------------
mpi/intel/3.0 mpi/intel/3.1 mpi/intel/3.2
If module avail shows that version mpi/intel/3.2 is available, then load it with the module load mpi/intel/3.2/default command at the beginning of your session to make it the default for the rest of your session. Use mpiicc and mpiifort to compile the programs, as before.
There is a lot of documentation on the Intel web site. These might be useful:
There is a lot of documentation on the Intel web site. This might be useful:
Use the ldd command. To see the ldd online manual use the man ldd command.
Yes. You can use gcc to compile c and c++ programs and gfortran for fortran 77 Fortran 95.
A short help text will be displayed by the gcc --help or gfortran --help commands.
More extensive documentation is in the online manual. Use the man gcc or man gfortran commands.
Documentation can also be found at http://gcc.gnu.org/onlinedocs/.