ZLib and BZip2 CMake external sources

Issue #3 closed
Former user created an issue

Note that you don't have to embed these in your package source tree, and as a potential downstream consumer, I'd strongly prefer them not to be present. It also hinders packaging by distributors (Debian Med, Ubuntu PPA, homebrew science, FreeBSD ports etc.) who will need to strip them out. With CMake, you could alternatively make use of an external super-build structure to allow them to remain system- or externally-provided dependencies which are built as part of a build of a larger package collection. In the ideal case, a simple unconditional find_package call for each library is all you need in a leaf package such as this (this is what we do for each of our library packages).

Examples: https://github.com/ome/ome-cmake-superbuild/tree/develop/packages/bzip2 https://github.com/ome/ome-cmake-superbuild/tree/develop/packages/zlib https://gitlab.kitware.com/paraview/common-superbuild/tree/master/projects We have these built as part of the super-build project, and ideally we would add KLB as another project to the super-build with dependencies upon the bzip2 and zlib parts of the super-build; we have no use for the embedded copies and the klb package can be blissfully unaware of the higher-level details. Note that you would be welcome to use the OME super-build infrastructure for this purpose; adding KLB is on the todo list for investigation.

Also, regarding the CMakeLists.txt you are using for bzip2, you might want to pick up this in the interim: https://github.com/ome/ome-cmake-superbuild/blob/develop/packages/bzip2/patches/cmake.diff This is a comprehensive conversion which has been submitted to the bzip2 upstream, and was jointly developed by OME and Kitware for our respective super-build support infrastructure. It's a bit more portable and complete than what you have in tree at present.

Regards, Roger

