-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly support the Intel compiler with the CMake build #68
base: master
Are you sure you want to change the base?
Conversation
I'm pretty sure that flag is (or at least was) needed, but don't remember on top of my head why. |
The -fno-automatic flag was needed because early FORTRAN codes always saved values when a routine was exited whereas F90 does not. I suspect the need is reduced but I am not sure it has been tested. Flags always depend on the compiler. |
Alright, new approach (since checking whether the user has modified
@jongrumer could you check that this does the right thing in a live |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me!
Ok - I know this should be in a separate PR, but to speed things up a bit - I added the mkdir fix we found in Intel Ifort + MPI/MKL (HPC) instructions for Linux: https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/apt.html#apt_PACKAGES Mac and Windows have to download executables (note that the Mac version does not seem to ship with MPI). Compiling with Cmake, and using the new Intel Ifort API kits (Base + HPC), including the -mkl flag above via the addition to CMakeList.txt, I get the following linked libraries for e.g. ldd rmcdhf_mpi
linux-vdso.so.1 (0x00007ffd2f969000)
libmkl_intel_lp64.so.1 => /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_lp64.so.1 (0x0000151c141f3000)
libmkl_intel_thread.so.1 => /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_thread.so.1 (0x0000151c108fe000)
libmkl_core.so.1 => /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_core.so.1 (0x0000151c07363000)
libiomp5.so => /opt/intel/oneapi/compiler/2021.2.0/linux/compiler/lib/intel64_lin/libiomp5.so (0x0000151c06f4c000)
libblas.so.3 => /usr/lib/x86_64-linux-gnu/libblas.so.3 (0x0000151c06cf1000)
liblapack.so.3 => /usr/lib/x86_64-linux-gnu/liblapack.so.3 (0x0000151c0646b000)
libmpifort.so.12 => /opt/intel/oneapi/mpi/2021.2.0//lib/libmpifort.so.12 (0x0000151c060ad000)
libmpi.so.12 => /opt/intel/oneapi/mpi/2021.2.0//lib/release/libmpi.so.12 (0x0000151c04de7000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x0000151c04be3000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x0000151c049db000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x0000151c047bc000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x0000151c0441e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000151c0402d000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x0000151c03e15000)
/lib64/ld-linux-x86-64.so.2 (0x0000151c14f58000)
libopenblas.so.0 => /usr/lib/x86_64-linux-gnu/libopenblas.so.0 (0x0000151c01b6f000)
libgfortran.so.4 => /usr/lib/x86_64-linux-gnu/libgfortran.so.4 (0x0000151c01790000)
libfabric.so.1 => /opt/intel/oneapi/mpi/2021.2.0//libfabric/lib/libfabric.so.1 (0x0000151c0154a000)
libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x0000151c01303000) And this is what it looks like for a gfortran/openMPI build (no surprises, GNU all the way) ldd rmcdhf_mpi
linux-vdso.so.1 (0x00007ffe37bd4000)
libblas.so.3 => /usr/lib/x86_64-linux-gnu/libblas.so.3 (0x0000149863537000)
liblapack.so.3 => /usr/lib/x86_64-linux-gnu/liblapack.so.3 (0x0000149862cb1000)
libmpi_mpifh.so.20 => /usr/lib/x86_64-linux-gnu/libmpi_mpifh.so.20 (0x0000149862a5a000)
libgfortran.so.4 => /usr/lib/x86_64-linux-gnu/libgfortran.so.4 (0x000014986267b000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00001498622dd000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00001498620c5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000149861cd4000)
libopenblas.so.0 => /usr/lib/x86_64-linux-gnu/libopenblas.so.0 (0x000014985fa2e000)
libmpi.so.20 => /usr/lib/x86_64-linux-gnu/libmpi.so.20 (0x000014985f73c000)
libopen-pal.so.20 => /usr/lib/x86_64-linux-gnu/libopen-pal.so.20 (0x000014985f48a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x000014985f26b000)
libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x000014985f024000)
/lib64/ld-linux-x86-64.so.2 (0x0000149863a71000)
libopen-rte.so.20 => /usr/lib/x86_64-linux-gnu/libopen-rte.so.20 (0x000014985ed9c000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x000014985eb94000)
libhwloc.so.5 => /usr/lib/x86_64-linux-gnu/libhwloc.so.5 (0x000014985e957000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x000014985e753000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x000014985e550000)
libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x000014985e345000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x000014985e13b000) Quick test case -- IN PROGRESS!
|
Ok, this is actually cool. With a proper Intel
seems to automatically configure a CMake build that uses MKL (via I am not quite sure that adding |
Ok great! I'll try setting EDIT: Seems like |
(This only affects the CMake build)
Currently, we always pass
-fno-automatic
as a compiler flag, even if the user adds their own flags (by settingCMAKE_Fortran_FLAGS
). This is a problem for e.g.ifort
which has a different name for that flag.With this change, if the user decides to customize the flags by passing their own
CMAKE_Fortran_FLAGS
, we no longer set-fno-automatic
automatically, which solves that problem. The only thing to note though is that the user then needs to explicitly pass-fno-automatic
.Question to anyone who might know this: do we actually need
-fno-automatic
for GRASP? It changes the waySAVE
attributes are handled.. but is there any part in GRASP that actually requires this flag?Fix #68