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

Problem with creating ungrib.exe

neyestani

New member
Hi there,

I was able to compile WRF-Chem successfully. When compiling WPS (v4.5), geogrid.exe and metgrid.exe are created, but failed to create ungrib.exe. These are the errors I receive:

dec_jpeg2000.c:(.text+0x61): undefined reference to `jpc_decode'
collect2: error: ld returned 1 exit status
make[1]: [ungrib.exe] Error 1 (ignored)

dec_jpeg2000.c:(.text+0x61): undefined reference to `jpc_decode'
collect2: error: ld returned 1 exit status
make[1]: [g2print.exe] Error 1 (ignored)

I selected serial mode with the same compiler I used to compile WRF-Chem. Please find configure.wps and log.compile files attached.

Also, when I select "NO_GRIB2" option, it works fine and creates ungrib.exe.

By the way, I checked two other posts in the forum with the same topic, but neither of the suggested solutions (configuring with "--build-grib2-libs" or adding "-lgomp" in configure file) helped.

Any idea how I can fix this?


Thank you!
 

Attachments

  • configure.wps
    3.5 KB · Views: 5
  • wps.compile.log
    148.8 KB · Views: 1
This is an error caused by jasper library. Have you installed jasper using the same compiler you used to compile WRF?
Please take a look at the document here for WPS installation.
 
Thanks for letting me know that it's jasper library issue. Yes, same compiler is used to install jasper and WRF.
Also, I used both static (.a) and shared object (.so) jasper libraries separately. Both give me similar errors.

Errors when using shared object library:
dec_jpeg2000.c:(.text+0x61): undefined reference to `jpc_decode'
collect2: error: ld returned 1 exit status
make[1]: [ungrib.exe] Error 1 (ignored)

Errors when using static library:
jpg_enc.c:(.text.jpg_encode+0x2c4): undefined reference to `jpeg_std_error'
jpg_enc.c:(.text.jpg_encode+0x2e3): undefined reference to `jpeg_CreateCompress'
jpg_enc.c:(.text.jpg_encode+0x2f3): undefined reference to `jpeg_stdio_dest'
jpg_enc.c:(.text.jpg_encode+0x33d): undefined reference to `jpeg_set_defaults'
jpg_enc.c:(.text.jpg_encode+0x39c): undefined reference to `jpeg_set_quality'
jpg_enc.c:(.text.jpg_encode+0x3a9): undefined reference to `jpeg_default_colorspace'
jpg_enc.c:(.text.jpg_encode+0x3bb): undefined reference to `jpeg_start_compress'
jpg_enc.c:(.text.jpg_encode+0x4b0): undefined reference to `jpeg_write_scanlines'
jpg_enc.c:(.text.jpg_encode+0x4d6): undefined reference to `jpeg_finish_compress'
jpg_enc.c:(.text.jpg_encode+0x4e3): undefined reference to `jpeg_destroy_compress'
...
jpc_cod.c:(.text.jpc_init+0xb): undefined reference to `pthread_once'
collect2: error: ld returned 1 exit status
make[1]: [ungrib.exe] Error 1 (ignored)
 
Let's try another option:
Please download WPSv4.4 or v4.5, then follow the steps below to compile:
(1) cd WPSv4.5
(2) ./clean -a
(3) ./configure --build-grib2-libs (choose option 1 or 2)

Please let me know whether this works for you.
 
./configure --build-grib2-libs didn't work for me. There were many different errors about missing libraries. However, an older version of Jasper worked fine (v1.9 instead of v3.0.6).

Thank you!
 
Did you use WPSV4.4 or WPSv4.5? We did broad tests with the configure option --build-grib2-libs and we know for sure that it works.
 
Top