Comments (5)

  1. Former user Account Deleted reporter

    Note that I've added preliminary support for klb to the OME super-build as a proof of concept to see how easy it would be to integrate. I've found a number of issues which I'll address separately from this one.

    You can find that here: https://github.com/rleigh-codelibre/ome-cmake-superbuild/commit/52bbd1a2d3627da4d97a6d4c6004889aea2cae8b

    The transcript below shows an example run from scratch, which you can try out yourself, to demonstrate how the external bzip2 and zlib dependencies are built. You can see them get downloaded, patched, built, tested and installed during the build. Then we build klb. Note the build failures due to link errors--likely missing -pthread. I'll look at that separately. You can also have cmake cache the downloaded sources if you add -Dsource-cache=cachedir to the cmake command line.

    % git clone https://github.com/ome/ome-cmake-superbuild.git
    Cloning into 'ome-cmake-superbuild'...
    [...]
    Checking connectivity... done.
    % cd ome-cmake-superbuild
    % git remote add rleigh https://github.com/rleigh-codelibre/ome-cmake-superbuild.git
    % git fetch rleigh
    [...]
    From https://github.com/rleigh-codelibre/ome-cmake-superbuild
     * [new branch]      add-klb    -> rleigh/add-klb
    [...]
    % git checkout add-klb
    Branch add-klb set up to track remote branch add-klb from rleigh.
    Switched to a new branch 'add-klb'
    % mkdir /tmp/build
    % cd /tmp/build
    % cmake -Dbuild-packages=klb /tmp/ome-cmake-superbuild
    -- The CXX compiler identification is GNU 5.4.0
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    [...]
    -- Obtaining version from git
    -- Found Git: /usr/bin/git (found version "2.7.4") 
    -- Configuring OME Super-Build version 0.2.0-3-g52bbd1a
    -- Using git commit 52bbd1a on 2016-09-08 14:38:10 +0100
    -- Adding dependency - klb
    -- Building KLB from git (URL https://bitbucket.org/fernandoamat/keller-lab-block-filetype.git, branch/tag master)
    -- Adding third-party dependency - bzip2
    -- Adding third-party dependency - patch
    -- Adding third-party dependency - zlib
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/build
    % make
    Scanning dependencies of target patch-prerequisites
    [  0%] Built target patch-prerequisites
    Scanning dependencies of target patch
    [  2%] Creating directories for 'patch'
    [  5%] No download step for 'patch'
    [  8%] No patch step for 'patch'
    [ 11%] No update step for 'patch'
    [ 14%] No configure step for 'patch'
    [ 17%] No build step for 'patch'
    [ 20%] No install step for 'patch'
    [ 22%] Completed 'patch'
    [ 22%] Built target patch
    Scanning dependencies of target bzip2-prerequisites
    [ 22%] Built target bzip2-prerequisites
    Scanning dependencies of target bzip2
    [ 25%] Creating directories for 'bzip2'
    [ 28%] Performing download step (download, verify and extract) for 'bzip2'
    -- downloading...
         src='http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz'
         dst='/tmp/build/sourcecache/bzip2-1.0.6.tar.gz'
         timeout='none'
    -- [download 100% complete]
    -- downloading... done
    -- verifying file...
         file='/tmp/build/sourcecache/bzip2-1.0.6.tar.gz'
    -- verifying file... done
    -- extracting...
         src='/tmp/build/sourcecache/bzip2-1.0.6.tar.gz'
         dst='/tmp/build/bzip2-source'
    -- extracting... [tar xfz]
    -- extracting... [analysis]
    -- extracting... [rename]
    -- extracting... [clean up]
    -- extracting... done
    [ 31%] Performing patch step for 'bzip2'
    -- Applying patch cmake.diff
    patching file BZip2Config.cmake.in
    patching file CMakeLists.txt
    patching file RunTest.cmake
    patching file bz2.def
    [ 34%] No update step for 'bzip2'
    [ 37%] Performing configure step for 'bzip2'
    -- Configuring with "/usr/bin/cmake"
      -G "Unix Makefiles"
      "-DCMAKE_BUILD_TYPE="
      "-DCMAKE_INSTALL_PREFIX=/tmp/build/superbuild-install"
      "-DCMAKE_INSTALL_LIBDIR=lib"
      "-DCMAKE_PREFIX_PATH=/tmp/build/superbuild-install"
      "-DCMAKE_PROGRAM_PATH="
      "-DCMAKE_LIBRARY_PATH="
      -Wno-dev;--no-warn-unused-cli
      "/tmp/build/bzip2-source"
    Not searching for unused variables given on the command line.
    -- The C compiler identification is GNU 5.4.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/build/bzip2-build
    [ 40%] Performing build step for 'bzip2'
    -- Building with "/usr/bin/cmake" --build .
      --config ""
      -- 
    Scanning dependencies of target bz2
    [  8%] Building C object CMakeFiles/bz2.dir/blocksort.c.o
    [ 16%] Building C object CMakeFiles/bz2.dir/huffman.c.o
    [ 25%] Building C object CMakeFiles/bz2.dir/crctable.c.o
    [ 33%] Building C object CMakeFiles/bz2.dir/randtable.c.o
    [ 41%] Building C object CMakeFiles/bz2.dir/compress.c.o
    [ 50%] Building C object CMakeFiles/bz2.dir/decompress.c.o
    [ 58%] Building C object CMakeFiles/bz2.dir/bzlib.c.o
    [ 66%] Linking C shared library libbz2.so
    [ 66%] Built target bz2
    Scanning dependencies of target bzip2recover
    [ 75%] Building C object CMakeFiles/bzip2recover.dir/bzip2recover.c.o
    [ 83%] Linking C executable bzip2recover
    [ 83%] Built target bzip2recover
    Scanning dependencies of target bzip2
    [ 91%] Building C object CMakeFiles/bzip2.dir/bzip2.c.o
    [100%] Linking C executable bzip2
    [100%] Built target bzip2
    [ 42%] Performing install step for 'bzip2'
    [ 66%] Built target bz2
    [ 83%] Built target bzip2recover
    [100%] Built target bzip2
    Install the project...
    -- Install configuration: ""
    -- Installing: /tmp/build/superbuild-install/lib/libbz2.so.1.0.6
    -- Installing: /tmp/build/superbuild-install/lib/libbz2.so.1.0
    -- Installing: /tmp/build/superbuild-install/lib/libbz2.so
    -- Installing: /tmp/build/superbuild-install/lib/cmake/BZip2/BZip2ConfigInternal.cmake
    -- Installing: /tmp/build/superbuild-install/lib/cmake/BZip2/BZip2ConfigInternal-noconfig.cmake
    -- Installing: /tmp/build/superbuild-install/lib/cmake/BZip2/BZip2Config.cmake
    -- Installing: /tmp/build/superbuild-install/lib/cmake/BZip2/BZip2ConfigVersion.cmake
    -- Installing: /tmp/build/superbuild-install/include/bzlib.h
    -- Installing: /tmp/build/superbuild-install/share/man/man1/bzip2.1
    -- Installing: /tmp/build/superbuild-install/share/man/man1/bzdiff.1
    -- Installing: /tmp/build/superbuild-install/share/man/man1/bzgrep.1
    -- Installing: /tmp/build/superbuild-install/share/man/man1/bzmore.1
    -- Installing: /tmp/build/superbuild-install/bin/bzip2
    -- Set runtime path of "/tmp/build/superbuild-install/bin/bzip2" to ""
    -- Installing: /tmp/build/superbuild-install/bin/bzip2recover
    -- Set runtime path of "/tmp/build/superbuild-install/bin/bzip2recover" to ""
    -- Installing: /tmp/build/superbuild-install/bin/bzgrep
    -- Installing: /tmp/build/superbuild-install/bin/bzmore
    -- Installing: /tmp/build/superbuild-install/bin/bzdiff
    [ 45%] Performing test step for 'bzip2'
    [ 66%] Built target bz2
    [ 83%] Built target bzip2recover
    [100%] Built target bzip2
    Install the project...
    -- Install configuration: ""
    -- Up-to-date: /tmp/build/superbuild-install/lib/libbz2.so.1.0.6
    -- Up-to-date: /tmp/build/superbuild-install/lib/libbz2.so.1.0
    -- Up-to-date: /tmp/build/superbuild-install/lib/libbz2.so
    -- Up-to-date: /tmp/build/superbuild-install/lib/cmake/BZip2/BZip2ConfigInternal.cmake
    -- Up-to-date: /tmp/build/superbuild-install/lib/cmake/BZip2/BZip2ConfigInternal-noconfig.cmake
    -- Up-to-date: /tmp/build/superbuild-install/lib/cmake/BZip2/BZip2Config.cmake
    -- Up-to-date: /tmp/build/superbuild-install/lib/cmake/BZip2/BZip2ConfigVersion.cmake
    -- Up-to-date: /tmp/build/superbuild-install/include/bzlib.h
    -- Up-to-date: /tmp/build/superbuild-install/share/man/man1/bzip2.1
    -- Up-to-date: /tmp/build/superbuild-install/share/man/man1/bzdiff.1
    -- Up-to-date: /tmp/build/superbuild-install/share/man/man1/bzgrep.1
    -- Up-to-date: /tmp/build/superbuild-install/share/man/man1/bzmore.1
    -- Up-to-date: /tmp/build/superbuild-install/bin/bzip2
    -- Up-to-date: /tmp/build/superbuild-install/bin/bzip2recover
    -- Up-to-date: /tmp/build/superbuild-install/bin/bzgrep
    -- Up-to-date: /tmp/build/superbuild-install/bin/bzmore
    -- Up-to-date: /tmp/build/superbuild-install/bin/bzdiff
    [ 48%] Completed 'bzip2'
    [ 48%] Built target bzip2
    Scanning dependencies of target zlib-prerequisites
    [ 48%] Built target zlib-prerequisites
    Scanning dependencies of target zlib
    [ 51%] Creating directories for 'zlib'
    [ 54%] Performing download step (download, verify and extract) for 'zlib'
    -- downloading...
         src='http://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.xz'
         dst='/tmp/build/sourcecache/zlib-1.2.8.tar.xz'
         timeout='none'
    -- [download 100% complete]
    -- downloading... done
    -- verifying file...
         file='/tmp/build/sourcecache/zlib-1.2.8.tar.xz'
    -- verifying file... done
    -- extracting...
         src='/tmp/build/sourcecache/zlib-1.2.8.tar.xz'
         dst='/tmp/build/zlib-source'
    -- extracting... [tar xfz]
    -- extracting... [analysis]
    -- extracting... [rename]
    -- extracting... [clean up]
    -- extracting... done
    [ 57%] No patch step for 'zlib'
    [ 60%] No update step for 'zlib'
    [ 62%] Performing configure step for 'zlib'
    -- Configuring with "/usr/bin/cmake"
      -G "Unix Makefiles"
      "-DCMAKE_BUILD_TYPE="
      "-DCMAKE_INSTALL_PREFIX=/tmp/build/superbuild-install"
      "-DCMAKE_INSTALL_LIBDIR=lib"
      "-DCMAKE_PREFIX_PATH=/tmp/build/superbuild-install"
      "-DCMAKE_PROGRAM_PATH="
      "-DCMAKE_LIBRARY_PATH="
      -Wno-dev;--no-warn-unused-cli
      "/tmp/build/zlib-source"
    Not searching for unused variables given on the command line.
    -- The C compiler identification is GNU 5.4.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of off64_t
    -- Check size of off64_t - done
    -- Looking for fseeko
    -- Looking for fseeko - found
    -- Looking for unistd.h
    -- Looking for unistd.h - found
    -- Renaming
    --     /tmp/build/zlib-source/zconf.h
    -- to 'zconf.h.included' because this file is included with zlib
    -- but CMake generates it automatically in the build directory.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/build/zlib-build
    [ 65%] Performing build step for 'zlib'
    -- Building with "/usr/bin/cmake" --build .
      --config ""
      -- 
    Scanning dependencies of target zlib
    [  2%] Building C object CMakeFiles/zlib.dir/adler32.o
    [  5%] Building C object CMakeFiles/zlib.dir/compress.o
    [  7%] Building C object CMakeFiles/zlib.dir/crc32.o
    [ 10%] Building C object CMakeFiles/zlib.dir/deflate.o
    [ 12%] Building C object CMakeFiles/zlib.dir/gzclose.o
    [ 15%] Building C object CMakeFiles/zlib.dir/gzlib.o
    [ 17%] Building C object CMakeFiles/zlib.dir/gzread.o
    [ 20%] Building C object CMakeFiles/zlib.dir/gzwrite.o
    [ 22%] Building C object CMakeFiles/zlib.dir/inflate.o
    [ 25%] Building C object CMakeFiles/zlib.dir/infback.o
    [ 27%] Building C object CMakeFiles/zlib.dir/inftrees.o
    [ 30%] Building C object CMakeFiles/zlib.dir/inffast.o
    [ 32%] Building C object CMakeFiles/zlib.dir/trees.o
    [ 35%] Building C object CMakeFiles/zlib.dir/uncompr.o
    [ 37%] Building C object CMakeFiles/zlib.dir/zutil.o
    [ 40%] Linking C shared library libz.so
    [ 40%] Built target zlib
    Scanning dependencies of target minigzip
    [ 42%] Building C object CMakeFiles/minigzip.dir/test/minigzip.o
    [ 45%] Linking C executable minigzip
    [ 45%] Built target minigzip
    Scanning dependencies of target example
    [ 47%] Building C object CMakeFiles/example.dir/test/example.o
    [ 50%] Linking C executable example
    [ 50%] Built target example
    Scanning dependencies of target zlibstatic
    [ 52%] Building C object CMakeFiles/zlibstatic.dir/adler32.o
    [ 55%] Building C object CMakeFiles/zlibstatic.dir/compress.o
    [ 57%] Building C object CMakeFiles/zlibstatic.dir/crc32.o
    [ 60%] Building C object CMakeFiles/zlibstatic.dir/deflate.o
    [ 62%] Building C object CMakeFiles/zlibstatic.dir/gzclose.o
    [ 65%] Building C object CMakeFiles/zlibstatic.dir/gzlib.o
    [ 67%] Building C object CMakeFiles/zlibstatic.dir/gzread.o
    [ 70%] Building C object CMakeFiles/zlibstatic.dir/gzwrite.o
    [ 72%] Building C object CMakeFiles/zlibstatic.dir/inflate.o
    [ 75%] Building C object CMakeFiles/zlibstatic.dir/infback.o
    [ 77%] Building C object CMakeFiles/zlibstatic.dir/inftrees.o
    [ 80%] Building C object CMakeFiles/zlibstatic.dir/inffast.o
    [ 82%] Building C object CMakeFiles/zlibstatic.dir/trees.o
    [ 85%] Building C object CMakeFiles/zlibstatic.dir/uncompr.o
    [ 87%] Building C object CMakeFiles/zlibstatic.dir/zutil.o
    [ 90%] Linking C static library libz.a
    [ 90%] Built target zlibstatic
    Scanning dependencies of target example64
    [ 92%] Building C object CMakeFiles/example64.dir/test/example.o
    [ 95%] Linking C executable example64
    [ 95%] Built target example64
    Scanning dependencies of target minigzip64
    [ 97%] Building C object CMakeFiles/minigzip64.dir/test/minigzip.o
    [100%] Linking C executable minigzip64
    [100%] Built target minigzip64
    [ 68%] Performing install step for 'zlib'
    [ 40%] Built target zlib
    [ 45%] Built target minigzip
    [ 50%] Built target example
    [ 90%] Built target zlibstatic
    [ 95%] Built target example64
    [100%] Built target minigzip64
    Install the project...
    -- Install configuration: ""
    -- Installing: /tmp/build/superbuild-install/lib/libz.so.1.2.8
    -- Installing: /tmp/build/superbuild-install/lib/libz.so.1
    -- Installing: /tmp/build/superbuild-install/lib/libz.so
    -- Installing: /tmp/build/superbuild-install/lib/libz.a
    -- Installing: /tmp/build/superbuild-install/include/zconf.h
    -- Installing: /tmp/build/superbuild-install/include/zlib.h
    -- Installing: /tmp/build/superbuild-install/share/man/man3/zlib.3
    -- Installing: /tmp/build/superbuild-install/share/pkgconfig/zlib.pc
    [ 71%] Performing test step for 'zlib'
    UpdateCTestConfiguration  from :/tmp/build/zlib-build/DartConfiguration.tcl
    UpdateCTestConfiguration  from :/tmp/build/zlib-build/DartConfiguration.tcl
    Test project /tmp/build/zlib-build
    Constructing a list of tests
    Done constructing a list of tests
    Checking test dependency graph...
    Checking test dependency graph end
    test 1
        Start 1: example
    
    1: Test command: /tmp/build/zlib-build/example
    1: Test timeout computed to be: 9.99988e+06
    1: zlib version 1.2.8 = 0x1280, compile flags = 0xa9
    1: uncompress(): hello, hello!
    1: gzread(): hello, hello!
    1: gzgets() after gzseek:  hello!
    1: inflate(): hello, hello!
    1: large_inflate(): OK
    1: after inflateSync(): hello, hello!
    1: inflate with dictionary: hello, hello!
    1/2 Test #1: example ..........................   Passed    0.00 sec
    test 2
        Start 2: example64
    
    2: Test command: /tmp/build/zlib-build/example64
    2: Test timeout computed to be: 9.99988e+06
    2: zlib version 1.2.8 = 0x1280, compile flags = 0xa9
    2: uncompress(): hello, hello!
    2: gzread(): hello, hello!
    2: gzgets() after gzseek:  hello!
    2: inflate(): hello, hello!
    2: large_inflate(): OK
    2: after inflateSync(): hello, hello!
    2: inflate with dictionary: hello, hello!
    2/2 Test #2: example64 ........................   Passed    0.00 sec
    
    100% tests passed, 0 tests failed out of 2
    
    Total Test time (real) =   0.01 sec
    -- cmake: Testing passed
    [ 74%] Completed 'zlib'
    [ 74%] Built target zlib
    Scanning dependencies of target klb-prerequisites
    [ 74%] Built target klb-prerequisites
    Scanning dependencies of target klb
    [ 77%] Creating directories for 'klb'
    [ 80%] Performing download step (git clone) for 'klb'
    Cloning into 'klb-source'...
    Already on 'master'
    Your branch is up-to-date with 'origin/master'.
    [ 82%] No patch step for 'klb'
    [ 85%] Skipping update step for 'klb'
    [ 88%] Performing configure step for 'klb'
    -- Configuring with "/usr/bin/cmake"
      -G "Unix Makefiles"
      "-DCMAKE_BUILD_TYPE="
      "-DCMAKE_INSTALL_PREFIX=/tmp/build/superbuild-install"
      "-DCMAKE_INSTALL_LIBDIR=lib"
      "-DCMAKE_PREFIX_PATH=/tmp/build/superbuild-install"
      "-DCMAKE_PROGRAM_PATH="
      "-DCMAKE_LIBRARY_PATH="
      -DUSE_BUNDLED_BZIP2:BOOL=OFF;-DUSE_BUNDLED_ZLIB:BOOL=OFF;-Dextra-warnings:BOOL=OFF;-Dfatal-warnings:BOOL=OFF;-Drelocatable-install:BOOL=ON;-Dtest:BOOL=ON;-Dextended-tests:BOOL=OFF;-Ddoxygen:BOOL=ON;-Dsphinx:BOOL=ON;-Dsphinx-pdf:BOOL=ON;-Dsphinx-linkcheck:BOOL=OFF
      "/tmp/build/klb-source/src"
    -- The C compiler identification is GNU 5.4.0
    -- The CXX compiler identification is GNU 5.4.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found BZip2: /tmp/build/superbuild-install/lib/libbz2.so (found version "1.0.6") 
    -- Looking for BZ2_bzCompressInit
    -- Looking for BZ2_bzCompressInit - found
    -- Found ZLIB: /tmp/build/superbuild-install/lib/libz.so (found version "1.2.8") 
    -- Configuring done
    -- Generating done
    CMake Warning:
      Manually-specified variables were not used by the project:
    
        CMAKE_INSTALL_LIBDIR
        doxygen
        extended-tests
        extra-warnings
        fatal-warnings
        relocatable-install
        sphinx
        sphinx-linkcheck
        sphinx-pdf
        test
    
    
    -- Build files have been written to: /tmp/build/klb-build
    [ 91%] Performing build step for 'klb'
    -- Building with "/usr/bin/cmake" --build .
      --config ""
      -- 
    Scanning dependencies of target klblib
    [  3%] Building CXX object CMakeFiles/klblib.dir/klb_circularDequeue.cpp.o
    [  7%] Building CXX object CMakeFiles/klblib.dir/klb_ROI.cpp.o
    [ 11%] Building CXX object CMakeFiles/klblib.dir/klb_imageIO.cpp.o
    [ 15%] Building CXX object CMakeFiles/klblib.dir/klb_Cwrapper.cpp.o
    [ 19%] Building CXX object CMakeFiles/klblib.dir/klb_imageHeader.cpp.o
    [ 23%] Linking CXX static library libklblib.a
    [ 23%] Built target klblib
    Scanning dependencies of target large_files_klbIO
    [ 26%] Building CXX object CMakeFiles/large_files_klbIO.dir/mainTest_largeFiles_klbIO.cxx.o
    [ 30%] Linking CXX executable large_files_klbIO
    [ 30%] Built target large_files_klbIO
    Scanning dependencies of target klblibs
    [ 34%] Building CXX object CMakeFiles/klblibs.dir/klb_circularDequeue.cpp.o
    [ 38%] Building CXX object CMakeFiles/klblibs.dir/klb_ROI.cpp.o
    [ 42%] Building CXX object CMakeFiles/klblibs.dir/klb_imageIO.cpp.o
    [ 46%] Building CXX object CMakeFiles/klblibs.dir/klb_Cwrapper.cpp.o
    [ 50%] Building CXX object CMakeFiles/klblibs.dir/klb_imageHeader.cpp.o
    [ 53%] Linking CXX shared library libklb.so
    [ 53%] Built target klblibs
    Scanning dependencies of target test_klbIO_C
    [ 57%] Building C object CMakeFiles/test_klbIO_C.dir/mainTest_klbIO.c.o
    [ 61%] Linking C executable test_klbIO_C
    [ 61%] Built target test_klbIO_C
    Scanning dependencies of target test_klbIO
    [ 65%] Building CXX object CMakeFiles/test_klbIO.dir/mainTest_klbIO.cxx.o
    [ 69%] Linking CXX executable test_klbIO
    [ 69%] Built target test_klbIO
    Scanning dependencies of target speed_klbIO
    [ 73%] Building CXX object CMakeFiles/speed_klbIO.dir/mainTestSpeed_klbIO.cxx.o
    [ 76%] Linking CXX executable speed_klbIO
    [ 76%] Built target speed_klbIO
    Scanning dependencies of target testPbzip2_Cpp11Threads
    [ 80%] Building CXX object CMakeFiles/testPbzip2_Cpp11Threads.dir/testPbzip2_Cpp11Threads.cxx.o
    [ 84%] Linking CXX executable testPbzip2_Cpp11Threads
    [ 84%] Built target testPbzip2_Cpp11Threads
    Scanning dependencies of target write_float_bz2
    [ 88%] Building C object test/CMakeFiles/write_float_bz2.dir/write_float_bz2.c.o
    /tmp/build/klb-source/src/test/write_float_bz2.c: In function ‘write’:
    /tmp/build/klb-source/src/test/write_float_bz2.c:16:40: warning: passing argument 3 of ‘writeKLBstack’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         return writeKLBstack(data,FILENAME,xyzct,FLOAT32_TYPE,-1,pixelSize, blockSize,BZIP2,0);
                                            ^
    In file included from /tmp/build/klb-source/src/test/write_float_bz2.c:3:0:
    /tmp/build/klb-source/src/test/../klb_Cwrapper.h:40:20: note: expected ‘uint32_t * {aka unsigned int *}’ but argument is of type ‘const uint32_t * {aka const unsigned int *}’
      DECLSPECIFIER int writeKLBstack(const void* im, const char* filename, uint32_t xyzct[KLB_DATA_DIMS], enum KLB_DATA_TYPE dataType, int numThreads, float32_t pixelSize[KLB_DATA_DIMS], uint32_t blockSize[KLB_DATA_DIMS], enum KLB_COMPRESSION_TYPE compressionType, char metadata[KLB_METADATA_SIZE]);
                        ^
    /tmp/build/klb-source/src/test/write_float_bz2.c:16:62: warning: passing argument 6 of ‘writeKLBstack’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         return writeKLBstack(data,FILENAME,xyzct,FLOAT32_TYPE,-1,pixelSize, blockSize,BZIP2,0);
                                                                  ^
    In file included from /tmp/build/klb-source/src/test/write_float_bz2.c:3:0:
    /tmp/build/klb-source/src/test/../klb_Cwrapper.h:40:20: note: expected ‘float32_t * {aka float *}’ but argument is of type ‘const float32_t * {aka const float *}’
      DECLSPECIFIER int writeKLBstack(const void* im, const char* filename, uint32_t xyzct[KLB_DATA_DIMS], enum KLB_DATA_TYPE dataType, int numThreads, float32_t pixelSize[KLB_DATA_DIMS], uint32_t blockSize[KLB_DATA_DIMS], enum KLB_COMPRESSION_TYPE compressionType, char metadata[KLB_METADATA_SIZE]);
                        ^
    /tmp/build/klb-source/src/test/write_float_bz2.c:16:73: warning: passing argument 7 of ‘writeKLBstack’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         return writeKLBstack(data,FILENAME,xyzct,FLOAT32_TYPE,-1,pixelSize, blockSize,BZIP2,0);
                                                                             ^
    In file included from /tmp/build/klb-source/src/test/write_float_bz2.c:3:0:
    /tmp/build/klb-source/src/test/../klb_Cwrapper.h:40:20: note: expected ‘uint32_t * {aka unsigned int *}’ but argument is of type ‘const uint32_t * {aka const unsigned int *}’
      DECLSPECIFIER int writeKLBstack(const void* im, const char* filename, uint32_t xyzct[KLB_DATA_DIMS], enum KLB_DATA_TYPE dataType, int numThreads, float32_t pixelSize[KLB_DATA_DIMS], uint32_t blockSize[KLB_DATA_DIMS], enum KLB_COMPRESSION_TYPE compressionType, char metadata[KLB_METADATA_SIZE]);
                        ^
    [ 92%] Linking CXX executable write_float_bz2
    ../libklblib.a(klb_imageIO.cpp.o): In function `std::thread::thread<void (klb_imageIO::*)(_IO_FILE*, int*, int*, klb_circular_dequeue**, int*), klb_imageIO*, _IO_FILE*&, int*&, int*&, klb_circular_dequeue**&, int*>(void (klb_imageIO::*&&)(_IO_FILE*, int*, int*, klb_circular_dequeue**, int*), klb_imageIO*&&, _IO_FILE*&, int*&, int*&, klb_circular_dequeue**&, int*&&)':
    klb_imageIO.cpp:(.text._ZNSt6threadC2IM11klb_imageIOFvP8_IO_FILEPiS4_PP20klb_circular_dequeueS4_EJPS1_RS3_RS4_SC_RS7_S4_EEEOT_DpOT0_[_ZNSt6threadC5IM11klb_imageIOFvP8_IO_FILEPiS4_PP20klb_circular_dequeueS4_EJPS1_RS3_RS4_SC_RS7_S4_EEEOT_DpOT0_]+0x15e): undefined reference to `pthread_create'
    ../libklblib.a(klb_imageIO.cpp.o): In function `std::thread::thread<void (klb_imageIO::*)(char const*, int*, std::atomic<unsigned long>*, int*, klb_circular_dequeue*, int, int*), klb_imageIO*, char const*&, int*&, std::atomic<unsigned long>*, int*&, klb_circular_dequeue*&, int&, int*>(void (klb_imageIO::*&&)(char const*, int*, std::atomic<unsigned long>*, int*, klb_circular_dequeue*, int, int*), klb_imageIO*&&, char const*&, int*&, std::atomic<unsigned long>*&&, int*&, klb_circular_dequeue*&, int&, int*&&)':
    klb_imageIO.cpp:(.text._ZNSt6threadC2IM11klb_imageIOFvPKcPiPSt6atomicImES4_P20klb_circular_dequeueiS4_EJPS1_RS3_RS4_S7_SE_RS9_RiS4_EEEOT_DpOT0_[_ZNSt6threadC5IM11klb_imageIOFvPKcPiPSt6atomicImES4_P20klb_circular_dequeueiS4_EJPS1_RS3_RS4_S7_SE_RS9_RiS4_EEEOT_DpOT0_]+0x1b2): undefined reference to `pthread_create'
    ../libklblib.a(klb_imageIO.cpp.o): In function `std::thread::thread<void (klb_imageIO::*)(char const**, int*, std::atomic<unsigned long>*, int*, klb_circular_dequeue*, int, int*), klb_imageIO*, char const**&, int*&, std::atomic<unsigned long>*, int*&, klb_circular_dequeue*&, int&, int*>(void (klb_imageIO::*&&)(char const**, int*, std::atomic<unsigned long>*, int*, klb_circular_dequeue*, int, int*), klb_imageIO*&&, char const**&, int*&, std::atomic<unsigned long>*&&, int*&, klb_circular_dequeue*&, int&, int*&&)':
    klb_imageIO.cpp:(.text._ZNSt6threadC2IM11klb_imageIOFvPPKcPiPSt6atomicImES5_P20klb_circular_dequeueiS5_EJPS1_RS4_RS5_S8_SF_RSA_RiS5_EEEOT_DpOT0_[_ZNSt6threadC5IM11klb_imageIOFvPPKcPiPSt6atomicImES5_P20klb_circular_dequeueiS5_EJPS1_RS4_RS5_S8_SF_RSA_RiS5_EEEOT_DpOT0_]+0x1b2): undefined reference to `pthread_create'
    ../libklblib.a(klb_imageIO.cpp.o): In function `std::thread::thread<void (klb_imageIO::*)(char*, std::atomic<unsigned long>*, klb_ROI const*, int*), klb_imageIO*, char*&, std::atomic<unsigned long>*, klb_ROI const*&, int*>(void (klb_imageIO::*&&)(char*, std::atomic<unsigned long>*, klb_ROI const*, int*), klb_imageIO*&&, char*&, std::atomic<unsigned long>*&&, klb_ROI const*&, int*&&)':
    klb_imageIO.cpp:(.text._ZNSt6threadC2IM11klb_imageIOFvPcPSt6atomicImEPK7klb_ROIPiEJPS1_RS2_S5_RS8_S9_EEEOT_DpOT0_[_ZNSt6threadC5IM11klb_imageIOFvPcPSt6atomicImEPK7klb_ROIPiEJPS1_RS2_S5_RS8_S9_EEEOT_DpOT0_]+0x135): undefined reference to `pthread_create'
    ../libklblib.a(klb_imageIO.cpp.o): In function `std::thread::thread<void (klb_imageIO::*)(char*, std::atomic<unsigned long>*, int*), klb_imageIO*, char*&, std::atomic<unsigned long>*, int*>(void (klb_imageIO::*&&)(char*, std::atomic<unsigned long>*, int*), klb_imageIO*&&, char*&, std::atomic<unsigned long>*&&, int*&&)':
    klb_imageIO.cpp:(.text._ZNSt6threadC2IM11klb_imageIOFvPcPSt6atomicImEPiEJPS1_RS2_S5_S6_EEEOT_DpOT0_[_ZNSt6threadC5IM11klb_imageIOFvPcPSt6atomicImEPiEJPS1_RS2_S5_S6_EEEOT_DpOT0_]+0x107): undefined reference to `pthread_create'
    collect2: error: ld returned 1 exit status
    test/CMakeFiles/write_float_bz2.dir/build.make:97: recipe for target 'test/write_float_bz2' failed
    make[5]: *** [test/write_float_bz2] Error 1
    CMakeFiles/Makefile2:1242: recipe for target 'test/CMakeFiles/write_float_bz2.dir/all' failed
    make[4]: *** [test/CMakeFiles/write_float_bz2.dir/all] Error 2
    Makefile:94: recipe for target 'all' failed
    make[3]: *** [all] Error 2
    CMake Error at /tmp/ome-cmake-superbuild/helpers/cmake_build.cmake:18 (message):
      cmake: Install failed
    
    
    CMakeFiles/klb.dir/build.make:106: recipe for target 'klb-prefix/src/klb-stamp/klb-build' failed
    make[2]: *** [klb-prefix/src/klb-stamp/klb-build] Error 1
    CMakeFiles/Makefile2:205: recipe for target 'CMakeFiles/klb.dir/all' failed
    make[1]: *** [CMakeFiles/klb.dir/all] Error 2
    Makefile:127: recipe for target 'all' failed
    make: *** [all] Error 2
    
  2. Former user Account Deleted reporter

    I should have a better example for this in a few days. I'll close this for now.

  3. Log in to comment