open62541-python-deprecated icon indicating copy to clipboard operation
open62541-python-deprecated copied to clipboard

Are README.md steps complete?

Open bvinodkumar2008 opened this issue 7 years ago • 7 comments

Hello,

I am not able to follow the README steps here. Can someone help answering below questions? In the build step of open62541,

  • Set following options in CMakeList.txt - what options to set?
  • I think we need cd build after mkdir build - this is missing
  • Is this command right? cmake -DBUILD_SHARED_LIBS=ON -DUA_ENABLE_FULL_NS0 .. (i tried executing it from build/ folder) - i got an issue of not a valid key value pair. What value do i need to give for DUA_ENABLE_FULL_NS0

Once i get this right, i hope i should be able to generate open62541.so and use it

bvinodkumar2008 avatar Oct 15 '18 09:10 bvinodkumar2008

Hi,

This code was only written to 1) demonstrate that writing python wrapper is relatively easy 2) support using an open62541 server in opcua-modeler https://github.com/FreeOpcUa/opcua-modeler. So it only exposes two methods start_server() and stop_server() NOTHING else

so it is currently only interesting for someone with good knowledge of python/C/Cython and might be outdated. If you want to use python look at the native python opcua implementation.

but yes, a cd command is missing as well as a complete command line (add =ON for example). Feel free to fix that

oroulet avatar Oct 15 '18 12:10 oroulet

Thanks, will do so. I was able to successfully compile open62541 but while running the setup.py script here, running into the below issue:

command: python setup.py build_ext --inplace running build_ext building 'open62541' extension x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I../open62541/include -I../open62541/plugins -I../open62541/build/src_generated/ -I../open62541/deps -I../open62541/build -I/usr/include/python2.7 -c open62541.c -o build/temp.linux-x86_64-2.7/open62541.o In file included from ../open62541/include/ua_types.h:19:0, from ../open62541/include/ua_server.h:16, from ../open62541/include/ua_plugin_network.h:12, from open62541.c:640: ../open62541/build/src_generated/ua_config.h:92:29: fatal error: ua_architecture.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Can someone help me in addressing this? I was trying to see if i can write python wrappers for some of the C APIs just like the ones exposed under https://github.com/open62541/open62541-python/blob/master/open62541.pyx.

bvinodkumar2008 avatar Oct 16 '18 04:10 bvinodkumar2008

Hello @oroulet,

Can you help me in getting the open62541 python module compiled? Thanks in advance...

bvinodkumar2008 avatar Oct 17 '18 08:10 bvinodkumar2008

I updated README and could compile it. although I had to modify ../open62541/build/src_generated/ua_types_generated.h @Pro it looks like the test at line 11 is wrong, I had to swicth else and then causes.....

@bvinodkumar2008 I used branch 0.3, there might be some changes in master... a patch is welcome for them

oroulet avatar Oct 17 '18 11:10 oroulet

Thanks @oroulet. I somehow missed your comment, will check with branch 0.3 today and let you know. Also, if it works for branch 0.3, will try to push a patch for master.

bvinodkumar2008 avatar Oct 22 '18 03:10 bvinodkumar2008

Thanks @oroulet. I somehow missed your comment, will check with branch 0.3 today and let you know. Also, if it works for branch 0.3, will try to push a patch for master.

bvinodkumar2008 avatar Oct 22 '18 03:10 bvinodkumar2008

Hi @oroulet , The git submodule udpate in the README.md step didn't work, i had to run git submodule update --init to get the submodules source code.

I still see the below error upon running python2.7 setup.py build_ext --inplace against branches 0.3 and tag 0.3-rc2 ( https://github.com/open62541/open62541):

running build_ext building 'open62541' extension x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I../open62541/include -I../open62541/plugins -I../open62541/build/src_generated/ -I../open62541/deps -I/usr/include/python2.7 -c open62541.c -o build/temp.linux-x86_64-2.7/open62541.o In file included from ../open62541/include/ua_server.h:21:0, from ../open62541/include/ua_plugin_network.h:16, from open62541.c:641: ../open62541/build/src_generated/ua_types_generated.h:15:23: fatal error: open62541.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Observation on master branch ( https://github.com/open62541/open62541):python setup.py build_ext --inplace Compiling open62541.pyx because it changed. [1/1] Cythonizing open62541.pyx /home/vkb1/.local/lib/python2.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/vkb1/opcua_repos/open62541-python/open62541.pyx tree = Parsing.p_module(s, pxd, full_module_name) running build_ext building 'open62541' extension x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I../open62541/include -I../open62541/plugins -I../open62541/build/src_generated/ -I../open62541/deps -I/usr/include/python2.7 -c open62541.c -o build/temp.linux-x86_64-2.7/open62541.o In file included from ../open62541/include/ua_types.h:19:0, from ../open62541/include/ua_server.h:16, from ../open62541/include/ua_plugin_network.h:12, from open62541.c:639: ../open62541/build/src_generated/ua_config.h:92:29: fatal error: ua_architecture.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

bvinodkumar2008 avatar Oct 22 '18 12:10 bvinodkumar2008