Skip to content

Missing inlat, nlat and ltr referenced from _cfml_kvec_symmetry_mp_latsym_ in libCrysFML08.a(ksym_auxsub.o) on macOS + ifort #22

@AndrewSazonov

Description

@AndrewSazonov

On macOS with ifort, the CrysFML static library libCrysFML08.a seems to be created without error:

ifort -fpp -fPIC -heap-arrays -nologo -c /path/to/CFML/Src/Forpy.f90
ifort -fpp -fPIC -heap-arrays -nologo -c /path/to/CFML/Src/CFML_GlobalDeps.f90
...
ar -r libCrysFML08.a *.o

But for some of the CrysFML functional test programs, such as, Testing/StructureFactors/Calc_Sfac.f90, the building process fails with the following error:

ifort -fpp -fPIC -heap-arrays -nologo -o Calc_Sfac Calc_Sfac.f90 -I /path/to/CFML/include -L/path/to/CFML/lib -lCrysFML08

Error:

Undefined symbols for architecture x86_64:
  "_cfml_kvec_symmetry_mp_inlat_", referenced from:
      _cfml_kvec_symmetry_mp_latsym_ in libCrysFML08.a(ksym_auxsub.o)
  "_cfml_kvec_symmetry_mp_ltr_", referenced from:
      _cfml_kvec_symmetry_mp_latsym_ in libCrysFML08.a(ksym_auxsub.o)
  "_cfml_kvec_symmetry_mp_nlat_", referenced from:
      _cfml_kvec_symmetry_mp_latsym_ in libCrysFML08.a(ksym_auxsub.o)
ld: symbol(s) not found for architecture x86_64

Looking into CFML_kvec_Symmetry.f90 and ksym_auxsub.f90 from CrysFML2008/Src, I can find the LatSym module subroutine (line 342, CFML_kvec_Symmetry.f90), as well as the defined nlat, inlat and Ltr (line 294, CFML_kvec_Symmetry.f90). Then, ksym_auxsub.f90, which is a sub-module of CFML_kvec_Symmetry, uses these variables, e.g. inlat (line 48, ksym_auxsub.f90).

In the case of Windows with ifort or Ubuntu with ifort everything works as expected.

Build processes for all the build combinations (inkl. macOS + ifort), can be found at https://github.com/EasyScience/PyCrysFML/actions/workflows/debug.yml?query=branch%3Adevelop

Metadata

Metadata

Assignees

No one assigned

    Labels

    [scope] bugBug report or fix (major.minor.PATCH)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions