Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update install_astrometry_on_linux.sh #285

Merged
merged 3 commits into from
Oct 13, 2023
Merged

Conversation

neatstranger
Copy link
Contributor

Trying to install on Rapsberry PI OS,
Kernel: 6.1.21-v8+

Missing SWIG Package.

After adding this, install runs smoothly.

Trying to install on Rapsberry PI OS,
Kernel: 6.1.21-v8+

Missing SWIG Package.

After adding this, everything runs smoothly.
@dstndstn
Copy link
Owner

dstndstn commented Oct 3, 2023

Swig shouldn't be required to build one of the released tarballs -- we run swig and include the results as part of the release.

Building from github would require swig.

@neatstranger
Copy link
Contributor Author

I was using the shell script for installing on linux. Which failed on the make py command. After installing swig, everything went smoothly.

running build_ext
building '_solver' extension
swigging solver.i to solver_wrap.c
swig -python -I../include -I../include/astrometry -I../gsl-an -I/usr/include/wcslib -I../include -I../include/astrometry -I../gsl-an -I/usr/include/wcslib -DWCSLIB_EXISTS -DWCSLIB_HAS_WCSCCS=0 -o solver_wrap.c solver.i
error: command 'swig' failed: No such file or directory
make[1]: *** [Makefile:344: _solver.cpython-39-aarch64-linux-gnu.so] Error 1
make[1]: Leaving directory '/tmp/astrometry.net-0.93/solver'
make: *** [Makefile:127: pysolver] Error 2

@dstndstn
Copy link
Owner

dstndstn commented Oct 3, 2023

Oh, you know, I think I have seen this before too. Would you be willing to dig into what's going on? eg, check the timestamps on solver.i, solver_wrap.c, solver.py, etc and see why it thinks it needs to re-run swig?

@neatstranger
Copy link
Contributor Author

I will take a look and see if there is anything I can see.

Looking at another python package that built just fine with these changes.
@neatstranger
Copy link
Contributor Author

Okay, I think I have figured it out.

I was looking over the total log. It seems that the plot extension worked just fine and pulled the swigged file in, instead of trying to re-swig a new file.

python3 setup.py build_ext -v --inplace --build-temp .
('link:', ['-g', '-Wall', '-ffinite-math-only', '-fno-signaling-nans', '-pthread', '-march=native', '-O3', '-fomit-frame-pointer', '-DNDEBUG', '-fpic', '-fPIC', '-Winline', '-lwcs', '-lm', '-lm', '-lwcs', '-lm', '-lm', '-lwcs', '-lm', '-lm', '-lwcs', '-lm', '-lm', '-lcairo', '-lpng16', '-lz', '-L.', '-lnetpbm', '-ljpeg'])
('objs:', ['../util/cairoutils.o', '../catalogs/libcatalogs.a', '../util/libanfiles.a', '../libkd/libkd.a', '../util/libanutils.a', '../qfits-an/libqfits.a', '../util/libanbase.a', '../gsl-an/libgsl-an.a', '../util/libanutils.a', '../qfits-an/libqfits.a', '../util/libanbase.a', '../gsl-an/libgsl-an.a'])
('inc:', ['../include', '../include/astrometry', '../gsl-an', '/usr/include/wcslib', '../include', '../include/astrometry', '../gsl-an', '/usr/include/wcslib', '/usr/include/cairo', '/usr/include/glib-2.0', '/usr/lib/aarch64-linux-gnu/glib-2.0/include', '/usr/include/pixman-1', '/usr/include/uuid', '/usr/include/freetype2', '/usr/include/libpng16', '../util'])
('cflags:', ['-DWCSLIB_EXISTS', '-DWCSLIB_HAS_WCSCCS=0', '-g', '-Wall', '-ffinite-math-only', '-fno-signaling-nans', '-pthread', '-march=native', '-O3', '-fomit-frame-pointer', '-DNDEBUG', '-fpic', '-fPIC', '-Winline', '-I../include', '-I../include/astrometry', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_GNU_SOURCE', "-DAN_GIT_REVISION='0.93'", "-DAN_GIT_DATE='Mon_Dec_19_16:41:15_2022_-0500'", "-DAN_GIT_URL='https://github.com/dstndstn/astrometry.net'", '-I../catalogs', '-DWCSLIB_EXISTS', '-DWCSLIB_HAS_WCSCCS=0', '-I../include', '-I../include/astrometry', '-I../gsl-an', '-I/usr/include/wcslib', '-I../include', '-I../include/astrometry', '-I../gsl-an', '-I/usr/include/wcslib', '-I../util', '-I.', '-I/usr/include/cairo', '-I/usr/include/glib-2.0', '-I/usr/lib/aarch64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/uuid', '-I/usr/include/freetype2', '-I/usr/include/libpng16'])
running build_ext
building '_plotstuff_c' extension
swigging plotstuff.i to plotstuff_wrap.c

Both have the swigged files in the correct directory from the tarball, and so the only thing I could see as a major difference, was that the build_ext command was commented out in the setup_solver.py file.

So I went through and fixed the missing dependencies, using the plot (setup.py) as a resource).

Now, when I run the commands:
python3 setup.py build_ext -v --inplace --build-temp .

And
python3 setup-solver.py build_ext -v --inplace --build-temp .

I get the exact same result(an error due to them not being ran from the makefile, but nothing about swig.

My test machine is tied up right now, but either later today or tomorrow, I should be able to attempt to rebuild the entire install from scratch without swig and see if my theory is correct.

Please let me know if I am completely barking up the wrong tree. (Latest commit) Patch 1

@neatstranger
Copy link
Contributor Author

Prior to changes:

python3 setup-solver.py build_ext -v --inplace --build-temp .
('link:', [])
('objs:', [])
('inc:', [])
('cflags:', [])
running build_ext
building '_solver' extension
swigging solver.i to solver_wrap.c
swig -python -o solver_wrap.c solver.i
error: command 'swig' failed: No such file or directory

After Changes

python3 setup-solver.py build_ext -v --inplace --build-temp .
('link:', [])
('objs:', [])
('inc:', [])
('cflags:', [])
running build_ext
building '_solver' extension
swigging solver.i to solver_wrap.c
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.9/dist-packages/numpy/core/include -I. -I/usr/include/python3.9 -c solver_wrap.c -o ./solver_wrap.o
solver_wrap.c:2732:10: fatal error: os-features.h: No such file or directory
 2732 | #include "os-features.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

Correctly Working plot/setup.py

python3 setup.py build_ext -v --inplace --build-temp .
('link:', [])
('objs:', [])
('inc:', ['../util'])
('cflags:', [])
running build_ext
building '_plotstuff_c' extension
swigging plotstuff.i to plotstuff_wrap.c
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.9/dist-packages/numpy/core/include -I../util -I/usr/include/python3.9 -c plotstuff_wrap.c -o ./plotstuff_wrap.o
plotstuff_wrap.c:2749:10: fatal error: os-features.h: No such file or directory
 2749 | #include "os-features.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

@neatstranger
Copy link
Contributor Author

Okay, I set up a new install, and the change corrects the issue. I was able to install the whole thing without any errors.

@neatstranger
Copy link
Contributor Author

I have removed the SWIG dependency from ./install_on_linux

@dstndstn
Copy link
Owner

I am so sorry for the long LONG delay in merging this! THank you very much!!

@dstndstn dstndstn merged commit d7430e0 into dstndstn:main Oct 13, 2023
4 checks passed
@neatstranger
Copy link
Contributor Author

No problem! Thank you!

@neatstranger neatstranger deleted the patch-1 branch October 14, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants