Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

WPS compilation error?


New member
Hi there, trying to compile WPS using ./compile on Mac with M2 chip.

Within the WPS compilation log output, I'm getting this message:

ld: Undefined symbols:
_dec_jpeg2000_, referenced from:
_jpcunpack_ in libg2_4.a[35](jpcunpack.o)
_dec_png_, referenced from:
_pngunpack_ in libg2_4.a[36](pngunpack.o)
_pngunpack_ in libg2_4.a[36](pngunpack.o)
collect2: error: ld returned 1 exit status

It appears that this error is preventing ungrib.exe from compiling. For reference, here's the COMPRESSION_LIBS and COMPRESSION_INC lines in my configure.wps file. I've ensured that all three libraries are installed using homebrew.

COMPRESSION_LIBS = -L/opt/homebrew/Cellar/jasper/4.1.1/lib -ljasper -L/opt/homebrew/Cellar/libpng/1.6.40/lib -lpng -L/opt/homebrew/opt/zlib/lib -lz
COMPRESSION_INC = -I/opt/homebrew/Cellar/jasper/4.1.1/include -ljasper -I/opt/homebrew/Cellar/libpng/1.6.40/include -lpng -I/opt/homebrew/opt/zlib/include -lz

I'm attaching the full output message here, if that would be of any help.

Thank you SO much!


  • out.txt
    10.5 KB · Views: 1
Hi, Apologies for the delayed response due to the holidays.

Since you're building the most recent version of WPS, I would recommend just using the option to build internal copies of zlib, libpng, and jasper to compile ungrib. Take a look at this section of the WRF Users' Guide, which discusses that option (see "Configure WPS").