dtamayo / reboundx

A library for adding additional forces to the REBOUND N-body integration package
GNU General Public License v3.0
80 stars 60 forks source link

Could not install reboundx due to 'wheels error' #131

Closed turner-julian closed 2 months ago

turner-julian commented 2 months ago

I tried installing reboundx in the Spyder (5.4.3) terminal with python 3.11 but got a "could not build wheels for reboundx" error.

I am running macOS (14.4) and I have REBOUND 4.4.1 and setuptools (70.1.1) installed.

Here is the terminal output:

In [3]: pip install reboundx

Collecting reboundx

  Using cached reboundx-4.2.0.tar.gz (92 kB)

  Installing build dependencies ... [?25ldone

etting requirements to build wheel ... e

g metadata (pyproject.toml) ... [?25ldone

irement already satisfied: rebound>=4.0.0 in /opt/homebrew/anaconda3/lib/python3.11/site-packages (from reboundx) (4.4.1)

Building wheels for collected packages: reboundx

  Building wheel for reboundx (pyproject.toml) ... [?25lerror

  error: subprocess-exited-with-error

  × Building wheel for reboundx (pyproject.toml) did not run successfully.

  │ exit code: 1

  ╰─> [60 lines of output]

      fatal: not a git repository (or any of the parent directories): .git

      running bdist_wheel

      running build

      running build_py

      creating build

      creating build/lib.macosx-11.1-arm64-cpython-311

      creating build/lib.macosx-11.1-arm64-cpython-311/reboundx

      copying reboundx/extras.py -> build/lib.macosx-11.1-arm64-cpython-311/reboundx

      copying reboundx/params.py -> build/lib.macosx-11.1-arm64-cpython-311/reboundx

      copying reboundx/tools.py -> build/lib.macosx-11.1-arm64-cpython-311/reboundx

      copying reboundx/constants.py -> build/lib.macosx-11.1-arm64-cpython-311/reboundx

      copying reboundx/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/reboundx

      copying reboundx/simulationarchive.py -> build/lib.macosx-11.1-arm64-cpython-311/reboundx

      copying reboundx/testing.py -> build/lib.macosx-11.1-arm64-cpython-311/reboundx

      copying reboundx/data.py -> build/lib.macosx-11.1-arm64-cpython-311/reboundx

      running build_ext

      *** /private/var/folders/yl/0_w56qsd0135bwfg4q_4v8km0000gn/T/pip-build-env-11ory4bm/overlay/lib/python3.11/site-packages/rebound *** /opt/homebrew/anaconda3/lib/python3.11/site-packages/ ***

      building 'libreboundx' extension

      creating build/temp.macosx-11.1-arm64-cpython-311

      creating build/temp.macosx-11.1-arm64-cpython-311/src

      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -DLIBREBOUNDX -Isrc -I/opt/homebrew/anaconda3/include/python3.11 -I/private/var/folders/yl/0_w56qsd0135bwfg4q_4v8km0000gn/T/pip-build-env-11ory4bm/overlay/lib/python3.11/site-packages/rebound -c src/central_force.c -o build/temp.macosx-11.1-arm64-cpython-311/src/central_force.o -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DREBXGITHASH=4b1377fe3337271cdd67013199ae2fd792ed5601 -DLIBREBOUNDX -D_GNU_SOURCE -fPIC

      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -DLIBREBOUNDX -Isrc -I/opt/homebrew/anaconda3/include/python3.11 -I/private/var/folders/yl/0_w56qsd0135bwfg4q_4v8km0000gn/T/pip-build-env-11ory4bm/overlay/lib/python3.11/site-packages/rebound -c src/core.c -o build/temp.macosx-11.1-arm64-cpython-311/src/core.o -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DREBXGITHASH=4b1377fe3337271cdd67013199ae2fd792ed5601 -DLIBREBOUNDX -D_GNU_SOURCE -fPIC

      src/core.c:557:12: warning: 9 enumeration values not handled in switch: 'REB_INTEGRATOR_SEI', 'REB_INTEGRATOR_LEAPFROG', 'REB_INTEGRATOR_NONE'... [-Wswitch]

          switch(sim->integrator){

                 ^~~~~~~~~~~~~~~

      src/core.c:557:12: note: add missing switch cases

          switch(sim->integrator){

                 ^

      src/core.c:857:18: warning: incompatible pointer types passing 'void **' to parameter of type 'struct rebx_node **' [-Wincompatible-pointer-types]

          rebx_free_ap(&p->ap);

                       ^~~~~~

      src/core.c:845:38: note: passing argument to parameter 'ap' here

      void rebx_free_ap(struct rebx_node** ap){

                                           ^

      2 warnings generated.

      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -DLIBREBOUNDX -Isrc -I/opt/homebrew/anaconda3/include/python3.11 -I/private/var/folders/yl/0_w56qsd0135bwfg4q_4v8km0000gn/T/pip-build-env-11ory4bm/overlay/lib/python3.11/site-packages/rebound -c src/exponential_migration.c -o build/temp.macosx-11.1-arm64-cpython-311/src/exponential_migration.o -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DREBXGITHASH=4b1377fe3337271cdd67013199ae2fd792ed5601 -DLIBREBOUNDX -D_GNU_SOURCE -fPIC

      src/exponential_migration.c:79:18: warning: unused variable 'r2' [-Wunused-variable]

          const double r2 = dx*dx + dy*dy + dz*dz;

                       ^

      1 warning generated.

      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -DLIBREBOUNDX -Isrc -I/opt/homebrew/anaconda3/include/python3.11 -I/private/var/folders/yl/0_w56qsd0135bwfg4q_4v8km0000gn/T/pip-build-env-11ory4bm/overlay/lib/python3.11/site-packages/rebound -c src/gas_dynamical_friction.c -o build/temp.macosx-11.1-arm64-cpython-311/src/gas_dynamical_friction.o -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DREBXGITHASH=4b1377fe3337271cdd67013199ae2fd792ed5601 -DLIBREBOUNDX -D_GNU_SOURCE -fPIC

      src/gas_dynamical_friction.c:126:28: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]

              const double vert=(abs(diff.z)<(10*h))?exp(-diff.z*diff.z/(2.0*h*h)):0;

                                 ^

      src/gas_dynamical_friction.c:126:28: note: use function 'fabs' instead

              const double vert=(abs(diff.z)<(10*h))?exp(-diff.z*diff.z/(2.0*h*h)):0;

                                 ^~~

                                 fabs

      1 warning generated.

      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -DLIBREBOUNDX -Isrc -I/opt/homebrew/anaconda3/include/python3.11 -I/private/var/folders/yl/0_w56qsd0135bwfg4q_4v8km0000gn/T/pip-build-env-11ory4bm/overlay/lib/python3.11/site-packages/rebound -c src/gr.c -o build/temp.macosx-11.1-arm64-cpython-311/src/gr.o -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DREBXGITHASH=4b1377fe3337271cdd67013199ae2fd792ed5601 -DLIBREBOUNDX -D_GNU_SOURCE -fPIC

      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/anaconda3/include -arch arm64 -DLIBREBOUNDX -Isrc -I/opt/homebrew/anaconda3/include/python3.11 -I/private/var/folders/yl/0_w56qsd0135bwfg4q_4v8km0000gn/T/pip-build-env-11ory4bm/overlay/lib/python3.11/site-packages/rebound -c src/gr_full.c -o build/temp.macosx-11.1-arm64-cpython-311/src/gr_full.o -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DREBXGITHASH=4b1377fe3337271cdd67013199ae2fd792ed5601 -DLIBREBOUNDX -D_GNU_SOURCE -fPIC

      src/gr_full.c:278:27: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]

                          const dotproduct = dxij*ps_b[j].ax+dyij*ps_b[j].ay+dzij*ps_b[j].az;

                          ~~~~~ ^

                          int

      src/gr_full.c:374:20: warning: variable 'sumk' set but not used [-Wunused-but-set-variable]

                  double sumk = 0.;

                         ^

      1 warning 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 reboundx

ailed to build reboundx

ERROR: Could not build wheels for reboundx, which is required to install pyproject.toml-based projects

Note: you may need to restart the kernel to use updated packages.

In [4]: 
acpetit commented 2 months ago

I have the same error from trying to install the latest version (4.2.0) from the github repository (Mac OS 14.5, python 3.12 and 3.11 in conda envs, rebound 4.4.1 local install too).

hannorein commented 2 months ago

Thanks. I've opened a PR which should fix this issue.

dtamayo commented 2 months ago

Thanks all