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

[email protected] testing - undefined references to maximize_system_stacksize_limit and mpp_init #1284

Closed
climbfuji opened this issue Jul 17, 2023 · 1 comment · Fixed by #1285
Assignees
Labels
bug Issue/PR that reports or fixes a given discovered bug

Comments

@climbfuji
Copy link
Contributor

Describe the bug
On my mac I am hitting the following problem:

Undefined symbols for architecture x86_64:
  "_maximize_system_stacksize_limit", referenced from:
      ___fms_mod_MOD_check_nml_error in libfms_r8.a(fms.F90.o)
      ___fms_mod_MOD_fms_init.part.0 in libfms_r8.a(fms.F90.o)
      ___fms_mod_MOD_write_version_number in libfms_r8.a(fms.F90.o)
      ___fms_mod_MOD_error_mesg in libfms_r8.a(fms.F90.o)
      ___fms_mod_MOD_fms_init in libfms_r8.a(fms.F90.o)
  "_mpp_init_", referenced from:
      ___module_wrt_grid_comp_MOD_wrt_initialize_p1 in libfv3atm.a(module_wrt_grid_comp.F90.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

I already had to add use mpp_mod and use fms_mod before the use fms statement in module_wrt_grid_comp.F90, but it seems that the C function maximize_system_stacksize_limit isn't defined anywhere in the installed library:

> grep -Rie maximize_system_stacksize_limit envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym
Binary file envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a matches
Binary file envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r8.a matches

> nm envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a |grep maximize
envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a:yaml_parser_binding.c.o: no symbols
envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a:yaml_output_functions.c.o: no symbols
envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a:constants.F90.o: no symbols
envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a:constantsr4.F90.o: no symbols
envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a:fm_yaml.F90.o: no symbols
                 U _maximize_system_stacksize_limit
envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a:yaml_parser.F90.o: no symbols
envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a:fms_yaml_output.F90.o: no symbols
envs/fms-beta-chained-clang/install/apple-clang/13.1.6/fms-2023.02-beta1-q26chym/lib/libfms_r4.a:platform.F90.o: no symbols

(and same for libfms_r8.a).

To Reproduce
Try to build current ufs-weather-model with [email protected] - note that you need to enable the legacy fms_io bindings.

Expected behavior
No undefined references in final linker step

System Environment

  • OS: macOS Mojave
  • Compiler(s): [email protected]
  • MPI type, and version (e.g. MPICH, Cray MPI, openMPI): [email protected]
  • netCDF Version: netCDF 4.9.2, netCDF-Fortran 4.6.0
  • Configure options: all from spack-stack
'-DGFS_PHYS:BOOL=ON'
'-DOPENMP:BOOL=ON'
'-DENABLE_QUAD_PRECISION:BOOL=ON'
'-DWITH_YAML:BOOL=OFF'
'-DCONSTANTS:STRING=GFS'
'-DFPIC:BOOL=ON'
'-D32BIT:BOOL=ON'
'-D64BIT:BOOL=ON'
'-DUSE_DEPRECATED_IO:BOOL=ON'
'-DCMAKE_C_COMPILER:STRING=/Users/heinzell/prod/spack-stack-1.4.1/envs/unified-env/install/apple-clang/13.1.6/openmpi-4.1.5-j7pjg6h/bin/mpicc'
'-DCMAKE_CXX_COMPILER:STRING=/Users/heinzell/prod/spack-stack-1.4.1/envs/unified-env/install/apple-clang/13.1.6/openmpi-4.1.5-j7pjg6h/bin/mpic++'
'-DCMAKE_Fortran_COMPILER:STRING=/Users/heinzell/prod/spack-stack-1.4.1/envs/unified-env/install/apple-clang/13.1.6/openmpi-4.1.5-j7pjg6h/bin/mpif90'
'-DCMAKE_Fortran_FLAGS:STRING=-fallow-argument-mismatch'

Additional context
Add any other context about the problem. If applicable, include where any files
that help describe, or reproduce the problem exist.

@bensonr
Copy link
Contributor

bensonr commented Jul 17, 2023

@climbfuji - I suspect this is an issue with the newly created fms/fms_stacksize.c file not existing in the CMakeLists.txt fms_c_src_files list. Also, we have not yet tested the functionality on a Mac - still trying to get a working autotools environment for our tests. So if you do encounter issues with any of the logic in this file, please keep us updated via this issue.

@bensonr bensonr added the bug Issue/PR that reports or fixes a given discovered bug label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue/PR that reports or fixes a given discovered bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants