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

Bugfix: Problem compiling MET on MacOS using GCC 12.3.0 #2615

Closed
7 of 22 tasks
jprestop opened this issue Jul 19, 2023 · 9 comments · Fixed by #2617
Closed
7 of 22 tasks

Bugfix: Problem compiling MET on MacOS using GCC 12.3.0 #2615

jprestop opened this issue Jul 19, 2023 · 9 comments · Fixed by #2617
Labels
component: build process Build process issue priority: high High Priority requestor: METplus Team METplus Development Team type: bug Fix something that is not working
Milestone

Comments

@jprestop
Copy link
Collaborator

jprestop commented Jul 19, 2023

Describe the Problem

The compilation of MET-11.1.0-rc1 on the MacOS fails when compiling with gcc 12.3.0, but succeeds with gcc 11.3.0. The error in the make.log file (attached) is the following when making pb2nc:
met.make.log

Note that a libbufr.a file is created from the BUFRLIB compilation, but I noticed this in the log file:

file: libbufr.a(modv_MXH4WLC.o) has no symbols

bufr.make.log

calcape.f:442:72:

  442 |  510    POLD(KP)=P
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 510 at (1)
calcape.f:464:72:

  464 |  530    QSNEW(KP)=QSNEW(KP-1)+DQS
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 530 at (1)
calcape.f:472:72:

  472 |  540    PTBL(KP,KTH)=PNEW(KP)
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 540 at (1)
calcape.f:485:72:

  485 |  560    THEOLD(KTH)=TH*EXP(ELIWV*QS/(CP*TOLD(KTH)))
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 560 at (1)
calcape.f:509:72:

  509 |  580    THENEW(KTH)=THENEW(KTH-1)+DTHE
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 580 at (1)
calcape.f:517:72:

  517 |  590    TTBL(KTH,KP)=TNEW(KTH)
      |                                                                        1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 590 at (1)
pb2nc.cc:147:31: error: variable 'const std::array<int, 6> var_gc' has initializer but incomplete type
  147 | const std::array<int, mxr8vt> var_gc = {
      |                               ^~~~~~
pb2nc.cc:151:32: error: aggregate 'std::array<int, 6> bufr_var_code' has incomplete type and cannot be defined
  151 | static std::array<int, mxr8vt> bufr_var_code;
      |                                ^~~~~~~~~~~~~
pb2nc.cc:157:36: error: variable 'const std::array<int, 6> derive_gc' has initializer but incomplete type
  157 | const std::array<int, n_derive_gc> derive_gc = {
      |                                    ^~~~~~~~~
mv -f .deps/pb2nc-pb2nc_conf_info.Tpo .deps/pb2nc-pb2nc_conf_info.Po
make[5]: *** [pb2nc-pb2nc.o] Error 1

Another user, @HathewayWill, also tested on a Mac using gcc 12.3.0 and received the same error his met.make.log file. A copy of his files are linked to in his comment on another issue.

Expected Behavior

MET-11.1.0-rc1 should build on the MacOS using gcc 12.3.0.

Environment

Describe your runtime environment:
1. Machine: Mac Laptop
2. OS: MacOS Monterey version 12.6.7
3. Software version number: MET-11.1.0-rc1

To Reproduce

Describe the steps to reproduce the behavior:
Attempt to install MET and its dependent libraries using the compilation script here or after this PR is merged, using the script in main_v11.1, on a MacOS using gcc 12.3.0.

Relevant Deadlines

Preferably before the 11.1.0 release.

Funding Source

2792543

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Select Organization level Project for support of the current coordinated release
  • Select Repository level Project for development toward the next official release or add alert: NEED CYCLE ASSIGNMENT label
  • Select Milestone as the next bugfix version

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of main_<Version>.
    Branch name: bugfix_<Issue Number>_main_<Version>_<Description>
  • Fix the bug and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into main_<Version>.
    Pull request: bugfix <Issue Number> main_<Version> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Organization level software support Project for the current coordinated release
    Select: Milestone as the next bugfix version
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Complete the steps above to fix the bug on the develop branch.
    Branch name: bugfix_<Issue Number>_develop_<Description>
    Pull request: bugfix <Issue Number> develop <Description>
    Select: Reviewer(s) and Development issue
    Select: Repository level development cycle Project for the next official release
    Select: Milestone as the next official version
  • Close this issue.
@jprestop jprestop added type: bug Fix something that is not working component: build process Build process issue alert: NEED ACCOUNT KEY Need to assign an account key to this issue requestor: METplus Team METplus Development Team labels Jul 19, 2023
@jprestop jprestop added this to the MET 11.1.0 milestone Jul 19, 2023
@hsoh-u
Copy link
Collaborator

hsoh-u commented Jul 20, 2023

The problem happens with gnu/12.1.0. The solution is adding the header file <array> at pb2nc.cc

#include <array>  // newly added
#include <netcdf> // existing

@HathewayWill
Copy link

The problem happens with gnu/12.1.0. The solution is adding the header file at pb2nc.cc

#include <array>  // newly added
#include <netcdf> // existing

@jprestop @georgemccabe @JohnHalleyGotway

Interesting Thank you @hsoh-u

@HathewayWill
Copy link

@jprestop

Can you let me know when to test the 11.0.2 and 11.1 scripts

@jprestop jprestop removed the alert: NEED ACCOUNT KEY Need to assign an account key to this issue label Jul 21, 2023
@jprestop
Copy link
Collaborator Author

@HathewayWill You are welcome to test the changes if you'd like, but please don't feel any obligation to test. Because this is a code change and we don't have a tar file for you to grab the testing would be different than usual for you. You would run the following:

cd /Users/workhorse/DTC_11.1/MET-11.1.0
make clean

Then you'd open ./src/tools/other/pb2nc/pb2nc.cc with the editor of your choice. Search for "#include <netcdf>" and add "#include <array>" above it. Save the file. Then:

cd /Users/workhorse/DTC_11.1
tar -cvf v11.1.0-rc1.tar.gz MET-11.1.0-rc1
mv v11.1.0-rc1.tar.gz  tar_files/

Then you'd run the compilation script again.

@jprestop jprestop added the priority: high High Priority label Jul 21, 2023
@jprestop jprestop linked a pull request Jul 21, 2023 that will close this issue
15 tasks
@HathewayWill
Copy link

@jprestop

I'll wait for the tar file to be ready then I will test. I try to avoid going into codes that I don't understand fully because if I make a mistake I can replicate the errors.

Hope that is okay?

@jprestop
Copy link
Collaborator Author

@HathewayWill Yes, that is fine. There will likely be an rc2 release for testing. Otherwise, this change will be included in the official release tarfile.

@HathewayWill
Copy link

I vote for rc2 since if their is a bug with it then there won't need to be a 11.1.1 patch right away.

But I understand the timeline and schedule that has to be kept.

@jprestop

@jprestop
Copy link
Collaborator Author

@HathewayWill This change itself doesn't really create a need for an rc2 release since it's been implemented and tested by two developers, but we have another PR that may need some further testing by the Met Office, which we will likely prepare an rc2 release for and this change will be included.

@HathewayWill
Copy link

@jprestop sounds good I'll keep an eye out for it. Just let me know how I can help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: build process Build process issue priority: high High Priority requestor: METplus Team METplus Development Team type: bug Fix something that is not working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants