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

wgrib2 build error on mac M1 #205

Closed
NeilBarton-NOAA opened this issue Apr 15, 2022 · 3 comments
Closed

wgrib2 build error on mac M1 #205

NeilBarton-NOAA opened this issue Apr 15, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@NeilBarton-NOAA
Copy link

The error message is

Undefined symbols for architecture arm64:
"_jpc_decode", referenced from:
_unpk_grib in unpk.c.o
"_jpc_encode", referenced from:
_enc_jpeg2000_clone in enc_jpeg2000_clone.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[6]: *** [wgrib2/wgrib2] Error 1
make[5]: *** [wgrib2/CMakeFiles/wgrib2_exe.dir/all] Error 2

previous to this Error 2, there are a bunch of warnings stating

ld: warning: could not create compact unwind for ludcmp: register 73 saved somewhere other than in frame
ld: warning: object file (/Users/neilbarton/NOAA/NCEPLIBS/sp-2.3.3/lib/libsp_d.a(sptranf0.f.o)) was built for newer macOS version (12.3) than being linked (12.0)

To Reproduce
I'm trying to build on a Mac Mini with an M1 chip. I'm using brew to install the needed dependencies and a brew list results in

==> Formulae
autoconf coreutils gmp isl libaec libpng mpfr [email protected] [email protected] xz
ca-certificates gcc hdf5 jasper libevent m4 netcdf pkg-config readline zstd
cmake gdbm hwloc jpeg libmpc mpdecimal open-mpi pyenv sqlite

==> Casks
rar

I followed the wiki steps before the install. Please let me know if you need more information.

@NeilBarton-NOAA NeilBarton-NOAA added the bug Something isn't working label Apr 15, 2022
@edwardhartnett
Copy link
Contributor

This is due to a change in the Jasper library starting with jasper 3.x. So a quick fix is to roll back to jasper-2.0.33.

The NCEPLIBS team is not supporting wgrib2, and we recommend that wgrib2 not be used in operational processing, due to instabilities and incompatibilities in it's build.

@JeffBeck-NOAA
Copy link

JeffBeck-NOAA commented Apr 15, 2022

@NeilBarton-NOAA, please let us know if the jasper change resolves your issue. Thanks. We're in the process of moving to g2 (instead of wgrib2), but it hasn't quite been completely implemented in UFS_UTILS. Hopefully soon.

@NeilBarton-NOAA
Copy link
Author

Since wgrib2 is not needed for my application, I just compiled the other items. Also rolling back to an older version of jasper with brew was not as simple as expected.

However, I will not be revisiting this and this can be closed in my opinion

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

3 participants