News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Enabling parallel builds seems to fail

Started by fortiernor, April 08, 2019, 08:20:36 PM

Previous topic - Next topic

fortiernor

New to Code::Blocks, to work on an open-source project.
I specified "Number of processes for parallel builds" to be 12 (this is a 6-core cpu). Still my cpu monitor indicates little use of processor and a rebuild takes over 9 minutes. Adding -pthread in "Other compiler options" and "Other linker options" does not make any difference. I include a sample build output below.
Rebuilding from command-line with cmake takes 3 minutes and cpu monitor indicates 100% use. With QTCreator a rebuild takes 4 minutes and cpu monitor also indicates 100% use.

Any suggestions?
This is 17.12 on Archlinux 5.0.4-arch1-1-ARCH #1 SMP PREEMPT.

gcc -v output:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto
Thread model: posix
gcc version 8.2.1 20181127 (GCC)


[ 86%] Building CXX object [...]
cd [...] && /usr/bin/c++  -DAUTO_GDK_FLUSH=0 -DGUIVERSION -DMYFILE_MMAP -DRT_FFTW3F_OMP -DSTRICT_MUTEX=1 -DTRACE_MYRWMUTEX=0 -D_DEBUG -I/home/normand/local/rt-xmp/build/rtgui -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi-3.2.1/include -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/uuid -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/libdrm -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/gtkmm-3.0 -I/usr/lib/gtkmm-3.0/include -I/usr/include/atkmm-1.6 -I/usr/include/pangomm-1.4 -I/usr/lib/pangomm-1.4/include -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib/gdkmm-3.0/include -I/usr/include/libiptcdata -I/usr/include/lensfun -I/usr/include/librsvg-2.0  -std=c++11 -march=corei7 -Werror=unused-label -Wall -Wuninitialized -Wno-deprecated-declarations -Wno-unused-result -fopenmp -Werror=unknown-pragmas -g    -std=c++11 -march=corei7 -Werror=unused-label -Wall -Wuninitialized -Wno-deprecated-declarations -Wno-unused-result -fopenmp -Werror=unknown-pragmas -o

oBFusCATed

1. I guess this is a cmake project?
2. -pthread is to use pthread in your project it doesn't matter for building
3. Do you have tons of output? Lots of warnings? What happens if you switch to no output?
4. ninja or make? Can you post the start of the log?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

fortiernor

Yes, this is a cmake project. Switching output off (Settings / Compiler settings / Other settings / Compiler logging -> No logging) does not make a difference (> 9 minutes).
This is using make (start of the log includes "Running command: /usr/bin/make [...]").

stahta01

Quote from: fortiernor on April 08, 2019, 09:45:59 PM
Yes, this is a cmake project. Switching output off (Settings / Compiler settings / Other settings / Compiler logging -> No logging) does not make a difference (> 9 minutes).
This is using make (start of the log includes "Running command: /usr/bin/make [...]").

Since, you are not using the CB Build system; you need to edit the cmake/make build system to change the build settings.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]


oBFusCATed

Please post the beginning of the build log.
It should start with something like make -jN mytarget.
-jN is the important part.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]