0

The aim is to create a singularity container with Feynhiggs/Higgsbounds/HiggsSignal/2HDMC/SusHi running together peacefully. They are a powerful combination, but fiddly to set up. I would like to be able to offer this container as a way to replicate my results.

In order to do this several hacks are required. For example, 2HDMC mostly requires Higgsbounds version 5, but also uses one legacy function from HiggsBounds version 4, so I will insert the legacy function into the source of HiggsBounds 5 before compiling HiggsBounds 5. 2HDMC is no longer maintained, but it is still the only program that does what I need. This is just one example, almost all packages require changes to source to co-operate although they are all intended to be used together.

In principle I could write all these changes into the singularity recipe as sed substitutions, but that would probably create a completely unreadable recipe file. Alternatively I could construct a zip of all the files that need alterations and just have the recipe substitute them in, I think this would be neater, but I have never seen it done. It would also make it obvious from the recipe where the alterations are.

Is there a standard practice for hacking source before compiling in a singularity?

Clumsy cat
  • 289
  • 1
  • 12
  • Is there any reason you're not opting to build the container as a sandbox first, interactively making the changes, and then generating an image from the sandbox? – LucasBoatwright May 07 '19 at 14:10
  • @compBio It seems like I would only be able to produce an image that way, not a recipe? To quote the [docs](https://www.sylabs.io/guides/3.2/user-guide/build_a_container.html#creating-writable-sandbox-directories); "Use care when converting a sandbox directory to the default SIF format. If changes were made to the writable container before conversion, there is no record of those changes in the Singularity definition file rendering your container non-reproducible. It is a best practice to build your immutable production containers directly from a Singularity definition file instead." – Clumsy cat May 13 '19 at 11:05
  • Yes, that's true. Depending on how the licenses are setup for the programs you're installing, I might actually recommend that you make a GitHub page (or other repository) with code for the exact setup and just clone it into the container. Is that acceptable? – LucasBoatwright May 13 '19 at 12:12
  • @compBio that seems like a good suggestion. It would make it easier for others to inspect the changes and reduce the number of external dependencies to (almost) just the github. – Clumsy cat May 13 '19 at 13:39

0 Answers0