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

Correct OptionsType subroutine's this parameter intent; Use brew --prefix to resolve the correct platform specific brew prefix #116

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

aaraney
Copy link
Member

@aaraney aaraney commented Sep 6, 2024

Change:

  • Correct OptionsType subroutine's this parameter intent to inout. aarm gfortran compilers appear to be more strict and do not generate the same symbols as other compilers. This results in linking errors (see comments below). Similar to Compile error on Mac M3 chipset snow17#37

CI:

On intel macOS, brew installs into /usr/local
On apple silicon, brew installs into /opt/homebrew

Use brew --prefix to resolve the right brew prefix in a platform independent manor

@aaraney aaraney self-assigned this Sep 6, 2024
@aaraney aaraney changed the title ci: brew prefix Use brew --prefix to resolve the correct platform specific brew prefix Sep 6, 2024
@aaraney aaraney force-pushed the fix-ci branch 3 times, most recently from d527de7 to 002a779 Compare September 6, 2024 16:35
@aaraney
Copy link
Member Author

aaraney commented Sep 6, 2024

The macOS Testing and Validation action seems to be failing b.c. of a linking issue

gfortran -o noah_owp_modular.exe -I../driver -I../src ../src/ErrorCheckModule.o ../src/NamelistRead.o ../src/ParametersRead.o ../src/LevelsType.o ../src/DomainType.o ../src/OptionsType.o ../src/ParametersType.o ../src/ForcingType.o ../src/EnergyType.o ../src/WaterType.o ../src/WaterModule.o ../src/CanopyWaterModule.o ../src/SnowWaterModule.o ../src/SnowWaterRenew.o ../src/SnowLayerChange.o ../src/SoilWaterModule.o ../src/SoilWaterRetentionCoeff.o ../src/SurfaceRunoffInfiltration.o ../src/SurfaceRunoffModule.o ../src/SoilWaterMovement.o ../src/SubsurfaceRunoffModule.o ../src/AtmProcessing.o ../src/ForcingModule.o ../src/InterceptionModule.o ../src/ThermalPropertiesModule.o ../src/AlbedoModule.o ../src/ShortwaveRadiationModule.o ../src/PrecipHeatModule.o ../src/EtFluxModule.o ../src/SnowSoilTempModule.o ../src/EnergyModule.o ../src/UtilitiesModule.o ../src/DateTimeUtilsModule.o ../src/RunModule.o ../driver/OutputModule.o ../driver/NoahModularDriver.o ../driver/AsciiReadModule.o ../bmi/bmi_noahowp.o ../bmi/bmi.o -L/opt/homebrew/lib -lnetcdf -lnetcdff
Undefined symbols for architecture arm64:
  "_is_recursive.0.2", referenced from:
      ___optionstype_MOD_inittransfer in OptionsType.o
      ___optionstype_MOD_inittransfer in OptionsType.o
      ___optionstype_MOD_inittransfer in OptionsType.o
  "_is_recursive.2.1", referenced from:
      ___optionstype_MOD_initdefault in OptionsType.o
      ___optionstype_MOD_initdefault in OptionsType.o
      ___optionstype_MOD_initdefault in OptionsType.o
  "_is_recursive.4.0", referenced from:
      ___optionstype_MOD_init in OptionsType.o
      ___optionstype_MOD_init in OptionsType.o
      ___optionstype_MOD_init in OptionsType.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make[1]: *** [noah_owp_modular.exe] Error 1
make: *** [all] Error 2

Im not sure if this is a platform specific issue or not. Going to try with an intel macOS runner to test that theory.

@aaraney aaraney force-pushed the fix-ci branch 2 times, most recently from 2a89af1 to 822684e Compare September 6, 2024 17:12
@aaraney
Copy link
Member Author

aaraney commented Sep 6, 2024

@madMatchstick
Copy link
Contributor

@aaraney - note that atm the add-to-project action will fail for PRs from forked repos. Thanks @SnowHydrology for pointing this out!

@aaraney
Copy link
Member Author

aaraney commented Sep 6, 2024

I think i've figured out what the issue is and it actually appears to be a bug in the source code. All of the OptionsType subroutines's this parameters where incorrectly marked as intent(out). These should have been marked as intent(inout).

On intel macOS, brew installs into /usr/local
On apple silicon, brew installs into /opt/homebrew

Use brew --prefix to resolve the right brew prefix in a platform independent manor
@aaraney aaraney changed the title Use brew --prefix to resolve the correct platform specific brew prefix Correct OptionsType subroutine's this parameter intent; Use brew --prefix to resolve the correct platform specific brew prefix Sep 6, 2024
@SnowHydrology
Copy link
Contributor

Cross-linking this same issue from Snow-17 in case it's of use: NOAA-OWP/snow17#37

Copy link
Contributor

@madMatchstick madMatchstick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aaraney for digging into this.

Noting for my own reference that this fixes the macos testing and validation workflow but the macos ngen CI still fails due to fortran compiler issues sourced from another workflow, module_integration here.

@SnowHydrology SnowHydrology merged commit 0abb891 into NOAA-OWP:main Sep 9, 2024
3 of 4 checks passed
@aaraney
Copy link
Member Author

aaraney commented Sep 10, 2024

@madMatchstick, once NOAA-OWP/ngen#880 has merged I expect that the tests will pass. At least, I wouldn't expect them to fail in the way they are now.

@aaraney aaraney deleted the fix-ci branch September 10, 2024 14:56
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

Successfully merging this pull request may close these issues.

3 participants