Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
610 stars 346 forks source link

Compilation of Fortran library fails on macOS #1387

Closed ischoegl closed 1 year ago

ischoegl commented 2 years ago

Problem description

Compilation fails on Apple Silicon (M2) after merge of #1382

Steps to reproduce

% scons clean
% scons build

Behavior

The build fails towards the end of the build process.

Expand Error log
[...]
gfortran -o build/lib/libcantera_fortran_shared.3.0.0.dylib -Wl,-rpath,/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib -dynamiclib -Wl,-current_version,3.0.0 -Wl,-compatibility_version,3.0.0 build/src/fortran/cantera.os build/src/fortran/cantera_funcs.os build/src/fortran/cantera_kinetics.os build/src/fortran/cantera_thermo.os build/src/fortran/cantera_transport.os build/src/fortran/fct_interface.os build/src/fortran/fct.os -Lbuild/lib -L/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib -lcantera -lsundials_cvodes -lsundials_ida -lsundials_nvecserial -lsundials_sunlinsollapackdense -lsundials_sunlinsollapackband -lfmt -lyaml-cpp -lc++ -framework Accelerate
ld: warning: dylib (/opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/current/libquadmath.dylib) was built for newer macOS version (12.0) than being linked (11.0)
Undefined symbols for architecture arm64:
  "_PyBaseObject_Type", referenced from:
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL33__Pyx_PyErr_GivenExceptionMatchesP7_objectS0_ in libcantera.a(pythonExtensions.os)
  "_PyBytes_FromStringAndSize", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyBytes_Type", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
  "_PyCFunction_Type", referenced from:
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      __ZL24__Pyx_PyObject_CallNoArgP7_object in libcantera.a(pythonExtensions.os)
  "_PyCapsule_GetName", referenced from:
      __ZL20__Pyx_ImportFunctionP7_objectPKcPPFvvES2_ in libcantera.a(pythonExtensions.os)
  "_PyCapsule_GetPointer", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
      __ZL20__Pyx_ImportFunctionP7_objectPKcPPFvvES2_ in libcantera.a(pythonExtensions.os)
  "_PyCapsule_IsValid", referenced from:
      __ZL20__Pyx_ImportFunctionP7_objectPKcPPFvvES2_ in libcantera.a(pythonExtensions.os)
  "_PyCode_NewEmpty", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "_PyDict_GetItemString", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
      __ZL20__Pyx_ImportFunctionP7_objectPKcPPFvvES2_ in libcantera.a(pythonExtensions.os)
  "_PyDict_New", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyDict_SetItem", referenced from:
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyDict_SetItemString", referenced from:
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyErr_Clear", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
  "_PyErr_ExceptionMatches", referenced from:
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
  "_PyErr_Fetch", referenced from:
      __ZN12_GLOBAL__N_122getPythonExceptionInfoEv in libcantera.a(PythonExtensionManager.os)
  "_PyErr_Format", referenced from:
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
      __ZL16__Pyx_ImportTypeP7_objectPKcS2_m26__Pyx_ImportType_CheckSize in libcantera.a(pythonExtensions.os)
      __ZL20__Pyx_ImportFunctionP7_objectPKcPPFvvES2_ in libcantera.a(pythonExtensions.os)
  "_PyErr_GivenExceptionMatches", referenced from:
      __ZL33__Pyx_PyErr_GivenExceptionMatchesP7_objectS0_ in libcantera.a(pythonExtensions.os)
  "_PyErr_NormalizeException", referenced from:
      __ZN12_GLOBAL__N_122getPythonExceptionInfoEv in libcantera.a(PythonExtensionManager.os)
  "_PyErr_Occurred", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
      __ZN12_GLOBAL__N_122getPythonExceptionInfoEv in libcantera.a(PythonExtensionManager.os)
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      __ZL24__Pyx_PyObject_CallNoArgP7_object in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
      ...
  "_PyErr_PrintEx", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
  "_PyErr_SetString", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      __ZL24__Pyx_PyObject_CallNoArgP7_object in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyErr_WarnEx", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
      __ZL16__Pyx_ImportTypeP7_objectPKcS2_m26__Pyx_ImportType_CheckSize in libcantera.a(pythonExtensions.os)
  "_PyErr_WriteUnraisable", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
  "_PyExc_AttributeError", referenced from:
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
  "_PyExc_BytesWarning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_DeprecationWarning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_FutureWarning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_ImportError", referenced from:
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
      __ZL20__Pyx_ImportFunctionP7_objectPKcPPFvvES2_ in libcantera.a(pythonExtensions.os)
  "_PyExc_ImportWarning", referenced from:
g++ -o build/lib/libcantera_shared.3.0.0.dylib -Wl,-rpath,/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib -dynamiclib -Wl,-current_version,3.0.0 -Wl,-compatibility_version,3.0.0 build/src/base/AnyMap.os build/src/base/Array.os build/src/base/ExtensionManagerFactory.os build/src/base/Interface.os build/src/base/Solution.os build/src/base/Units.os build/src/base/ValueCache.os build/src/base/YamlWriter.os build/src/base/checkFinite.os build/src/base/clockWC.os build/src/base/ctexceptions.os build/src/base/stringUtils.os build/src/base/application.os build/src/base/global.os build/src/thermo/BinarySolutionTabulatedThermo.os build/src/thermo/ConstCpPoly.os build/src/thermo/DebyeHuckel.os build/src/thermo/Elements.os build/src/thermo/GibbsExcessVPSSTP.os build/src/thermo/HMWSoln.os build/src/thermo/IdealGasPhase.os build/src/thermo/IdealMolalSoln.os build/src/thermo/IdealSolidSolnPhase.os build/src/thermo/IdealSolnGasVPSS.os build/src/thermo/IonsFromNeutralVPSSTP.os build/src/thermo/LatticePhase.os build/src/thermo/LatticeSolidPhase.os build/src/thermo/MargulesVPSSTP.os build/src/thermo/MaskellSolidSolnPhase.os build/src/thermo/MixtureFugacityTP.os build/src/thermo/MolalityVPSSTP.os build/src/thermo/Mu0Poly.os build/src/thermo/MultiSpeciesThermo.os build/src/thermo/Nasa9Poly1.os build/src/thermo/Nasa9PolyMultiTempRegion.os build/src/thermo/NasaPoly2.os build/src/thermo/PDSS.os build/src/thermo/PDSSFactory.os build/src/thermo/PDSS_ConstVol.os build/src/thermo/PDSS_HKFT.os build/src/thermo/PDSS_IdealGas.os build/src/thermo/PDSS_IonsFromNeutral.os build/src/thermo/PDSS_SSVol.os build/src/thermo/PDSS_Water.os build/src/thermo/PengRobinson.os build/src/thermo/Phase.os build/src/thermo/PlasmaPhase.os build/src/thermo/PureFluidPhase.os build/src/thermo/RedlichKisterVPSSTP.os build/src/thermo/RedlichKwongMFTP.os build/src/thermo/SingleSpeciesTP.os build/src/thermo/Species.os build/src/thermo/SpeciesThermoFactory.os build/src/thermo/SpeciesThermoInterpType.os build/src/thermo/StoichSubstance.os build/src/thermo/SurfPhase.os build/src/thermo/ThermoFactory.os build/src/thermo/ThermoPhase.os build/src/thermo/VPStandardStateTP.os build/src/thermo/WaterProps.os build/src/thermo/WaterPropsIAPWS.os build/src/thermo/WaterPropsIAPWSphi.os build/src/thermo/WaterSSTP.os build/src/tpx/CarbonDioxide.os build/src/tpx/HFC134a.os build/src/tpx/Heptane.os build/src/tpx/Hydrogen.os build/src/tpx/Methane.os build/src/tpx/Nitrogen.os build/src/tpx/Oxygen.os build/src/tpx/Sub.os build/src/tpx/Water.os build/src/tpx/utils.os build/src/equil/BasisOptimize.os build/src/equil/ChemEquil.os build/src/equil/MultiPhase.os build/src/equil/MultiPhaseEquil.os build/src/equil/vcs_MultiPhaseEquil.os build/src/equil/vcs_VolPhase.os build/src/equil/vcs_solve.os build/src/equil/vcs_solve_TP.os build/src/equil/vcs_util.os build/src/numerics/AdaptivePreconditioner.os build/src/numerics/BandMatrix.os build/src/numerics/CVodesIntegrator.os build/src/numerics/DAE_solvers.os build/src/numerics/DenseMatrix.os build/src/numerics/Func1.os build/src/numerics/FuncEval.os build/src/numerics/IDA_Solver.os build/src/numerics/ODE_integrators.os build/src/numerics/PreconditionerFactory.os build/src/numerics/ResidJacEval.os build/src/numerics/funcs.os build/src/numerics/polyfit.os build/src/kinetics/Arrhenius.os build/src/kinetics/BlowersMaselRate.os build/src/kinetics/BulkKinetics.os build/src/kinetics/ChebyshevRate.os build/src/kinetics/Custom.os build/src/kinetics/Falloff.os build/src/kinetics/GasKinetics.os build/src/kinetics/Group.os build/src/kinetics/ImplicitSurfChem.os build/src/kinetics/InterfaceKinetics.os build/src/kinetics/InterfaceRate.os build/src/kinetics/Kinetics.os build/src/kinetics/KineticsFactory.os build/src/kinetics/PlogRate.os build/src/kinetics/Reaction.os build/src/kinetics/ReactionPath.os build/src/kinetics/ReactionRateFactory.os build/src/kinetics/TwoTempPlasmaRate.os build/src/kinetics/solveSP.os build/src/transport/DustyGasTransport.os build/src/transport/GasTransport.os build/src/transport/HighPressureGasTransport.os build/src/transport/IonGasTransport.os build/src/transport/MMCollisionInt.os build/src/transport/MixTransport.os build/src/transport/MultiTransport.os build/src/transport/Transport.os build/src/transport/TransportData.os build/src/transport/TransportFactory.os build/src/transport/WaterTransport.os build/src/oneD/Boundary1D.os build/src/oneD/Domain1D.os build/src/oneD/IonFlow.os build/src/oneD/MultiJac.os build/src/oneD/MultiNewton.os build/src/oneD/OneDim.os build/src/oneD/Sim1D.os build/src/oneD/StFlow.os build/src/oneD/refine.os build/src/zeroD/ConstPressureMoleReactor.os build/src/zeroD/ConstPressureReactor.os build/src/zeroD/FlowDevice.os build/src/zeroD/FlowDeviceFactory.os build/src/zeroD/FlowReactor.os build/src/zeroD/IdealGasConstPressureMoleReactor.os build/src/zeroD/IdealGasConstPressureReactor.os build/src/zeroD/IdealGasMoleReactor.os build/src/zeroD/IdealGasReactor.os build/src/zeroD/MoleReactor.os build/src/zeroD/Reactor.os build/src/zeroD/ReactorBase.os build/src/zeroD/ReactorFactory.os build/src/zeroD/ReactorNet.os build/src/zeroD/ReactorSurface.os build/src/zeroD/Wall.os build/src/zeroD/WallFactory.os build/src/zeroD/flowControllers.os build/src/clib/ct.os build/src/clib/ctfunc.os build/src/clib/ctmultiphase.os build/src/clib/ctonedim.os build/src/clib/ctreactor.os build/src/clib/ctrpath.os build/src/clib/ctsurf.os build/src/extensions/pythonExtensions.os build/src/extensions/PythonExtensionManager.os -Lbuild/lib -L/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib -L/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib/python3.10/config-3.10-darwin -L/opt/homebrew/Caskroom/miniforge/base/envs/cantera-dev/lib -lpython3.10 -ldl -lsundials_cvodes -lsundials_ida -lsundials_nvecserial -lsundials_sunlinsollapackdense -lsundials_sunlinsollapackband -lfmt -lyaml-cpp -framework Accelerate      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_NameError", referenced from:
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyExc_PendingDeprecationWarning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_ResourceWarning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_RuntimeError", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyExc_RuntimeWarning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_StopIteration", referenced from:
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
  "_PyExc_SyntaxWarning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_SystemError", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      __ZL24__Pyx_PyObject_CallNoArgP7_object in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
  "_PyExc_TypeError", referenced from:
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
      __ZL16__Pyx_ImportTypeP7_objectPKcS2_m26__Pyx_ImportType_CheckSize in libcantera.a(pythonExtensions.os)
      __ZL20__Pyx_ImportFunctionP7_objectPKcPPFvvES2_ in libcantera.a(pythonExtensions.os)
  "_PyExc_UnicodeWarning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_UserWarning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyExc_ValueError", referenced from:
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
      __ZL16__Pyx_ImportTypeP7_objectPKcS2_m26__Pyx_ImportType_CheckSize in libcantera.a(pythonExtensions.os)
  "_PyExc_Warning", referenced from:
      __GLOBAL__sub_I_pythonExtensions.cpp in libcantera.a(pythonExtensions.os)
  "_PyFrame_New", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "_PyImport_AddModule", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyImport_GetModuleDict", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyImport_Import", referenced from:
      __ZN7Cantera22PythonExtensionManager20registerRateBuildersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in libcantera.a(PythonExtensionManager.os)
  "_PyImport_ImportModule", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyImport_ImportModuleLevelObject", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyInterpreterState_GetID", referenced from:
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
  "_PyList_New", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyList_Type", referenced from:
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
  "_PyMem_Malloc", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "_PyMem_Realloc", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "_PyMethod_Type", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
  "_PyModuleDef_Init", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
      _PyInit_pythonExtensions in libcantera.a(pythonExtensions.os)
  "_PyModule_ExecDef", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
  "_PyModule_FromDefAndSpec2", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
  "_PyModule_GetDict", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyModule_GetName", referenced from:
      __ZL20__Pyx_ImportFunctionP7_objectPKcPPFvvES2_ in libcantera.a(pythonExtensions.os)
  "_PyModule_NewObject", referenced from:
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
  "_PyNumber_InPlaceAdd", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
  "_PyOS_snprintf", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
      __ZL16__Pyx_ImportTypeP7_objectPKcS2_m26__Pyx_ImportType_CheckSize in libcantera.a(pythonExtensions.os)
  "_PyObject_Call", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      __ZL24__Pyx_PyObject_CallNoArgP7_object in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
  "_PyObject_GetAttr", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyObject_GetAttrString", referenced from:
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
      __ZL16__Pyx_ImportTypeP7_objectPKcS2_m26__Pyx_ImportType_CheckSize in libcantera.a(pythonExtensions.os)
      __ZL20__Pyx_ImportFunctionP7_objectPKcPPFvvES2_ in libcantera.a(pythonExtensions.os)
  "_PyObject_GetItem", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyObject_GetIter", referenced from:
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
  "_PyObject_Hash", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyObject_Not", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "_PyObject_SetAttr", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyObject_SetAttrString", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyThreadState_Get", referenced from:
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
  "_PyTraceBack_Here", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "_PyTuple_New", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyTuple_Pack", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyTuple_Type", referenced from:
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
  "_PyType_IsSubtype", referenced from:
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      __ZL24__Pyx_PyObject_CallNoArgP7_object in libcantera.a(pythonExtensions.os)
  "_PyUnicode_AsUTF8", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "_PyUnicode_Concat", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
  "_PyUnicode_Decode", referenced from:
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyUnicode_FromFormat", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "_PyUnicode_FromString", referenced from:
      __ZN7Cantera22PythonExtensionManager20registerRateBuildersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in libcantera.a(PythonExtensionManager.os)
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
  "_PyUnicode_FromStringAndSize", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyUnicode_InternFromString", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_PyUnicode_Join", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
  "_PyUnicode_Type", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
  "_Py_BuildValue", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
  "_Py_EnterRecursiveCall", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      __ZL24__Pyx_PyObject_CallNoArgP7_object in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
  "_Py_GetVersion", referenced from:
      __ZL33__pyx_pymod_exec_pythonExtensionsP7_object in libcantera.a(pythonExtensions.os)
  "_Py_Initialize", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
  "_Py_IsInitialized", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
  "_Py_LeaveRecursiveCall", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      __ZL24__Pyx_PyObject_CallNoArgP7_object in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
  "_Py_SetProgramName", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
  "__PyDict_GetItem_KnownHash", referenced from:
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
  "__PyNamespace_New", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
  "__PyObject_GetDictPtr", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "__PyThreadState_UncheckedGet", referenced from:
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
  "__Py_Dealloc", referenced from:
      __ZN7Cantera22PythonExtensionManagerC2Ev in libcantera.a(PythonExtensionManager.os)
      __ZN7Cantera22PythonExtensionManager20registerRateBuildersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in libcantera.a(PythonExtensionManager.os)
      __ZN12_GLOBAL__N_122getPythonExceptionInfoEv in libcantera.a(PythonExtensionManager.os)
      __ZN12_GLOBAL__N_112PythonHandleD1Ev in libcantera.a(PythonExtensionManager.os)
      __ZN12_GLOBAL__N_112PythonHandleD0Ev in libcantera.a(PythonExtensionManager.os)
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      __ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ in libcantera.a(pythonExtensions.os)
      ...
  "__Py_FalseStruct", referenced from:
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
  "__Py_NoneStruct", referenced from:
      __ZN12_GLOBAL__N_122getPythonExceptionInfoEv in libcantera.a(PythonExtensionManager.os)
      _ct_getExceptionString in libcantera.a(pythonExtensions.os)
      _ct_newPythonExtensibleRate in libcantera.a(pythonExtensions.os)
      _ct_registerReactionDelegators in libcantera.a(pythonExtensions.os)
      __ZL18__pyx_pymod_createP7_objectP11PyModuleDef in libcantera.a(pythonExtensions.os)
  "__Py_TrueStruct", referenced from:
      __ZL18__Pyx_AddTracebackPKciiS0_ in libcantera.a(pythonExtensions.os)
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
scons: *** [build/lib/libcantera_fortran_shared.3.0.0.dylib] Error 1
Create symlinks for: 'build/lib/libcantera_shared.3.0.0.dylib'
    'build/lib/libcantera_shared.3.dylib'->'build/lib/libcantera_shared.3.0.0.dylib'
    'build/lib/libcantera_shared.dylib'->'build/lib/libcantera_shared.3.0.0.dylib'
