NOAA-EMC / NCEPLIBS

Top level repo containing submodules for NCEPLIBS and associated dependencies for superproject builds
Other
42 stars 18 forks source link

Undefined references to jasper and png elements #208

Open coderodyhpc opened 1 year ago

coderodyhpc commented 1 year ago

Hello, The compilation of UPP complains about some NCEP subroutines:

/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libg2_v3.1.0_4.a(enc_jpeg2000.c.o): in function `enc_jpeg2000_':
/home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_jpeg2000.c:165: undefined reference to `jas_stream_memopen'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_jpeg2000.c:172: undefined reference to `jas_stream_memopen'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_jpeg2000.c:177: undefined reference to `jpc_encode'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_jpeg2000.c:186: undefined reference to `jas_stream_close'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_jpeg2000.c:187: undefined reference to `jas_stream_close'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libg2_v3.1.0_4.a(enc_png.c.o): in function `user_write_data':
/home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:66: undefined reference to `png_get_io_ptr'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libg2_v3.1.0_4.a(enc_png.c.o): in function `enc_png_':
/home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:117: undefined reference to `png_create_write_struct'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:122: undefined reference to `png_create_info_struct'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:133: undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:135: undefined reference to `png_destroy_write_struct'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:150: undefined reference to `png_set_write_fn'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:170: undefined reference to `png_set_IHDR'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:181: undefined reference to `png_set_rows'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:186: undefined reference to `png_write_png'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:192: undefined reference to `png_destroy_write_struct'
/usr/bin/ld: /home/ubuntu/POSTPRO/NCEPLIBS/download/nceplibs-g2/src/enc_png.c:125: undefined reference to `png_destroy_write_struct'

I don't understand why because libjasper and libpng are in standard directories (and other apps have no problem finding them). Did I miss anything while building the NCEP or could it be a matter of old components? Thanks

edwardhartnett commented 1 year ago

This seems like a problem with the version of jasper. Jasper changed sometime around version 3.0 and dropped support for some functions, and requires a rewrite of any jasper code, which is annoyinjg.

What version of NCEPLIBS-g2 are you using?

coderodyhpc commented 1 year ago

I built NCEPLIBS directly from the Github develop branch. The subdirectories for the libraries read g2-3.4.5, g2c-1.6.2 and g2tmpl-1.9.1. NCEPLIBS-g2 should probably be v3.4.5.

coderodyhpc commented 1 year ago

Hello @edwardhartnett, This is some info: -The system has JASPER release-v2 so it's not version 3, and the jasper library itself seems to be working fine:

000000000001a130 T jas_stream_memopen
000000000001a8f8 T jas_stream_close

However, these components seem to be broken when building libg2_d.a & libg2_4.a:

                 U jas_stream_memopen
                 U jas_stream_close

I went down to NCEPLIBv3.3.0 but got the same error. Is there any chance to get NCEPLIBS version 3.1 to check if that makes any difference? It's not available from Github. Thanks

coderodyhpc commented 1 year ago

I've gone over many combinations with the JasPer library (versions 1, 2 and 3) and older versions of NCEPLIBS in addition to v3.4.5, but the result is always the same with libg2_d.a & libg2_d.a building but JasPer subroutines being undefined.

edwardhartnett commented 1 year ago

I am soon to do a new release of g2. Stand by. It works with all versions of jasper.