cyclonedds icon indicating copy to clipboard operation
cyclonedds copied to clipboard

cyclonedds/src/core/ddsc/tests/CdrStreamWstring.idl:13:22: syntax error

Open razr opened this issue 1 year ago • 1 comments

It fails to compile

[ 64%] Built target CdrStreamKeyExt_generate
[ 64%] Built target CdrStreamChecking_generate
[ 64%] Generating CdrStreamWstring.c, CdrStreamWstring.h
~/github/razr/cyclonedds/src/core/ddsc/tests/CdrStreamWstring.idl:13:22: syntax error
make[2]: *** [src/core/ddsc/tests/CMakeFiles/CdrStreamWstring_generate.dir/build.make:74: src/core/ddsc/tests/CdrStreamWstring.c] Error 1
make[1]: *** [CMakeFiles/Makefile2:2191: src/core/ddsc/tests/CMakeFiles/CdrStreamWstring_generate.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

I use idlc which I have compiled a while back

$ which idlc
/usr/local/bin/idlc
~/github/razr/cyclonedds/vxworks$ idlc -v
idlc (Eclipse Cyclone DDS) 0.11.0
~/github/razr/cyclonedds/vxworks$ ls -la /usr/local/bin/idlc
-rwxr-xr-x 1 root root 536832 Nov 22 10:54 /usr/local/bin/idlc

it is the same version but the size is different in compare to the local master

~/github/razr/cyclonedds/linux$ ls -la bin/idlc 
-rwxrwxr-x 1 user user 536848 Mar 10 12:22 bin/idlc
~/github/razr/cyclonedds/linux$ bin/idlc -v
idlc (Eclipse Cyclone DDS) 0.11.0

If I install a freshly complied idlc the error is gone. Confusing (the same version) ...

razr avatar Mar 10 '25 11:03 razr

Sorry, I messed up my setup, and this is why:

I cross-compile cyclonedds-0.10.5 on Ubuntu 22.04 as follows

cmake .. -DCMAKE_TOOLCHAIN_FILE=$WIND_SDK_CC_SYSROOT/mk/toolchain.cmake \
  -DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON -DCMAKE_PREFIX_PATH=/usr/local -DBUILD_DDSPERF=ON

at some point it needs the idlc binary. I cannot use cyclonedds-tools (0.8.2-5) package, it is too old, causing the compilation process to fail. It would be helpful to have a compatibility check for this in CMakeLists.txt somewhere.

The only way it to build it natively and install it e.g. to /usr/local/bin. However I couldn't find a way to build and install idlc only. It also installs headers, cmake artifacts, and other shared libraries which is not very convenient.

razr avatar Mar 18 '25 10:03 razr