asammdf icon indicating copy to clipboard operation
asammdf copied to clipboard

Installation failing on MacBook M2 Pro with Sonoma 14.4.1

Open joshiji opened this issue 1 year ago • 11 comments

Python version

('python=3.9.6 (default, Aug 11 2023, 19:44:49) \n'
 '[Clang 15.0.0 (clang-1500.0.40.1)]')
'os=macOS-14.4.1-arm64-arm-64bit'

Description

When I am running pip install asammdf, it is failing to compile cutils.o. Following is the log output starting at failing part. Please let me know if full output will help in resolving this:

...
      creating build/temp.macosx-10.9-universal2-cpython-39
      creating build/temp.macosx-10.9-universal2-cpython-39/src
      creating build/temp.macosx-10.9-universal2-cpython-39/src/asammdf
      creating build/temp.macosx-10.9-universal2-cpython-39/src/asammdf/blocks
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -Wno-error=unreachable-code -I/private/var/folders/bz/hsz3cjcd1cx0fvs8cgcfqzwh0000gn/T/pip-build-env-htz4l547/overlay/lib/python3.9/site-packages/numpy/_core/include -I/Users/santosh/dev/area51/ridot_telemetry/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c src/asammdf/blocks/cutils.c -o build/temp.macosx-10.9-universal2-cpython-39/src/asammdf/blocks/cutils.o -std=c99
      src/asammdf/blocks/cutils.c:253:20: error: no member named 'elsize' in 'struct _PyArray_Descr'
                  descr->elsize = max;
                  ~~~~~  ^
      src/asammdf/blocks/cutils.c:361:24: warning: unused variable 'current_size' [-Wunused-variable]
          unsigned long long current_size = 0, * offsets_array;
                             ^
      src/asammdf/blocks/cutils.c:1241:28: warning: comparison of integers of different signs: 'int' and 'unsigned long long' [-Wsign-compare]
                  for (int i=0; i<cycles; i++) {
                                ~^~~~~~~
      src/asammdf/blocks/cutils.c:1272:16: warning: incompatible pointer types assigning to 'PyArrayObject *' (aka 'struct tagPyArrayObject *') from 'PyObject *' (aka 'struct _object *') [-Wincompatible-pointer-types]
              result = PyArray_ZEROS(1, dims, NPY_BOOL, 0);
                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      3 warnings and 1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for asammdf
Failed to build asammdf
ERROR: Could not build wheels for asammdf, which is required to install pyproject.toml-based projects

joshiji avatar Jun 17 '24 20:06 joshiji

For now, I was able to install using --prefer-binary option for pip install.

joshiji avatar Jun 17 '24 20:06 joshiji

Thanks that worked well to install it. However then I run into a numpy problem...

    from .cutils import get_channel_raw_bytes
ImportError: numpy.core.multiarray failed to import

KingJuleZ avatar Jun 17 '24 21:06 KingJuleZ

For now you should not use asammdf in combination with numpy 2.0.0

danielhrisca avatar Jun 18 '24 03:06 danielhrisca

Hi Daniel, could you add more details on that? My pip doesn't find no version 2.0.0 of jumpy. However, @joshiji 's solution works for now...

KingJuleZ avatar Jun 18 '24 06:06 KingJuleZ

It was a typo. Numpy

danielhrisca avatar Jun 18 '24 06:06 danielhrisca

Alright got that, thanks for the great work!

KingJuleZ avatar Jun 18 '24 06:06 KingJuleZ

@KingJuleZ I realised that --prefer-binary installed v6 of asammdf, which is like four years old. There don't seem to be binary wheels available for Apple Silicon Macs for new version.

joshiji avatar Jun 18 '24 08:06 joshiji

Oh okay, however for my code it does the job

KingJuleZ avatar Jun 19 '24 08:06 KingJuleZ

Any update regarding this? I am also facing the same problem with python 3.11.7

annotated-types 0.7.0 anyio 4.4.0 attrs 23.2.0 canmatrix 1.0 click 8.1.7 coverage 7.5.4 deltalake 0.18.2 fastapi 0.109.2 future 1.0.0 gunicorn 20.1.0 h11 0.14.0 idna 3.7 iniconfig 2.0.0 lxml 5.2.2 lz4 4.3.3 natsort 8.4.0 numexpr 2.10.1 numpy 2.0.0 packaging 24.1 pandas 2.2.0 pip 23.2.1 pluggy 1.5.0 pyarrow 15.0.0 pyarrow-hotfix 0.6 pydantic 2.6.1 pydantic_core 2.16.2 pytest 8.0.0 pytest-cov 4.1.0 pytest-snapshot 0.9.0 python-dateutil 2.9.0.post0 pytz 2024.1 setuptools 65.5.0 six 1.16.0 sniffio 1.3.1 starlette 0.36.3 typing_extensions 4.12.2 tzdata 2024.1 uvicorn 0.27.0.post1 wheel 0.43.0

MehdiJaiemMHP avatar Jul 10 '24 11:07 MehdiJaiemMHP

Any update regarding this? I am also facing the same problem with python 3.11.7

annotated-types 0.7.0 anyio 4.4.0 attrs 23.2.0 canmatrix 1.0 click 8.1.7 coverage 7.5.4 deltalake 0.18.2 fastapi 0.109.2 future 1.0.0 gunicorn 20.1.0 h11 0.14.0 idna 3.7 iniconfig 2.0.0 lxml 5.2.2 lz4 4.3.3 natsort 8.4.0 numexpr 2.10.1 numpy 2.0.0 packaging 24.1 pandas 2.2.0 pip 23.2.1 pluggy 1.5.0 pyarrow 15.0.0 pyarrow-hotfix 0.6 pydantic 2.6.1 pydantic_core 2.16.2 pytest 8.0.0 pytest-cov 4.1.0 pytest-snapshot 0.9.0 python-dateutil 2.9.0.post0 pytz 2024.1 setuptools 65.5.0 six 1.16.0 sniffio 1.3.1 starlette 0.36.3 typing_extensions 4.12.2 tzdata 2024.1 uvicorn 0.27.0.post1 wheel 0.43.0

I'm using asammdf==7.4.5 and it is ok for me. Did you try this version?

MatheusAndrade97 avatar Jul 11 '24 09:07 MatheusAndrade97

@MatheusAndrade97 Yes I also installed that version, and it worked, but we would have liked to stay synchronized and use one common virtual environment for the team since they are using an earlier version

MehdiJaiemMHP avatar Jul 11 '24 10:07 MehdiJaiemMHP