[petsc-dev] Fwd: cmake issue

Barry Smith bsmith at mcs.anl.gov
Thu Dec 16 10:27:11 CST 2010

On Dec 16, 2010, at 10:11 AM, Jed Brown wrote:

> On Thu, Dec 16, 2010 at 03:41, Barry Smith <bsmith at mcs.anl.gov> wrote:
> Note that configure/make handles what I do just fine but Jed's cmake had trouble and suggested changing configure to move the variables.
> Using CC="gcc -m32" literally means that spaces in paths cannot be supported.  BuildSystem mostly doesn't support spaces in paths out of laziness.  But if commands are created in a way that the above will work, then paths cannot possibly have spaces.  CMake functions correctly with spaces in paths at the cost of having to treat the compiler path separately from flags.

  I don't understand why cmake cannot handle "gcc -m32" as is since "cmake can handle commands with spaces" then how does cmake know that "gcc -m32" is not just a command named gcc -m32 with a space in it? So when I use CC="gcc -m32" I am not telling configure (or cmake) my command is gcc with a flag as -m32 I am simply telling configure (or cmake) that my command is gcc -m32 and it never needs decompose it at all.

  Why doesn't cmake "just work" with this CC="gcc -m32"?


> I propose attempting to find CC="/long string/with -spaces" as a single path first and if that fails, break it on spaces, try to use the first item as a compiler, and put the rest into the various flags variables.  That won't work on "/long string/with -spaces", but it will work for "gcc -flags" and "/path/to/gcc -flags".

More information about the petsc-dev mailing list