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

Point-independent code to avoid static linking issues #12

Merged
merged 1 commit into from
Jun 25, 2016

Conversation

wesm
Copy link
Member

@wesm wesm commented Jun 24, 2016

The point independent code means that the boost static libraries can be properly statically linked while creating other shared libraries. This makes so that users of those shared libraries do not need to install the boost dynamic libraries on their system.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@jakirkham
Copy link
Member

Could you please explain a bit more about why they must be statically linked? Does it actually present a problem to use a newer version libstdc++ with boost as is? Examples would be very helpful to understand your use case.

@wesm
Copy link
Member Author

wesm commented Jun 24, 2016

Let me break this into two patches. It's probably worth coming up with an example showing how incompatible libstdc++ can cause problems.

The -fPIC issue is much more serious as the static binaries in this build cannot be linked into shared libraries.

@jakirkham
Copy link
Member

That sounds like a great idea, @wesm. Will gladly accept the -fPIC patch. We can then examine the libstdc++ issue more closely.

@@ -13,6 +13,9 @@ set -x -e
INCLUDE_PATH="${PREFIX}/include"
LIBRARY_PATH="${PREFIX}/lib"

# Always build PIC code for easier static linking
CXXFLAGS="${CXXFLAGS} -O3 -fPIC"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is O3 safe? I think I haven't seen optimization options added to any conda package. Or is it needed by fPIC?

Copy link
Member

Choose a reason for hiding this comment

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

It shouldn't be needed by -fPIC.

That is a good question about -O3. I don't know how well that works with Boost. Have seen other libraries that have issues with this level of optimization. We should investigate this further.

Copy link
Member Author

Choose a reason for hiding this comment

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

I know that Impala is compiling all of its boost with -O3 and it does not cause problems, but bears more examination

Copy link
Member

Choose a reason for hiding this comment

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

Don't get me wrong. If it works reliably, we definitely should go for that speed up. Just want to be sure about the reliability part.

@wesm wesm changed the title Point-independent code, better portability across gcc toolchains Point-independent code to avoid static linking issues Jun 24, 2016
@wesm
Copy link
Member Author

wesm commented Jun 24, 2016

Separated up

@wesm
Copy link
Member Author

wesm commented Jun 24, 2016

@jakirkham I've been digging around for some consistent information about libstdc++; it sounds like systems with gcc 4.6 or lower as their default toolchain, you need to consistently do -static-libstdc++ to get binaries to work. This also includes RHEL / CentOS 6. I'm going to install a CentOS 6 VM so I can see for myself on the conda forge binaries

@jakirkham
Copy link
Member

Ok, well let's go ahead with this -fPIC change first so that you have a better package to play with. 😄

PS - Could you please bump the build number?

@wesm
Copy link
Member Author

wesm commented Jun 25, 2016

Done, and rebased

@jakirkham
Copy link
Member

LGTM

@wesm
Copy link
Member Author

wesm commented Jun 25, 2016

Someone want to pull the trigger on this? @msarahan @jakirkham?

@msarahan msarahan merged commit 35cc8f5 into conda-forge:master Jun 25, 2016
@msarahan
Copy link
Member

Thanks @wesm and @jakirkham for review.

@wesm wesm deleted the build-static-fpic branch June 25, 2016 23:51
@wesm
Copy link
Member Author

wesm commented Jun 25, 2016

Thanks

h-vetinari pushed a commit to h-vetinari/boost-feedstock that referenced this pull request May 3, 2023
Fix missing include in boost::serialization
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.

None yet

5 participants