Problems while linking

Hello,
The compilation for v4.7 keeps breaking while linking everything together. The issue seems to originate from mediation_interp_domain, but the object (mediation_interp_domain.o) has interp_domain_em_part1_, interp_domain_em_part2_, interp_domain_em_part3_, interp_domain_em_small_part1_ & interp_domain_em_small_part2_, and the library has picked up the object. The only difference versus v4.6 is the addition of 'interp_domain_em_part3' but cannot figure out why this would causes the linking to fail. I noticed that interp_domain_em_part1, interp_domain_em_part2 and interp_domain_em_part3 seem to do the same, but that's more a matter of coding style, not sure if this would cause the compilation error.
Thanks.

$ /opt/atrium/openmpi/bin/mpif90 -o wrf.exe -O3 -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch -fallow-invalid-boz wrf.o ../main/module_wrf_top.o libwrflib.a /home/ubuntu/WRF-4.7/external/fftpack/fftpack5/libfftpack.a /home/ubuntu/WRF-4.7/external/io_grib1/libio_grib1.a /home/ubuntu/WRF-4.7/external/io_grib_share/libio_grib_share.a /home/ubuntu/WRF-4.7/external/io_int/libwrfio_int.a -L/home/ubuntu/WRF-4.7/external/esmf_time_f90 -lesmf_time /home/ubuntu/WRF-4.7/external/RSL_LITE/librsl_lite.a /home/ubuntu/WRF-4.7/frame/module_internal_header_util.o /home/ubuntu/WRF-4.7/frame/pack_utils.o -L/home/ubuntu/WRF-4.7/external/io_netcdf -lwrfio_nf -L/opt/atrium/netcdf/lib -lnetcdff -lnetcdf -L/home/ubuntu/WRF-4.7/external/io_netcdfpar -lwrfio_nfpar -L/opt/atrium/netcdf/lib -lnetcdff -lnetcdf -L/opt/atrium/netcdf/lib -lnetcdf -L/opt/atrium/netcdf/lib -lnetcdff -L/opt/atrium/openmpi/lib -L/opt/atrium/netcdf/lib -lnetcdf -lnetcdf -lm
/usr/bin/ld: libwrflib.a(mediation_interp_domain.o): in function `med_interp_domain_':
mediation_interp_domain.f90:(.text+0x6cc): undefined reference to `interp_domain_em_part1_'
/usr/bin/ld: mediation_interp_domain.f90:(.text+0x1870): undefined reference to `interp_domain_em_part2_'
/usr/bin/ld: mediation_interp_domain.f90:(.text+0x299c): undefined reference to `interp_domain_em_part3_'
/usr/bin/ld: libwrflib.a(mediation_interp_domain.o): in function `med_interp_domain_small_':
mediation_interp_domain.f90:(.text+0x3b60): undefined reference to `interp_domain_em_small_part1_'
/usr/bin/ld: mediation_interp_domain.f90:(.text+0x4cb0): undefined reference to `interp_domain_em_small_part2_'
/usr/bin/ld: libwrflib.a(mediation_force_domain.o): in function `med_force_domain_':
mediation_force_domain.f90:(.text+0x770): undefined reference to `interp_domain_em_part1_'
/usr/bin/ld: mediation_force_domain.f90:(.text+0x18cc): undefined reference to `force_domain_em_part2_'
/usr/bin/ld: libwrflib.a(mediation_feedback_domain.o): in function `med_feedback_domain_':
mediation_feedback_domain.f90:(.text+0x81c): undefined reference to `feedback_domain_em_part2_'
/usr/bin/ld: mediation_feedback_domain.f90:(.text+0x2bbc): undefined reference to `feedback_domain_em_part1_'
collect2: error: ld returned 1 exit status
 

Attachments

Not sure if I understand why this is an issue with v4.7, but not with previous version. Anyway, the fix worked. Thanks.
Note: Without the fix, the source files were compiled and libraries were built, but linking everything together failed.
 
v4.6.1 split these functions out into separate files with this PR : Break out module_dm external subroutines into separate files by islas · Pull Request #2069 · wrf-model/WRF

So the changes are fairly recent and would have been missed in any version <= v4.6.0

Interestingly, the fix should already be in v4.7.0 and I can't find any other stanzas that are missing the DMPARALLEL = # 1 line. I'd be interesting in seeing your configure.wrf and which stanza you used, just to make sure no one else runs into this issue as well.
 
Back
Top