Open bahamas10 opened 6 years ago
I have also been looking into this issue along with @bahamas10.
I am able to successfully build python-openzwave
via --flavor=dev with a checkout of the patched openzwave. But, I have to use this patch:
diff --git a/pyozw_setup.py b/pyozw_setup.py
index f9d2d21..3d5f9b3 100644
--- a/pyozw_setup.py
+++ b/pyozw_setup.py
@@ -181,7 +181,7 @@ class Template(object):
elif sys.platform.startswith("sunos"):
if static:
- ctx['libraries'] += [ "udev", "stdc++",'resolv' ]
+ ctx['libraries'] += [ "usb-1.0", "stdc++",'resolv' ]
ctx['extra_objects'] = [ "{0}/libopenzwave.a".format(self.openzwave) ]
ctx['include_dirs'] += [ "{0}/cpp/build/linux".format(self.openzwave) ]
else:
diff --git a/src-lib/libopenzwave/libopenzwave.pyx b/src-lib/libopenzwave/libopenzwave.pyx
index c35bbe0..262ae6c 100644
--- a/src-lib/libopenzwave/libopenzwave.pyx
+++ b/src-lib/libopenzwave/libopenzwave.pyx
@@ -32,7 +32,7 @@ from libcpp.map cimport map, pair
from libcpp cimport bool
#from libc.stdint cimport bint
from libcpp.vector cimport vector
-from libc.stdint cimport uint16_t, uint32_t, uint64_t, int32_t, int16_t, uint8_t, int8_t
+from libc.stdint cimport uint16_t, uint32_t, uint64_t, int32_t, int16_t, uint8_t
from libc.stdlib cimport malloc, free
#from libcpp.string cimport string
from mylibc cimport string
@@ -60,6 +60,8 @@ import warnings
import six
from shutil import copyfile
+ctypedef signed char int8_t
+
# Set default logging handler to avoid "No handler found" warnings.
import logging
try: # Python 2.7+
What's not clear to me is why int8_t resolves to a char *
in one file and a signed char *
in another.
Anyone know what's up with that?
I you can compile / install openzwave, simply try to use the flavor "shared". But looking at papertigers comment, there seems to have other problems.
@papertigers :
elif sys.platform.startswith("sunos"):
if static:
- ctx['libraries'] += [ "udev", "stdc++",'resolv' ]
+ ctx['libraries'] += [ "usb-1.0", "stdc++",'resolv' ]
This update is specific to smartos or also apply to sunos ? If this is specific, is there a way to identify smartos (in python) ?
Which version of cython is installed on smartos ?
Thanks
Could you try to install the last release (0.4.8). I've updated the setup process according to your changes in openzwave :
Don't know if ldconfig is present on smartos too :
For the problem of int8_t resolving, don't know what happen. Looking at cython code : https://github.com/cython/cython/blob/master/Cython/Includes/libc/stdint.pxd#L9 I should be resolved to
ctypedef signed char int8_t
HTH
I'm currently using this project through Home Assistant on a raspberry pi and it works flawlessly. I want to transition to my more powerful and capable server running SmartOS however the one thing holding me back is getting openzwave/python-openzwave running on my SmartOS Zone.
I'm able to get OpenZWave compiled using this patch, however python-openzwave still fails. Attached is the build log (after manually applying the patch above to the OpenZWave code checked out).
The actual error:
I believe the issue is with how cython converts the code from python to C(++?) but i'm really out of my area of expertise here. If I run the
gcc
command that fails manually with-fpermissive
it exits cleanly FWIW.System information
Note: I want to make a pull request to OpenZWave with my patch above for SmartOS support, but would prefer to wait until I can get python-openzwave working as well so I can more thoroughly test it myself.