Author Topic: Enabling parallel builds seems to fail  (Read 2957 times)

Offline fortiernor

  • Single posting newcomer
  • *
  • Posts: 3
Enabling parallel builds seems to fail
« on: April 08, 2019, 08:20:36 pm »
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:
Code
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)

Code
[ 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Enabling parallel builds seems to fail
« Reply #1 on: April 08, 2019, 08:50:41 pm »
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!]

Offline fortiernor

  • Single posting newcomer
  • *
  • Posts: 3
Re: Enabling parallel builds seems to fail
« Reply #2 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 [...]").

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Re: Enabling parallel builds seems to fail
« Reply #3 on: April 08, 2019, 10:40:52 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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline fortiernor

  • Single posting newcomer
  • *
  • Posts: 3
Re: Enabling parallel builds seems to fail
« Reply #4 on: April 08, 2019, 10:42:16 pm »
Ok, thank you.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Enabling parallel builds seems to fail
« Reply #5 on: April 09, 2019, 08:47:18 am »
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!]