Difficulties building mbed-client-examples

Hi -

I can’t succeed to build mbed-client-examples

$ git clone https://github.com/ARMmbed/mbed-client-examples
Cloning into 'mbed-client-examples'...
remote: Counting objects: 361, done.
remote: Total 361 (delta 0), reused 0 (delta 0), pack-reused 361
Receiving objects: 100% (361/361), 1.89 MiB | 684.00 KiB/s, done.
Resolving deltas: 100% (186/186), done.
Checking connectivity... done.
$ cd mbed-client-examples/
$ yotta build
info: get versions for x86-linux-native
info: download x86-linux-native@1.0.0 from the public module registry
info: get versions for linux-native
info: download linux-native@1.0.0 from the public module registry
info: get versions for mbed-client
info: download mbed-client@1.2.0 from the public module registry
info: get versions for mbed-client-c
info: download mbed-client-c@1.1.1 from the public module registry
info: get versions for mbed-client-linux
info: download mbed-client-linux@1.1.0 from the public module registry
info: get versions for mbed-client-mbedtls
info: download mbed-client-mbedtls@1.0.7 from the public module registry
info: get versions for nanostack-libservice
info: download nanostack-libservice@3.0.8 from the public module registry
info: get versions for mbedtls
info: download mbedtls@2.2.0-rc.1 from the public module registry
info: generate for target: x86-linux-native 1.0.0 at /home/agreen/projects/mbed/mbed-client-examples/yotta_targets/x86-linux-native
-- The C compiler identification is GNU 5.1.1
-- The CXX compiler identification is GNU 5.1.1
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/agreen/projects/mbed/mbed-client-examples/build/x86-linux-native
[86/124] Building C object ym/mbedtls/source/CMakeFiles/mbedtls.dir/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbedtls/source/entropy_poll.c.o
/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbedtls/source/entropy_poll.c: In function ‘getrandom_wrapper’:
/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbedtls/source/entropy_poll.c:93:13: warning: implicit declaration of function ‘syscall’ [-Wimplicit-function-declaration]
     return( syscall( SYS_getrandom, buf, buflen, flags ) );
             ^
[121/124] Building CXX object source/CMakeFiles/mbed-client-examples.dir/home/agreen/projects/mbed/mbed-client-examples/source/main.cpp.o
FAILED: /bin/c++   -Dmbed_client_examples_EXPORTS -O2 -g -DNDEBUG -I/home/agreen/projects/mbed/mbed-client-examples -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbed-client -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbed-client-c -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbed-client-linux -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbed-client-mbedtls -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/nanostack-libservice -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbedtls -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbed-client-c/nsdl-c -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbed-client-c/source/libNsdl/src/include -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbed-client-c/source/libCoap/src/include -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/mbed-client-linux/mbed-client-libservice -I/home/agreen/projects/mbed/mbed-client-examples/yotta_modules/nanostack-libservice/mbed-client-libservice -I/home/agreen/projects/mbed/mbed-client-examples/source    -include "/home/agreen/projects/mbed/mbed-client-examples/build/x86-linux-native/yotta_config.h" -MMD -MT source/CMakeFiles/mbed-client-examples.dir/home/agreen/projects/mbed/mbed-client-examples/source/main.cpp.o -MF source/CMakeFiles/mbed-client-examples.dir/home/agreen/projects/mbed/mbed-client-examples/source/main.cpp.o.d -o source/CMakeFiles/mbed-client-examples.dir/home/agreen/projects/mbed/mbed-client-examples/source/main.cpp.o -c /home/agreen/projects/mbed/mbed-client-examples/source/main.cpp
/home/agreen/projects/mbed/mbed-client-examples/source/main.cpp:16:40: fatal error: mbed-net-sockets/UDPSocket.h: No such file or directory
compilation terminated.
[121/124] Building CXX object ym/mbed-client/test/CMakeFiles/mbed-client-test-mbedclient_linux.dir/mbedclient_linux/main.cpp.o
ninja: build stopped: subcommand failed.
error: command ['ninja'] failed

mbed-net-sockets does not appear in github Arm Mbed · GitHub

What steps did I miss?

Edit: Attempting to fill in things using this “yotta repository” did not go well

[agreen@build mbed-client-examples]$ yotta install sockets
info: get versions for sockets
info: download sockets@1.0.2 from the public module registry
info: dependency sockets: ^1.0.2 written to module.json
info: get versions for sal
info: download sal@1.0.2 from the public module registry
info: get versions for core-util
info: download core-util@1.0.1 from the public module registry
info: get versions for minar
info: download minar@1.0.1 from the public module registry
info: get versions for cmsis-core
info: download cmsis-core@1.0.1 from the public module registry
info: get versions for ualloc
info: download ualloc@1.0.2 from the public module registry
info: get versions for dlmalloc
info: download dlmalloc@1.0.0 from the public module registry
info: get versions for compiler-polyfill
info: download compiler-polyfill@1.1.1 from the public module registry
info: get versions for minar-platform
info: download minar-platform@1.0.0 from the public module registry
info: get versions for minar-platform-posix
error: Failed to satisfy dependencies of /home/agreen/projects/mbed/mbed-client-examples/yotta_modules/minar-platform:
error: minar-platform-posix does not exist in the modules registry. Check that the name is correct, and that it has been published.

The page for the sockets module says “the best place to start is mbed-example-network”

https://yotta.mbed.com/#/module/sockets/1.0.2

$ yotta install mbed-example-network
info: get versions for mbed-example-network
info: download mbed-example-network@0.1.8 from the public module registry
info: dependency mbed-example-network: ~0.1.8 written to module.json
info: get versions for minar-platform-posix
info: get versions for mbed-drivers
info: download mbed-drivers@0.6.9 from the public module registry
info: get versions for mbed-hal
info: download mbed-hal@0.6.4 from the public module registry
error: Failed to satisfy dependencies of /home/agreen/projects/mbed/mbed-client-examples/yotta_modules/minar-platform:
error: minar-platform-posix does not exist in the modules registry. Check that the name is correct, and that it has been published.
error: sockets does not meet specification ~0.3.0 required by mbed-example-network
error: core-util does not meet specification ~0.0.11 required by mbed-drivers
error: minar does not meet specification ~0.6.0 required by mbed-drivers
error: cmsis-core does not meet specification ~0.2.0 required by mbed-drivers
error: ualloc does not meet specification ~0.0.0 required by mbed-drivers
$

Thanks

-Andy

Hello Andy,
Did you set the target?
For example " yotta target frdm-k64f-gcc"

Stanly

Thanks Stanley.

You’re right I didn’t set the target. I didn’t understand that this has to be done on every project, or it defaults to trying to build native on the build OS.

That got me a bit further, but I am can’t clear dependencies for mbed-client-examples. specifically mbed-example-network

error: sockets does not meet specification ~0.3.0 required by mbed-example-network
error: mbed-drivers does not meet specification ~0.6.3 required by mbed-example-network

Current sockets is 1.0.2 and mbed-drivers 0.11.1… mbed-example-network seems old.

I can build it, but the build fails with a couple of errors, if I hack the errors away (missing include file, and confusion if YOTTA_CFG_UVISOR_PRESENT is set or not, then I can build and run it. But he just says “Error occured” after a couple of seconds (Ethernet is plugged into network with a dhcp server).

Ah I read your other thread

They still have the wrong URL in the source…

With that I think it is working.

However I am not interested in the cloud part right now, just basic network function by itself.

So I will study the code.

Thanks for your help earlier ^^

Hello Andy,
I has tested mbed-example-network before, and it was built successfully.
Below is the commands procedure.

  1. git clone GitHub - ARMmbed/mbed-example-network: Example applications using the Sockets API
  2. cd mbed-example-network
  3. yotta target frdm-k64f-gcc
    4.yotta build

I try to clone mbed-example-network again, and just built it 10 minutes ago, I also encounter build error, I check the module.json for many modules, and I found that many modules version are revised recently, so it cause the build errror.
I upload the previous tested version to git , you can try it.

Stanly

Thanks Stanley.

I have managed to get the git client app to work by replacing uvisor-libs and mbed-example-network with git versions down yotta_modules instead of what was pulled in by yotta install, and update the JSON to want the ^1.0.0 versions that are in git.

The problems are mainly coming from nobody updated the registry with git pieces.

But there is a bug around YOTTA_CFG_UVISOR_PRESENT not being defined, in uvisor_libs. I can hack it to work and the application can build and run then. But it seems there should be a proper fix.

I pushed my changes to the new stuff to github (and sent pull requests).

The client app itself

And you need to git clone this down ./yotta_modules

before doing the yotta install

Then it should build and run OK – I only really tested it as far as DHCP. But without these fixes it won’t even build.

1 Like

Hello @warmcat,
Thank you for reporting the issue with the YOTTA_CFG_UVISOR_PRESENT symbol. We fixed it and everything should be now back to normal. I also closed your PR as the fix needed to be done at the target level. Please check out my comment here and let me know if the problem persists.

AlessandroA