jll63 / yomm2

Fast, orthogonal, open multi-methods. Solve the Expression Problem in C++17.
Boost Software License 1.0
343 stars 18 forks source link

Boost download #21

Closed derpda closed 3 years ago

derpda commented 3 years ago

Outline

We are using yomm2 as a dependency of our library on a range of machines, and many of them do not have boost installed by default. System administrators often do not want to install boost system wide. This makes compiling yomm2 difficult, and it would be better if yomm2 took care of its boost dependency itself. This PR implements that feature in the same way we deal with google/benchmark already.

Comments

jll63 commented 3 years ago

I tried in a pristine Ubuntu 20.04 WSL image. I got the following error:

$ cmake --version
cmake version 3.16.3
$ ~/dev/yomm2$ dev/run-cmake g++ Debug
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.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/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Package "Boost" not found in system.
-- Downloading dependency "Boost" and building from source.
assertconfigcontainer_hashcoredetaildynamic_bitsetfunctionalintegermovepreprocessorstatic_asserttype_traitsthrow_exception
libs/assertlibs/configlibs/container_hashlibs/corelibs/detaillibs/dynamic_bitsetlibs/functionallibs/integerlibs/movelibs/preprocessorlibs/static_assertlibs/type_traitslibs/throw_exception
CMake Error: Could not open file for write in copy operation /usr/local/lib/cmake/Boost-1.74.0/BoostConfigVersion.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at CMakeLists.txt:66 (configure_file):
  configure_file Problem configuring file

CMake Error: Could not open file for write in copy operation /usr/local/lib/cmake/boost_headers-1.74.0/boost_headers-config-version.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at CMakeLists.txt:72 (configure_file):
  configure_file Problem configuring file

CMake Error: Could not open file for write in copy operation /usr/local/lib/cmake/boost_headers-1.74.0/boost_headers-config.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at CMakeLists.txt:78 (configure_file):
  configure_file Problem configuring file

CMake Error at cmake/find_or_download_package.cmake:48 (message):
  Download of dependency Boost failed: 1
Call Stack (most recent call first):
  CMakeLists.txt:14 (find_or_download_package)

-- Configuring incomplete, errors occurred!
See also "/home/jleroy/dev/yomm2/build/g++/Debug/CMakeFiles/CMakeOutput.log".

I tried again as root. Of course this created a ton of files owned by root. I changed the owner back to my normal account and things almost worked - the tests did not compile:

