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

Building shared lib on a mac #280

Closed
stackjohn opened this issue Oct 16, 2024 · 1 comment · Fixed by #281
Closed

Building shared lib on a mac #280

stackjohn opened this issue Oct 16, 2024 · 1 comment · Fixed by #281

Comments

@stackjohn
Copy link
Contributor

Hello....

With the following, I can build the main exe, but I cannot build the shared lib, these are the steps:

export OpenMP_ROOT=$(brew --prefix)/opt/libomp
export NetCDF_ROOT=$(brew --prefix)/opt/netcdf
mkdir build && cd build
cmake ..
make wgrib2_exe

This compiles and wgrib2/wgrib2 exists

Then I try the following:

make wgrib2_lib

snip

[ 29%] Building C object wgrib2/CMakeFiles/wgrib2_lib.dir/Config.c.o
/wgrib2/wgrib2/Config.c:14:10: fatal error: 'netcdf.h' file not found
#include <netcdf.h>
         ^~~~~~~~~~
1 error generated.

Only change to my main CMakeLists.txt is:

-option(BUILD_SHARED_LIB "Build shared library?" off)
+option(BUILD_SHARED_LIB "Build shared library?" on)

How can I resolve this?

Thanks in advance for any help.

@stackjohn
Copy link
Contributor Author

Created a PR for this which seems to allow it to build for me.

#281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant