Contiki compile error - contiki

I'm working with Tmote-sky nodes. I have installed instant-contiki as a virtual machine using VMware player. Now I can't compile any .c file on the nodes. I have always this error message:
make: msp430-gcc: Command not found
CC ../../core/net/rime/rimeaddr.c
make: msp430-gcc: Command not found
make: *** [obj_sky/rimeaddr.o] Error 127
I thought that it was because of msp430-gcc toolchain. I've installed this toolchain which normally exists with instant-contiki but I still have this problem.
Can some one help me please?

You have to install gcc-msp430 with the following command:
sudo apt-get install gcc-msp430

Try this :
the problem causes with little switch. remove it you're good to go.
open this file in note pad and goto line 132
contiki/cpu/msp40/Makefile.msp430
remove -g switch from the following line:
CFLAGSNO = -Wall -mmcu=$(CC_MCU) -g $(CFLAGSWERROR)
the line will be:
CFLAGSNO = -Wall -mmcu=$(CC_MCU) $(CFLAGSWERROR)
just clean up and recompile.
it should work.... :)

Related

ERROR while code coverage report using lcov

I am trying to run coverage on my project, after updating to Ubuntu 16.04.
I get
Deleted 665 files
Writing data to coverage.info.cleaned
lcov: ERROR: cannot write to coverage.info.cleaned!
CMakeFiles/coverage.dir/build.make:57: recipe for target 'CMakeFiles/coverage' failed
make[3]: *** [CMakeFiles/coverage] Error 13
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/coverage.dir/all' failed
make[2]: *** [CMakeFiles/coverage.dir/all] Error 2
CMakeFiles/Makefile2:74: recipe for target 'CMakeFiles/coverage.dir/rule' failed
make[1]: *** [CMakeFiles/coverage.dir/rule] Error 2
Makefile:129: recipe for target 'coverage' failed
make: *** [coverage] Error 2
enter code here
Before the update I had no problem running the coverage
Does it help if you use absolute paths instead of relative paths when passing files to lcov?
I ran into a similiar problem where lcov also failed to write the file.
Not sure if it is a bug in lcov, but the problem was that it got confused with relative paths:
lcov -a test_fast_cxxtest_gcov__base.info -a test_fast_cxxtest_gcov__test.info \
-o test_fast_cxxtest_gcov__total.info
Combining tracefiles.
Reading tracefile test_fast_cxxtest_gcov__base.info
Reading tracefile test_fast_cxxtest_gcov__test.info
lcov: WARNING: function data mismatch at /home/phil/ghost/constants.h:1862
Writing data to test_fast_cxxtest_gcov__total.info
lcov: ERROR: cannot write to test_fast_cxxtest_gcov__total.info!
Running it with strace revealed that it executes chdir("/") on several locations, which changes the working directory to /. That explains why it cannot write the file.
One workaround is to use absolute paths. For instance, if you are using GNU make, you can use the abspath command:
lcov -a $(abspath test_fast_cxxtest_gcov__base.info) \
-a $(abspath test_fast_cxxtest_gcov__test.info) \
-o $(abspath test_fast_cxxtest_gcov__total.info)
After that change, it was finally able to write the file.
(Other options like trying to set the directories using the --base-directory or --directory option did not have an effect, as far as I saw.
The version of lcov that I tested with is 1.12.)
The problem is not limited to Ubuntu, as I ran into it on Arch Linux. It could be a regression introduced in 1.12, however, so I reported it (see issue #77630).
Update: Lcov is not part of GCC, so my original bug report was closed, but I got an answer from the Lcov mailing list. The problem is already fixed in commit 632c25. Users of Arch Linux based distros can try the latest snapshot with aur/lcov-git.

Mqtt: How to install mosquitto old version

I have installed mosquitto using the command apt-get install mosquitto. It is installed successfully on my system, but I got version "1.4.5". I want to downgrade to version 1.4.4, so I was trying using the source tar file. Under folder, I am running the command make and it is throwing an error:
set -e; for d in lib client src; do make -C ${d}; done
make[1]: Entering directory `/home/ubuntu/org.eclipse.mosquitto-1.4.4/lib'
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c mosquitto.c -o mosquitto.o
In file included from mosquitto.c:33:0:
./mosquitto_internal.h:27:27: fatal error: openssl/ssl.h: No such file or directory
# include <openssl/ssl.h>
^
compilation terminated.
make[1]: *** [mosquitto.o] Error 1
make[1]: Leaving directory `/home/ubuntu/org.eclipse.mosquitto-1.4.4/lib'
make: *** [mosquitto] Error 2
What is going wrong here?. Is there any another way to install 1.4.4 version of mosquitto?
Thanks
You're missing dependencies needed for compilation.
Try:
apt-get install libc-ares-dev libssl-dev libwrap0-dev uthash-dev uuid-dev
If you want libwebsockets support you can either install libwebsockets-dev, or better install it manually from source - that will get you version 1.5 instead of the old 1.2 that is in Debian/Ubuntu.
If you install the manually compiled version with
make prefix=/usr install
then it will overwrite the existing binary and you can use it with the existing system services.

Error: File format not recognized

I'm using a Raspberry Pi 2 running Ubuntu MATE 15.10 to work on a project.
I'm trying to run a makefile and got this error
/home/dpanagou/Quadrotors/Vicon/libs/libViconDataStreamSDK_CPP.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:8: recipe for target '../bin/Vicon_state' failed
make[1]: *** [../bin/Vicon_state] Error 1
make[1]: Leaving directory '/home/dpanagou/Quadrotors/HLP/Vicon'
Makefile:40: recipe for target 'Vicon' failed
make: *** [Vicon] Error 2
I've also tried make clean before make.
From research, a lot of people have suggested that the object file might be corrupted. So I downloaded new files from the developer and ran the makefile again. I still get the same error.
Here is my makefile:
CUR_DIR = $(shell pwd)
CFLAGS = `pkg-config --cflags lcm`
LDFLAGS = `pkg-config --libs lcm` ../src/filter_util.o ../src/util.o
vicon_lib = $(CUR_DIR:%/HLP/Vicon=%/Vicon/libs)
../bin/Vicon_state:
g++ $(CFLAGS) Vicon_state_data.cpp -o ../bin/Vicon_state -Wl,- rpath=../../Vicon/libs -L$(vicon_lib) -lViconDataStreamSDK_CPP -lDebugServices $(LDFLAGS)
Please help with specific instructions as I am very new to Linux and programming.
Check the format of the file with the "file" command, and compare it to the format of any .so that comes with rpi.
I'm not 100% sure, but might it be that the library is for raspbian with its v6 compatible HF vs generic V7-only HF in debian?

Luarocks error building luafilesystem

I'm using Luarocks 2.2.0beta1 to install luafilesystem on windows 7 with lua 5.2 and mingw. I got this error:
>luarocks install luafilesystem
Installing http://rocks.moonscript.org/luafilesystem-1.6.2-2.src.rock...
Using http://rocks.moonscript.org/luafilesystem-1.6.2-2.src.rock... switching to 'build' mode
mingw32-gcc -O2 -c -o src/lfs.o -IC:/lua/include/src/lfs.c
mingw32-gcc -shared -o lfs.dll src/lfs.o C:/lua/bin/lua52.dll -lm
C:\lua\bin\lua52.dll: file not recognized: File format not recognized
collect2.exe: error: Id returned 1 exit status
Error: Build error: Failed compiling module lfs.dll
any idea how to fix this?
note: until now, I have no problem installing other module with luarocks that have no dependency with luafilesystem.
Solved, this problem arise because actually I'm not using the same MinGW compiler when building lua52.dll. I don't know which compiler I use at the first time. Thanks to #siffiejoe

asm/socket.h: No such file or directory cross compiling Dart for Raspberry pi

I'm cross-compiling the Dart runtime using the instruction here.
I've installed all the dependencies as specified. I've also cloned the git repository with the necessary tool chain.
I'm running the runtime compilation with this command:
./tools/build.py -m release -a arm --toolchain=../tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf runtime
The compilation starts with no problem then it stops with this error:
LINK(target) out/ReleaseXARM/libdart_dependency_helper.target
CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o
In file included from /usr/include/sys/socket.h:38:0,
from /usr/include/netinet/in.h:23,
from /usr/include/arpa/inet.h:22,
from runtime/platform/globals.h:56,
from runtime/platform/assert.h:16,
from runtime/vm/allocation.h:8,
from runtime/vm/bootstrap.h:9,
from runtime/vm/bootstrap.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
#include <asm/socket.h>
^
compilation terminated.
CXX(host) out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o
In file included from /usr/include/sys/socket.h:38:0,
from /usr/include/netinet/in.h:23,
from /usr/include/arpa/inet.h:22,
from runtime/platform/globals.h:56,
from runtime/platform/assert.h:16,
from runtime/vm/allocation.h:8,
from runtime/vm/bootstrap.h:9,
from out/ReleaseXARM/obj/gen/async_gen.cc:5:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
#include <asm/socket.h>
^
compilation terminated.
runtime/libdart_lib_withcore.host.mk:978: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/runtime/vm/bootstrap.o] Error 1
make: *** Waiting for unfinished jobs....
runtime/libdart_lib_withcore.host.mk:986: recipe for target 'out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o' failed
make: *** [out/ReleaseXARM/obj.host/libdart_lib_withcore/gen/async_gen.o] Error 1
BUILD FAILED
Am I missing any dependency or package?
I hit the same problem. On my ubuntu 14.04 system /usr/include/asm didn't exist. It was called asm-generic instead. I sym-linked it and the build was able to continue.
cd /usr/include
sudo ln -s asm-generic/ asm
The build was able to continue after that.
This is probably because you're trying to build an application without some of the include paths correctly set, for example using a 32-bit gcc on a 64-bit platform.
To resolve:
sudo apt-get install gcc-multilib
I'm not sure why this happens, but sometimes /usr/include/asm gets deleted. My teammates who looked at their Ubuntu x86-64 workstations found that the asm symlink was:
0 lrwxrwxrwx 1 root root 20 May 22 2013 /usr/include/asm -> x86_64-linux-gnu/asm
And the command to recreate it is:
$ cd /usr/include
$ sudo ln -s x86_64-linux-gnu/asm asm
The files in /usr/include/asm-generic are sometimes, but not always, equivalent to the files in the x86-64 specific directory; so it's difficult to recommend symlinking it as a workaround.

Resources