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

macos confusion about libpbg version #168

Closed
edwardhartnett opened this issue Oct 31, 2021 · 4 comments · Fixed by #164
Closed

macos confusion about libpbg version #168

edwardhartnett opened this issue Oct 31, 2021 · 4 comments · Fixed by #164
Assignees
Labels
bug Something isn't working

Comments

@edwardhartnett
Copy link
Contributor

When I added a test for PNG and it ran on the mac, I get this:

12/12 Test #12: tst_png ..........................***Failed    0.10 sec
33
libpng warning: Application built with libpng-1.4.12 but running with 1.6.37
34
Testing PNG functions.
35
Testing enc_png() call...-1

Turns out this is a known macos issue: https://stackoverflow.com/questions/36523911/osx-homebrew-cmake-libpng-version-mismatch-issue

@edwardhartnett edwardhartnett added the bug Something isn't working label Oct 31, 2021
@edwardhartnett edwardhartnett self-assigned this Oct 31, 2021
@edwardhartnett
Copy link
Contributor Author

OK, this was fixed for macos by changing the CMakeLists.txt file to:

link_directories("/usr/local/lib")
if(USE_PNG)
  find_package(ZLIB REQUIRED)
  find_package(PkgConfig REQUIRED)
  pkg_check_modules(PNG libpng16 REQUIRED)
#  find_package(PNG REQUIRED)
else()
  message(STATUS "Will not build PNG support")
endif()

This was as described here: https://stackoverflow.com/questions/36523911/osx-homebrew-cmake-libpng-version-mismatch-issue

@kgerheiser @aerorahul did I do the right thing here?

Also, I presume that the g2 project would have the same problem with macOS and PNG, and we will discover it as we add tests to that project...

@DusanJovic-NOAA
Copy link
Contributor

Please do not make changes like this anymore. If PNG installation is broken on Mac it should be fixed there. Or if Mac specific code needs to be added to this project then it must be in added Mac specific if section.

@edwardhartnett
Copy link
Contributor Author

What do we mean by "changes like this?" ;-)

I will be making many changes to this library. We (the NCEPLIBS team and Arun) recently had a meeting in which we mapped out our development plans with respect to GRIB code. We have some nice ambitious plans! ;-) No longer will these libraries languish, neglected and untested. A new day is dawning for this code!

However, backward compatibly will be preserved.

@dusanjovic
Copy link

By 'changes like this' I mean changes that are platform specific. "/usr/local/lib" does not necessarily exist on all platforms. Platform specific code should be in if(....) .... endif() sections.

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

Successfully merging a pull request may close this issue.

3 participants