Skip to content

Cannot build with CMAKE_OSX_DEPLOYMENT_TARGET=10.14 #1185

@eschnett

Description

@eschnett

I am trying to build an updated version of openPMD_api with this build script. Note that openPMD now requires C++17, and requires on macOS the option -mmacosx_version_min=10.14 to enable certain C++17 features in libc++.

I am using the current master branch of Yggdrasil.

This works fine on Linux. On macOS the build fails with undefined symbols:

Undefined symbols for architecture x86_64:
  "__ZNSt19bad_optional_accessD1Ev", referenced from:
      __ZNSt3__127__throw_bad_optional_accessEv in ReadIterations.cpp.o
      __ZNSt3__127__throw_bad_optional_accessEv in Series.cpp.o
      __ZNSt3__127__throw_bad_optional_accessEv in WriteIterations.cpp.o
      __ZNSt3__127__throw_bad_optional_accessEv in JSON.cpp.o
      __ZNSt3__127__throw_bad_optional_accessEv in JSONIOHandlerImpl.cpp.o
      __ZNSt3__127__throw_bad_optional_accessEv in ADIOS2IOHandler.cpp.o
  "__ZTISt18bad_variant_access", referenced from:
      __ZNSt3__126__throw_bad_variant_accessEv in Iteration.cpp.o
      __ZNSt3__126__throw_bad_variant_accessEv in Mesh.cpp.o
      __ZNSt3__126__throw_bad_variant_accessEv in Record.cpp.o
      __ZNSt3__126__throw_bad_variant_accessEv in RecordComponent.cpp.o
      __ZNSt3__126__throw_bad_variant_accessEv in Series.cpp.o
      __ZNSt3__126__throw_bad_variant_accessEv in Attributable.cpp.o
      __ZNSt3__126__throw_bad_variant_accessEv in BaseRecordComponent.cpp.o
      ...

These missing symbols are e.g. vtable for std::bad_optional_access or std::__1::__throw_bad_optional_access(), which should definitely be defined in libc++. I thus think that this might be a problem with the build environment provided by BinaryBuilder and not with my build script, or with openPMD_api's build system.

I tried to look into the libc++ in the BinaryBuilder cross-compilation environment, and found that these libraries are just empty shells, presumably just defining which symbols are exported. Could it be that these export lists are missing the symbols above?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions