Alignment trap , not handling instruction error when trying to build c++ library with arm processor - c++

I'm trying to build the AWS SDK for C++ library on a cubietruck board.
My current software configuration is the following:
gcc 4.9.2
cmake 3.8.2
OS: Armbian_5.20_Cubietruck_Debian_jessie_3.4.112
kernel 3.4.112.sun7i
curl : 7.38
aws cpp SDK version :(1.1.46)
I tried to build the above c++ library by giving :
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="config;core;kinesis"
However the build fails and I receive the following error messages:
alignment trap: not handling instruction e8de677f at []
Unhandled fault :alignment exception (0x001) at 0x00bb674c
Bus error
I also tried the following:
1) I tried to build different versions of the library
2) I updated the curl from 7.38 to 7.51
3) I upgraded the os with sudo apt-get update, sudo apt-get upgrade
But the problem persisted. It seems to be a memory issue either leak or a bad dereferencing but could not find any useful info.
I checked the in /var/log/syslog but didn't get any new info.
Has anyone come across a similar issue. Since it'a library what can I do to get more info regarding the problem?

Related

wxWindows 2.4.2 configuration failed saying checking for toolkit... configure: error: Please specify at most one toolkit

I am new to Linux environment, we have task to migrate a Windows wxWidgets(version 2.4.2) GUI application to Linux platform(RHEL8 or 8.3).The application is successful on Visual studio 2017&2019(Compiler MSVC++ 14.1 and 14.2) using the wxWindows-2.4.2(very old one). But when i try to build wxWindows2.4.2 on Linux( g++ (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5))
../configure --with-gtk=2
at configuration stage process stopped saying
checking for toolkit... configure: error: Please specify at most one
toolkit (maybe some are cached in configarg.cache?)
I tried by installing "Development Tool" on Linux but getting same thing.
Source: https://github.com/wxWidgets/wxWidgets/archive/refs/tags/v2.4.2.zip
You can successfully run the configure phase by first performing dnf install gtk2-devel, and then configuring with ./configure --enable-gtk2.
However, (not surprisingly), wx 2.4.2 will not successfully build on RHEL8 (I tried); there will be a bunch of compilation errors. Those are not impossible to fix, but I wonder if that's worth the trouble – there probably would be runtime errors and/or misbehaving GUI components at the next stage.
While I understand your strategy of choosing the old wx version that the application is known to work with on Windows, it seems to be the hard way in this case.

upgrading protobuf tensorflow on jetson tx2

To give as much background as possible -
I have a machine learning model trained using keras i'm trying to embed on an nvidia jetson tx2.
I have set up tensorflow on there (a bit of a pain in itself) however when i run my script i'm hitting an error with protobuf.
Using TensorFlow backend.
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.1.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "external/protobuf/src/google/protobuf/any.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program requires version 3.1.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "external/protobuf/src/google/protobuf/any.pb.cc".)
Aborted (core dumped)
So - i upgraded protobuf using pip at first but i thought the clash is because c++ version is taking priority and the version in linux was still stating 2.6.1 however after building in c++ the version is now shown as 3.1.0 however i am still getting the same error.
From the nvidia dev forums i received some feedback
"/usr/lib/aarch64-linux-gnu/libprotobuf.so.9.0.1
This means that C/C++ code will find version 2.6.
pip install protobuf-3.1.0-py2.py3-none-any.whl
This means that Python code will find version 3.1.
You need to upgrade the C++ (system) library to match version 3.1.
I don't think there's a default package on Ubuntu that does this, so you will have to either hack it by building your own and installing it on top of the system package, or you will have to find a deb package that has a newer version that will still install on your current system."
Ive really been struggling with this as i cant find a way to upgrade the system files. Any help would be much appreciated
Thanks
edit: i'm also wondering could this be a clash with GTK (i am also using openCV here so thats worth a mention!)
Please check your version of libprotobuf-dev.
Please try to uninstall your existing one on your PC with following commands:
apt-get remove --purge libprotobuf-dev
Then, build new version of libprotobuf-dev:
apt-get install autoconf automake libtool curl make g++ unzip
wget https://github.com/google/protobuf/releases/download/v3.5.0/protobuf-cpp-3.5.0.tar.gz
tar -xvf protobuf-cpp-3.5.0.tar.gz
cd protobuf-3.5.0
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig
Good luck.
References:
https://github.com/BVLC/caffe/issues/5711
https://github.com/google/protobuf/issues/2979
step 1:
first, uninstall with purge protobuf
sudo apt-get remove --purge libprotobuf
step 2:
start a fresh one
$ wget https://raw.githubusercontent.com/jkjungavt/jetson_nano/master/install_protobuf-3.6.1.sh
sudo chmod +x install_protobuf-3.6.1.sh
./install_protobuf-3.6.1.sh #this time will take 30 min on my board.

The tools required to build C++ code for R were not found

