[CMake] Better BlueGene/P and cross-compile support for CMake
Brad King
brad.king at kitware.com
Mon Jun 28 11:03:08 EDT 2010
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.
> 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.
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