schism-dev / fabm

The Framework for Aquatic Biogeochemical Models (FABM): a Fortran 2003 programming framework for biogeochemical models of marine and freshwater systems.
GNU General Public License v2.0
1 stars 0 forks source link

Undefined symbols for architecture arm64: "_signa_", referenced from: ___fabm_cosine_misc_MOD_pt_in_poly #2

Open platipodium opened 2 years ago

platipodium commented 2 years ago

When making the python driver, the cosine model is lacking the _signa_ symbol

cmake -S /Users/Lemmen/devel/fabm/fabm-schism/src/drivers/python -B /Users/Lemmen/devel/fabm/fabm-schism/build -DFABM_HOST=python 
make -C /Users/Lemmen/devel/fabm/fabm-schism/build install
...
Scanning dependencies of target fabm_c
[ 93%] Building Fortran object fabm/c/CMakeFiles/fabm_c.dir/c_helper.F90.o
[ 94%] Building Fortran object fabm/c/CMakeFiles/fabm_c.dir/helper.F90.o
[ 95%] Building Fortran object fabm/c/CMakeFiles/fabm_c.dir/fabm_c.F90.o
[ 96%] Building Fortran object fabm/c/CMakeFiles/fabm_c.dir/integrate.F90.o
[ 96%] Building Fortran object fabm/c/CMakeFiles/fabm_c.dir/link_list.F90.o
[ 97%] Building Fortran object fabm/c/CMakeFiles/fabm_c.dir/parameter.F90.o
[ 98%] Building Fortran object fabm/c/CMakeFiles/fabm_c.dir/variable.F90.o
[ 98%] Linking Fortran shared library libfabm_c.dylib
Undefined symbols for architecture arm64:
  "_signa_", referenced from:
      ___fabm_cosine_misc_MOD_pt_in_poly in libfabm.a(fabm_cosine_misc.F90.o)
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make[3]: *** [fabm/c/libfabm_c.dylib] Error 1
make[2]: *** [fabm/c/CMakeFiles/fabm_c.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [pyfabm] Error 2
platipodium commented 2 years ago

The function signa depends on the SCHISM host, so cannot be found when used with a different host like python. @wzhengui we should make this more generic, the grid_cell_area is a property we can pull from the host without this calculation in fabm_misc_cosine.

wzhengui commented 2 years ago

Hi Carsten:

Thank you for the suggestion. I agree with you. I just changed this. Can you help test whether it works on your side now?

Thanks, Zhengui

On Fri, Oct 14, 2022 at 2:03 PM Carsten Lemmen @.***> wrote:

The function signa depends on the SCHISM host, so cannot be found when used with a different host like python. @wzhengui https://github.com/wzhengui we should make this more generic, the grid_cell_area is a property we can pull from the host without this calculation in fabm_misc_cosine.

— Reply to this email directly, view it on GitHub https://github.com/schism-dev/fabm/issues/2#issuecomment-1279308487, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFFROBJV7TFOJ3DIA6ZBE4DWDGN7PANCNFSM5ZRA6YQA . You are receiving this because you were mentioned.Message ID: @.***>

platipodium commented 2 years ago

Your commit fixes #1 Thx! This one here is harder, as we would have to take the misc source apart and also do some work on the host side

wzhengui commented 2 years ago

Thanks again. I agree with you. I put this on my note. Re-organizing fabm_cosine_misc.F90 is a good idea, as many parts are not needed for fabm.

platipodium commented 2 years ago

See https://github.com/fabm-model/fabm/issues/26#issuecomment-1279337128