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

mpc: Unset LIBS before configuring #24188

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guy-david
Copy link

@guy-david guy-david commented Jun 2, 2024

mpc/1.3.1

On systems that do not have libmpfr.so.6 installed, I fail to configure this package:

configure:3919: checking whether we are cross compiling
configure:3927: clang-16 -o conftest  -m64 -O3 -I/local/users/guyd/conan/.conan/data/gmp/6.3.0/_/_/package/581209b46b4309cd0f7261e5f10bfe21d5d4fc08/include -I/local/users/guyd/conan/.conan/data/mpfr/4.2.0/_/_/package/e4297c5e065990fd51a06a706f890cb821c50fae/include  -DNDEBUG -I/local/users/guyd/conan/.conan/data/mpfr/4.2.0/_/_/package/e4297c5e065990fd51a06a706f890cb821c50fae/include -I/local/users/guyd/conan/.conan/data/gmp/6.3.0/_/_/package/581209b46b4309cd0f7261e5f10bfe21d5d4fc08/include -L/local/users/guyd/conan/.conan/data/gmp/6.3.0/_/_/package/581209b46b4309cd0f7261e5f10bfe21d5d4fc08/lib -L/local/users/guyd/conan/.conan/data/mpfr/4.2.0/_/_/package/e4297c5e065990fd51a06a706f890cb821c50fae/lib  -m64 -L/local/users/guyd/conan/.conan/data/mpfr/4.2.0/_/_/package/e4297c5e065990fd51a06a706f890cb821c50fae/lib -L/local/users/guyd/conan/.conan/data/gmp/6.3.0/_/_/package/581209b46b4309cd0f7261e5f10bfe21d5d4fc08/lib conftest.c -lm -lmpfr -lgmpxx -lgmp -lm >&5
configure:3931: $? = 0
configure:3938: ./conftest
./conftest: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory

My theory is that the AutoToolsToolchain populates the LIBS environment variable with the package's dependencies (i.e. -lgmp, -lmpfr), MPC then adds these to the implicit list of libraries it should link (LIBS libraries to pass to the linker, e.g. -l<library>). That works fine during linking but to actually run the resulting executable, one needs to set LD_LIBRARY_PATH or compile with an RPATH which I believe is undesirable.
I think that it's not MPC at fault in this case because it manually configures the paths to its dependencies, so therefore I limited the scope of this "fix" but I'd rather someone with more experience will take a look.


Signed-off-by: Guy David <guy.david@nextsilicon.com>
@CLAassistant
Copy link

CLAassistant commented Jun 2, 2024

CLA assistant check
All committers have signed the CLA.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Sorry, the build is only launched for Access Request users. You can request access writing in this issue.

Conan v2 pipeline ❌

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping @conan-io/barbarians on the PR and we will help you.

See details:

Sorry, the build is only launched for Access Request users. You can request access writing in this issue.

@guy-david guy-david marked this pull request as ready for review June 2, 2024 08:33
@jcar87
Copy link
Contributor

jcar87 commented Jun 3, 2024

Hi @guy-david, thank you for your contribution.

I believe something else might be happening that explains what you are experiencing - libmpfr is listed as a conan dependency, and I can see logic in the recipe to handle this appropriately.

Could you please provide details of your conan profile and which conan command you are invoking that results in this error so that we could troubleshoot this on our end? thanks!

@jcar87 jcar87 self-assigned this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants