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

Add option to replace TPL absolute paths with library names #10

Closed
wants to merge 1 commit into from

Conversation

dtip
Copy link
Contributor

@dtip dtip commented Feb 12, 2019

This should help with relocatability: instead of generating
eccodes-config.cmake with an absolute path to Third Party Libraries
(TPLs) (e.g. /lib/x86_64-linux-gnu/libm.so.6) we use the library
name instead (e.g. -lm).

We also use library names in eccodes-targets.cmake and eccodes.pc.

The motivation is so that we can distribute packages with conda-forge.
Without this change, the conda-forge build leaves its build path in the
files above. When we come to build another package downstream, e.g.
Magics, we are unable to find the ecCodes libraries because the absolute
paths to the TPLs are no longer valid. Using library names instead lets
cmake find the TPLs on the downstream build system.

We currently use -lpthreads instead of an absolute path, so hopefully
doing the same for the other TPLs isn't too controversial.

@dtip dtip self-assigned this Feb 12, 2019
@dtip
Copy link
Contributor Author

dtip commented Feb 12, 2019

This probably needs some discussion, so the fact that there's currently no CircleCI config is fine for now. I'll add the config in a separate PR and rebase once it's merged.

@dtip dtip mentioned this pull request Feb 13, 2019
dtip added a commit to dtip/staged-recipes that referenced this pull request Feb 15, 2019
So cmake can find libm.so. This is necessary because of an upstream
issue with ecCodes.

See ecmwf/eccodes#10
@dtip dtip force-pushed the dtip-replace-absolute-paths branch from 6549d53 to fd0be3c Compare February 22, 2019 12:22
@dtip dtip force-pushed the dtip-replace-absolute-paths branch from fd0be3c to 03a23e4 Compare March 1, 2019 15:37
This should help with relocatability: instead of generating
eccodes-config.cmake with an absolute path to Third Party Libraries
(TPLs) (e.g. /lib/x86_64-linux-gnu/libm.so.6) we have the option to use
the library name instead (e.g. -lm).

We also use library names in eccodes-targets.cmake and eccodes.pc if the
option is set.

The motivation is so that we can distribute packages with conda-forge.
Without this change, the conda-forge build leaves its build path in the
files above. When we come to build another package downstream, e.g.
Magics, we are unable to find the ecCodes libraries because the absolute
paths to the TPLs are no longer valid. Using library names instead lets
cmake find the TPLs on the downstream build system.
@dtip dtip force-pushed the dtip-replace-absolute-paths branch from 03a23e4 to b6aa5f0 Compare March 13, 2019 14:18
@dtip
Copy link
Contributor Author

dtip commented Mar 13, 2019

I've update the PR so that the new behaviour can be enabled with the cmake option REPLACE_TPL_ABSOLUTE_PATHS. The default behaviour is unchanged.

@dtip dtip changed the title Replace TPL absolute paths with library names Add option to replace TPL absolute paths with library names Mar 13, 2019
@dtip dtip closed this Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants