dstndstn / astrometry.net

Astrometry.net -- automatic recognition of astronomical images
http://astrometry.net
Other
666 stars 187 forks source link

Update install_astrometry_on_linux.sh #285

Closed neatstranger closed 11 months ago

neatstranger commented 1 year ago

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

Missing SWIG Package.

After adding this, install runs smoothly.

dstndstn commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

neatstranger commented 1 year ago

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 buildext -v --inplace --build-temp .

And _python3 setup-solver.py buildext -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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

I have removed the SWIG dependency from ./install_on_linux

dstndstn commented 11 months ago

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

neatstranger commented 11 months ago

No problem! Thank you!