Ask Your Question

Mock and Environment Modules with rpm dependency

asked 2015-03-26 11:14:09 -0500

Dani_L gravatar image

I'm building some multiversion RPMs using environment modules. This works great with rpmbuild (I can use environment variables set in the modulefiles for the INCLUDE path etc). How can I tell mock to issue the relevant module load commands necessary to build the dependant RPMS correctly?

currently I module load the versions I want to build against (which publish a $PREFIX_XXX for each lib) and in the %build section ../configure --with-xxx=$PREFIX_XXX ...

As I said, this works very well outside mock, but of course fails spectacularly inside mock (I can't even persuade it to install my custom buildreqs, which have "provides" identical to distro RPMs (required so I can use them as dependency for 3rd party or distro RPMs without also installing the official RPMs).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-29 06:01:30 -0500

It would've been easier to answer if you had posted your spec file. We do use environment modules to switch between MPI implementations in Fedora, so I'd invite you to look at how MPI packaging is done.

Basically, when you're packaging something that depends on a library provided via environment modules, you load that module in all relevant spec sections, usually %build and %install, and you add the necessary dependencies. For example, see the spec file for GROMACS.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-03-26 11:14:09 -0500

Seen: 267 times

Last updated: Mar 26 '15