Problems compiling since v3.6039 on linux x86 Topic is solved

On various Hardware and OS systems: pi / windows / routers / nas, etc
georgep
Posts: 24
Joined: Tuesday 01 December 2015 17:57
Target OS: Linux
Domoticz version: Latest
Location: Somerset, UK
Contact:

Problems compiling since v3.6039 on linux x86

Postby georgep » Friday 23 December 2016 12:42

Hi all,

I try to keep reasonably up-to-date with new versions and I last compiled v3.6039 with no problems.

Now when I try to pull the latest files and recompile I'm getting a lot of errors, most relating to Python (my system has version 2.7.3). Here's the full output:

Code: Select all

Scanning dependencies of target domoticz
[ 22%] Building CXX object CMakeFiles/domoticz.dir/main/domoticz.cpp.o
[ 22%] Building CXX object CMakeFiles/domoticz.dir/hardware/OTGWBase.cpp.o
[ 22%] Building CXX object CMakeFiles/domoticz.dir/hardware/plugins/PluginManager.cpp.o
In file included from /usr/include/python2.7/Python.h:8:0,
                 from /home/george/domoticz/hardware/plugins/PluginManager.cpp:34:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:164:0: note: this is the location of the previous definition
/usr/include/python2.7/pyconfig.h:1183:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]
/usr/include/features.h:166:0: note: this is the location of the previous definition
In file included from /home/george/domoticz/hardware/plugins/PluginManager.cpp:37:0:
/home/george/domoticz/hardware/plugins/DelayedLink.h:260:0: warning: "PyBytes_AsString" redefined [enabled by default]
/usr/include/python2.7/bytesobject.h:16:0: note: this is the location of the previous definition
/home/george/domoticz/hardware/plugins/PluginManager.cpp:496:28: error: variable ‘Plugins::PyModuleDef Plugins::DomoticzModuleDef’ has initializer but incomplete type
/home/george/domoticz/hardware/plugins/PluginManager.cpp:497:3: error: ‘PyModuleDef_HEAD_INIT’ was not declared in this scope
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘PyObject* Plugins::CDevice_insert(Plugins::CDevice*, PyObject*)’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:663:96: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:673:60: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:677:127: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:703:151: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘PyObject* Plugins::CDevice_update(Plugins::CDevice*, PyObject*)’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:725:103: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:734:18: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:734:83: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:738:24: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:739:47: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘PyObject* Plugins::CDevice_seticon(Plugins::CDevice*, PyObject*)’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:764:96: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:771:73: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘PyObject* Plugins::CDevice_str(Plugins::CDevice*)’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:795:113: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:795:157: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp: At global scope:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:851:21: error: variable ‘Plugins::PyModuleDef Plugins::CDevice_module’ has initializer but incomplete type
/home/george/domoticz/hardware/plugins/PluginManager.cpp:852:3: error: ‘PyModuleDef_HEAD_INIT’ was not declared in this scope
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘void Plugins::PyInit_Domoticz()’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:868:11: error: return-statement with a value, in function returning 'void' [-fpermissive]
/home/george/domoticz/hardware/plugins/PluginManager.cpp:872:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In member function ‘bool Plugins::CPluginSystem::StartPluginSystem()’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:1965:54: error: invalid conversion from ‘void (*)()’ to ‘PyObject* (*)() {aka _object* (*)()}’ [-fpermissive]
make[2]: *** [CMakeFiles/domoticz.dir/hardware/plugins/PluginManager.cpp.o] Error 1
make[1]: *** [CMakeFiles/domoticz.dir/all] Error 2
make: *** [all] Error 2
[email protected]:~/domoticz$


My server is a relatively old version of Ubuntu linux but it is kept up-to-date with updates from the usual repositories...

Code: Select all

[email protected]:~/domoticz$ uname -a
Linux asusbox 3.2.0-118-generic #161-Ubuntu SMP Fri Dec 2 15:36:31 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


Any clues would be much appreciated.

Thanks, and Happy Christmas everyone!
George

georgep
Posts: 24
Joined: Tuesday 01 December 2015 17:57
Target OS: Linux
Domoticz version: Latest
Location: Somerset, UK
Contact:

Problems compiling since v3.6039 on linux x86

Postby georgep » Friday 23 December 2016 13:03

I just found a mention of Domoticz now requiring at least libpython3.2, which I've now installed.

I'll update again if/when it compiles OK.

georgep
Posts: 24
Joined: Tuesday 01 December 2015 17:57
Target OS: Linux
Domoticz version: Latest
Location: Somerset, UK
Contact:

Re: Problems compiling since v3.6039 on linux x86

Postby georgep » Friday 23 December 2016 14:16

