dscharrer / innoextract

A tool to unpack installers created by Inno Setup
https://constexpr.org/innoextract/
Other
1k stars 125 forks source link

Build failure with boost 1.70.0 & cmake 3.14.4 #88

Closed wich closed 5 years ago

wich commented 5 years ago

Trying to build innoextract with boost 1.70.0 & cmake 3.14.4 results in the error message No suitable boost_iostreams variant has been identified!

Tried version 1.7 as well as current master (38ae68f393b2f3ed1862ec7f24b1d99bbbaacb19), both fail with the same error.

cmake command:

cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_DATADIR=share -DCMAKE_INSTALL_DOCDIR=share/doc -DCMAKE_INSTALL_INCLUDEDIR=include -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_MANDIR=share/man -DCMAKE_PREFIX_PATH=share/apps/cmake/modules -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_C_FLAGS_RELEASE="-march=core2 -fPIC -DPIC -pipe -O3" -DCMAKE_CXX_FLAGS_RELEASE="-march=core2 -fPIC -DPIC -pipe -O3" -DBoost_DEBUG=ON ..

Relevant error messages:

-- Found Boost 1.70.0 at /usr/lib/cmake/Boost-1.70.0
--   Requested configuration: QUIET REQUIRED COMPONENTS iostreams;filesystem;date_time;system;program_options
-- BoostConfig: find_package(boost_headers 1.70.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib/cmake)
-- Found boost_headers 1.70.0 at /usr/lib/cmake/boost_headers-1.70.0
-- BoostConfig: find_package(boost_iostreams 1.70.0 EXACT CONFIG REQUIRED QUIET HINTS /usr/lib/cmake)
-- Found boost_iostreams 1.70.0 at /usr/lib/cmake/boost_iostreams-1.70.0
-- Boost toolset is gcc9 (GNU 9.1.0)
-- Scanning /usr/lib/cmake/boost_iostreams-1.70.0/libboost_iostreams-variant*.cmake
--   Including /usr/lib/cmake/boost_iostreams-1.70.0/libboost_iostreams-variant-shared.cmake
--   ... skipped libboost_iostreams.so.1.70.0 (shared, BUILD_SHARED_LIBS not ON, set Boost_USE_STATIC_LIBS=OFF to override)
-- No suitable boost_iostreams variant has been identified!
CMake Error at /usr/lib/cmake/Boost-1.70.0/BoostConfig.cmake:95 (find_package):
  Found package configuration file:

    /usr/lib/cmake/boost_iostreams-1.70.0/boost_iostreams-config.cmake

  but it set boost_iostreams_FOUND to FALSE so package "boost_iostreams" is
  considered to be NOT FOUND.  Reason given by package:

  No suitable build variant has been found.

Call Stack (most recent call first):
  /usr/lib/cmake/Boost-1.70.0/BoostConfig.cmake:124 (boost_find_dependency)
  /usr/share/cmake/Modules/FindBoost.cmake:266 (find_package)
  CMakeLists.txt:138 (find_package)
wich commented 5 years ago

Additional notes; adding -DBUILD_SHARED_LIBS=ON -DBoost_USE_STATIC_LIBS=OFF to the cmake call allows the checks to pass, but then the linking phase fails with many undefined reference to various boost symbols, e.g.:

/usr/bin/ld: CMakeFiles/innoextract.dir/src/cli/extract.cpp.o: in function `process_file(boost::filesystem::path const&, extract_options const&)':
extract.cpp:(.text+0x8aca): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
/usr/bin/ld: extract.cpp:(.text+0x913f): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
/usr/bin/ld: extract.cpp:(.text+0x919c): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
/usr/bin/ld: extract.cpp:(.text+0x98b7): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
/usr/bin/ld: extract.cpp:(.text+0xc423): undefined reference to `boost::filesystem::path::parent_path() const'
/usr/bin/ld: extract.cpp:(.text+0xc440): undefined reference to `boost::filesystem::path::stem() const'
/usr/bin/ld: extract.cpp:(.text+0xc728): undefined reference to `boost::filesystem::detail::create_directories(boost::filesystem::path const&, boost::system::error_code*)'
orbea commented 5 years ago

Try -DBoost_NO_BOOST_CMAKE=ON.

Relevant issues:

https://gitlab.kitware.com/cmake/cmake/issues/18865 https://github.com/lightspark/lightspark/issues/344

wich commented 5 years ago

@orbea thanks that works. @dscharrer I guess the cmake files still need updates for boost 1.70.0 compatibility

wich commented 5 years ago

Just tried with cmake version 3.13.5, no change, same errors.

dscharrer commented 5 years ago

Finding Boost is handled by CMake and this needs to be fixed there.