FIAS . Impressum . Privacy

creating enormous commandlines in cmake

Matthias Kretz [please enable javascript to see the address]
Sat May 25 13:13:02 CEST 2013


On Saturday 25 May 2013 11:46:29 Boudewijn Rempt wrote:
>     get_directory_property(_inc INCLUDE_DIRECTORIES)
>     foreach(_i ${_inc})
>        list(APPEND _flags "-I${_i}")
>     endforeach()
> 
> And longer... This is okay on linux, but breaks on windows with nmake, jom
> or ninja. What's the purpose of this code -- and how can we fix it?

It seems your collection of directories that were passed via 
include_directories is very large (and apparently contains duplicates). AFAIK 
this is no problem with cmake proper as cmake creates a temporary file per 
object file that contains the compiler flags. This way they can keep the 
command line length down.

The purpose of this cmake code in Vc is to build a single source file into 
different object files with different compiler flags and have them linked into 
the same target later on. This is not possible with cmake proper, that's why I 
developed a new macro to do it. It's just not robust enough, it seems...

What needs to be done to fix it:
- determine whether the compiler supports a file to set compiler flags (cmake 
already knows this - I don't know whether it's queriable, though)
- for these compilers put the compiler flags into a tempfile and call the 
compiler on this file (probably just do this unconditionally - I think cmake 
also just always uses tempfiles). You need to adjust the code in 
_vc_compile_one_implementation.

Quick intermediate fix: reduce the contents of the INCLUDE_DIRECTORIES 
property.

Cheers,
	Matthias
-- 
Dipl.-Phys. Matthias Kretz

Phone: +49 69 798 44110
Web:   http://compeng.uni-frankfurt.de/?mkretz

SIMD easy and portable: http://compeng.uni-frankfurt.de/?vc



More information about the Vc mailing list
FIAS . Impressum . Privacy