[CMake] ExternalProject breaks a parallel make.

David Cole david.cole at kitware.com
Sat Apr 2 14:08:36 EDT 2011


Try with CMake 2.8.4 -- we fixed some parallel make propagation issues
in 2.8.3 or 2.8.4... Using "$(MAKE)" now. Should avoid the problem
you're reporting here.

On Saturday, April 2, 2011, Andrey Nikitin <andrey.d.nikitin at gmail.com> wrote:
> Hi.
>
> I have problem with make -jN and Cmake ExternalProject.
> % alias make="make -j5"
> % make
> Scanning dependencies of target EXTLIB
> [  0%] Creating directories for 'EXTLIB'
> [  0%] No download step for 'EXTLIB'
> [  0%] [  0%] No patch step for 'EXTLIB'
> No update step for 'EXTLIB'
> [  0%] No configure step for 'EXTLIB'
> [  0%] Performing build step for 'EXTLIB'
> make[3]: warning: jobserver unavailable: using -j1.  Add `+' to parent
>          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>          ^^^            THIS IS MY PROBLEM             ^^^
>          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> make rule. start EXTLIB build: duration 5 sec. EXTLIB is built
> [  0%] Performing install step for 'EXTLIB' EXTLIB *.{a,so} objects are
> installed [  0%] No test step for 'EXTLIB'
> [  0%] Completed 'EXTLIB'
> [ 90%] Built target EXTLIB
> Scanning dependencies of target hello
> [100%] Building C object CMakeFiles/hello.dir/main.c.o
> Linking C executable hello
> [100%] Built target hello
>
>
> My test project files contents see below.
>
> % tree -AF --dirsfirst
> .
> ├── build/
> ├── extlib/
> │   ├── CMakeLists.txt
> │   └── Makefile
> ├── CMakeLists.txt
> └── main.c
>
> % cat CMakeLists.txt
> cmake_minimum_required(VERSION 2.8)
> project ( hello C )
> add_subdirectory( extlib )
> add_executable( ${PROJECT_NAME} WIN32 main.c )
> add_dependencies(  ${PROJECT_NAME} EXTLIB )
>
> % cat extlib/CMakeLists.txt
> cmake_minimum_required(VERSION 2.8)
> include(ExternalProject)
>
> ExternalProject_Add( EXTLIB
>    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
>    BUILD_IN_SOURCE 1
>    DOWNLOAD_COMMAND ""
>    UPDATE_COMMAND   ""
>    PATCH_COMMAND   ""
>    CONFIGURE_COMMAND  ""
>    # BUILD_COMMAND  ""
>    TEST_COMMAND ""
>    INSTALL_COMMAND echo "EXTLIB *.{a,so} objects are installed"
> )
>
> % cat extlib/Makefile
> all:
>         echo "start EXTLIB build: duration 5 sec."
>         sleep 5
>         echo "EXTLIB is built"
>
> % cat main.c
> #include <stdio.h>
>
> int main( int argc, const char* argv[] )
> {
>    printf("Hello world!\n");
> }
>
> % cmake --version
> cmake version 2.8.2 (Debian/GNU Linux 6.0.1)
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list