open62541 without CMake?

1,242 views
Skip to first unread message

thomas....@gmail.com

unread,
Jul 2, 2015, 5:19:56 PM7/2/15
to open...@googlegroups.com
Hi,

I like to evaluate open62541. My target platform is an Arm microcontroller with a proprietary real-time operating system. Unfortunately I am not familiar with CMake, and I couldn't find my toolchain in the configuration dialogue of CMake. So, when I tried to compile the source code of open62541 the file 'ua_types_generated.h' was missing.

CMake is really a big obstacle for me and prevents me to get started with open62541. Is there any possibility to use open62541 without CMake? Is the complete source code available including the "automatic generated files"? I just want to evaluate open62541 and cannot spend too much time learning CMake.

Best regards

Thomas

Grüner, Sten

unread,
Jul 3, 2015, 12:28:18 AM7/3/15
to thomas....@gmail.com, open...@googlegroups.com
Hi Thomas,

this is exactly why we provide single-file releases open62541.c and open62541.h.

To use them:

1) get the latest autogenerated single file release (get one from origin/master branch) from http://open62541.org/releases/ e.g. http://open62541.org/releases/4d5ddc81f8.zip
2) get the example server: https://github.com/acplt/open62541/blob/master/examples/server.c
3) compile the server gcc -std=c99 server.c open62541.c -o server

Best Regards
Sten


Von: open...@googlegroups.com [open...@googlegroups.com]" im Auftrag von "thomas....@gmail.com [thomas....@gmail.com]
Gesendet: Donnerstag, 2. Juli 2015 23:19
An: open...@googlegroups.com
Betreff: [open62541] open62541 without CMake?

--
You received this message because you are subscribed to the Google Groups "open62541" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open62541+...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/open62541/ecce153d-1e70-407f-a647-98e8115e2b93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

thomas....@gmail.com

unread,
Jul 5, 2015, 6:40:21 PM7/5/15
to open...@googlegroups.com, s.gr...@plt.rwth-aachen.de
Hi, Sten,

thank you very much for your advice :-) I followed your hints and like to give you a feedback.

I was able to build open62541 under Debian 7 at the command line by 'gcc -std=c99 -DUA_AMALGAMATE server.c open62541.c -o server'. As Eclipse is more comfortable I setup an Eclipse project. I successfully built open62541 and started it. However, I was not able to test this executable with the client which I downloaded from https://github.com/acplt/open62541/releases/download/v0.1/open62541-linux32.tar.gz. For if I start the client I get the error message 'error while loading shared libraries: libopen62541.so: cannot open shared object file: No such file or directory'. Furthermore I tried the preprocessor definition 'UA_MULTITHREADING'. I realized that I had to install liburcu. Nevertheless I get the following error message 'In file include from /usr/include/urcu-pointer.h:30:0, from /usr/include/urcu.h, from ../src/open62541.c:112: /usr/include/urcu/arch.h: in function 'caa_get_cycles': /usr/include/urcu/arch.h:79:9: error: 'asm' undeclared (first use in this function)'. Unfortunately I am not familiar enough with Linux to solve these problems in a reasonable time. So I gave up to run open62541 under Linux and tried Microsoft Visual Studio instead.

The version 2013 of Microsoft Visual Studio is necessary because only this new version supports C99, e.g. stdbool.h. Preprocessor definitions UA_AMALGAMATE and _W32 must be added. ws2_32.lib must additionally be linked. During the build of the project warnings are ejected. Files 'server.lib' and 'server.exp' are created. I don't know why these files are necessary to make the file 'server.exe'. Furthermore I found that the preprocessor definition 'UA_MULTITHREADING' is not supported under Windows.

Okay, that were my experiences so far.

Best regards

Thomas

Sten Grüner

unread,
Jul 6, 2015, 2:42:45 AM7/6/15
to thomas....@gmail.com, open...@googlegroups.com
On 07/06/2015 12:40 AM, thomas....@gmail.com wrote:
Hi, Sten,

thank you very much for your advice :-) I followed your hints and like to give you a feedback.

I was able to build open62541 under Debian 7 at the command line by 'gcc -std=c99 -DUA_AMALGAMATE server.c open62541.c -o server'. As Eclipse is more comfortable I setup an Eclipse project. I successfully built open62541 and started it. However, I was not able to test this executable with the client which I downloaded from https://github.com/acplt/open62541/releases/download/v0.1/open62541-linux32.tar.gz. For if I start the client I get the error message 'error while loading shared libraries: libopen62541.so: cannot open shared object file: No such file or directory'. Furthermore I tried the preprocessor definition 'UA_MULTITHREADING'. I realized that I had to install liburcu. Nevertheless I get the following error
The UA_AMALGAMATE flag is fixed now, you can compile the client in the same way you compile the server! Just use this file: https://github.com/acplt/open62541/blob/master/examples/client.c


message 'In file include from /usr/include/urcu-pointer.h:30:0, from /usr/include/urcu.h, from ../src/open62541.c:112: /usr/include/urcu/arch.h: in function 'caa_get_cycles': /usr/include/urcu/arch.h:79:9: error: 'asm' undeclared (first use in this function)'. Unfortunately I am not familiar enough with Linux to solve these problems in a reasonable time. So I gave up to run open62541 under Linux and tried Microsoft Visual Studio instead.

we compile our library with liburcu in out automated build (it is Ubutntu, though) and it works, did you try to check the version of liburcu?



The version 2013 of Microsoft Visual Studio is necessary because only this new version supports C99, e.g. stdbool.h. Preprocessor definitions UA_AMALGAMATE and _W32 must be added. ws2_32.lib must additionally be linked. During the build of the project warnings are ejected. Files 'server.lib' and 'server.exp' are created. I don't know why these files are necessary to make the file 'server.exe'. Furthermore I found that the preprocessor definition 'UA_MULTITHREADING' is not supported under Windows.
I will check for _W32, afaik it is not needed at least for MSVS 2015. You can see the MSVS compile log here: https://ci.appveyor.com/project/Stasik0/open62541/branch/master

apparently warnings arise due to limited support of C99 :/ you are free to contribute fixes (as long the do not break the gcc compatibililty).

yes, UA_MULTITHREADING relies on liburcu which is not supported for Windows
-- 
Sten Grüner
Chair of Process Control Engineering
RWTH Aachen University

Turmstrasse 46, 52064 Aachen, Germany
Tel. +49 (0) 241 80-97745
Fax  +49 (0) 241 80-92238

www.plt.rwth-aachen.de 
Reply all
Reply to author
Forward
0 new messages