MALLOC option in autotools eclipse plugin - eclipse

I'm struggling with autotools plugin in Eclipse and some C++ project I have downloaded.
My goal consists on cross-compilng for an arm processor, so the project is already configured to work with autotools, but when I try to crosscompile I have the following issue
In file included from /usr/include/c++/4.6/bits/stl_algo.h:61:0,
from /usr/include/c++/4.6/algorithm:63,
from dtntracepath.cpp:17:
/usr/include/c++/4.6/cstdlib:119:11: error: ‘::malloc’ has not been declared
I've checked out the configure output of my project noticing this
...
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... no
checking for memset... yes
...
I know how to fix it through linux terminal through adding the option
export ac_cv_func_malloc_0_nonnull=yes
but non through Eclipse or autotools pluging, since the settings of the project aren't available. May you enlighten me?
Kind regards,
Thanks in advance
PS: the parameters which I've set in autotools plugin are the following ones:
-Command: configure CFLAGS="-m32" LDFLAGS="-m32" CC=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CC=c99
-All options : --host=arm-mv5sft-linux-gnueabi --build=i686-linux --target=arm-mv5sft-linux-gnueabi --with-sysroot=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi/
EDITED:
I have tried ldav1s advice an using the following configure
configure CC=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CXX=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++ CFLAGS="-m32" LDFLAGS="-m32"
I get these errors
Command-line environment variables:
LDFLAGS="-m32" LDFLAGS="-m32" CC="/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc" CXX="/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++"
sh -c /home/t/ibrdtn/ibrdtn-tools-0.8.0/configure ++ --host=arm-mv5sft-linux-gnueabi --with-sysroot=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi/
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: ++
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-mv5sft-linux-gnueabi-strip... no
checking for arm-mv5sft-linux-gnueabi-strip... no
checking for strip... strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
Invalid configuration `++': machine `++' not recognized
configure: error: /bin/bash ./config.sub ++ failed
configure: error: /bin/bash ./config.sub ++ failed
checking build system type...
Configuration failed with error
EDIT2
After reinstalling eclipse the ++ errors of first edition were gone, now if I use the following configuration
configure CC=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CXX=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++ CFLAGS="-m32" LDFLAGS="-m32"--host=arm-mv5sft-linux-gnueabi --build=i686-linux --target=arm-mv5sft-linux-gnueabi
It was compiling properly, I have seen some arm/le outputs, but I have got this error
concerning to one of the libraries
make[3]: Entering directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon/net'
CXX tcpclient.lo
CXX tcpserver.lo
CXX tcpstream.lo
CXX udpsocket.lo
CXX MulticastSocket.lo
CXX UnicastSocket.lo
CXX stopandwait.lo
CXX vsocket.lo
CXX vinterface.lo
CXX vaddress.lo
CXX LinkManager.lo
In file included from LinkManager.cpp:16:
../../ibrcommon/net/NetLinkManager.h:19:29: error: netlink/netlink.h: No such file or directory
../../ibrcommon/net/NetLinkManager.h:20:26: error: netlink/attr.h: No such file or directory
make[3]: *** [LinkManager.lo] Error 1
make[3]: Leaving directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon/net'
make[2]: Leaving directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon'
make[2]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon'
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
**** Build Finished ****

You haven't set up the C++ compiler (CXX) as part of your arguments to configure, as well as multiply defining the C compiler (CC).
You seem to be picking up the compiler for the build machine (the ones in /usr/include) instead of the one for the crosscompiler (the ones in /home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1).

Related

Cmake fail to compile cant find python.h (Flutter, dart:ffi)