install_name_tool -id @rpath/libcantera_shared.3.0.0.dylib /Volumes/Data/work/GitHub/cantera/build/lib/libcantera_shared.3.0.0.dylib
scons: building terminated because of errors.

System information

bryanwweber commented 2 years ago

How was gfortran installed? Which Python is running SCons and which is used for the Python package? Which C/C++ compiler is being used? If they're not all from conda, I'm not surprised you're getting an error here. macOS doesn't provide a FORTRAN compiler and gfortran isn't compatible with the Apple Clang compiler, AFAIK.

ischoegl commented 2 years ago

@bryanwweber ...

(base) % conda activate cantera-dev
(cantera-dev) % g++ --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
(cantera-dev) % gfortran --version
GNU Fortran (Homebrew GCC 12.2.0) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(cantera-dev) % python --version
Python 3.10.5

Fwiw, the cantera.conf file only sets verbose_tests.

I'm not surprised you're getting an error here. macOS doesn't provide a FORTRAN compiler and gfortran isn't compatible with the Apple Clang compiler, AFAIK.

Until yesterday, everything was working nicely within my conda environment, so at least to me this is surprising - before, linking to clib appears to have worked. The error log is clearly pointing at PythonExtensibleRate; I haven't had a chance yet to compile on an Intel Mac, but I assume that it's not specific to Apple Silicon.

