Conversation
The libiberty.a library from GNU binutils. Libiberty provides demangling and support functions for the GNU toolchain. This package uses the binutils tarfile but only builds the libiberty subdirectory. This is useful for other packages that want the demangling functions without the rest of binutils. Add variant 'fpic' to compile with -fPIC. Addresses some issues raised in PR spack#8806.
| # Configure and build just libiberty. | ||
| @property | ||
| def configure_directory(self): | ||
| return join_path(self.stage.source_path, 'libiberty') |
There was a problem hiding this comment.
This whole thing can be replace with:
configure_directory = 'libiberty'There was a problem hiding this comment.
Ok, I didn't realize that. I'll change it.
|
|
||
| # Set default cflags (-g -O2), add -fPIC if requested, and move to | ||
| # the configure line. | ||
| def flag_handler(self, name, flags): |
There was a problem hiding this comment.
Does this work for Autotools packages as well? I've only ever seen it used in CMake packages.
There was a problem hiding this comment.
Yes, build_system_flags works for Autotools and Cmake. Any other
package type would have to implement flags_to_build_system_args() or
else use a different flag handler.
| return args | ||
|
|
||
| # Libiberty always installs libiberty.a into lib64, even with | ||
| # --libdir or --disable-multilib, so just give up and copy. |
There was a problem hiding this comment.
Is there something wrong with lib64?
There was a problem hiding this comment.
I was worried about robustness and I thought it was simpler to always
put it in lib. I could ask if there's anything wrong with lib?
Is this the normal way spack handles this? That is, let the package
choose for itself whether to install into lib or lib64?
If that's how spack normally works, then yes, I'll change it. But if
that's the convention, then doesn't every package have to know if its
dependency libraries are in lib or lib64?
For autotools, you normally just use, '--with-pkg=prefix' and let the
package figure it out. But if you want the actual lib dir, then you
can't just assume that prefix.lib will always work, right?
Worse yet, I've seen other packages that install into lib on x86 and
lib64 on powerpc. Libunwind used to do this, I think they still do.
How does spack handle that?
(I don't mean to be sarcastic. I'm just asking, how does spack handle
this?)
There was a problem hiding this comment.
I think in general Spack lets the package decide where to install its libraries. Note that we also need to support externally installed packages, where we have no control over where they install things. Most of the time, Autotools figures out where dependencies live, but in the case that we need to specify a directory, we can use the spec['foo'].libs attribute to automatically locate libraries.
| version('2.29.1', 'acc9cd826edb9954ac7cecb81c727793') | ||
| version('2.28.1', 'a3bf359889e4b299fce1f4cb919dc7b6') | ||
|
|
||
| variant('fpic', default=False, description='Compile with -fPIC.') |
There was a problem hiding this comment.
Call the variant pic. -fPIC is only the flag for some compilers, not all. The description should be Compile with position independent code.
There was a problem hiding this comment.
You're right! Normally I grep through existing packages to see if
there's a standard name for these things. But I guess I was sloppy in
this case. I'll change it.
Btw, there is a 'Style guidelines for packages' in read-the-docs, but
it only mentions 'shared', 'static', 'mpi' and 'python' as standard
variant names.
There was a problem hiding this comment.
No style guide yet. We could add one, but there are so many things to add...
|
I guess I'll drop the lib64 to lib copy then. Is there a reference for spec['foo'].libs? I found this in ncurses/package.py: Is that what you meant? Is this a way for ncurses to announce to its |
|
Correct, see http://spack.readthedocs.io/en/latest/llnl.util.html#llnl.util.filesystem.LibraryList for more information. By default, |
|
Ok, I'll play around with this and update the patch. Thanks! |
|
If the package has a |
Allow libiberty to install the library in lib64 and don't try to copy it to lib.
|
Ok, I've made the changes as above, including the 'pic' name and Unless there's something else, I'm done. I looked at the use of spec['...'].libs as you suggested. AFAICT, in Thanks! I keep learning new things .... |
* libiberty: new package The libiberty.a library from GNU binutils. Libiberty provides demangling and support functions for the GNU toolchain. This package uses the binutils tarfile but only builds the libiberty subdirectory. This is useful for other packages that want the demangling functions without the rest of binutils. Add variant 'fpic' to compile with -fPIC. Addresses some issues raised in PR spack#8806. * libiberty: change variant name to 'pic'. Allow libiberty to install the library in lib64 and don't try to copy it to lib.
The libiberty.a library from GNU binutils. Libiberty provides
demangling and support functions for the GNU toolchain.
This package uses the binutils tarfile but only builds the libiberty
subdirectory. This is useful for other packages that want the
demangling functions without the rest of binutils.
Add variant 'fpic' to compile with -fPIC.
Addresses some issues raised in PR #8806.