MantisBT - CMake
View Issue Details
0015054CMakeCMakepublic2014-08-03 17:052016-06-10 14:31
tgexm 
Kitware Robot 
normalminoralways
closedmoved 
Windows 7 x64Windows 7 x64Windows 7 x64
CMake 3.0 
 
0015054: Codelite generated build commands fail because of "-j 0" argument to mingw32-make
When you try to build/rebuild or even clean a Project inside Codelite, you get an error because of the "-j 0" argument to mingw32-make.

j must be a positive integer!

For comparison, in Codeblocks there is no -j arg in the build cmdlines.
No tags attached.
Issue History
2014-08-03 17:05tgexmNew Issue
2015-12-15 16:28Dave DriesenNote Added: 0039988
2016-01-20 18:40Sean KaufmanNote Added: 0040280
2016-01-20 19:32Sean KaufmanNote Added: 0040281
2016-01-20 19:34Sean KaufmanNote Edited: 0040281bug_revision_view_page.php?bugnote_id=40281#r2006
2016-01-21 11:26Sean KaufmanNote Edited: 0040280bug_revision_view_page.php?bugnote_id=40280#r2008
2016-06-10 14:29Kitware RobotNote Added: 0042599
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0039988)
Dave Driesen   
2015-12-15 16:28   
Still occurring in 3.4.1:

<BuildCommand>C:/PROGRA~1/TDM-GC~1/bin/mingw32-make.exe -j 0</BuildCommand>

The above is generated in the .project files, and as a result the build chokes on the "-j 0":

C:\WINDOWS\system32\cmd.exe /C C:/PROGRA~1/TDM-GC~1/bin/mingw32-make.exe -j 0
----------Building project:[ glmud - Debug ]----------
mingw32-make.exe: the '-j' option requires a positive integral argument

Does anyone have a workaround aside from manually editing the "-j 0" parameter?
(0040280)
Sean Kaufman   
2016-01-20 18:40   
(edited on: 2016-01-21 11:26)
I'm seeing the same thing. I generate with the build option:

-G "CodeLite - MinGW Makefiles"

It produces a CodeLite project that cannot be built until I manually edit out the '-j 0' from the commands. This is making it difficult to use CMake for portability since CodeLite is the editor we use here.

Are there any workarounds? Perhaps a way to do this via command-line?

EDIT: Command-line to resolve this (requires MinGW to be available in PATH afaik):

sed -i "s/-j 0//g" MyProject.project

(0040281)
Sean Kaufman   
2016-01-20 19:32   
(edited on: 2016-01-20 19:34)
It appears this bug is caused by an incorrect CPU core count:

https://github.com/Kitware/CMake/blob/master/Source/cmExtraCodeLiteGenerator.cxx#L319 [^]

It seems, to me at least, that we should eliminate this altogether and let MinGW handle this option by default as it appears in CodeBlocks generator. Alternatively, we could treat this as a platform-specific issue with CPU core count and fix that instead.

I am not familiar with building CMake to comfortably create a PR for this issue, however.

(0042599)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.