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

[mpfr] Fix when building shared library on Linux #19150

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

uilianries
Copy link
Member

@uilianries uilianries commented Aug 11, 2023

Specify library name and version: mpfr/4.2.0

When building with Conan 2.0, and */*:shared=True, the mpfr executes a validation with autotools to check if is possible to use gmp. However, as VirtualRunEnv was not configured, the LD_LIBRARY_PATH was not present, resulting in failure when trying to run its test:

configure:4522: gcc -o conftest  -m64 -O3  -I/home/conan/.conan2/p/gmp0bfdd57764b0f/p/include -DNDEBUG -I/home/conan/.conan2/p/gmp0bfdd57764b0f/p/include  -L/home/conan/.conan2/p/gmp0bfdd57764b0f/p/lib -m64 -L/home/conan/.conan2/p/gmp0bfdd57764b0f/p/lib conftest.c  -lgmpx
x -lgmp -lm >&5
configure:4526: $? = 0
configure:4533: ./conftest
./conftest: error while loading shared libraries: libgmpxx.so.4: cannot open shared object file: No such file or directory
configure:4537: $? = 127
configure:4544: error: in `/home/conan/.conan2/p/b/mpfrbaa826e03f170/b/build-release':
configure:4546: error: cannot run C compiled programs.

This PR fixes the situation by adding VirtualRunEnv.

Required by #18720 and #19124


Signed-off-by: Uilian Ries <uilianries@gmail.com>
@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 1 (fd6e77d9ba7e145003016a5b11dba5450f25d27a):

  • mpfr/4.1.0@:
    All packages built successfully! (All logs)

  • mpfr/4.0.2@:
    All packages built successfully! (All logs)

  • mpfr/4.2.0@:
    All packages built successfully! (All logs)


Conan v2 pipeline ✔️

Note: Conan v2 builds may be required once they are on the v2 ready list

All green in build 1 (fd6e77d9ba7e145003016a5b11dba5450f25d27a):

  • mpfr/4.1.0@:
    All packages built successfully! (All logs)

  • mpfr/4.2.0@:
    All packages built successfully! (All logs)

  • mpfr/4.0.2@:
    All packages built successfully! (All logs)

Copy link
Contributor

@jcar87 jcar87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to find a way to solve this that doesn't require exposing the run environment at build time!

@conan-center-bot conan-center-bot merged commit 78976dd into conan-io:master Aug 11, 2023
6 checks passed
ericLemanissier pushed a commit to ericLemanissier/conan-center-index that referenced this pull request Sep 15, 2023
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@nextsilicon-itay-bookstein
Copy link
Contributor

Writing it out here for posterity: apparently this trick causes libgmp from the conan cache to load into the compiler process itself! I only found this out as I was doing an address-sanitized build (with shared-libasan) and this caused weird errors to pop up when the configure script tried interrogating the compiler itself (missing symbols that normally would be retrieved from libasan DSO).

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 this pull request may close these issues.

5 participants