eclipse-wakaama / wakaama

Eclipse Wakaama is a C implementation of the Open Mobile Alliance's LightWeight M2M protocol (LWM2M).
BSD 3-Clause "New" or "Revised" License
500 stars 374 forks source link

client example building issue #797

Open queifaro opened 3 months ago

queifaro commented 3 months ago

Hello, after clone the repo and submodule, the example server is built correctly but the sample client no. For both i follow the instruction in the github readme. For client cmake -S examples/client -B build-client -DWAKAAMA_MODE_CLIENT=ON will produce the build-client directory and his files but the cmake --build build-client do not produce executable nor error or warning messages

Is there anythings to change ? Thanks in advance B/R

mlasch commented 2 months ago

I had the same issue building the client (and lightclient) as described in the readme. There have been changes recently to the build system and it looks like it broke the client builds when building as described in the readme. You can try to use the cmake presets to build. This is unfortunately not documented yet.

$ cmake --preset client
$ cmake --build --preset client

Then you can find the client executables in build-presets/client/examples/client. This will also build some unittests. The same works for the server. You can also list the available cmake presets.

$ cmake --build --list-presets
Available build presets:

  "server"
  "bootstrap_server"
  "client"
  "log_dbg"
  "log_warn"
  "log_fatal"
queifaro commented 2 months ago

cmake -S examples/client -B build-client -DWAKAAMA_MODE_CLIENT=ON result OK cmake --build --list-presets result OK cmake --build --preset client result in

12%] Building C object examples/client/CMakeFiles/lwm2mclient.dir//shared/platform.c.o [ 13%] Building C object examples/client/CMakeFiles/lwm2mclient.dir//shared/connection.c.o [ 13%] Linking C executable lwm2mclient [ 13%] Built target lwm2mclient [ 13%] Performing autoheader step for 'external_tinydtls' ./autogen.sh: 21: autoreconf: not found gmake[2]: [examples/client/CMakeFiles/external_tinydtls.dir/build.make:87: examples/client/external_tinydtls-prefix/src/external_tinydtls-stamp/external_tinydtls-autoheader] Error 127 gmake[1]: [CMakeFiles/Makefile2:247: examples/client/CMakeFiles/external_tinydtls.dir/all] Error 2 gmake: *** [Makefile:101: all] Error 2

is my command sequence correct ?

Thanks

mlasch commented 2 months ago

It looks like you are missing autoconf which is a build dependency of tinydtls.

sudo apt install autoconf

Your first step is not needed anymore, if you use the preset, otherwise it looks correct.

LukasWoodtli commented 2 months ago

Sorry for the inconvenience. We are in the process of modernizing the CMake build system. Hopefully, building the examples will be more straight forward in the near future. Added the autoconf dependency to the readme: #799

LukasWoodtli commented 2 months ago

@queifaro Could you fix the issue?