Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined references to jasper and png elements #208

Open
coderodyhpc opened this issue Mar 14, 2023 · 5 comments
Open

Undefined references to jasper and png elements #208

coderodyhpc opened this issue Mar 14, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@coderodyhpc
Copy link

coderodyhpc commented Mar 14, 2023

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

@coderodyhpc coderodyhpc added the bug Something isn't working label Mar 14, 2023
@edwardhartnett
Copy link
Contributor

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
Copy link
Author

coderodyhpc commented Mar 14, 2023

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
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants