Skip to content
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

Double R4/R8 link for stats.x (and more...) #179

Open
mathomp4 opened this issue Apr 26, 2021 · 0 comments
Open

Double R4/R8 link for stats.x (and more...) #179

mathomp4 opened this issue Apr 26, 2021 · 0 comments

Comments

@mathomp4
Copy link
Member

mathomp4 commented Apr 26, 2021

This is a fun one. I will probably need @lltakacs and/or @sdrabenh to help test. (I'll also ping @tclune as it's CMake related)

I've been trying to get GEOSldas to compile with NAG. I'm using GEOSldas because it has no FMS (which NAG can never compile at present). I'm currently up to 83 files changed but stats.F90 is getting to me. The main issue now is linking stats.x:

[100%] Linking Fortran executable ../../../../../bin/stats.x
NAG Fortran Compiler Release 7.0(Yurakucho) Build 7036
duplicate symbol '_m_gfio_getfld_MP_fix_undef_in_' in:
    ../../../../../lib/libGMAO_gfio_r4.a(m_GFIO_GetFld.f.o)
    ../../../../../lib/libGMAO_gfio_r8.a(m_GFIO_GetFld.f.o)
duplicate symbol '_m_gfio_getfld_MP_gfio_get_fall_' in:
    ../../../../../lib/libGMAO_gfio_r4.a(m_GFIO_GetFld.f.o)
    ../../../../../lib/libGMAO_gfio_r8.a(m_GFIO_GetFld.f.o)

Why this is happening can be seen by looking at CMake. To wit, first we have what stats.x wants:

target_link_libraries (stats.x post_nompi GMAO_gfio_r4 MAPL ${ESMF_LIBRARIES})

So an explicit link to GMAO_gfio_r4 and to post_nompi. That has a dependency on GMAO_hermes:

esma_add_library (post_nompi
  SRCS dynamics_lattice_module.F mpi_util.F mymalloc.F timer.F
  DEPENDENCIES MAPL GMAO_hermes)
target_compile_definitions(post_nompi PRIVATE mpi)

which links in GMAO_gfio_r8:

   esma_add_library(${this} SRCS ${srcs} DEPENDENCIES GMAO_mpeu GMAO_gfio_r8)

And so the issue. stats.x wants both the r4 and r8 versions of GFIO. 😦 (NOTE: libpost.a has the same issue as well so a LOT of programs have an issue like this.)

I can obviously "fix" this by removing the explicit link to GMAO_gfio_r4 in post, but I'm not sure if that breaks stats.x...as I don't know how to run it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant