Hello,

I've been banging my head against the wall here.  The main problem is, how
does one get the right dependencies and libraries to the compiler?

Consider what happens if I'm writing a library with dependencies A-J, where
they are installed with EasyBuild (or Spack).  Projects A-J also depend on
other projects K-Z.  How do I get my build set up to find these
dependencies?  Options include:

  a) Load modules A-J with LMod, then run CMake.  Because of LMod, CMake
will be able to find A-Z because they're all in the search path.  After
CMake configure step, loading modules shouldn't be necessary.

  b) Create a dummy .eb file for MyProject (which I've done), and create
its module right away.  Load that module now, and then do step (a)  above.
This is a work-saving way of loading modules A-J manually...

  c) Instead of loading the module based on our dummy .eb file, ask
EasyBuild to provide CMake command line -D options directly based on it.
Feed those into CMake.

   d) Try to coerce EasyBuild to run CMake for me via "eb--stop
configure".  This can be painful if there are errors in the CMake file.

  e) Call cmake with directories of A-Z on the command line as inputs to
the FindXXX.cmake scripts; CMake then finds each one on its own

I've been trying option (e), but I think it's a dead-end.  The problem here
is transitive dependencies.  Should each CMake project have to list every
transitive dependency it has?  Especially if project A includes files from
project M?  That quickly becomes impractical.

So that leaves options (a)-(d), which are approximately similar in spirit:
let EasyBuild/Lmod figure out the transitive dependencies properly, and
then feed that into CMake.  Any thoughts on pros and cons of (a) vs. (b)
vs. (c) vs. (d)?

So... once I've managed to call CMake with the right environment, I have to
list dependencies A-J AGAIN in CMakeLists.txt.  Ugh.  Moreover, the
FindXXX.cmake scripts are non-standard and tedious.

Once LMod has set up the correct environment for me, wouldn't it be easier
to dispense with all this CMake library finding and just use the libraries
that come on the path that's been constructed for us with EasyBuild?  Or
put another way... the library finding features in CMake solve a problem
that never happens if you let EasyBuild/Lmod construct your paths.

On the other hand... what if someone wants to build my software with CMake
but WITHOUT EasyBuild?  Is that even practical, given the number of
dependencies I'm dealing with?  Is the world going to move to EasyBuild to
the point that we can distribute our software as a set of EasyBuild
scripts.  Or more likely --- EasyBuild templates, which get instantiated
with a particular compiler version/etc. and then placed on a system?
People don't install individual RPMs anymore they use yum / apt-get / etc.
Why do we think people will be manually installing CMake projects in the
future?

Finally... CMake is messing up my RPaths.  I've sent over to the CMake list
for help.  But I think it has something to do with me using option (e)
above, which just isn't working for me at this point.

So circling back... suppose I have EasyBuild (or Spack) and I want to
develop software with CMake?  What is the recommended way to do that?  What
is the recommended way for the two systems to work together (EasyBuild
providing recursive dependency management, and CMake providing
cross-platform compatibility)?  How does one write CMake scripts that can
be used with or without help from EasyBuild?

Any thoughts here?

Thank you,
-- Elizabeth

Reply via email to