Closed MadNietzsche closed 1 month ago
Hi @MadNietzsche, the error message you are getting is because cmake is trying to build amici for a x86_64
architecture (wrong) and then runs into issues when linking external libraries that were build for arm64
(correct).
Conda has a pretty bad track record in terms of touching compiler flags it shouldn't touch, so I am guessing that that it's the culprit. Could you try installing amici in a new conda environment created using CONDA_SUBDIR=osx-arm64 conda create
?
Hi Fabian - Thank you for your timely reply!
The error has now changed to no matching constructor for initialization of 'amici::IDASolver'
, while I am getting a warning about tp_print
being deprecated. Any ideas?
Changed extra_compile_args for unix to ['-std=c++14']
building 'amici._amici' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -stdlib=libc++ -DAMICI_SWIG_WITHOUT_HDF5 -Iamici/include -Iamici/ThirdParty/gsl -Iamici/ThirdParty/sundials/include -Iamici/ThirdParty/sundials/src -Iamici/ThirdParty/sundials/src/sundials -Iamici/ThirdParty/SuiteSparse/KLU/Include -Iamici/ThirdParty/SuiteSparse/AMD/Include -Iamici/ThirdParty/SuiteSparse/COLAMD/Include -Iamici/ThirdParty/SuiteSparse/BTF/Include -Iamici/ThirdParty/SuiteSparse/SuiteSparse_config -Iamici/ThirdParty/SuiteSparse/include -Iamici/ThirdParty/SuiteSparse/KLU/Include -Iamici/ThirdParty/SuiteSparse/AMD/Include -Iamici/ThirdParty/SuiteSparse/COLAMD/Include -Iamici/ThirdParty/SuiteSparse/BTF/Include -Iamici/ThirdParty/SuiteSparse/SuiteSparse_config -Iamici/ThirdParty/SuiteSparse/include -I/private/var/folders/kj/f8dkpgvs5fqf4vprt8x28ndm0000gq/T/pip-build-env-81yv9_0w/overlay/lib/python3.8/site-packages/numpy/core/include -I/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8 -c amici/amici_wrap.cxx -o build/temp.macosx-12.6-arm64-cpython-38/amici/amici_wrap.o -std=c++14
amici/amici_wrap.cxx:1503:7: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
0, /* tp_print */
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
In file included from amici/amici_wrap.cxx:199:
In file included from /Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/Python.h:85:
In file included from /Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/pytime.h:6:
In file included from /Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/object.h:746:
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/cpython/object.h:177:16: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
typedef struct _typeobject {
^
amici/amici_wrap.cxx:1516:18: note: in implicit copy assignment operator for '_typeobject' first required here
varlink_type = tmp;
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
In file included from amici/amici_wrap.cxx:199:
In file included from /Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/Python.h:85:
In file included from /Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/pytime.h:6:
In file included from /Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/object.h:746:
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/cpython/object.h:177:16: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
typedef struct _typeobject {
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
amici/amici_wrap.cxx:2133:7: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
0, /* tp_print */
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
amici/amici_wrap.cxx:2349:7: warning: 'tp_print' is deprecated [-Wdeprecated-declarations]
0, /* tp_print */
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here
Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
^
/Users/aaguilar/.pyenv/versions/3.8.14/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
amici/amici_wrap.cxx:53558:42: error: no matching constructor for initialization of 'amici::IDASolver'
result = (amici::IDASolver *)new amici::IDASolver((amici::Solver const &)*arg1);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
amici/include/amici/solver_idas.h:28:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const amici::Solver' to 'const amici::IDASolver' for 1st argument
class IDASolver : public Solver {
^
amici/include/amici/solver_idas.h:28:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
amici/amici_wrap.cxx:54731:44: error: no matching constructor for initialization of 'amici::CVodeSolver'
result = (amici::CVodeSolver *)new amici::CVodeSolver((amici::Solver const &)*arg1);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
amici/include/amici/solver_cvodes.h:31:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const amici::Solver' to 'const amici::CVodeSolver' for 1st argument
class CVodeSolver : public Solver {
^
amici/include/amici/solver_cvodes.h:31:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
5 warnings and 2 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
error: subprocess-exited-with-error
× Building wheel for amici (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /Users/aaguilar/.pyenv/versions/3.8.14/bin/python3.8 /Users/aaguilar/.pyenv/versions/3.8.14/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/kj/f8dkpgvs5fqf4vprt8x28ndm0000gq/T/tmp4wx1cgm5
cwd: /private/var/folders/kj/f8dkpgvs5fqf4vprt8x28ndm0000gq/T/pip-install-1c52olr1/amici_b91d0eba4f474e4ca1c0c8ae436cc94a
Building wheel for amici (pyproject.toml) ... error
ERROR: Failed building wheel for amici
Failed to build amici
ERROR: Could not build wheels for amici, which is required to install pyproject.toml-based projects
Hi @MadNietzsche, it looks like you changed to Python3.8 - this will give you a rather old version of amici. Please retry with a more recent Python version.
Closing assuming the issue was fixed.
Dear AMICI Team,
I have encountered an issue while installing AMICI on my Mac M1 with Anaconda. I have followed the documentation verbatim and have arrived to an architecture error. Both
pip install amici
andCFLAGS="-stdlib=libc++" CC=clang CXX=clang pip3 install --verbose amici
gives similar errors. Could anyone help me to look into this?OS Details:
Hardware Overview:
Model Name: MacBook Air Model Identifier: MacBookAir10,1 Chip: Apple M1 Total Number of Cores: 8 (4 performance and 4 efficiency) Memory: 16 GB System Firmware Version: 10151.101.3 OS Loader Version: 10151.101.3 Serial Number (system): FVFHW11PQ6LR
Python Version:
The error messages are quite large. Here is the one for
CFLAGS="-stdlib=libc++" CC=clang CXX=clang pip3 install --verbose amici
onLet me know if more details are needed
FYI @matthiaskoenig