MPAS-Dev / MPAS-Model

Repository for MPAS models and shared framework releases.
239 stars 319 forks source link

Add "-check all" to LDFLAGS_DEBUG for 'intel' build target #1187

Closed mgduda closed 3 months ago

mgduda commented 3 months ago

This PR adds -check all to LDFLAGS_DEBUG for the intel build target to resolve linking errors.

When building MPAS with the Intel oneAPI compilers and DEBUG=true, the linking step fails with undefined references to various __msan symbols. According to the Intel compiler documentation, if -check all is used to compile source files, that option must also be used during linking. From the Intel 2024.1 manual:

     Caution
     Files compiled with option check all should also be
     linked with this same option, or the link step may fail.
mgduda commented 3 months ago

Note that even with the changes in this PR, we get further linking errors on Derecho with the intel/2024.0.2 module when compiling using the DEBUG=true option; e.g.,

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_log.o):(.debug_info+0x250e): undefined reference to `MPIR_C_MPI_ERRCODES_IGNORE'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_log.o):(.debug_info+0x2528): undefined reference to `MPIR_C_MPI_ARGVS_NULL'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_log.o):(.debug_info+0x2542): undefined reference to `MPIR_C_MPI_ARGV_NULL'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_log.o):(.debug_info+0x2590): undefined reference to `MPIR_C_MPI_STATUSES_IGNORE'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_log.o):(.debug_info+0x25aa): undefined reference to `MPIR_C_MPI_STATUS_IGNORE'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_abort.o):(.debug_info+0xcd): undefined reference to `MPIR_C_MPI_ERRCODES_IGNORE'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_abort.o):(.debug_info+0xe6): undefined reference to `MPIR_C_MPI_ARGVS_NULL'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_abort.o):(.debug_info+0xff): undefined reference to `MPIR_C_MPI_ARGV_NULL'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_abort.o):(.debug_info+0x14a): undefined reference to `MPIR_C_MPI_STATUSES_IGNORE'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: ../../framework/libframework.a(mpas_abort.o):(.debug_info+0x163): undefined reference to `MPIR_C_MPI_STATUS_IGNORE'

These will be addressed with a separate PR.

mgduda commented 3 months ago

@gdicker1 Thanks for the review! The "further linking errors" I referenced are addressed by PR #1188 . There will likely be one more PR to modify the checks, since -check all now turns on a memory sanitizer that seems to stop the model with less-than-helpful output.