The Linux operating system is very popular in high-performance computing (HPC) and many current compute resources are Linux based. In contrast to most ``Workstation-type'' vendor supported operating systems, however, on Linux systems there is no single company or consortium enforcing a standard way of organizing the file system layout and how to configure system services. So there is no simple way for programs like CPMD to provide a one-size-fits-all configuration for Linux. This is made even more complicated by the fact that there are several (commercial and free) FORTRAN compilers available for Linux and the fact that in general one cannot mix and match code and libraries compiled with different FORTRAN compilers.
Particularly for parallel compilation on older Linux installations this can become a problem, as the both BLAS/LAPACK libraries and the MPI package shipped with those Linux distributions are compiled with the (now obsolete) GNU g77 compiler, which is not sufficient to compile CPMD.
This is less of a problem with current Linux distributions since they (e.g. Fedora) now ship GNU Gfortran, OpenMPI, and ATLAS compiled in a consistent way, so one can compile CPMD out of the box.
Compiler Runtime Libraries
Most compilers on Linux link executables
by default with one or more shared runtime libraries. Particularly
when installing/using a commercial compiler on a cluster, one has to
make sure that those runtime libraries are available from all nodes
of the cluster and the LD_LIBRARY_PATH environment variable
is set so that they can be found at runtime. Alternately one can instruct
the compiler to link those libraries statically (check your compiler
documentation). Note: a fully static link is strongly discouraged
(this is frequently recommended on older web pages) because of the design
of the GNU glibc library that allows backward compatibility only
when the libraries ``libc'', ``libm'' are linked dynamically. The
runtime library requirements of an executable can be checked with the
ldd utility:
[user ~]# ldd cpmd.x liblapack.so.3 => /usr/lib64/atlas/liblapack.so.3 (0x00002aaaaaac0000) libblas.so.3 => /usr/lib64/atlas/libblas.so.3 (0x00002aaaab1d9000) libgfortran.so.1 => /usr/lib64/libgfortran.so.1 (0x00002aaaabbaa000) libm.so.6 => /lib64/libm.so.6 (0x00000038e1200000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00000038e9c00000) libc.so.6 => /lib64/libc.so.6 (0x00000038e0e00000) /lib64/ld-linux-x86-64.so.2 (0x00000038e0a00000)
Multi-threaded Libraries
When using multi-threaded Fourier transform and/or BLAS/LAPACK
libraries (e.g. Intel's MKL) one has to be careful to set the
environment variable OMP_NUM_THREADS to a value of 1, or
else the library may try automatically multi-thread across all
available (local) processors. Particularly with MPI parallelization
this may not be desired and can lead to outright disastrous
performance on large single system image machine, e.g., SGI Altix
(up to 100 times slowdown depending on the size of the machine).