Open citibeth opened 7 years ago
Another use for this feature would be configuration issues specific to a particular version of macOS.
OK, I have a sample file here for CentOS7 (below). I like where this is heading because it shows how we can integrate Spack with system-provided package managers. That's an issue we've kicked around a bunch, but have not yet found an easy way forward (see #2116 #541).
The idea here is as follows... something like the CentOS7-specific file below would be included with Spack in an OS-specific config scope. Note the # yum:
lines, which show which Yum packages must be installed to provide the same functionality that comes from the Spack package in question.
Let's assume the # yum:
functionality is added to the YAML grammer; and we will call it system-package
, to be OS-neutral. If that is done, then Spack would be able to issue the yum
commands needed to support any particular configuration. For example, the command spack system-installs <spec>
would do as follows:
<spec>
system-package
annotations that occur in the concretized DAG.Now, the command spack system-installs git
would print out:
curl
libcurl-devel
One can then use this in the command to install the system packages required for a spec:
sudo yum install `spack system-installs git`
Alternately, one can just do spack system-installs
and install all system-package
annotations listed in the configuration. This would be easier to implement, and probably almost as useful.
We would ship Spack with as many overrides for each OS as we come up with. Depending on how we feel about the package, we either comment it out in the packages.yaml
file we ship, or we leave it in. According to the following criteria:
Security-sensitive stuff should always be left in. Spack should not be building openssl
unless the user specifically wants it. Sysadmans are responsible for keeping system software up to date.
Unless a user NEEDS to build a dependency, there is no point in having Spack build it. Stable core-level packages should be left in --- for example, libXaw
. This will improve the user's build experience by shortening build times and avoiding possible build / concretization / circular dependency problems.
Higher-level stuff that changes more frequently, we should probably ship but comment it out. If users want to use the system version, they can copy to a user-supplied config scope and uncomment it.
Things work best if Spack can supply the version of a package provided by the system. This will result in package versions being added to support this use; see #2703
# Use system version of certain packages on CentOS 7
#
# Try:
# yum list installed | grep <package>
# repoquery -l <package> | grep <expected filename>
packages:
# Problems in the past installing Python2
# See: https://github.com/LLNL/spack/issues/1100
# yum: python
python:
paths:
python@2.7.5: /usr
version: [2.7.5]
# Recommended for security reasons
# Do not install OpenSSL as non-root user.
# yum: openssl-devl
openssl:
paths:
openssl@1.0.1e: /usr
version: [1.0.1e]
buildable: False
# Recommended, unless your system doesn't provide Qt4
# yum: qt
qt:
paths:
qt@4.8.5: /usr
version: [4.8.5]
buildable: False
# Recommended, unless your system doesn't provide X11 libs
# yum: libXaw-devel
libxaw:
paths:
libxaw@1.0.12: /usr
version: [1.0.12]
buildable: False
# Matplotlib uses the system libpng anyway
# yum: libpng-devel
libpng:
paths:
libpng@1.5.13: /usr
version: [1.5.13]
buildable: False
# yum: libssh2-devel
libssh2:
paths:
libssh2@1.4.3: /usr
version: [1.4.3]
buildable: False
# yum: curl libcurl-devel
curl:
paths:
curl@7.29.0: /
version: [7.29.0]
buildable: False
# yum: xz xz-libs
xz:
paths:
xz@5.2.2: /usr
version: [5.2.2]
buildable: False
Closing, since there has been no activity in a while. Feel free to reopen if you want to continue work on this.
This is implemented in #31028 , so I would appreciate if other interested folks would comment on whether my implementation
(which allows i.e. $SPACK_ROOT/etc/spack/scientific7/packages.yaml
) addresses their concerns.
I'm looking to create a
packages.yaml
file specific to CentOS-7. I noticed that Spack provides platform-specific scopes. But when I looked at it, it seems that the scope is specific to justlinux
, notlinux-centos7-x86_64
, which is what I'm running.I want an OS-specific scope so I can add things specific to my Linux distro; mostly, directing it to use system-supplied libraries for various packages that I don't want to build (on my system). For example:
Might I suggest a further expansion of scopes, to provide for OS-specific as well as platform-specific scopes? Now the default hierarchy would look like this on my system:
defaults
defaults/linux
defaults/linux-centos7-x86_64
site
site/linux
site/linux-centos7-x86_64
user
user/linux
user/linux-centos7-x86_64