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

Add ifdef/undef/endif to unused.inc #92

Open
mathomp4 opened this issue Jan 23, 2020 · 1 comment
Open

Add ifdef/undef/endif to unused.inc #92

mathomp4 opened this issue Jan 23, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@mathomp4
Copy link
Collaborator

In trying to build MAPL with GCC9 recently, I saw quite a few of these:

[ 54%] Building Fortran object MAPL_Base/CMakeFiles/MAPL_Base.dir/MAPL_ESMFTimeVectorMod.F90.o
/discover/swdev/gmao_SIteam/Baselibs/ESMA-Baselibs-6.0.4-SLES11/x86_64-unknown-linux-gnu/gfortran_9.1.0-openmpi_4.0.1/Linux/GFTL-1.2/include/templates/unused.inc:10:0:

   10 | #define _UNUSED_DUMMY(dummy) if (.false.) print*,shape(dummy)
      | 
Warning: "_UNUSED_DUMMY" redefined
/discover/swdev/mathomp4/Models/MAPL-MAPL20-Cleanup-GCC9/MAPL/MAPL_Base/unused_dummy.H:13:0:

   13 | #define _UNUSED_DUMMY(x) if (.false.) print*,shape(x)
      | 
note: this is the location of the previous definition

I believe this is due to unused.inc being just a #define without the usual quartet:

#ifdef FOO
#undef FOO
#endif
#define FOO

Thus in some files in MAPL that used templates/vector.inc, say, they pick up this new (nigh-identical) macro.

Note: something perhaps should/could be added to all_macros_undef.inc as well? I see it exists but gFTL is more complex than I'm used to.

@tclune tclune added the enhancement New feature or request label Jan 23, 2020
@tclune tclune self-assigned this Jan 23, 2020
@tclune
Copy link
Member

tclune commented Jan 23, 2020

I concur, and believe the expedient fix is to add a block as you describe. Assigning myself, but feel free to scoop me.

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

No branches or pull requests

2 participants