OS: Ubuntu 14.04
g++: g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
R version: 3.2.0 (2015-04-16) -- "Full of Ingredients"
Rcpp: 0.11.6
Today I apt-get dist-upgrade my system, and the g++ was also been upgraded.
Then when I am trying to use "Rcpp" package in R, the code is the simplest test code >>evalCpp("1+1") . An error as follows occurred:
Error in frameTypes(env) : not a proper evaluation environment
Calls: ::: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
Error in sourceCpp(code = code, env = env, rebuild = rebuild,showOutput = showOutput, :
Error 1 occurred building shared library.
WARNING: The tools required to build C++ code for R were not found.
Please install GNU development tools including a C++ compiler.
I have did google for it. The following links are all about Mac OSX:
Error when with Xcode 5.0 and Rcpp (Command Line Tools ARE installed)
g++ errors when trying to compile c++11 with Rcpp
From the answers and comments, I can not tell what is the real problem.
Appreciate your help!
UPDATE: I finally solved this problem by reinstalling all the R related deb packages. And one thing we should keep in mind is that I also did what #Dirk suggested first apt-get build-dep r-base-dev. I can not confirm which one is the key step.
You need
sudo apt-get build-dep r-base
to install the all the build dependencies for R itself.
But we even built an explicitly helper package r-base-dev so in most cases (and in your use case of Rcpp) you just need
sudo apt-get install r-base-dev
There is something wrong/missing in your system configuration. First of all, I doubt that you are really running Ubuntu 14.04 (after the dist-upgrade) because the the other versions that you listed wouldn't be available (unless you have pulled them in from a non-default repository). You might also consider running a full-upgrade to try to straighten out your configuration.
You might gain some insights by running with showOutput=1...
library(Rcpp)
evalCpp("1+1",showOutput=1,rebuild=1)
...but actually, it looks like the problem is related specifically to a parameter called env (Error in frameTypes(env) : not a proper evaluation environment) which is likely evaluated prior-to attempting to compile.
For what it is worth, I was able to run this without r-base-dev installed, but maybe installing r-base-dev will pull in the correct, and updated, versions of what you need. I would be inclined to just reinstall all R-related packages.

C/C++ Compiler Missing on NetBeans 7.3 on Debian

I have installed Debian 7.0.0 and have just installed the full version of NetBeans 7.3 which is supposed to have C/C++ building capabilities. However, when I start, I get the message
No C/C++ Compilers Found
I did a search for this error message and Bugzilla said it was obsolete instructions. However, when I try to build a C++ application, it gives error highlights for standard C++ includes and gives a pop-up asking for the location of the C++ compiler and Makefile. I thought these were both provided by IDEs that are supposed to support C++.
All of my C/C++ compilers (or their names at least) are in
/usr/share/bash-completion/completions
However, when I try to execute them, they behave like they are not there
peter#app-server:~$ ls /usr/share/bash-completion/completions/g++
/usr/share/bash-completion/completions/g++
peter#app-server:~$ /usr/share/bash-completion/completions/g++
bash: /usr/share/bash-completion/completions/g++: Permission denied
peter#app-server:~$ sudo /usr/share/bash-completion/completions/g++
sudo: /usr/share/bash-completion/completions/g++: command not found
peter#app-server:~$
Check that you actually have a compiler installed. Typing g++ -v on the command line is the easiest way to verify that (and you also get to know which version you're using by default).
If you don't have a compiler yet, aptitude install build-essential will install the bare minimum.

installing c++ boost on mac osx leopard -- port fails

I'm not much of a c++ programmer, just an end-user trying to install an existing project from source.
One of the project dependencies is the boost library.
When I tried to install boost on my osx 10.5.7 using "sudo port install boost", I got the following error message:
---> Building boost with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_boost/work/boost_1_35_0" && gmake all " returned error 2
Command output: Makefile:2: *** missing separator. Stop.
Error: Status 1 encountered during processing.
help?
EDIT: I suspect something is wrong with my system, though I am not sure what -- it's just a plain osx installation + the xcode CD that came with it, nothing fancy. [things are just so much easier on this front on linux!)
I did "sudo port selfupdate" and "sudo port upgrade outdated" as suggested in an answer,
and the second one ran about all night, then failed with many errors, the last few are:
Error: The following dependencies failed to build: db46
Error: Unable to upgrade port: 1
---> Extracting tiff
On Mac OS X 10.5, tiff 3.8.2 requires Xcode 3.1 or later but you have Xcode 3.0.
Error: Target org.macports.extract returned: incompatible Xcode version
Error: Unable to upgrade port: 1
---> Activating xorg-renderproto #0.9.3_0
Error: Target org.macports.activate returned: Image error: /opt/local/include/X11/extensions/render.h is being used by the active render port. Please deactivate this port first, or use 'port -f activate xorg-renderproto' to force the activation.
Error: The following dependencies failed to build: xorg-renderproto
Error: Unable to upgrade port: 1
In my experience you can easily do things with other installers that can break the port command from working correctly. Not to mention that MacPorts just breaks at the most random of times for me. Once I removed perl using the port command. It broke the whole port installation, don't even try this.
If you can I would just build Boost from source using gcc.It is actually not that difficult.
I have written an article on how to do this with some detail here.
It has a specific focus on how to do this on Mac OS X but says how to do this on Windows as well.
The two commands you will need are:
Build debug libs using GCC:
bjam toolset= darwin variant=debug threading=multi link=static
Build release libs using GCC:
bjam toolset=darwin variant=release threading=multi link=static
More detailed info on doing this here.
On Mac OS X 10.5, tiff 3.8.2 requires Xcode 3.1 or later but you have Xcode 3.0.
Isn't that the cause of port upgrade outdated failure?
Try running 'sudo port selfupdate'. You are using an outdated version of MacPorts. Once this is done run 'port upgrade outdated' to update the ports you have and then try to install boost again.
Update:
Update XCode as Paul mentioned in a post below. You can get it on the Apple Developer Site. You will probably have to signup to get a download link. As for the bug about the active render port you can safely disable this port as it has been replaced by xorg-renderproto. Deactivate it by running 'sudo port deactivate render'. Once that is done you can update again using 'port upgrade outdated' and it shouldn't take as long this time.
My experiences with MacPorts are a mixed blessing at best. Sometimes ports are out of date, or only half-done, it's very nice when it works, but unfortunatly doesn't always, so I kind of gave up on port to be honest...
That said, the default configure, bjam, ... combo from the boost distribution works flawlessly on os x, any reason you specifically want to get it working via port ?