NOAA-GFDL / MOM6-examples

Example configurations for MOM6 and SIS2
Other
86 stars 146 forks source link

Issues getting started #357

Closed bendinej closed 2 years ago

bendinej commented 2 years ago

Hi, I have been attempting to set-up the MOM6 source codes and have been following the “Getting Started” steps. I am running Ubuntu 20.04 via WSL on windows 10. I have run into a few issues:

  1. When setting up the compiler environment on the “To build FMS library” step I got the error “static declaration of ‘gettid’ follows non-static declaration”. The variable is defined as static in the location: ~/MOM6-examples/src/FMS/affinity$ vi affinity.c, but defined as extern in the gnu file: /usr/include/x86_64-linux-gnu/bits$ vi unistd_ext.h a. Please note that changing the “unistd_ext” file did fix the issue
  2. On the step “"To create the Makefile for compiling MOM6:" I ran into the issue that there are two drivers missing. I get the following messages: a. find: ‘../../../../src/MOM6/config_src/dynamic/’: No such file or directory
    1. I looked into src/MOM6/config_sr and verified that these folders do not exist b. find: ‘../../../../src/MOM6/config_src/solo_driver/’: No such file or directory
    2. I found the solo driver in src/MOM6/config_src/drivers/solo_driver/ but did not find the dynamic driver Please let me know any steps that can be taken to reconcile these differences. Thank you so much!
adcroft commented 2 years ago

The wiki page compiling MOM6 in ocean-only mode has ../../../../src/MOM6/{config_src/infra/FMS1,config_src/memory/dynamic_symmetric,config_src/drivers/solo_driver,config_src/external,src/{*,*/*}}/ for the arguments to listpaths. Where did you find the path "config_src/dynamic"? We restructured the directories a while back and updated the wiki at that time but evidently missed something in the instructions.

In the restructuring, what was config_src/dynamic is now config_src/memory/dynamic_symmetric and provides the include file MOM_memory.h. What was config_src/solo_driver is now config_src/drivers/solo_driver (which you found).

The unistd_ext.h issue is new to us. I'll see if we can reproduce this problem. We might have to forward it to the FMS team.

marshallward commented 2 years ago

Regarding the gettid issue:

My best guess is that you need to build FMS with the -DHAVE_GETTID flag. (There is a way to build FMS which automatically configures this flag, but those instructions are not in the MOM6-examples wiki.)

If you only plan to build ocean-only models, then you may want to try the MOM6 autoconf build:

https://github.com/NOAA-GFDL/MOM6/blob/dev/gfdl/ac/README.md

It includes a Makefile which will configure and build the FMS library.

However, if you plan to move up to ice-ocean or coupled builds, you will probably want to continue working through the MOM6-examples instructions.

mjclobo commented 2 years ago

I went through these issues myself a couple of days ago when setting up MOM6 on my Ubuntu machine. Your issue 1 has been discussed at FMS issue 276 and FMS issue 426. The workaround suggested there is similar to what you did, but you edit the declaration of gettid in affinity.c instead.

Regarding 2, I updated the relevant paths for this a couple of days ago on the Building the ocean-only MOM6 executable section of the Ubuntu compiler environment page. Note that depending on where you got your outdated instructions from, on top of the two paths that you mentioned you'll have to add the path config_src/infra/FMS1, which was not in the instructions that I was using two days ago. @adcroft 's comment includes this path.

adcroft commented 2 years ago

Thanks @mjclobo on both counts.

I found another source of the old paths in a user contributed page on using MOM6 in Fedora. I edited that page but haven't tested with a walk through.

@bendinej Does the above get you back in business?

bendinej commented 2 years ago

Thank you so much everyone! I just got around to going through the comments and they were very helpful, I am able to run the model now!