How to handle packages that don't install to the traditional filesystem hierarchy #4203
Replies: 9 comments
-
My general recommendation for packages like PGI is to symlink the contents of In the second case, I consider that to be a reasonable install. Many libraries separate out their headers and libs into subdirectories, and it's part of the contract with developers. i.e., you're supposed to There are cases where the same package is frequently installed two different ways (e.g. # in some package
def extra_rpaths(self):
return [ <list of paths> ]
def extra_includes(self):
return [ <list of paths> ] Spack would, as you say, put the above extra RPATHs and includes into the compiler wrappers. This isn't hard to implement -- we just haven't settled on an interface yet. @mplegendre took a stab at this in #2645 -- we held off on it until @alalazo's #1875 was merged. Maybe it's time to revive that. |
Beta Was this translation helpful? Give feedback.
-
as long as it's
I think Similarly for include flags we should use the new class (analog of |
Beta Was this translation helpful? Give feedback.
-
In the PGI and Lmod case, why don't we look at what RedHat, Ubuntu, etc. do? I expect they somehow patch the package to install in the standard places. Adding |
Beta Was this translation helpful? Give feedback.
-
This discussion came up in #4300, so I'm copying the relevant bits here. Packages like
To get around point 2, we could symlink all libraries to @davydden and @alalazo suggested using |
Beta Was this translation helpful? Give feedback.
-
@adamjstewart We can probably do something like (pseudo-code): try:
ld_flags = spec[name].libs.ld_flags
except SomeSpecificError:
tty.warn('Package {foo} still use the old method. Consider updating it.')
ld_flags = ... # Whatever we are currently doing This will permit to transition smoothly from using |
Beta Was this translation helpful? Give feedback.
-
probably if packages install into weird locations they don't work currently either. So i would not be worried about this case. What is trickier are packages which install into As for the usage case, no sane project which link against p.s. another example is |
Beta Was this translation helpful? Give feedback.
-
@alalazo I don't even think this is necessary. As far as I know,
@davydden Oh, I'm not saying this is a problem, I'm saying this is a feature! They currently don't work, but if we switch to using
I don't think we need to extend We may need to extend
where none of the header files contain a |
Beta Was this translation helpful? Give feedback.
-
o_O , so those are indeed header files without
tricky indeed. |
Beta Was this translation helpful? Give feedback.
-
I just noticed that def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# set up MKLROOT for everyone using MKL package
spack_env.set('MKLROOT', self.prefix)
spack_env.append_path('SPACK_COMPILER_EXTRA_RPATHS',
join_path(self.prefix.lib, 'intel64')) Is this the recommended workaround until a better solution has been implemented? |
Beta Was this translation helpful? Give feedback.
-
In an ideal world, every package would install to the following directories:
Unfortunately, we don't live in an ideal world. Some packages like PGI and Lmod install into subdirectories:
others install into multiple directories:
So far we have inconsistent means of getting around this problem. Sometimes we can force the package to install to the normal directories. Sometimes we can use
setup_environment
to get the module file working, but this does nothing for the compiler wrappers that expect the libraries to be in lib. #4031 had to addlib/bamtools
to the CMake RPATH to get it to build properly. Unfortunately this won't work for other build systems. And what about the packages that depend on these? Right now,prefix
is immutable and there is no way to changeprefix.lib
to point tolinux86-64/17.4/lib
.For the PGI/Lmod layout, being able to remap
prefix
globally would be useful. For the case of multiple directories containing libraries and header files, we need a different way to handle this. Right now, the compiler wrappers work through an environment variable,SPACK_DEPENDENCIES
, which contains a list of the installation prefixes of each dependency. We could change this to separate environment variables for lib directories and include directories. Then packages that need to could append to these environment variables.Thoughts? Are there any other scenarios I haven't thought of?
Beta Was this translation helpful? Give feedback.
All reactions