bryanwweber commented 2 years ago

Fair enough! Last time I tried to mix gfortran and Apple clang, it was bad news bears, although I don't recall the precise error ☺️

ischoegl commented 2 years ago

:+1: ... since I only recently started to compile on macOS, I had assumed that it 'just worked'. I haven't seen any issues on Intel macOS, although I ran into #1379 on Apple silicon (which presumably is a string handling issue).

bryanwweber commented 2 years ago

My understanding is that the linker needs to point your executable/library at the file offset of the function it needs in the libc shared object (which is the underlying layer for most everything). As gfortran is a GNU project, it does things one way; Apple's Clang does things a different way, and you get possible ABI (application binary interface) incompatibilities. Annoyingly, Apple provides g++ and gcc wrappers (or maybe they're symlinks) to their own clang++/clang, effectively hiding that you're not using the real gcc/g++. Anyhow, I am curious if this issue or the other one is resolved by using gcc/g++ from homebrew with gfortran.

ischoegl commented 2 years ago

As gfortran is a GNU project, it does things one way; Apple's Clang does things a different way, and you get possible ABI (application binary interface) incompatibilities.

From a user perspective, I see two possibilities here: it should either work without restrictions, or be blocked by SCons.

As an aside, it is not limited to Apple Silicon (as expected), and things build if you set f90_interface=n (which is hardly a surprise).

mefuller commented 2 years ago

I'm not so familiar with clang, but if it's LLVM, could the Flang compiler be used for Apple machines instead of gFortran?

ischoegl commented 2 years ago

After running into an unrelated issue with Intel compilers (again, gfortran was "helpfully" detected, leading to a compilation of the f90_interface based on default options), I am starting to think that mixing compilers may not be a good idea in general. If there's a consensus, I'd rather just 'block' them for f90_interface=default unless consistent build tools are used.

bryanwweber commented 2 years ago

Yes, if you were using the clang from Homebrew, I think you'd use flang also from homebrew. My understanding is that the key is really that the linker has to be compatible between the compilers. Apple makes unknown modifications to their version of the compilers/linker, so there's no guarantee of error-free behavior with anything other than the Apple system root, if you're using the Apple compiler set. And Apple doesn't distribute a Fortran compiler.

If you're using GCC entirely, or LLVM entirely (not Apple's version), then you should also expect error free behavior (except for bugs and user error ☺️). It's mixing things that's usually the problem.

bryanwweber commented 2 years ago

I am starting to think that mixing compilers may not be a good idea in general.

This is a very bad idea in general ☺️

If there's a consensus, I'd rather just 'block' them for f90_interface=default unless consistent build tools are used

👍 from me on this. To avoid having to add too much logic, I'd suggest relying on the existing check for Apple's compilers and set f90_interface to n if it's been left as default. If someone explicitly configures f90_interface=y, caveat emptor ☺️ I'd personally avoid trying to implement a general check for mixing compilers, there are too many rabbit holes there of different versions and such, it doesn't seem worth it, and macos with default Apple compilers seems to be the main place this comes up

ischoegl commented 2 years ago

I'd suggest relying on the existing check for Apple's compilers and set f90_interface to n if it's been left as default.

:+1: sounds reasonable.

speth commented 2 years ago

Isn't the issue in this case just that we're failing to link to libpython3.X? I guess this is an oversight on my part in the SCons updates for #1382. I think the reason why it doesn't cause the same problem on Linux, where we are more likely to have the Fortran module enabled, is because the linker there doesn't check for all the symbols being available until you're linking an executable rather than a library.

speth commented 1 year ago

This issue was fixed by #1429 (though the other separately-reported issues with using the Fortran interface on macOS remain).