how to create a virtual package

90 views
Skip to first unread message

petr.h...@gmail.com

unread,
Nov 12, 2020, 12:45:16 PM11/12/20
to Spack
Hi forum,
I would like to solve within Spack this usecase. Let's say I need some customized super-modulefile including other modulefiles/packages. Something like "gromacs-custom-bundle" with bundle of other packages. And I want to give the user only a modulefile, not the spack environment.
Yes, I could create some hand-made modulefile outside Spack jurisdiction but I was thinking about something like super-package within Spack to use its automation capabilities. Let's say create some package.py like this:

class GromacsBundle(Package):
   """
   Bundle package for Gromacs and other software
   """
   homepage = "https://www.metacentrum.cz"
   #url not necessary as this is a super-package

   version('1.0')

   variant('samtools', default=True, description='Add Samtools dependency')
   variant('lammps', default=True, description='Add Lammps dependency')

   depends_on('samtools', when='+samtools')
   depends_on('lammps', when='+lammps')

Adding to environment is OK then. But installation ends with:

==> Error: Could not guess a fetch strategy for <spack.pkg.metacentrum.gromacs-custom-bundle.GromacsBundle object at 0x7f832e084090>@1.0
with arguments: {'fetch_options': {}}

So could I add a package without download URL? Or is there a better way to treat in Spack such a demand?

Thank you, Petr

Massimiliano Culpo

unread,
Nov 16, 2020, 8:02:13 AM11/16/20
to Spack
Hi Petr,

 The "BundlePackage" package type seems to fit your use case perfectly. You can find a good example of its use in the xsdk package.

Cheers,
Massimiliano

Reply all
Reply to author
Forward
0 new messages