$ make -j
Scanning dependencies of target dl_shared
Scanning dependencies of target yomm2
[  5%] Building CXX object examples/CMakeFiles/dl_shared.dir/dl_shared.cpp.o
[  5%] Building CXX object src/CMakeFiles/yomm2.dir/yomm2.cpp.o
[  8%] Linking CXX shared library libdl_shared.so
[  8%] Built target dl_shared
[ 10%] Linking CXX static library libyomm2.a
[ 10%] Built target yomm2
Scanning dependencies of target lab
Scanning dependencies of target whitebox
Scanning dependencies of target benchmarks
Scanning dependencies of target blackbox
Scanning dependencies of target synopsis
Scanning dependencies of target matrix
Scanning dependencies of target namespaces
Scanning dependencies of target next
Scanning dependencies of target adventure
Scanning dependencies of target accept_no_visitors
Scanning dependencies of target asteroids
[ 13%] Building CXX object examples/CMakeFiles/synopsis.dir/synopsis.cpp.o
[ 16%] Building CXX object tests/CMakeFiles/whitebox.dir/whitebox.cpp.o
[ 18%] Building CXX object tests/CMakeFiles/namespaces.dir/namespaces.cpp.o
[ 21%] Building CXX object tests/CMakeFiles/blackbox.dir/blackbox.cpp.o
[ 24%] Building CXX object examples/CMakeFiles/matrix.dir/matrix.cpp.o
[ 29%] Building CXX object tests/CMakeFiles/lab.dir/lab.cpp.o
[ 29%] Building CXX object tests/CMakeFiles/benchmarks.dir/benchmarks_vfuncs.cpp.o
[ 35%] Building CXX object tests/CMakeFiles/benchmarks.dir/benchmarks.cpp.o
[ 35%] Building CXX object examples/CMakeFiles/next.dir/next.cpp.o
Scanning dependencies of target dl_main
Scanning dependencies of target containers
[ 37%] Building CXX object examples/CMakeFiles/adventure.dir/adventure.cpp.o
[ 40%] Building CXX object examples/CMakeFiles/accept_no_visitors.dir/accept_no_visitors.cpp.o
[ 43%] Building CXX object examples/CMakeFiles/asteroids.dir/asteroids.cpp.o
[ 45%] Building CXX object examples/CMakeFiles/dl_main.dir/dl_main.cpp.o
[ 48%] Building CXX object examples/containers/CMakeFiles/containers.dir/main.cpp.o
[ 51%] Building CXX object examples/containers/CMakeFiles/containers.dir/shape_painter.cpp.o
[ 54%] Building CXX object examples/containers/CMakeFiles/containers.dir/concrete_shape_painters.cpp.o
[ 56%] Building CXX object examples/containers/CMakeFiles/containers.dir/arc_painter.cpp.o
[ 59%] Building CXX object examples/containers/CMakeFiles/containers.dir/line_painter.cpp.o
[ 62%] Building CXX object examples/containers/CMakeFiles/containers.dir/segment_painter.cpp.o
[ 64%] Building CXX object examples/containers/CMakeFiles/containers.dir/painter.cpp.o
/home/jleroy/dev/yomm2/tests/blackbox.cpp:13:10: fatal error: boost/test/included/unit_test.hpp: No such file or directory
   13 | #include <boost/test/included/unit_test.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [tests/CMakeFiles/blackbox.dir/build.make:63: tests/CMakeFiles/blackbox.dir/blackbox.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1070: tests/CMakeFiles/blackbox.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/jleroy/dev/yomm2/tests/whitebox.cpp:13:10: fatal error: boost/test/included/unit_test.hpp: No such file or directory
   13 | #include <boost/test/included/unit_test.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [tests/CMakeFiles/whitebox.dir/build.make:63: tests/CMakeFiles/whitebox.dir/whitebox.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1097: tests/CMakeFiles/whitebox.dir/all] Error 2
[ 67%] Linking CXX executable lab
[ 67%] Built target lab
[ 70%] Linking CXX executable next
[ 72%] Linking CXX executable containers
[ 75%] Linking CXX executable dl_main
[ 78%] Linking CXX executable asteroids
[ 78%] Built target next
[ 81%] Linking CXX executable matrix
[ 83%] Linking CXX executable synopsis
[ 86%] Linking CXX executable accept_no_visitors
[ 89%] Linking CXX executable namespaces
[ 89%] Built target dl_main
[ 89%] Built target asteroids
[ 89%] Built target containers
[ 91%] Linking CXX executable adventure
[ 94%] Linking CXX executable benchmarks
[ 94%] Built target synopsis
[ 94%] Built target matrix
[ 94%] Built target accept_no_visitors
[ 94%] Built target namespaces
[ 94%] Built target adventure
[ 94%] Built target benchmarks
make: *** [Makefile:141: all] Error 2

This should be easy to fix, I speculate that it's just a matter of adding Boost.Test.

Do you think you can come up with a solution that is more friendly to users without root privilege?

derpda commented 3 years ago

Thank you for the feedback! On my machine it works without root privilege (in fact I never use root when developing). Are you specifying an install directory for yomm? It looks like it is trying to install in /use/local. The default I have set is to install in a subdirectory of the source tree.

I'll fix the simple EOL stuff first and then look into what is going on here. Could you post the output of the cmake command you run as root?

derpda commented 3 years ago

