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

NCEP_bufr cannot build with GCC #16

Open
mathomp4 opened this issue Nov 18, 2020 · 1 comment
Open

NCEP_bufr cannot build with GCC #16

mathomp4 opened this issue Nov 18, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mathomp4
Copy link
Member

In looking at GEOS-ESM/GEOSgcm#224, it was seen that NCEP_bufr cannot build with GCC. The error is:

[  0%] Building Fortran object src/Shared/@NCEP_Shared/NCEP_bufr_r4i4/CMakeFiles/NCEP_bufr_r4i4.dir/moda_mstabs.F.o
/discover/swdev/mathomp4/Models/GEOSgcm-with-bufr-GCC10/GEOSgcm/src/Shared/@NCEP_Shared/NCEP_bufr/moda_mstabs.F:39:44:

   39 |    CHARACTER*4, BIND(C) :: CBBW(MXMTBB)
      |                                            1
Error: BIND(C) Variable ‘cbbw’ at (1) must have length one
/discover/swdev/mathomp4/Models/GEOSgcm-with-bufr-GCC10/GEOSgcm/src/Shared/@NCEP_Shared/NCEP_bufr/moda_mstabs.F:42:48:

   42 |    CHARACTER*120, BIND(C) :: CBELEM(MXMTBB)
      |                                                1
Error: BIND(C) Variable ‘cbelem’ at (1) must have length one
/discover/swdev/mathomp4/Models/GEOSgcm-with-bufr-GCC10/GEOSgcm/src/Shared/@NCEP_Shared/NCEP_bufr/moda_mstabs.F:41:46:

   41 |    CHARACTER*8, BIND(C) :: CBMNEM(MXMTBB)
      |                                              1
Error: BIND(C) Variable ‘cbmnem’ at (1) must have length one
/discover/swdev/mathomp4/Models/GEOSgcm-with-bufr-GCC10/GEOSgcm/src/Shared/@NCEP_Shared/NCEP_bufr/moda_mstabs.F:37:45:

   37 |    CHARACTER*4, BIND(C) :: CBSCL(MXMTBB)
      |                                             1
Error: BIND(C) Variable ‘cbscl’ at (1) must have length one
/discover/swdev/mathomp4/Models/GEOSgcm-with-bufr-GCC10/GEOSgcm/src/Shared/@NCEP_Shared/NCEP_bufr/moda_mstabs.F:38:47:

   38 |    CHARACTER*12, BIND(C) :: CBSREF(MXMTBB)
      |                                               1
Error: BIND(C) Variable ‘cbsref’ at (1) must have length one
/discover/swdev/mathomp4/Models/GEOSgcm-with-bufr-GCC10/GEOSgcm/src/Shared/@NCEP_Shared/NCEP_bufr/moda_mstabs.F:40:47:

   40 |    CHARACTER*14, BIND(C) :: CBUNIT(MXMTBB)
      |                                               1
Error: BIND(C) Variable ‘cbunit’ at (1) must have length one
/discover/swdev/mathomp4/Models/GEOSgcm-with-bufr-GCC10/GEOSgcm/src/Shared/@NCEP_Shared/NCEP_bufr/moda_mstabs.F:45:46:

   45 |    CHARACTER*8, BIND(C) :: CDMNEM(MXMTBD)
      |                                              1
Error: BIND(C) Variable ‘cdmnem’ at (1) must have length one
/discover/swdev/mathomp4/Models/GEOSgcm-with-bufr-GCC10/GEOSgcm/src/Shared/@NCEP_Shared/NCEP_bufr/moda_mstabs.F:44:47:

   44 |    CHARACTER*120, BIND(C) :: CDSEQ(MXMTBD)
      |                                               1
Error: BIND(C) Variable ‘cdseq’ at (1) must have length one
src/Shared/@NCEP_Shared/NCEP_bufr_r4i4/CMakeFiles/NCEP_bufr_r4i4.dir/build.make:1903: recipe for target 'src/Shared/@NCEP_Shared/NCEP_bufr_r4i4/CMakeFiles/NCEP_bufr_r4i4.dir/moda_mstabs.F.o' failed
make[3]: *** [src/Shared/@NCEP_Shared/NCEP_bufr_r4i4/CMakeFiles/NCEP_bufr_r4i4.dir/moda_mstabs.F.o] Error 1
CMakeFiles/Makefile2:10370: recipe for target 'src/Shared/@NCEP_Shared/NCEP_bufr_r4i4/CMakeFiles/NCEP_bufr_r4i4.dir/all' failed
make[2]: *** [src/Shared/@NCEP_Shared/NCEP_bufr_r4i4/CMakeFiles/NCEP_bufr_r4i4.dir/all] Error 2
CMakeFiles/Makefile2:10377: recipe for target 'src/Shared/@NCEP_Shared/NCEP_bufr_r4i4/CMakeFiles/NCEP_bufr_r4i4.dir/rule' failed
make[1]: *** [src/Shared/@NCEP_Shared/NCEP_bufr_r4i4/CMakeFiles/NCEP_bufr_r4i4.dir/rule] Error 2
Makefile:2554: recipe for target 'NCEP_bufr_r4i4' failed
make: *** [NCEP_bufr_r4i4] Error 2

This is @tclune level thinking needed I think.

That said, I think I can see a cheap fix. I'll test it.

@mathomp4 mathomp4 added the bug Something isn't working label Nov 18, 2020
@mathomp4
Copy link
Member Author

Note, I might "fix" this for GNU by using:

if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
   target_compile_definitions (${this} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:DYNAMIC_ALLOCATION>)
endif ()

where we use the DYNAMIC_ALLOCATION path to let GNU at least build without touching Intel (which might change results).

We would then need someone on the ADAS side (perhaps @gmao-msienkie can suggest someone?) to try out DYNAMIC_ALLOCATION with Intel and see if the results are good.

mathomp4 added a commit that referenced this issue Nov 18, 2020
GNU threw an error (#16)
when building this code without `DYNAMIC_ALLOCATION`. So as to not
(possibly) change Intel results, we turn on that flag only for GNU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants