On 16/01/16 15:29, Jack Perdue wrote:
On 01/15/2016 09:37 PM, Elizabeth Fischer wrote:
Hello,

I'm writing a C++ library with a Cython extension that wraps it. I'm thinking of how best to build and install this within an EasyBuild-based framework.

Traditionally, Python has its own way to install packages, which I'm only partly familiar with: eggs, installing in --user or --system, etc. But I'm wondering if I would be better off installing my Python stuff in a more traditional way, especially since it relies on a library that will be built by EasyBuild. I'm thinking of a directory that looks something like this:

     eb/software/myproj/1.0/
          lib/
               libmyproj.dylib
          python/
               libmyproj_pythonextension.so
               mypythonfiles.py

In order to use this Python code, I would then need to set PYTHONPATH to eb/software/myproj/1.0/python. This is just like setting LD_LIBRARY_PATH in order to access EasyBuild-built libraries.

So... how does one go about adding new path variabels (like PYTHONPATH) to the Lmod modules? The module command should be able to manipulate PYTHONPATH just like all the other env variables it manipulates.

Thank you,
-- Elizabeth

PS: It's probably best to also add more traditionally Pythonic ways to install this software. But I'm not worried about that at this point; maybe I'll never be worried about it. It's not clear yet whether this software will ever be compiled or installed without an EasyBuild-like system.


Probably the short answer is use "modextrapath" in the easyconfig file. See "eb -a".

For the Python part, you might write a traditional setup.py and then use the PythonPackage
easyblock which should take care of the PYTHONPATH for you.


Spot on, see https://github.com/hpcugent/easybuild-easyconfigs/search?utf8=%E2%9C%93&q=PYTHONPATH for examples.


K.

Reply via email to