-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Variants for static/shared build types #2779
Comments
Also.. https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html |
we already have a discussion on that topic #2380, why create a separate issue? |
Because this is a new try. Thank you for linking to previous tries.
…On Jan 9, 2017 2:58 AM, "Denis Davydov" ***@***.***> wrote:
we already have a discussion on that topic #2380
<#2380>, why create a separate issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2779 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB1cdyZTQO_QMK9xCNmq7uxL_KHitXgKks5rQeiOgaJpZM4Ld5W4>
.
|
@citibeth We already have over 400 issues in Spack. The more you add, the less likely we are to solve any of them. There is no reason to split the discussion over multiple issues. It just makes it harder to follow. If there is already an open issue on a topic, please refrain from opening another issue. |
Sorry, I disagree. It has admittedly been difficult to find a design for the |
Time flies and we are over 600 now. Trying to burn a few. The most recent discussion on this topic is #5269 |
@scheibelp @mamelara @tgamblin
This proposal is the result of previous proposals and discussions. The idea is to standardize how packages process static vs. shared builds; and to make it easy and logical to control for the user. Comments welcome.
There will be a multi-valued variant
build_type
that can take the valuesstatic
orshared
. Packages will interpret the variant as follows. In each case, if the package is incapable of doing the required task, then the value should not be an option forbuild_type
in that package; thus causing an error if the user tries to choose it. Thebuild_type
variant should always default toshared
.static
: The package must produce a static library (preferably without PIC).shared
: The package must produce either a shared library, or a static library with PIC. Thus,shared
means "appropriate for use in a shared-linking context", not necessarily "produces a shared library."There will be a second multi-valued variant
shared_type
that can take the valuesshared
orpic
. It is only in effect ifbuild_type=shared
. In that case, the package will build true shared libraries ifshared_type=shared
, and static libraries with PIC ifshared_type=pic
. It should default toshared
, if the package is capable of building true shared libraries. If a package cannot build the requested library type, it should not allow that particular value of theshared_type
variant, thus forcing a concretization error.Some upstream packages have builds that simultaneously generate shared and static libraries. This feature will be ignored by Spack; in fact, Spack packages might choose to delete "extra" libraries not specified by the
build_type
variant. If a user wants multiple build types, then the package will have to be built and installed twice, with different values for thebuild_type
orshared_type
variants.Use Cases
Users will typically set
build_type
as a "global" variant (Allow setting default variants #2644), depending on whether they want to build with shared or static linking. Users who do shared will do nothing; those who need to build static will setbuild_type=static
in the appropriate YAML config file.For users who have
build_type=shared
, they can additionally configure certain packages for either true shared libs, or static libs with PIC. It is expected thatshared_type
will be configured on a per-package basis, as appropriate.The text was updated successfully, but these errors were encountered: