TInyOS 1.x Generating an error when compiling BLINK - java

root#everton-laptop:/opt/tinyos-1.x/apps/Blink# make pc
compiling Blink to a pc binary
ncc -o build/pc/main.exe -g -O0 -board=micasb -pthread -target=pc -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -fnesc-nido-tosnodes=1000 -fnesc-cfile=build/pc/app.c Blink.nc -lm
In file included from /opt/tinyos-1.x/tos/platform/pc/packet_sim.h:55,
from /opt/tinyos-1.x/tos/platform/pc/nido.h:81,
from /opt/tinyos-1.x/tos/platform/pc/hardware.h:43,
from /opt/tinyos-1.x/tos/system/tos.h:144:
/opt/tinyos-1.x/tos/types/AM.h:155: parse error before `struct'
/opt/tinyos-1.x/tos/types/AM.h:156: parse error before `struct'
/opt/tinyos-1.x/tos/types/AM.h:158: parse error before `struct'
/opt/tinyos-1.x/tos/types/AM.h: In function `TOS_MsgLength':
/opt/tinyos-1.x/tos/types/AM.h:186: parse error before `TOS_Msg'
In file included from /opt/tinyos-1.x/tos/platform/pc/hardware.h:116,
from /opt/tinyos-1.x/tos/system/tos.h:144:
/opt/tinyos-1.x/tos/platform/pc/eeprom.c: At top level:
/opt/tinyos-1.x/tos/platform/pc/eeprom.c:115: warning: declaration of `length' shadows global declaration
/opt/tinyos-1.x/tos/types/AM.h:158: warning: location of shadowed declaration
/opt/tinyos-1.x/tos/platform/pc/eeprom.c:145: warning: declaration of `length' shadows global declaration
/opt/tinyos-1.x/tos/types/AM.h:158: warning: location of shadowed declaration
make: *** [build/pc/main.exe] Error 1
Tried compiling BLink and i keep getting the above error and not sure what to do next. any help would be nice .

Looking at the CVS repository for tos/types/AM.h, it looks like it's choking on the following code:
154: enum {
155: MSG_DATA_SIZE = offsetof(struct TOS_Msg, crc) + sizeof(uint16_t), // 36 by default
156: TINYSEC_MSG_DATA_SIZE = offsetof(struct TinySec_Msg, mac) + TINYSEC_MAC_LENGTH, // 41 by default
157: DATA_LENGTH = TOSH_DATA_LENGTH,
158: LENGTH_BYTE_NUMBER = offsetof(struct TOS_Msg, length) + 1,
159: TINYSEC_NODE_ID_SIZE = sizeof(uint16_t)
160: };
The common item from lines 155, 156, and 158 are the offsetof() macro, which should be defined in stddef.h and which looks like should have been brought in by the tos.h before it causes AM.h to be included, so offsetof() should already be defined.
You might want to verify whether or not the compiler you're using has offsetof() properly defined and/or why it's not available for use in AM.h. If necessary, you can probably define it yourself using a more or less usual implementation:
#define offsetof(st, m) ((size_t) ( (char *)&((st *)(0))->m - (char *)0 )) // stolen from Wikipedia

Related

Where can I find the set of exit codes that may be returned by dvd+rw-mediainfo

Running on redhat 7.9. I will be using dvd+rw-mediainfo wrapped by either ProcBuilder from apache or the ProcessBuilder from java 11 to query the state of media inserted into an optical drive. I'd like information about the possible exit values dvd+rw-mediainfo can produce. Empirically I have determined that 251 means there is no disc inserted into the drive and 130 means there is no drive matching the argument to the command. Are there any other exit codes I should be aware of? I looked at the c source I found at https://sources.debian.org/src/dvd+rw-tools/7.1-3/dvd+rw-mediainfo.cpp/ but there is no definition of the return codes in there. There are not a lot of included h files. I was unable to find stddef.h on my system which I sort of suspected might be the location.
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
I'm not very adept at c++ (strictly java) but I was hoping to find a h file that defined the exit codes. They are not listed in the man page entries for the command. Where I see exit called in the source it is not clear to me where the values are defined.
if ((err=cmd.transport(READ,inq,36)))
sperror ("INQUIRY",err),
exit (FATAL_START(errno));
I don't see where the value of errno is set. I also can't find the definitation of FATAL_START. Also one exit calls uses a constant that I can't find defined anywhere.
exit (FATAL_START(EINVAL));
For the errno values, see errno.h (and other files included from therein), which on a RedHat-based system you will find in /usr/include/errno.h, provided by package glibc-headers.
Looking at your link to the source code, the macro FATAL_START seems to be defined in the header file transport.hxx, and it just sets bit 7:
#define FATAL_START(er) (0x80|(er))
So, exit code 251 = 128 + 123 would correspond to this:
#define ENOMEDIUM 123 /* No medium found */
And 130 = 128 + 2 corresponds to this:
#define ENOENT 2 /* No such file or directory */

Why warnings crashes openJDK-11 build?

I need to build following openJDK
git clone --depth 1 --branch jdk-11+28 https://github.com/openjdk/jdk.git
on aarm64 NAME="Simply Linux", VERSION="9.1 (Destiny)"
For that I run:
bash ./configure
make images > make.log
And it fails with following error (make.log)
Building target 'images' in configuration 'linux-aarch64-normal-server-release'
Warning: No mercurial configuration present and no .src-rev
Compiling 117 files for BUILD_java.compiler.interim
Compiling 394 files for BUILD_jdk.compiler.interim
Compiling 299 files for BUILD_jdk.javadoc.interim
ERROR: Build failed for target 'images' in configuration 'linux-aarch64-normal-server-release' (exit code 2)
=== Output from failing command(s) repeated here ===
* For target hotspot_variant-server_tools_adlc_objs_dfa.o:
/home/user/jdk/src/hotspot/share/adlc/dfa.cpp: In member function ‘const char* Expr::compute_external(const Expr*, const Expr*)’:
/home/user/jdk/src/hotspot/share/adlc/dfa.cpp:724:14: error: ‘char* strncat(char*, const char*, size_t)’ specified bound 2048 equals destination size [-Werror=stringop-overflow=]
strncat(string_buffer, "+", STRING_BUFFER_LENGTH);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/jdk/src/hotspot/share/adlc/dfa.cpp:732:14: error: ‘char* strncat(char*, const char*, size_t)’ specified bound 2048 equals destination size [-Werror=stringop-overflow=]
strncat(string_buffer, " + ", STRING_BUFFER_LENGTH);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/jdk/src/hotspot/share/adlc/dfa.cpp: In member function ‘const char* Expr::compute_expr(const Expr*, const Expr*)’:
/home/user/jdk/src/hotspot/share/adlc/dfa.cpp:746:14: error: ‘char* strncat(char*, const char*, size_t)’ specified bound 2048 equals destination size [-Werror=stringop-overflow=]
strncat(string_buffer, "+", STRING_BUFFER_LENGTH);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
* All command lines available in /home/user/jdk/build/linux-aarch64-normal-server-release/make-support/failure-logs.
=== End of repeated output ===
No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See doc/building.html#troubleshooting for assistance.
What am I doing wrong?
Where can I submit a bug report about openjdk11, or discuss this issue?

Java CSVeed library, option for quote inside unquoted field?

I'm benching several Java libraries to parse csv files. I can't find a solution for the CSVeed library with this line :
af,dekh"iykh'ya,Dekh"iykh'ya,13,,34.60345,69.2405
I have this error :
org.csveed.report.CsvException: Illegal state transition:
Parsing symbol QUOTE_SYMBOL [34] in state INSIDE_FIELD
19970: af,dekh
I understand very well what happen unfortunately I tried different blend of options without succeed. Is there a way?
In fact the perfect line of 7 cols should be :
af,dekh\"iykh\'ya,Dekh\"iykh\'ya,13,,34.60345,69.2405
af,dekh"iykh'ya,Dekh"iykh'ya,13,,34.60345,69.2405
To parse this in the following fields you'll have to turn quoting off in your parser:
af
dekh"iykh'ya
Dekh"iykh'ya
13
<null>
34.60345
69.2405
If quoting can not be turned off, you could use setQuote(char symbol) and provide an unused char as parameter.

Android build error: ro.build.fingerprint cannot exceed 91 bytes

I'm building an android rom from the android source code but after about 5 minutes it gives this error.
error: ro.build.fingerprint cannot exceed 91 bytes: Android/mini_emulator_x86/mini-emulator-x86:5.0.555/AOSP/username02280306:userdebug/test-keys (97)
make: *** [out/target/product/mini-emulator-x86/system/build.prop] Error 1
make: *** Deleting file `out/target/product/mini-emulator-x86/system/build.prop'
make: *** Waiting for unfinished jobs....
How do I increase the ro.build.fingerprint size limit?
Plus I'm building on a Mac.
Edit build/tools/post_process_props.py. Change lines as follows:
PROP_NAME_MAX = 31
# PROP_VALUE_MAX = 91
PROP_VALUE_MAX = 128
Edit bionic/libc/include/sys/system_properties.h. Change lines as follows:
#define PROP_NAME_MAX 32
// #define PROP_VALUE_MAX 92
#define PROP_VALUE_MAX 128
Do
make clean
make
You can also run the second make command in parallel using syntax such as
make -j8
Alternatively, you can specify the build fingerprint string as command line argument to make using:
make -j5 BUILD_FINGERPRINT="....."
This will allow you to stay within the 91 byte limit.

Eigen - Levenberg Marquardt algorithm: invalid template arguments on definition of permutation

I'm trying to use the Eigen implementation of Levenberg Marquardt algorithm on a Android application. In order to use Eigen, I'm using Android NDK and jni. I've already tested Eigen with simple calculations (like matrix creation and vector sums) and it works perfectly. However, when I tried to use the Levenberg Marquardt algorithm I got some errors on the LevenbergMarquardt.h file from Eigen's library.
First, here is my code. I based on this code:
Eigen::MatrixXd matrix(count, 3);
for (int i = 0; i < count; i++) {
Eigen::VectorXd t(3);
t << x[i], y[i], accuracy[i];
matrix.row(i) = t;
}
distance_functor functor(matrix, count);
Eigen::NumericalDiff<distance_functor> numDiff(functor);
Eigen::LevenbergMarquardt<Eigen::NumericalDiff<distance_functor>,double> lm(numDiff);
lm.parameters.maxfev = 2000;
lm.parameters.xtol = 1.49012e-08;
lm.parameters.ftol = 1.49012e-08;
lm.parameters.gtol = 0;
lm.parameters.epsfcn = 0;
Eigen::LevenbergMarquardtSpace::Status ret = lm.minimize(poseResult);
And those are the error that I got. The first two errors are in Eigen's library, and the last one is on the LevenbergMarquardt object creation. I've also included the respective line of code of the error, following the message:
Invalid template
arguments LevenbergMarquardt.h /jnimath/jni/unsupported/Eigen/src/LevenbergMarquardt line
121 Semantic Error
typedef PermutationMatrix<Dynamic,Dynamic> PermutationType;
Invalid template
arguments LevenbergMarquardt.h /jnimath/jni/unsupported/Eigen/src/NonLinearOptimization line
103 Semantic Error
PermutationMatrix<Dynamic,Dynamic> permutation;
Invalid template arguments test.cpp /jnimath/jni line 47 Semantic
Error
Eigen::LevenbergMarquardt,double> lm(numDiff);
The first two errors are really strange because there are some other typedefs using Dynamic and they are not throwing errors.
Also, I noticed that I got some symbol errors on the compilation, which are:
Symbol
'YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY'
could not be resolved Matrix.h /jnimath/jni/Eigen/src/Core line
277 Semantic Error
Symbol 'YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX' could not be
resolved Matrix.h /jnimath/jni/Eigen/src/Core line 224 Semantic Error
So, I have two questions:
Why am I getting errors on those lines?
Does anyone know how to fix that problem?
Thank you

Categories

Resources