The National Institute for Computational Sciences

Darter: What common changes are needed to compile my programs?

  • Replace all compiler commands (mpicc, mpif90, icc, ifort, pgCC, pgf90, etc) with the following: cc (C), CC (C++) or ftn (Fortran).
  • 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: man libsci)
  • 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:

  1. If you change versions of hdf5, you only need to load a different module. The makefile does not have to be modified.
  2. 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.
  3. Libraries loaded via module are automatically included and linked to the program without the need for additional compile and linking flags.

For a list of libraries and other software available for Darter see Darter Software. Also see Compiling on Darter Example 3.