So I looked into it again and we in fact do not set a default install directory. The problem is that users (rightly) expect to be able to run cmake without root, even if they later need root privilege to do make install. Since Boost needs to be installed alongside yomm2, and since we download and build Boost during the configuration step of yomm2 (cmake), it is also installed during the configuration step. This was what forced you to use root privilege to execute cmake. I'll look into fixing that!

jll63 commented 3 years ago

Are you specifying an install directory for yomm? It looks like it is trying to install in /use/local. The default I have set is to install in a subdirectory of the source tree.

I run cmake with dev/run-cmake g++ Debug.

Could you post the output of the cmake command you run as root?

First as non-root:

$ dev/run-cmake g++ Debug
-- Package "Boost" not found in system.
-- Downloading dependency "Boost" and building from source.
CMake Error: Could not open file for write in copy operation /usr/local/lib/cmake/Boost-1.74.0/BoostConfigVersion.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at CMakeLists.txt:70 (configure_file):
  configure_file Problem configuring file

CMake Error: Could not open file for write in copy operation /usr/local/lib/cmake/boost_headers-1.74.0/boost_headers-config-version.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at CMakeLists.txt:76 (configure_file):
  configure_file Problem configuring file

CMake Error: Could not open file for write in copy operation /usr/local/lib/cmake/boost_headers-1.74.0/boost_headers-config.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at CMakeLists.txt:82 (configure_file):
  configure_file Problem configuring file

CMake Error at cmake/find_or_download_package.cmake:48 (message):
  Download of dependency Boost failed: 1
Call Stack (most recent call first):
  CMakeLists.txt:14 (find_or_download_package)

-- Configuring incomplete, errors occurred!
See also "/home/jleroy/yomm2/build/g++/Debug/CMakeFiles/CMakeOutput.log".
See also "/home/jleroy/yomm2/build/g++/Debug/CMakeFiles/CMakeError.log".

And now as root:

$ sudo dev/run-cmake g++ Debug
-- Package "Boost" not found in system.
-- Downloading dependency "Boost" and building from source.
Scanning dependencies of target Boost
[  2%] Creating directories for 'Boost'
[  5%] Performing download step (git clone) for 'Boost'
Cloning into 'Boost'...
remote: Enumerating objects: 6516, done.
remote: Counting objects: 100% (6516/6516), done.
remote: Compressing objects: 100% (2196/2196), done.
remote: Total 6516 (delta 4683), reused 5798 (delta 4197), pack-reused 0
Receiving objects: 100% (6516/6516), 8.42 MiB | 12.71 MiB/s, done.
Resolving deltas: 100% (4683/4683), done.
HEAD is now at a7090e8 Bug fix for 1.74.0 reelase
Submodule 'algorithm' (https://github.com/boostorg/algorithm.git) registered for path 'libs/algorithm'
Submodule 'assert' (https://github.com/boostorg/assert.git) registered for path 'libs/assert'
Submodule 'bind' (https://github.com/boostorg/bind.git) registered for path 'libs/bind'
Submodule 'config' (https://github.com/boostorg/config.git) registered for path 'libs/config'
Submodule 'container_hash' (https://github.com/boostorg/container_hash.git) registered for path 'libs/container_hash'
Submodule 'core' (https://github.com/boostorg/core.git) registered for path 'libs/core'
Submodule 'detail' (https://github.com/boostorg/detail.git) registered for path 'libs/detail'
Submodule 'dynamic_bitset' (https://github.com/boostorg/dynamic_bitset.git) registered for path 'libs/dynamic_bitset'
Submodule 'exception' (https://github.com/boostorg/exception.git) registered for path 'libs/exception'
Submodule 'function' (https://github.com/boostorg/function.git) registered for path 'libs/function'
Submodule 'functional' (https://github.com/boostorg/functional.git) registered for path 'libs/functional'
Submodule 'integer' (https://github.com/boostorg/integer.git) registered for path 'libs/integer'
Submodule 'io' (https://github.com/boostorg/io.git) registered for path 'libs/io'
Submodule 'iterator' (https://github.com/boostorg/iterator.git) registered for path 'libs/iterator'
Submodule 'move' (https://github.com/boostorg/move.git) registered for path 'libs/move'
Submodule 'mpl' (https://github.com/boostorg/mpl.git) registered for path 'libs/mpl'
Submodule 'numeric_conversion' (https://github.com/boostorg/numeric_conversion.git) registered for path 'libs/numeric/conversion'
Submodule 'preprocessor' (https://github.com/boostorg/preprocessor.git) registered for path 'libs/preprocessor'
Submodule 'range' (https://github.com/boostorg/range.git) registered for path 'libs/range'
Submodule 'smart_ptr' (https://github.com/boostorg/smart_ptr.git) registered for path 'libs/smart_ptr'
Submodule 'static_assert' (https://github.com/boostorg/static_assert.git) registered for path 'libs/static_assert'
Submodule 'test' (https://github.com/boostorg/test.git) registered for path 'libs/test'
Submodule 'throw_exception' (https://github.com/boostorg/throw_exception.git) registered for path 'libs/throw_exception'
Submodule 'type_index' (https://github.com/boostorg/type_index.git) registered for path 'libs/type_index'
Submodule 'type_traits' (https://github.com/boostorg/type_traits.git) registered for path 'libs/type_traits'
Submodule 'utility' (https://github.com/boostorg/utility.git) registered for path 'libs/utility'
Submodule 'boost_install' (https://github.com/boostorg/boost_install.git) registered for path 'tools/boost_install'
Submodule 'cmake' (https://github.com/boostorg/cmake.git) registered for path 'tools/cmake'
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/algorithm'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/assert'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/bind'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/config'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/container_hash'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/core'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/detail'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/dynamic_bitset'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/exception'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/function'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/functional'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/integer'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/io'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/iterator'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/move'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/mpl'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/numeric/conversion'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/preprocessor'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/range'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/smart_ptr'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/static_assert'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/test'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/throw_exception'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/type_index'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/type_traits'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/libs/utility'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/tools/boost_install'...
Cloning into '/home/jleroy/yomm2/dependencies/Boost/tools/cmake'...
Submodule path 'libs/algorithm': checked out '7f527f3c4dc3b88b11f1584d7decf0537450b441'
Submodule path 'libs/assert': checked out '35c31e7778cd5e02cdcdea7bedce4c7f8d767803'
Submodule path 'libs/bind': checked out 'cd32792f0ef444347b1a522de945ee298e1112a8'
Submodule path 'libs/config': checked out '83fd6b3e9d3709d3efdc609a5aceb9d5851212b0'
Submodule path 'libs/container_hash': checked out '8a7fc581ed987fde8cae4e7145378d23b9b6b351'
Submodule path 'libs/core': checked out 'dcc04c55089b8a74c5a37e3d25694fca697ffb9f'
Submodule path 'libs/detail': checked out '5d285a2d5a561308ad6703e1ff284d106eb01032'
Submodule path 'libs/dynamic_bitset': checked out 'b59fc97a670a1cd1866ea4a46612525a17752978'
Submodule path 'libs/exception': checked out '63b57749a2e1fc1505ec8a382c82cf32103ab68c'
Submodule path 'libs/function': checked out '4841cbf4754043a8bcf02fc081106c6f26259324'
Submodule path 'libs/functional': checked out '28b1b25b9464abb3fd5783e10f49df40d6aac2ff'
Submodule path 'libs/integer': checked out '54dcfa677d8883d0bc7179f32cb806d89d4f8e40'
Submodule path 'libs/io': checked out '40b87939b2ce6a0d607e37877f2e36bbaf1f23f7'
Submodule path 'libs/iterator': checked out '72f0ebe8d06991968c6f792c0a846519a795cac1'
Submodule path 'libs/move': checked out 'fa3aa147b4b0a8e02edb0ac516acc21b4b139b78'
Submodule path 'libs/mpl': checked out '9c0f98f088bbed5943382ebfcfd1b0159aaa7462'
Submodule path 'libs/numeric/conversion': checked out 'de922921408bc7116a3c7c67b2fcfbe3e3214f3b'
Submodule path 'libs/preprocessor': checked out 'e4fb5f4866f69a917b7eeb522a3257d4625e52c1'
Submodule path 'libs/range': checked out 'f3ff60c3bc41e42ffebef1452deb285047a5639f'
Submodule path 'libs/smart_ptr': checked out '620620df3d232365bb75216250eafb37421ba7eb'
Submodule path 'libs/static_assert': checked out 'ba846a309164183757683b64df4b88f2d72cb0ff'
Submodule path 'libs/test': checked out '65892881d7393ab3df2ba63813f8fc48b7983d2d'
Submodule path 'libs/throw_exception': checked out 'da6f5420fe7e96f673ee185c2ff37cbaa3f95b84'
Submodule path 'libs/type_index': checked out '9862011b6b5e900eee31d32684766c15d3506adf'
Submodule path 'libs/type_traits': checked out '5588bb1ab7ba1809aaa492c4f6c6620dc2aaa927'
Submodule path 'libs/utility': checked out 'a4feaf4f243b9865dc8c65102232394d0c20473d'
Submodule path 'tools/boost_install': checked out 'ea28ed441fb04f2c5839e99e37f4c173fcfd48ec'
Submodule path 'tools/cmake': checked out 'efbbc015ba9de6367880a6a1e0e1ce0dd52fe371'
[  8%] No patch step for 'Boost'
[ 11%] No update step for 'Boost'
[ 14%] Performing configure step for 'Boost'
-- The CXX compiler identification is GNU 9.3.0
-- 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
-- The C compiler identification is GNU 9.3.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: /home/jleroy/yomm2/build/g++/Debug/Boost_build
[ 17%] Performing build step for 'Boost'
[ 20%] Performing install step for 'Boost'
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/local/include
-- Installing: /usr/local/include/boost
-- Installing: /usr/local/include/boost/current_function.hpp
-- Installing: /usr/local/include/boost/assert
-- Installing: /usr/local/include/boost/assert/source_location.hpp
-- Installing: /usr/local/include/boost/assert.hpp
-- Installing: /usr/local/lib/cmake/boost_assert-1.74.0/boost_assert-targets.cmake
-- Installing: /usr/local/lib/cmake/boost_assert-1.74.0/boost_assert-config.cmake
-- Installing: /usr/local/lib/cmake/boost_assert-1.74.0/boost_assert-config-version.cmake
-- Up-to-date: /usr/local/include
-- Up-to-date: /usr/local/include/boost
-- Installing: /usr/local/include/boost/bind.hpp
-- Installing: /usr/local/include/boost/mem_fn.hpp
-- Installing: /usr/local/include/boost/is_placeholder.hpp
-- Installing: /usr/local/include/boost/bind
[BIG SNIP]
-- Installing: /usr/local/lib/cmake/boost_utility-1.74.0/boost_utility-targets.cmake
-- Installing: /usr/local/lib/cmake/boost_utility-1.74.0/boost_utility-config.cmake
-- Installing: /usr/local/lib/cmake/boost_utility-1.74.0/boost_utility-config-version.cmake
[ 22%] Performing libs_utility step for 'Boost'
[ 25%] Performing install_config step for 'Boost'
[ 28%] Performing libs_algorithm step for 'Boost'
[ 31%] Performing libs_assert step for 'Boost'
[ 34%] Performing libs_bind step for 'Boost'
[ 37%] Performing libs_config step for 'Boost'
[ 40%] Performing libs_container_hash step for 'Boost'
[ 42%] Performing libs_core step for 'Boost'
[ 45%] Performing libs_detail step for 'Boost'
[ 48%] Performing libs_dynamic_bitset step for 'Boost'
[ 51%] Performing libs_exception step for 'Boost'
[ 54%] Performing libs_function step for 'Boost'
[ 57%] Performing libs_functional step for 'Boost'
[ 60%] Performing libs_integer step for 'Boost'
[ 62%] Performing libs_io step for 'Boost'
[ 65%] Performing libs_iterator step for 'Boost'
[ 68%] Performing libs_move step for 'Boost'
[ 71%] Performing libs_mpl step for 'Boost'
[ 74%] Performing libs_numeric_conversion step for 'Boost'
[ 77%] Performing libs_preprocessor step for 'Boost'
[ 80%] Performing libs_range step for 'Boost'
[ 82%] Performing libs_smart_ptr step for 'Boost'
[ 85%] Performing libs_static_assert step for 'Boost'
[ 88%] Performing libs_test step for 'Boost'
[ 91%] Performing libs_type_index step for 'Boost'
[ 94%] Performing libs_type_traits step for 'Boost'
[ 97%] Performing libs_throw_exception step for 'Boost'
[100%] Completed 'Boost'
[100%] Built target Boost
-- Using Boost libraries from /usr/local/include
-- Tests enabled
-- Benchmarks enabled
-- Package "benchmark" not found in system.
-- Downloading dependency "benchmark" and building from source.
Scanning dependencies of target benchmark
[ 12%] Creating directories for 'benchmark'
[ 25%] Performing download step (git clone) for 'benchmark'
Cloning into 'benchmark'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 5729 (delta 1), reused 3 (delta 1), pack-reused 5720
Receiving objects: 100% (5729/5729), 1.82 MiB | 17.46 MiB/s, done.
Resolving deltas: 100% (3750/3750), done.
Already on 'master'
Your branch is up to date with 'origin/master'.
[ 37%] No patch step for 'benchmark'
[ 50%] Performing update step for 'benchmark'
Current branch master is up to date.
[ 62%] Performing configure step for 'benchmark'
-- The CXX compiler identification is GNU 9.3.0
-- 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
-- Failed to find LLVM FileCheck
-- Found Git: /usr/bin/git (found version "2.25.1")
-- git Version: v1.5.2-bf585a27
-- Version: 1.5.2
-- Performing Test HAVE_CXX_FLAG_STD_CXX11
-- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WSHADOW
-- Performing Test HAVE_CXX_FLAG_WSHADOW - Success
-- Performing Test HAVE_CXX_FLAG_WERROR
-- Performing Test HAVE_CXX_FLAG_WERROR - Success
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS - Success
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED - Success
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WD654
-- Performing Test HAVE_CXX_FLAG_WD654 - Failed
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Success
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jleroy/yomm2/build/g++/Debug/benchmark_build
[ 75%] Performing build step for 'benchmark'
Scanning dependencies of target benchmark
[  4%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark.cc.o
[  9%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_api_internal.cc.o
[ 14%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_name.cc.o
[ 19%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_register.cc.o
[ 23%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_runner.cc.o
[ 28%] Building CXX object src/CMakeFiles/benchmark.dir/colorprint.cc.o
[ 33%] Building CXX object src/CMakeFiles/benchmark.dir/commandlineflags.cc.o
[ 38%] Building CXX object src/CMakeFiles/benchmark.dir/complexity.cc.o
^[[F[ 42%] Building CXX object src/CMakeFiles/benchmark.dir/console_reporter.cc.o
[ 47%] Building CXX object src/CMakeFiles/benchmark.dir/counter.cc.o
[ 52%] Building CXX object src/CMakeFiles/benchmark.dir/csv_reporter.cc.o
[ 57%] Building CXX object src/CMakeFiles/benchmark.dir/json_reporter.cc.o
[ 61%] Building CXX object src/CMakeFiles/benchmark.dir/reporter.cc.o
[ 66%] Building CXX object src/CMakeFiles/benchmark.dir/sleep.cc.o
[ 71%] Building CXX object src/CMakeFiles/benchmark.dir/statistics.cc.o
[ 76%] Building CXX object src/CMakeFiles/benchmark.dir/string_util.cc.o
[ 80%] Building CXX object src/CMakeFiles/benchmark.dir/sysinfo.cc.o
[ 85%] Building CXX object src/CMakeFiles/benchmark.dir/timers.cc.o
[ 90%] Linking CXX static library libbenchmark.a
[ 90%] Built target benchmark
Scanning dependencies of target benchmark_main
[ 95%] Building CXX object src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o
[100%] Linking CXX static library libbenchmark_main.a
[100%] Built target benchmark_main
[ 87%] Performing install step for 'benchmark'
[ 90%] Built target benchmark
[100%] Built target benchmark_main
Install the project...
-- Install configuration: "Release"
-- Installing: /home/jleroy/yomm2/dependencies/lib/libbenchmark.a
-- Installing: /home/jleroy/yomm2/dependencies/lib/libbenchmark_main.a
-- Installing: /home/jleroy/yomm2/dependencies/include/benchmark
-- Installing: /home/jleroy/yomm2/dependencies/include/benchmark/benchmark.h
-- Installing: /home/jleroy/yomm2/dependencies/lib/cmake/benchmark/benchmarkConfig.cmake
-- Installing: /home/jleroy/yomm2/dependencies/lib/cmake/benchmark/benchmarkConfigVersion.cmake
-- Installing: /home/jleroy/yomm2/dependencies/lib/pkgconfig/benchmark.pc
-- Installing: /home/jleroy/yomm2/dependencies/lib/cmake/benchmark/benchmarkTargets.cmake
-- Installing: /home/jleroy/yomm2/dependencies/lib/cmake/benchmark/benchmarkTargets-release.cmake
[100%] Completed 'benchmark'
[100%] Built target benchmark
-- Examples enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jleroy/yomm2/build/g++/Debug

After chown, tests build and pass.

derpda commented 3 years ago

I'm looking into delaying the installation of the downloaded boost until yomm2 is also installed (make install) - at that point the user will need appropriate privileges anyway.

jll63 commented 3 years ago

We forgot that we have Travis!

jll63 commented 3 years ago

I'm looking into delaying the installation of the downloaded boost until yomm2 is also installed (make install) - at that point the user will need appropriate privileges anyway.

If an installation of Boost is already present, it should be used. From the Travis log I have the impression that it is not.

derpda commented 3 years ago

So the problem is actually not with travis, and travis cannot solve it. The way it worked previously is as follows:

The issue is that this now requires root privileges during cmake .. execution if CMAKE_INSTALL_PREFIX is not owned by the user - and by default it is /usr/lib or something similar.

I have now made it so that boost is first install locally in the build tree during cmake .. (of course only if no boost was found in the system). This version is then used to build yomm. If a user also wants to install yomm using make install, the downloaded boost version is installed alongside YOMM to the same folder (CMAKE_INSTALL_PREFIX)

jll63 commented 3 years ago

We still have problems, see here.

I am preparing a commit that facilitates creating a docker container to test installation.

Ok, done.

To create the yomm2:latest image, assuming a ubuntu:latest image is available on your system: dev/create-docker-image. The image contains cmake, g++, git and sudo; and a user configured with the same user and group ids as on the host.

To run a container: dev/container bash. The yomm2 dev dir will be mapped at exactly the same location in the container. User inside container has full sudo power on all commands, thus allowing testing the full cmake/make/make test/sudo make install cycle, possibly preceded by a sudo apt-get install -y libboost-dev.

derpda commented 3 years ago

I pushed a fix to the issue, it was a stupid typo...

jll63 commented 3 years ago

Great! I tested with and without an existing installation of Boost, and it works in both cases. I am going to merge your commits (preserving authorship of course) and merge into master.

Have you tried the docker stuff? It should come handy in future cmake work...

jll63 commented 3 years ago

I think that this work deserves a version bump.

jll63 commented 3 years ago

Merged into master after squashing together all the commits by @derpda.