matthewholman / assist

ASSIST is a software package for ephemeris-quality integrations of test particles.
https://assist.readthedocs.io/
GNU General Public License v3.0
24 stars 10 forks source link

pip install failing for assit #94

Closed mschwamb closed 11 months ago

mschwamb commented 1 year ago

I'm getting errors when trying to install assist with pip and Python 3.9.18 | packaged by conda-forge | (main, Aug 30 2023, 03:53:08)

mschwamb@cider:~$ pip install assist Collecting assist Downloading assist-1.1.4.tar.gz (47 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 47.0/47.0 kB 769.9 kB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting rebound>=3.10.0 (from assist) Using cached rebound-4.0.1-cp39-cp39-macosx_11_0_arm64.whl.metadata (9.7 kB) Collecting numpy (from assist) Using cached numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl.metadata (61 kB) Using cached rebound-4.0.1-cp39-cp39-macosx_11_0_arm64.whl (233 kB) Using cached numpy-1.26.2-cp39-cp39-macosx_11_0_arm64.whl (14.0 MB) Building wheels for collected packages: assist Building wheel for assist (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for assist (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [58 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-39 creating build/lib.macosx-11.1-arm64-cpython-39/assist copying assist/extras.py -> build/lib.macosx-11.1-arm64-cpython-39/assist copying assist/init.py -> build/lib.macosx-11.1-arm64-cpython-39/assist copying assist/ephem.py -> build/lib.macosx-11.1-arm64-cpython-39/assist copying assist/py.typed -> build/lib.macosx-11.1-arm64-cpython-39/assist running build_ext building 'libassist' extension creating build/temp.macosx-11.1-arm64-cpython-39 creating build/temp.macosx-11.1-arm64-cpython-39/src clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/mschwamb/mambaforge/envs/assist/include -arch arm64 -I/Users/mschwamb/mambaforge/envs/assist/include -fPIC -O2 -isystem /Users/mschwamb/mambaforge/envs/assist/include -arch arm64 -DLIBASSIST -Isrc -I/Users/mschwamb/mambaforge/envs/assist/include/python3.9 -I/private/var/folders/ss/8zqns7xj6jd1kj4q3y81kg500000gn/T/pip-build-env-5suqi78x/normal/lib/python3.9/site-packages/rebound -c src/assist.c -o build/temp.macosx-11.1-arm64-cpython-39/src/assist.o -fstrict-aliasing -O3 -std=c99 -fPIC -D_GNU_SOURCE -Wpointer-arith -DASSISTGITHASH=76ae72ccd4dc2b706ce638a30bb59f597476f717 src/assist.c:195:32: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] for (int m=0; m<sizeof(massmap); m+=2){ ~^~~~ src/assist.c:363:9: error: call to undeclared function 'reb_error'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] reb_error(assist->sim, msg); ^ src/assist.c:452:36: error: variable has incomplete type 'enum reb_input_binary_messages' enum reb_input_binary_messages warnings = REB_INPUT_BINARY_WARNING_NONE; ^ src/assist.c:452:10: note: forward declaration of 'enum reb_input_binary_messages' enum reb_input_binary_messages warnings = REB_INPUT_BINARY_WARNING_NONE; ^ src/assist.c:453:33: error: call to undeclared function 'reb_create_simulation'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] struct reb_simulation r2 = reb_create_simulation(); ^ src/assist.c:453:28: warning: incompatible integer to pointer conversion initializing 'struct reb_simulation ' with an expression of type 'int' [-Wint-conversion] struct reb_simulation r2 = reb_create_simulation(); ^ ~~~~~~~ src/assist.c:454:5: error: call to undeclared function 'reb_create_simulation_from_simulationarchive_with_messages'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] reb_create_simulation_from_simulationarchive_with_messages(r2, sa, blob-1, &warnings); ^ src/assist.c:454:5: note: did you mean 'reb_simulation_create_from_simulationarchive_with_messages'? /private/var/folders/ss/8zqns7xj6jd1kj4q3y81kg500000gn/T/pip-build-env-5suqi78x/normal/lib/python3.9/site-packages/rebound/rebound.h:1231:16: note: 'reb_simulation_create_from_simulationarchive_with_messages' declared here DLLEXPORT void reb_simulation_create_from_simulationarchive_with_messages(struct reb_simulation r, struct reb_simulationarchive sa, int64_t snapshot, enum reb_simulation_binary_error_codes warnings); ^ src/assist.c:457:28: warning: incompatible integer to pointer conversion initializing 'struct reb_simulation ' with an expression of type 'int' [-Wint-conversion] struct reb_simulation r3 = reb_create_simulation(); ^ ~~~~~~~ src/assist.c:463:5: error: call to undeclared function 'reb_free_simulation'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] reb_free_simulation(r3); ^ src/assist.c:490:9: error: call to undeclared function 'reb_integrate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] reb_integrate(sim, t); ^ src/assist.c:579:5: error: call to undeclared function 'reb_update_acceleration'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] reb_update_acceleration(sim); // This will later be recalculated. Could be optimized. ^ src/assist.c:452:47: error: use of undeclared identifier 'REB_INPUT_BINARY_WARNING_NONE' enum reb_input_binary_messages warnings = REB_INPUT_BINARY_WARNING_NONE; ^ 3 warnings and 8 errors 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 assist Failed to build assist ERROR: Could not build wheels for assist, which is required to install pyproject.toml-based projects

