[CMake] Better BlueGene/P and cross-compile support for CMake

Todd Gamblin tgamblin at llnl.gov
Mon Jun 28 12:01:45 EDT 2010


On Jun 28, 2010, at 8:03 AM, Brad King wrote:

> Todd Gamblin wrote:
>> So it's *probably* safe to set your CMAKE_FIND_ROOT_PATH to
>> /bgsys/drivers/ppcfloor, but technically it's outside your
>> definition above.
> [snip]
>> Thinking about this some more, maybe you just don't *need* a
>> find root on BG/P ... You can get all the system information
>> you need from the MPI compiler
> 
> We still need to hide the rest of the host system libraries
> from the find_* commands.  CMAKE_FIND_ROOT_PATH in ONLY mode
> is the way to do that.

Agreed -- for now.  See below.

>> The problem right now is really that the find_ commands ignore
>> both PATHS and HINTS in a cross compile environment
> 
> Huh?  They are not ignored.  However, all the values given are
> re-rooted under CMAKE_FIND_ROOT_PATH.  This may have led you to
> believe they are ignored if you used full paths from the real root.
> Both PATHS and HINTS were developed for host-only builds and did
> not consider cross compiling.  CMAKE_FIND_ROOT_PATH was developed
> specifically for cross compiling and simply re-roots *all* search
> paths computed by the normal mechanisms.

Ok, I think I see what the real problem here is for BG/P systems.  CMake cross-compile support is assuming that there is only one (or maybe a few) directories where target software might be installed.  On our BlueGene systems, there is one target environment directory, and, as I mentioned, even that is somewhat convoluted because it really contains binaries for *three* platforms (FEN, CN, and ION).  Nearly all the BlueGene systems I've worked on also have shared filesystems that are accessible both from the FEN and the CN, and these filesystems are going to have CN (target) software installs that *shouldn't* be re-rooted.

I need to be able to supply paths that look something like this:

> cmake -DMY_EXTERNAL_LIB_PREFIX=/usr/gapps/my_external_lib/bgp/1.2.1


Which is pretty much the way you'd specify a library in a nonstandard install location in a normal build, right?  The problem is that right now this is all going to be re-rooted.  Any suggestions on this?  Is there some way to tell the cross-compile that certain things (like user-supplied paths) should *not* be re-rooted?

-Todd







> 
> Look at CMake's source file Source/cmFindCommon.cxx for the method
> cmFindCommon::RerootPaths.  It is responsible for re-rooting all
> the search paths under CMAKE_FIND_ROOT_PATH.  There is a "#if 0"
> block at the top of the method that was left from debugging its
> original implementation.  Build CMake with this changed to "#if 1"
> to get detailed information about the list of paths considered
> *before* re-rooting.  Note also that the method does *not* modify
> paths that already lie under the new root.
> 
> Perhaps this information can aid your analysis of what happens.
> 
> -Brad
> 
> 
> P.S. (FYI)
> 
>> PATHS are supposed to come from user-supplied locations
>> HINTS are supposed to come from system locations.
> 
> In that documentation, "user" is the author of the Find* module.
> PATHS are hard-coded last-ditch guesses of common install locations.
> They are searched after all other paths.  HINTS are educated
> guesses based on information found from some other source on the
> actual system, like mpicc -show results.  They are searched before
> normal system directories.
> 
> 
> 



More information about the CMake mailing list