Netpbm not found

37 views
Skip to first unread message

Hal Weaver

unread,
Apr 28, 2023, 4:05:02 PM4/28/23
to astrometry
Hi,

I used Homebrew to install astrometry.net, and the Netpbm package was definitely installed too, but solve-field engine keeps spitting out:

cairoutils.c:715:cairoutils_read_ppm_stream: Netpbm is not available; can't read PPM images

I noticed in a previous thread that someone else saw a similar issue, and Dustin recommended reinstalling Netpbm. So I entered:

brew reinstall netpbm

which ran fine after complaining that the package had already been installed.

I note that using the "--fits-image" option doesn't make any difference for the FITS image I'm feeding the engine. I note also that the engine still successfully solves for the astrometry, but the PNG output file has 0 bytes and multiple warnings are produced.

Any advice on how to fix this problem? I'm reluctant to run "make" since I used Homebrew for the installation. If I really need to run make, please advise as to exactly what directory to issue the command from and what options to use.

Thanks,
Hal

Dustin Lang

unread,
Apr 28, 2023, 4:13:18 PM4/28/23
to Hal Weaver, astrometry
Hi,

--fits-image is just a hint that the input file is a FITS image (it makes it not try opening it as other kinds of files)

If homebrew is building the astrometry.net package, then you'll need to have netpbm installed before it gets built... ie also "brew reinstall astrometry-net"

cheers,
dustin


--
You received this message because you are subscribed to the Google Groups "astrometry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astrometry+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astrometry/9df5bc59-b546-4f98-8e65-14ece6faf916n%40googlegroups.com.

Hal Weaver

unread,
Apr 28, 2023, 4:29:13 PM4/28/23
to astrometry
Thanks, Dustin, but I'm not sure what you mean...

Using brew to install astrometry-net also automatically installs netpbm. Nevertheless, I ran "brew reinstall astrometry-net",  after I'd previously run "brew reinstall netpbm", but the solve engine still can't find the netpbm library.

-Hal

Hal Weaver

unread,
Apr 28, 2023, 4:43:49 PM4/28/23
to astrometry
I note also that all the netpbm routines are in my unix path, which was set up by brew.

Like I said, what I'm seeing isn't fatal because astrometric solutions are produced. But it's certainly annoying that multiple error messages are produced and the final PNG files can't be produced.

Cheers,

Hal

Dustin Lang

unread,
Apr 28, 2023, 4:59:18 PM4/28/23
to Hal Weaver, astrometry
Okay, well it looks like the astrometry.net build script is failing to find or link to netpbm.  You should try to get some debug output out of the "brew reinstall astrometry-net" -- I forget what that flag is, "-d" for debug? "-v" for verbose?  That message, "Netpbm is not available; can't read PPM images" happens when astrometry.net doesn't find netpbm *during building* -- nothing you do after that is going to change the behavior.

cheers,
dustin


Hal Weaver

unread,
Apr 28, 2023, 7:25:01 PM4/28/23
to astrometry
Thanks again, Dustin. I guess I'll have to check with the Homebrew team about this.

In the meantime, are there any Mac users out there who used brew to install astrometry.net who either did, or didn't, have this problem linking to the netpbm library?

Cheers,

Hal

Dustin Lang

unread,
Apr 28, 2023, 9:17:08 PM4/28/23
to Hal Weaver, astrometry
I just tried on my own mac and I get the same thing.  When I try to build from source (brew reinstall -v -v -s astrometry-net), I see the netpbm check failing:


Testing netpbm...
   NETPBM_INC is -I/usr/local/opt/netpbm/include/netpbm
   NETPBM_LIB is -L/usr/local/opt/netpbm/lib -lnetpbm
((clang -o os-features-test-netpbm \
...
 -L/usr/local/opt/netpbm/lib -lnetpbm >> os-features.log && \
  ./os-features-test-netpbm >> os-features.log && \
  echo "#define HAVE_NETPBM 1") \
|| echo "#define HAVE_NETPBM 0") >> ../include/astrometry/os-features-config.h.tmp
ld: library not found for -lnetpbm
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Back in the olden days, you could just edit the formula in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/astrometry-net.rb
but that doesn't seem to work any more??  it seems to want to grab the original formula from github?

==> Fetching astrometry-net
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/b15f0d2e25da1c5b93002dd09336a962af577977/Formula/astrometry-net.rb
Already downloaded: /Users/dstn/Library/Caches/Homebrew/downloads/fc636454c63c71b9337d38db8b37251622108d7097256e7c5a9fb1bef70498ff--astrometry-net.rb
==> Verifying checksum for 'fc636454c63c71b9337d38db8b37251622108d7097256e7c5a9fb1bef70498ff--astrometry-net.rb'

so I'm not sure how to modify the build recipe...


Okay, so I just tried something silly and it worked...

I looked in
/usr/local/Cellar/netpbm/10.86.38_1/lib

and it only has
libnetpbm.11.86.dylib
libnetpbm.11.dylib -> libnetpbm.11.86.dylib

but no just plain "libnetpbm.dylib".  So I just added a symlink:

cd /usr/local/opt/netpbm/lib
ln -s libnetpbm.11.dylib libnetpbm.dylib

and did a "brew reinstall -s astrometry-net"
and the netpbm check worked!

cheers,
dustin


Hal Weaver

unread,
Apr 28, 2023, 9:48:27 PM4/28/23
to astrometry
Great sleuthing, Dustin!

Your fix above works for me too! (Although my path is different: /opt/homebrew/Cellar/netpbm/10.86.38_1/lib)

Thanks so much for your help!

Cheers,

Hal

Dustin Lang

unread,
Apr 29, 2023, 10:28:16 AM4/29/23
to Hal Weaver, astrometry
Reply all
Reply to author
Forward
0 new messages