mschwamb commented 1 year ago

This is on a M2 mac, but also seeing this issue on ubuntu non Mac silicon machine. I've tried on my M2 mac installing via conda and there is no issue

hannorein commented 1 year ago

HI Meg,

This is because I've updated REBOUND and ASSIST does not yet work with the new version. I've submitted a PR a while ago that makes sure ASSIST uses a REBOUND version < 4.0.0. Matt has merged it into ASSIST, but it hasn't been pushed to pypi yet (Matt needs to do that - I don't have permission). In the meantime you need to install ASSIST with pip from GitHub rather than pypi: pip install git+https://github.com/matthewholman/assist.git

I hope that helps.

Hanno

matthewholman commented 1 year ago

I'll take care of this. Sorry for the trouble.

On Tue, Nov 14, 2023 at 8:50 AM Hanno Rein @.***> wrote:

HI Meg,

This is because I've updated REBOUND and ASSIST does not yet work with the new version. I've submitted a PR a while ago that makes sure ASSIST uses a REBOUND version < 4.0.0. Matt has merged it into ASSIST, but it hasn't been pushed to pypi yet (Matt needs to do that - I don't have permission). In the meantime you need to install ASSIST with pip from GitHub rather than pypi: pip install git+https://github.com/matthewholman/assist.git

I hope that helps.

Hanno

— Reply to this email directly, view it on GitHub https://github.com/matthewholman/assist/issues/94#issuecomment-1810240373, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5CVWL2QNTG3ZIKNQZBLKLYENZLDAVCNFSM6AAAAAA7KUM7N2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJQGI2DAMZXGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Matthew J. Holman, PhD Senior Astrophysicist Center for Astrophysics | Harvard & Smithsonian 60 Garden Street, MS #51 Cambridge, MA 02138 (617) 496-7775

matthewholman commented 1 year ago

I have pushed the updated version to pypi.

hannorein commented 1 year ago

I've also created a PR (#95) which makes the changes for ASSIST to work with REBOUND Version 4. All the unit tests are passing.

hannorein commented 1 year ago

@matthewholman Thanks! I can confirm that a simple pip install assist works again (it automatically installs REBOUND version 3.28.4).

matthewholman commented 1 year ago

Wonderful! I just now merged your latest PR (#95) and updated the version (1.1.6) on pypi again.

hannorein commented 1 year ago

Great! Sorry for the update mess, but in the long run the changes to REBOUND should be worth it. All the function names and variables are much more consistent now.

@mschwamb If you use REBOUND/ASSIST in production. I could make sense to freeze the versions that work for you. You probably don't need to use the latest versions unless you want to make use of a new feature, in which case you can update it manually. That way things don't break so often.

mschwamb commented 1 year ago

@hannorein My repo is setup with unit tests that run daily and the continuous CI caught the issue. So I think it's fine as it will alert to future issues like this.

hannorein commented 1 year ago

I appreciate you reporting the issues! I just feel bad for breaking things so often...

matthewholman commented 1 year ago

No worries, @hannorein !

hannorein commented 1 year ago

@matthewholman The version 1.1.6 on pypi does not include the changes from #95. Is it possible that you forgot to pull from GitHub before pushing to pypi?

matthewholman commented 1 year ago

Fixed!

On Tue, Nov 14, 2023 at 10:02 AM Hanno Rein @.***> wrote:

@matthewholman https://github.com/matthewholman The version 1.1.6 on pypi does not include the changes from #95 https://github.com/matthewholman/assist/pull/95. Is it possible that you forgot to pull from GitHub before pushing to pypi?

— Reply to this email directly, view it on GitHub https://github.com/matthewholman/assist/issues/94#issuecomment-1810401839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5CVWM2BO5VSEFHZAMEGWDYEOBZVAVCNFSM6AAAAAA7KUM7N2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJQGQYDCOBTHE . You are receiving this because you were mentioned.Message ID: @.***>

-- Matthew J. Holman, PhD Senior Astrophysicist Center for Astrophysics | Harvard & Smithsonian 60 Garden Street, MS #51 Cambridge, MA 02138 (617) 496-7775

hannorein commented 1 year ago

Thanks! (You might also want to do one more "git push" to GitHub so that the version on GitHub is the same as the one on pypi.)

matthewholman commented 1 year ago

Thanks!

On Tue, Nov 14, 2023 at 11:08 AM Hanno Rein @.***> wrote:

Thanks! (You might also want to do one more "git push" to GitHub so that the version on GitHub is the same as the one on pypi.)

— Reply to this email directly, view it on GitHub https://github.com/matthewholman/assist/issues/94#issuecomment-1810572613, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5CVWJRHUAT2RDPBMCZVQTYEOJQDAVCNFSM6AAAAAA7KUM7N2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJQGU3TENRRGM . You are receiving this because you were mentioned.Message ID: @.***>

-- Matthew J. Holman, PhD Senior Astrophysicist Center for Astrophysics | Harvard & Smithsonian 60 Garden Street, MS #51 Cambridge, MA 02138 (617) 496-7775

mjuric commented 1 year ago

Note to ourselves: we should make the PyPi (and conda-forge) publishing be automatically triggered from a CI step in github, once the repo is tagged with something like vX.Y.Z.

It would ensure pip+conda releases are always consistent with the code on github (and make the whole release process much easier -- just tag, push & let the CI do the rest).