I need to connect .C/.CPP code that makes use of Python in to Flutter app.
Luckily I can use dart:ffi for it. and therefore the
but when I'm trying to compile the apk I am getting the following error:
Launching lib/main.dart on AOSP on IA Emulator in debug mode...
lib/main.dart:1
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.
> Build command failed.
Error while executing process /home/*usr_name*/Android/Sdk/cmake/3.18.1/bin/ninja with arguments {-C /home/*usr_name*/flutter/final4/android/app/.cxx/cmake/debug/x86_64 weather}
ninja: Entering directory `/home/*usr_name*/flutter/final4/android/app/.cxx/cmake/debug/x86_64'
[1/2] Building C object CMakeFiles/weather.dir/home/*usr_name*/flutter/final4/src/weather.c.o
FAILED: CMakeFiles/weather.dir/home/*usr_name*/flutter/final4/src/weather.c.o
/home/*usr_name*/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=x86_64-none-linux-android21 --gcc-toolchain=/home/*usr_name*/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/*usr_name*/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Dweather_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O0 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/weather.dir/home/*usr_name*/flutter/final4/src/weather.c.o -MF CMakeFiles/weather.dir/home/*usr_name*/flutter/final4/src/weather.c.o.d -o CMakeFiles/weather.dir/home/*usr_name*/flutter/final4/src/weather.c.o -c /home/*usr_name*/flutter/final4/src/weather.c
/home/*usr_name*/flutter/final4/src/weather.c:43:10: fatal error: 'Python.h' file not found
#include <Python.h>
^~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
at first my CMakeLists.txt file looked like this:
cmake_minimum_required(VERSION 3.18)
project(py)
add_library(
weather
SHARED
../../src/weather.c
)
So I edit it to find Python and make sure that he indeed find it and the development version that I have installed :
cmake_minimum_required(VERSION 3.18)
project(py)
find_package(Python COMPONENTS Interpreter Development)
message("Python_FOUND:${Python_FOUND}")
message("Python_VERSION:${Python_VERSION}")
message("Python_Development_FOUND:${Python_Development_FOUND}")
message("Python_LIBRARIES:${Python_LIBRARIES}")
message("Python_LIBRARY_DIRS:${Python_LIBRARY_DIRS}")
message("Python_INCLUDE_DIRS:${Python_INCLUDE_DIRS}")
message("Python_LINK_OPTIONS:${Python_LINK_OPTIONS}")
message("Python_NumPy_FOUND:${Python_NumPy_FOUND}")
add_library(
weather
SHARED
../../src/weather.c
)
Now cmake . prints:
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter Development Development.Module Development.Embed
Python_FOUND:TRUE
Python_VERSION:3.8.10
Python_Development_FOUND:TRUE
Python_LIBRARIES:/usr/lib/x86_64-linux-gnu/libpython3.8.so
Python_LIBRARY_DIRS:/usr/lib/x86_64-linux-gnu
Python_INCLUDE_DIRS:/usr/include/python3.8
Python_LINK_OPTIONS:
Python_NumPy_FOUND:FALSE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/*usr_name*/flutter/final4/android/app
Great, now Cmake knows where python is but still returns the same error when trying to create the apk.
I tried as well to include the include/python3.8 path for the compiler with the -I flag but that caused a bunch of different issues that make me force outer paths which just felt wrong and ended up with no solution.
I added the project to github so you guys can take a look at it as well:
https://github.com/Eidantz/Flutter_python_c
you can find weather.c and another .C file that I tried in /src folder.
the CMakeLists.txt is of course in /android/app folder
Thanks in advance guys!

How to install humanoid_navigation ROS kinetic Ubuntu 16.04?

When installing ROS Kinetic packages (Ubuntu 16.04), namely humanoid_navigation, it throws an error when executing catkin_make. Without this package, catkin_make runs without error. Everything was done according to the instructions https://emanual.robotis.com/docs/en/platform/op3/recovery/#op3-manual-installation
[ 97%] Building CXX object humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o
/home/user/catkin_ws/src/humanoid_navigation/humanoid_localization/src/HumanoidLocalization.cpp:23:42: fatal error: pcl/filters/uniform_sampling.h: No such file or directory
compilation terminated.
humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/build.make:62: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o' failed
make[2]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o] Error 1
CMakeFiles/Makefile2:12108: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all' failed
make[1]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 97%] Linking CXX executable /home/user/catkin_ws/devel/lib/footstep_planner/footstep_planner_node
[ 97%] Built target footstep_planner_node
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j2 -l2" failed
After this error, installed pcl from github https://github.com/PointCloudLibrary/pcl in src, ran catkin make, and gave an error
/home/user/catkin_ws/src/humanoid_navigation/humanoid_localization/src/HumanoidLocalization.cpp:23:42: fatal error: pcl/filters/uniform_sampling.h: No such file or directory
compilation terminated.
humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/build.make:62: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o' failed
make[2]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o] Error 1
CMakeFiles/Makefile2:12108: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all' failed
make[1]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Help please!
Did you terminate/interrupt any build recently? This might be due to the fact that the object code was not generated successfully. One way is to clean the build and devel folder's associated content with the package and then build again.
UPDATE!!!
So I replicated your problem and followed my steps to solve them. In my case I had issues with my ros_control package and pcl. Not it works. Cheers!!!
[100%] Linking CXX executable
/home/aadi/catkin_ws/devel/lib/robot_state_publisher/state_publisher
[100%] Built target joint_state_listener
[100%] Built target state_publisher
[100%] Built target robot_state_publisher
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
The problem is that in PCL 1.7.2, UniformSampling is located in the "keypoints" module, and in 1.8.0, it has been moved to the "filters" module.
Please check your PCL version
Okay, I have a working solution:
nano /home/<user>/catkin_ws/src/humanoid_navigation/humanoid_localization/src/HumanoidLocalization.cpp
And change to following:
//#include <pcl/filters/uniform_sampling.h>
#include <pcl/keypoints/uniform_sampling.h>
Then go and run catkin_make with cd ~/catkin_ws && catkin_make.
It now should work without any errors.
You can try following
cd ~/catkin_ws/src
wget https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.8.1.zip
unzip pcl-1.8.1.zip
cd pcl-pcl-1.8.1
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j4
sudo make install -j4
cd ~/catkin_ws && catkin_make
If you have installed another pcl version before go to this library and enter
sudo make uninstall
make uninstall
and then remove this directory.

pgxn install madlib UBUNTU 16 LTS not working

The command pgxn install madlib get so many errors at UBUNTU 16 LTS (xenial)... There are a bug with MADLib installation for UBUNTU?
INFO: best version: madlib 1.10.0
INFO: saving /tmp/tmpZPEFvN/madlib-1.10.0.zip
INFO: unpacking: /tmp/tmpZPEFvN/madlib-1.10.0.zip
INFO: running configure
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:14 (project):
The CMAKE_CXX_COMPILER:
sunCC;g++
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
CMake Error at /usr/share/cmake-3.5/Modules/CMakeCXXInformation.cmake:61 (include):
include called with wrong number of arguments. include() only takes one
file.
Call Stack (most recent call first):
CMakeLists.txt:14 (project)
-- Configuring incomplete, errors occurred!
See also "/tmp/tmpZPEFvN/madlib-1.10.0/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/tmpZPEFvN/madlib-1.10.0/build/CMakeFiles/CMakeError.log".
INFO: building extension
make -C build all
make[1]: Entering directory '/tmp/tmpZPEFvN/madlib-1.10.0/build'
make[1]: *** No rule to make target 'all'. Stop.
make[1]: Leaving directory '/tmp/tmpZPEFvN/madlib-1.10.0/build'
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 2
ERROR: command returned 2: make PG_CONFIG=/usr/bin/pg_config all
See also MADlib apt install, how to?

How to compile zsh on/for an iPhone?

Background
I recently changed from bash to zsh as my default shell and have quickly gotten used to the awesomeness that's added by associated tools (prezto, zaw and zsh-dwim).
I wanted to have a similar setup on iPhone as well. However, only zsh v.4.3.10 is available from the default repos and that's not supported by prezto:
Would you know how I should go about compiling zsh from source for the iPhone? I attempted to use Theos to build something on my Win7 box, but am greeted with the following errors after doing the make package install:
/home/blah/projects/ashrocks/theos/makefiles/targets/Cygwin/iphone.mk:38: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Bootstrapping CydiaSubstrate...
Compiling iPhoneOS CydiaSubstrate stub... default target? failed, what?
cp: cannot stat `_out/*': No such file or directory
cp: cannot stat `libsubstrate.dylib': No such file or directory
Generating substrate.h header...
Making all for tweak ashrocks...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
/bin/sh: theos/toolchain/windows/iphone/bin/armv7-apple-darwin11-clang++: No such file or directory
/home/blah/projects/ashrocks/theos/makefiles/instance/rules.mk:144: recipe for target 'obj/Tweak.xm.666c9a3c.o' failed
make[2]: *** [obj/Tweak.xm.666c9a3c.o] Error 127
/home/blah/projects/ashrocks/theos/makefiles/instance/library.mk:19: recipe for target 'internal-library-all_' failed
make[1]: *** [internal-library-all_] Error 2
/home/blah/projects/ashrocks/theos/makefiles/master/rules.mk:54: recipe for target 'ashrocks.all.tweak.variables' failed
make: *** [ashrocks.all.tweak.variables] Error 2
Would you know how the command line tools availabe in Cydia were compiled ?
It's probably because you don't have the standard libraries compiled for the iPhone on your computer. Try setting up gcc on your iPhone by following these instructions. I have done this and have successfully compile various pieces of software.

Error while building binutils 2.21.1a on Solaris

I'm trying to build binutils 2.21.1a from http://ftp.gnu.org/gnu/binutils on Solaris sun4u sparc SunOS 5.10. I am using gcc version 4.0.2. When I built this is the error:
cc1: warnings being treated as errors
compress.c: In function 'bfd_compress_section_contents':
compress.c:100: warning: implicit declaration of function 'compressBound'
make[2]: *** [compress.lo] Error 1
make[2]: Leaving directory `/nfs/netapp0/user/home/hart/downloads/binutils-2.21.1/bfd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/nfs/netapp0/user/home/hart/downloads/binutils-2.21.1/bfd'
*** Error code 2
make: Fatal error: Command failed for target `all'
I added the --disable-werror to the configure line to try to bypass it and hopefully continue the build. Unfortunately this did not work either and I got this new, related, error at link time:
Undefined first referenced
symbol in file
compressBound ../bfd/.libs/libbfd.a(compress.o)
ld: fatal: Symbol referencing errors. No output written to size
collect2: ld returned 1 exit status
I have searched for an existing issue but I have found nothing related. Any ideas? I prefer to use this version of binutils, but if you know of a version that builds OK on this platform with gcc 4.0.2 specifically please let me know.
I finally found the issue was indeed filed as a BUG. The workaround is to add --without-zlib to the configure script or install an up to date version of zlib on the system.