-
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
Getting unique identifier of installed package #4080
Comments
Try
|
@adamjstewart Thank you for the hint about "spack -l". It does only return part of the hash. I would rather need the entire hash, as I use a script, which generates some symbolic links for installed spack packages. My plan is to start from a minimal Linux installation and then to also build system tools (in principle I am rebuilding a part of /usr/bin). Since spack has a different installation directory for each package, I create kind of a fake "/usr/bin" and create symbolic links to the system tools installed by spack. A user needs then to only add a single directory to his PATH and can use all the system tools (I think nobody wants to load a module for using tools like "ls" or "mv"):
In order to make this setup simpler, I created a script that sets up the system tools and creates the symbolic links automatically, therefore I need the full hash. Please find below an excerpt from the script, which contains m4 as example:
|
You can get the full hash with |
@adamjstewart Thank you for pointing me to spack view, this sounds exactly like what I was looking for. Do you know where I can find some documentation about it ? I was browsing the spack documentation but could not find information part about "spack view". It is also not listed in the command reference part of the documentation: https://spack.readthedocs.io/en/latest/command_index.html When trying to use it to create symbolic links, I run into the same problem as before with spack find:
Best regards and thank you for helping me. |
Does this work?
This is the only documentation I could find on I'll see if I can add that to the Command Index. |
@adamjstewart Thank you for your help. The command that you propose creates some links:
|
Any time you need to pass a spec to a command, you should be able to use a hash instead. If you encounter any commands that this doesn't work with, it's a bug. |
@serbanmaerean In the meantime, you can (have to) parse the output of |
PS: We know that #2698 is not going to get merged. But boy do I depend on it in the meantime, you might find it useful too. |
Hi all,
Installing a package, for instance
spack install m4@1.4.18+sigsegv ^libsigsegv@2.11 %gcc@4.8.5 arch=linux-centos7-x86_64_avx
will generate a unique identifier as part of the name of the installation directory. I would like to get this identifier after installing a package and save it in a variable. Up to now I was parsing the output of spack find:
If I have two packages, which only differ by the CPU target, then specifying the "arch" when running spack find resolves the conflict and returns only the package I am searching for:
For some reason, this does not properly work for ncurses:
Even when specifying the arch parameter, spack returns the path for both installations instead of just for the specified arch.
Therefore I have two questions:
1.) Is there a better way to "extract" the unique identifier of a package installation ?
2.) @alalazo Do you think the problem described above could be related to $SPACK_TARGET_TYPE ? I would rather think that this is not the case, as the output of spack find for the patch package was correct.
Best regards and thank you in advance.
The text was updated successfully, but these errors were encountered: