- Replace all compiler commands (
pgf90, etc) with the following:
- Remove all references to MPI libraries and environment variables related to third-party libraries within the makefile.
- Any references to libraries BLAS, LAPACK, BLACS, and ScalaPACK should be removed from your makefiles. The system will automatically link with the most highly optimized versions of these libraries. (For a complete list of libraries, enter:
- References to MKL can often be removed because their function is replaced by libsci.
Before you compile your code, load any relevant modules for third-party libraries. For example:
module load cray-hdf5-parallel
The documentation will tell you how to use environment variables in your makefile. In the hdf5 example, this is documented in HDF5.
cc -o hdf5example.x hdf5example.c
There are three advantages to using the module with the environment variable instead of the pathname:
- If you change versions of hdf5, you only need to load a different module. The makefile does not have to be modified.
- If you change to a different compiler and then reload the hdf5 module, the system will load a version of hdf5 that is compiled with the other compiler.
- Libraries loaded via module are automatically included and linked to the program without the need for additional compile and linking flags.