...
Rebuild the program with:
- The default GNU GCC compiler.
- The default Classic Intel compiler.
- The default LLVM-based Intel compiler.
- The default AMD AOCC.
Use the following command to test and show what versions of the libraries are being used at any point:
No Format make clean ldd test
Expand title Solution You can perform this test with the following one-liner, exploiting the
prgenv
module:No Format for pe in gnu intel intel-llvm amd; do ml prgenv/$pe; make clean ldd test; echo "******************"; done
Pay attention to the following aspects:
- The Lmod module command informs you that it has reloaded the corresponding modules when changing the
prgenv
. This ensures the libraries used in your program are built with the same compiler for maximum compatibility. - The compiler command changes automatically, since we are using the environment variable $
CC
in the Makefile. - The include and library flags in the compilation lines are adapted automatically based on the libraries loaded.
- The final binary is linked with the corresponding libraries for the version of the compiler as shown by
ldd
output.