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

CMAKE not building shared object files #165

Open
Marston opened this issue Apr 14, 2023 · 5 comments
Open

CMAKE not building shared object files #165

Marston opened this issue Apr 14, 2023 · 5 comments

Comments

@Marston
Copy link

Marston commented Apr 14, 2023

It is not building the so files with the call:
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DBUILD_SHARED_LIBS=ON ..

How did I build ip with so files?

@EricEngle-NOAA
Copy link
Contributor

The following is related to this issue...

I have been playing around with this and from what I can tell is the order in which you install SP is important vs the IP library type you want to build. Here is a scenario that fails with latest versions of each library:

  • build SP (shared, then static)
  • build IP with shared....THIS FAILS

Because the SP build and install of static after shared, overwrote the cmake config files for SP shared. So CMake basically has no recollection of SP being build with shared library and therefore IP points to the SP static lib .a file.

@EricEngle-NOAA
Copy link
Contributor

EricEngle-NOAA commented Apr 26, 2023

From further investigation, it seems linking to a shared object dependent library when building a static library is not an issue. For example, if you build SP with a shared object library, but then build IP as a static library, all tests pass.

@AlexanderRichert-NOAA
Copy link
Contributor

@Marston is this still an issue? The only caveat to building shared ip using static sp is that sp will need to be built with PIC enabled (-DCMAKE_POSITION_INDEPENDENT_CODE=ON).

@EricEngle-NOAA
Copy link
Contributor

FWIW, it was having this issue back then, but not anymore. I should also note here that we are maintaining NCEPLIBS g2c, ip, and sp on conda-forge.

https://anaconda.org/conda-forge/nceplibs-g2c
https://anaconda.org/conda-forge/nceplibs-ip
https://anaconda.org/conda-forge/nceplibs-sp

@Marston
Copy link
Author

Marston commented Sep 23, 2023

@AlexanderRichert-NOAA Not anymore. I was able to get it compiled but I am still waiting on @EricEngle-NOAA to give some guidance on encoding grib2 with grib2io, in particular, what fields are adjustable.

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

No branches or pull requests

3 participants