Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Rebuild the program with:

    1. The default GNU GCC compiler.
    2. The default Classic Intel compiler.
    3. The default LLVM-based Intel compiler.
    4. 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
    titleSolution

    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.