No luck. My compile is still failing at 'PluginManager.cpp.o' :-(

I did 'make clean', 'cmake .' and 'make' and here are the results...

Code: Select all

[email protected]:~/domoticz$ cmake .
-- Using builtin Mosquitto library
-- Python3 includes found at: /usr/include/python2.7
-- Compiling Revision #6231
-- Boost version: 1.59.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   system
-- Linking against boost static libraries
-- ZLIB libraries found at: /usr/lib/x86_64-linux-gnu/libz.so
-- ZLIB includes found at: /usr/include
-- Curl libraries found at: /usr/lib/x86_64-linux-gnu/libcurl.so
-- Curl includes found at: /usr/include
-- LIBUSB found at: /usr/lib/x86_64-linux-gnu/libusb.so
-- ==== OpenZWave not found, support disabled!
-- ==== WiringPi include file (wiringPi.h) not found. GPIO support disabled.
-- ==== (Please follow http://wiringpi.com/download-and-install/ if you want to use GPIO.)
-- Not found telldus-core (telldus-core.h), not adding tellstick support
/usr/bin/c++  ;-O3;-DNDEBUG;-I/usr/include/python2.7;-I/home/george/domoticz/main;-I/usr/local/include;-I/usr/include;;-DBUILTIN_MQTT;-DUSE_PYTHON_PLUGINS;-DHAVE_EXECINFO_H;-DWITH_LIBUSB;-DWWW_ENABLE_SSL -x c++-header -o /home/george/domoticz/stdafx.h.gch/.c++ /home/george/domoticz/main/stdafx.h
-- Using static libgcc/libstdc++
-- Configuring done
-- Generating done
-- Build files have been written to: /home/george/domoticz
[email protected]:~/domoticz$


Code: Select all

...
[ 77%] Building CXX object CMakeFiles/domoticz.dir/hardware/ZiBlueBase.cpp.o
[ 77%] Building CXX object CMakeFiles/domoticz.dir/hardware/ZiBlueSerial.cpp.o
[ 78%] Building CXX object CMakeFiles/domoticz.dir/hardware/ZiBlueTCP.cpp.o
[ 78%] Building CXX object CMakeFiles/domoticz.dir/hardware/ZWaveBase.cpp.o
[ 79%] Building CXX object CMakeFiles/domoticz.dir/hardware/Yeelight.cpp.o
[ 79%] Building CXX object CMakeFiles/domoticz.dir/hardware/XiaomiGateway.cpp.o
[ 79%] Building CXX object CMakeFiles/domoticz.dir/hardware/plugins/PluginManager.cpp.o
In file included from /usr/include/python2.7/Python.h:8:0,
                 from /home/george/domoticz/hardware/plugins/PluginManager.cpp:34:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:164:0: note: this is the location of the previous definition
/usr/include/python2.7/pyconfig.h:1183:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]
/usr/include/features.h:166:0: note: this is the location of the previous definition
In file included from /home/george/domoticz/hardware/plugins/PluginManager.cpp:37:0:
/home/george/domoticz/hardware/plugins/DelayedLink.h:260:0: warning: "PyBytes_AsString" redefined [enabled by default]
/usr/include/python2.7/bytesobject.h:16:0: note: this is the location of the previous definition
/home/george/domoticz/hardware/plugins/PluginManager.cpp:496:28: error: variable ‘Plugins::PyModuleDef Plugins::DomoticzModuleDef’ has initializer but incomplete type
/home/george/domoticz/hardware/plugins/PluginManager.cpp:497:3: error: ‘PyModuleDef_HEAD_INIT’ was not declared in this scope
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘PyObject* Plugins::CDevice_insert(Plugins::CDevice*, PyObject*)’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:663:96: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:673:60: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:677:127: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:703:151: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘PyObject* Plugins::CDevice_update(Plugins::CDevice*, PyObject*)’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:725:103: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:734:18: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:734:83: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:738:24: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:739:47: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘PyObject* Plugins::CDevice_seticon(Plugins::CDevice*, PyObject*)’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:764:96: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:771:73: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘PyObject* Plugins::CDevice_str(Plugins::CDevice*)’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:795:113: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp:795:157: error: ‘struct Plugins::SharedLibraryProxy’ has no member named ‘PyBytes_AsString’
/home/george/domoticz/hardware/plugins/PluginManager.cpp: At global scope:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:851:21: error: variable ‘Plugins::PyModuleDef Plugins::CDevice_module’ has initializer but incomplete type
/home/george/domoticz/hardware/plugins/PluginManager.cpp:852:3: error: ‘PyModuleDef_HEAD_INIT’ was not declared in this scope
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In function ‘void Plugins::PyInit_Domoticz()’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:868:11: error: return-statement with a value, in function returning 'void' [-fpermissive]
/home/george/domoticz/hardware/plugins/PluginManager.cpp:872:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
/home/george/domoticz/hardware/plugins/PluginManager.cpp: In member function ‘bool Plugins::CPluginSystem::StartPluginSystem()’:
/home/george/domoticz/hardware/plugins/PluginManager.cpp:1965:54: error: invalid conversion from ‘void (*)()’ to ‘PyObject* (*)() {aka _object* (*)()}’ [-fpermissive]
make[2]: *** [CMakeFiles/domoticz.dir/hardware/plugins/PluginManager.cpp.o] Error 1
make[1]: *** [CMakeFiles/domoticz.dir/all] Error 2
make: *** [all] Error 2
[email protected]:~/domoticz$

georgep
Posts: 24
Joined: Tuesday 01 December 2015 17:57
Target OS: Linux
Domoticz version: Latest
Location: Somerset, UK
Contact:

Re: Problems compiling since v3.6039 on linux x86

Postby georgep » Friday 23 December 2016 23:12

OK- I got it to compile by disabling Python ( -DUSE_PYTHON_PLUGINS=NO ) but with Python enabled the error persists.

I don't *need* Python enabled so I'll stick with this as a 'solution' for now.

User avatar
Dnpwwo
Posts: 558
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Problems compiling since v3.6039 on linux x86

Postby Dnpwwo » Saturday 24 December 2016 8:43

@georgep,

You only need libpython3.2 or (preferrably) greater if you are going to use python plugins (sounds like you are not) but to compile you do need to have

Code: Select all

python3-dev
to get a clean compile.

I added this to the Linux page on the wiki a little while ago (http://www.domoticz.com/wiki/Linux#Installing_the_required_libraries). If you think it needs to be specified somewhere else let me know.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

georgep
Posts: 24
Joined: Tuesday 01 December 2015 17:57
Target OS: Linux
Domoticz version: Latest
Location: Somerset, UK
Contact:

Re: Problems compiling since v3.6039 on linux x86

Postby georgep » Saturday 24 December 2016 14:24

OK it looks like I may have resolved this...

Despite having installed python3-dev and libpython3.2, cmake was still only finding the original versions

I had to manually edit CMakeFileCache.txt as follows:

Code: Select all

//Path to a file.
PYTHON_INCLUDE_DIR:PATH=/usr/include/python3.2

//Path to a library.
PYTHON_LIBRARY:FILEPATH=/usr/lib/libpython3.2mu.so


Cmake now completes successfully with Python plugins enabled:

Code: Select all

[email protected]:~/domoticz$ cmake . -DUSE_PYTHON_PLUGINS=YES
-- Using builtin Mosquitto library
-- Python3 includes found at: /usr/include/python3.2
-- Compiling Revision #6235
-- Boost version: 1.59.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   system
-- Linking against boost static libraries
-- ZLIB libraries found at: /usr/lib/x86_64-linux-gnu/libz.so
-- ZLIB includes found at: /usr/include
-- Curl libraries found at: /usr/lib/x86_64-linux-gnu/libcurl.so
-- Curl includes found at: /usr/include
-- LIBUSB found at: /usr/lib/x86_64-linux-gnu/libusb.so
-- ==== OpenZWave not found, support disabled!
-- ==== WiringPi include file (wiringPi.h) not found. GPIO support disabled.
-- ==== (Please follow http://wiringpi.com/download-and-install/ if you want to use GPIO.)
-- Not found telldus-core (telldus-core.h), not adding tellstick support
/usr/bin/c++  ;-O3;-DNDEBUG;-I/usr/include/python3.2;-I/home/george/domoticz/main;-I/usr/local/include;-I/usr/include;-I/usr/include;-I/usr/include;;-DBUILTIN_MQTT;-DUSE_PYTHON_PLUGINS;-DHAVE_EXECINFO_H;-DWITH_LIBUSB;-DWWW_ENABLE_SSL -x c++-header -o /home/george/domoticz/stdafx.h.gch/.c++ /home/george/domoticz/main/stdafx.h
-- Using static libgcc/libstdc++
-- Configuring done
-- Generating done
-- Build files have been written to: /home/george/domoticz
[email protected]:~/domoticz$


And hopefully it will now compile OK.. let's see ...

User avatar
Dnpwwo
Posts: 558
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Problems compiling since v3.6039 on linux x86

Postby Dnpwwo » Saturday 24 December 2016 14:34

@georgep,

Your cmake version is probably the issue here, try this: http://www.domoticz.com/wiki/Linux#CMake_version
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

georgep
Posts: 24
Joined: Tuesday 01 December 2015 17:57
Target OS: Linux
Domoticz version: Latest
Location: Somerset, UK
Contact:

Re: Problems compiling since v3.6039 on linux x86  Topic is solved

Postby georgep » Saturday 24 December 2016 18:08

Thanks @Dnpwwo

I updated my cmake yesterday.

It all compiles fine now so the problem was definitely that cmake hadn't picked up the latest python library locations.
It could just be that my server is based on an old Ubuntu distribution; I quite often find that instructions based on newer versions don't work for me.
Hopefully the info here may be of use to someone; If I can figure out how to do it I'll update the title to show 'Fixed' :-)

George


Return to “Installation, Compiling, Permissions, Security and Starting”

Who is online

Users browsing this forum: No registered users and 2 guests