Page 1 of 1

Compilation failure against Boost 1.70.0

Posted: Sunday 21 April 2019 16:24
by Conn-artist
Hi,

Version: git commit 08d470c, 15 Apr 2019
Platform: Debian Stretch
Plugin/Hardware: Raspberry Pi 3
Description: I have been trying to compile Domoticz from source using the instructions in the wiki. I built Boost 1.70.0 from scratch and it is detected by Domoticz. However there seems to be something going wrong with the version number detection: Found libBoost version 1.70.0, 106000 or newer required

Here's the output of cmake:

Code: Select all

-- Found Boost 1.70.0 at /usr/local/lib/cmake/Boost-1.70.0
--   Requested configuration: QUIET REQUIRED COMPONENTS thread;system
-- Found boost_headers 1.70.0 at /usr/local/lib/cmake/boost_headers-1.70.0
-- Found boost_thread 1.70.0 at /usr/local/lib/cmake/boost_thread-1.70.0
--   libboost_thread.a
-- Adding boost_thread dependencies: headers
-- Found boost_system 1.70.0 at /usr/local/lib/cmake/boost_system-1.70.0
--   libboost_system.a
-- Adding boost_system dependencies: headers
Boost  found.
Found Boost components:
   thread;system
-- Linking against boost static libraries
CMake Error at CMakeLists.txt:589 (message):
Found libBoost version 1.70.0, 106000 or newer required
Using cmake 3.7.2.

The Debian Stretch installation is fresh and I removed all factory-installed libboost libraries before compiling.

The last entries in CMakeFiles/CMakeError.log are:

Code: Select all

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/pi/git/domoticz/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_6ffa2/fast"
/usr/bin/make -f CMakeFiles/cmTC_6ffa2.dir/build.make CMakeFiles/cmTC_6ffa2.dir/build
make[1]: Entering directory '/home/pi/git/domoticz/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6ffa2.dir/CheckFunctionExists.c.o
/usr/bin/cc    -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_6ffa2.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.7/Modules/CheckFunctionExists.c
Linking C executable cmTC_6ffa2
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6ffa2.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_6ffa2.dir/CheckFunctionExists.c.o  -o cmTC_6ffa2 -rdynamic -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_6ffa2.dir/build.make:97: recipe for target 'cmTC_6ffa2' failed
make[1]: *** [cmTC_6ffa2] Error 1
make[1]: Leaving directory '/home/pi/git/domoticz/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_6ffa2/fast' failed
make: *** [cmTC_6ffa2/fast] Error 2
Any suggestions are appreciated.

Re: Compilation failure against Boost 1.70.0

Posted: Sunday 21 April 2019 17:08
by Conn-artist
FWIW: compilation of the release 4.9700 throws the same error.

Re: Compilation failure against Boost 1.70.0

Posted: Monday 22 April 2019 19:56
by Conn-artist
More effort was spent figuring out what the issue was. Eventually I installed the libboost-system/thread libraries that come with Stretch, and the compilation continued a lot further.

However, after a long time it still bombed out with boost-related errors.

Eventually I capitulated and installed 4.9700 with
curl -sSL install.domoticz.com | sudo bash
and now all is well.

Re: Compilation failure against Boost 1.70.0

Posted: Thursday 27 June 2019 10:27
by garethhowell
I've started getting this error as well.
I had previously compiled from source with no problems, but suddenly, after running `updatedomo` from the domoticz directory, I got the error

Code: Select all

Found libBoost version 1.70.0, 106000 or newer required

Re: Compilation failure against Boost 1.70.0

Posted: Thursday 27 June 2019 11:37
by waaren
garethhowell wrote: Thursday 27 June 2019 10:27 Suddenly, after running `updatedomo` from the domoticz directory, I got the error

Code: Select all

Found libBoost version 1.70.0, 106000 or newer required
What is your Cmake version ?

Re: Compilation failure against Boost 1.70.0

Posted: Monday 12 August 2019 7:56
by gizmocuz
You need to use CMake 3.14, it is explained on our wiki

Re: Compilation failure against Boost 1.70.0

Posted: Monday 12 August 2019 10:41
by pocock
Distributions don't have cmake 3.14, e.g. the most recent Debian release has 3.13 and stretch still has 3.7.2:

https://packages.qa.debian.org/c/cmake.html

It would make it a lot easier for people using distributions if Domoticz avoids dependencies on the latest versions of tools. Compiler macros can also be used sometimes to support older API versions.

Personally, I found that Domoticz compiles successfully with 3.7.2 and 3.13 so when I build the packages, I just change the CMake config to accept 3.7.0 or greater:
https://gitlab.com/dpocock/domoticz-deb ... sion.patch

Anybody who wants to install from packages on Debian/Raspbian, stretch or buster, can find details in this thread:
viewtopic.php?f=47&t=28951

Re: Compilation failure against Boost 1.70.0

Posted: Tuesday 24 September 2019 12:22
by darrepac
I have the same error
Found libBoost version 1.71.0, 106000 or newer required
While I use CMake 3.15.2 as written in the wiki...