User forums > Using Code::Blocks
custom makefile support mutliple cpus
Jenna:
You could try something like:
--- Quote ---$make -r -R -j $if(PLATFORM == PLATFORM_MSW){%NUMBER_OF_PROCESSORS%}{`getconf _NPROCESSORS_ONLN`} -f $makefile $target
--- End quote ---
the linux part should work, but I'm not sure about the windows part, you might need someting similar to linux' "echo".
mattn2:
thanks - but there is also mac - which does this again a little bit different. and c::b must already know the amount of cpus, no?
Jenna:
wxWidgets has a static function to determine the umber of cpu's, but I don't know how good it works.
But it could surely be used to add a cpu_count macro, that can be used wherever macro-/variable-expansion is done.
oBFusCATed:
--- Quote from: jens on October 25, 2012, 10:29:42 pm ---wxWidgets has a static function to determine the umber of cpu's, but I don't know how good it works.
But it could surely be used to add a cpu_count macro, that can be used wherever macro-/variable-expansion is done.
--- End quote ---
We have also a setting for the number of cpus used for building, this could be provided here.
Jenna:
--- Quote from: oBFusCATed on October 25, 2012, 10:34:10 pm ---
--- Quote from: jens on October 25, 2012, 10:29:42 pm ---wxWidgets has a static function to determine the umber of cpu's, but I don't know how good it works.
But it could surely be used to add a cpu_count macro, that can be used wherever macro-/variable-expansion is done.
--- End quote ---
We have also a setting for the number of cpus used for building, this could be provided here.
--- End quote ---
Both could be provided:
the number of CPU's determined by wxw and the number of parallel processes for building set by the user in the compiler options dialog.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version