dstndstn / astrometry.net

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

os-features-test.c:8:10: fatal error: netpbm/pam.h: No such file or directory in Ubuntu20.04 #315

Open ShenDongxiang opened 1 month ago

ShenDongxiang commented 1 month ago

Hello everyone, I encountered a problem when compiling and installing astrometry. My system is Ubuntu 20.04. Before installation and compilation, I have installed the necessary packages through these commands:

$sudo apt install build-essential curl git file pkg-config swig \ libcairo2-dev libnetpbm10-dev netpbm libpng-dev libjpeg-dev \ zlib1g-dev libbz2-dev libcfitsio-dev wcslib-dev \ python3 python3-pip python3-dev \ python3-numpy python3-scipy python3-pil $ pip install astropy

However, after I executed the make command, an error was reported during the compilation process:

/include/libpng16 -DNCSLIB EXISTS -DHCSLIB HAS WCSCCS=0 -1../include -I../include/astrometry -I../gsl-an -I/usr/include/wcslib -../include -../include/astrometry -l../gsl-an -I/usr/include/wcslib -I. os-features-test.c -g.Wall -ffinite-math-only -fno-signaling-nans -pthread -march=native -03 -fomit-frame-pointer -DNDEBUG -fpic -fPIc -Winline -L. -lnetpbm >> os-features.log &&./os-features-test-netpbm>>os-features.log && "#define HAVE NETPBM 1")\echoecho "#define HAVE NETPBM ")>>../include/astrometry/os-features-config.h.TMP.
os-features-test.c:8:10: fatal error: netpbm/pam.h: No such file or directory.

However, when I executed sudo apt install netpbm before, it showed that I had successfully installed this package. Subsequently, I ignored this error and executed the subsequent installation steps. When using the solve-field command, it still prompts:

Reading input file 1 of 1: "2024-07-14_23-26-47_L_-9.96_45.00s_0017.fits"... Running command: /home/sdx/astrometry/bin/image2pnm --infile 2024-07-14_23-26-47_L_-9.96_45.00s_0017.fits --uncompressed-outfile /tmp/tmp.uncompressed.EiBTCl --outfile /tmp/tmp.ppm.hIbZVi --ppm --mydir /home/sdx/astrometry/bin/solve-field. Extracting sources... ``simplexy: found 1388 sources. Making source extraction overlay plot -- pnmfn = /tmp/tmp.ppm.hIbZVi. cairoutils.c:715:cairoutils_read_ppm_stream: cairoutils.c:715:cairoutils_read_ppm_stream: Netpbm is not available; can't read PPM imagesNetpbm is not available; can't read PPM images. cairoutils.c:715:cairoutils_read_ppm_stream: cairoutils.c:715:cairoutils_read_ppm_stream: Netpbm is not available; can't read PPM imagesNetpbm is not available; can't read PPM images. libpng warning: Image width is zero in IHDR. libpng warning: Image height is zero in IHDR. libpng error: Invalid IHDR data. Aborted (core dumped). solve-field.c:331:plot_source_overlay Plotting command failed. solve-field.c:137:run_command Command was: "/home/sdx/astrometry/bin/plotxy -I /tmp/tmp.ppm.hIbZVi -i./2024-07-14_23-26-47_L_-9.96_45.00s_0017.axy -C red -w 2 -N 50 -x 1 -y 1 -P | /home/sdx/astrometry/bin/plotxy -i./2024-07-14_23-26-47_L_-9.96_45.00s_0017.axy -I - -w 2 -r 3 -C red -n 50 -N 200 -x 1 -y 1 >./2024-07-14_23-26-47_L_-9.96_45.00s_0017-objs.png".

And the solve field was not completed in the 4200 series index. I would like to ask how to solve this problem?

dstndstn commented 1 month ago

Hi,

As shown here,

https://github.com/dstndstn/astrometry.net/blob/main/.circleci/config.yml#L189

the way Ubuntu packages netpbm, you need to create a symlink for it to find netpbm correctly.

ShenDongxiang commented 1 month ago

Thank you for your help. I found that copying the files under the directory /usr/include/ to the directory astrometry.net/util/ and modifying the corresponding #include <metpbm/pam.h> to #include can also solve the problem.