Unable to build Boost.Python - boost

I am trying to build boost.python following this link.
When I try to compile using ./b2 or ./bjam, I am getting errors like:
error: No best alternative for /python_for_extensions
next alternative: required properties: <python>2.6 <target-os>linux
matched
next alternative: required properties: <python>2.6 <target-os>linux
matched
The error disappears when I added this line:
using python : 2.6 : /usr/bin/python2.6 : /usr/include/python2.6 : /usr/lib/python2.6 : <python-debugging>on ;
in
/home/kchaitanya/boost/boost_1_50_0/tools/build/v2/user-config.jam
However, when compiling now, I get compile time errors of not being able to find header files. Just a small excerpt of the errors is:
...patience...
...patience...
...found 1548 targets...
...updating 62 targets...
gcc.compile.c++ bin.v2/libs/python/build/gcc-4.1.2/release/link-static/threading multi/numeric.o
In file included from ./boost/python/detail/prefix.hpp:13,
from ./boost/python/numeric.hpp:8,
from libs/python/src/numeric.cpp:6:
./boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory
./boost/python/detail/wrap_python.hpp:75:24: error: patchlevel.h: No such file or directory
./boost/python/detail/wrap_python.hpp:78:2: error: #error Python 2.2 or higher is required for
./boost/python/detail/wrap_python.hpp:142:21: error: Python.h: No such file or directory
./boost/python/instance_holder.hpp:34: error: ‘PyObject’ has not been declared
./boost/python/instance_holder.hpp:41: error: expected ‘;’ before ‘(’ token
./boost/python/instance_holder.hpp:45: error: ‘PyObject’ has not been declared
./boost/python/detail/wrapper_base.hpp:21: error: expected initializer before ‘*’ token
./boost/python/detail/wrapper_base.hpp:23: error: expected initializer before ‘*’ token
Need help on building this boost.python.

The problem was not installing the python-devel or python-dev package corresponding to my python version.
In my case it was python2.6 so
sudo yum install python26-devel did the trick.

I had a similar issue in my project and above would not help. I was cross-compiling python and boost, and the actual issue for me was duplication of the 'using python : ' in configuration (one existed in project-config.jam, following the bootstrap.sh/bat execution and I was trying to add another python config myself to a user-config.jam).
This solution was described in here:
http://comments.gmane.org/gmane.comp.lib.boost.build/22088
and here:
https://groups.google.com/forum/#!topic/boost-developers-archive/namMFSO_6Rg

Related

Boost Compilation Failed for Installation of LightGBM on Windows: Name clash for '<pC:\boost\boost-build\lib>libboost_atomic.a'

I am trying to install LightGBM GPU version on Windows systems (I am using Anaconda on Windows for Python). I followed the installation guide from the beginning.
I have succefully completed the first two tasks:
Install the appropriate OpenCL SDK
Install MinGW
However, I encountered error after this command for Boost Compilation:
b2 install --build_dir="C:\boost\boost-build" --prefix="C:\boost\boost-build" toolset=gcc --with=filesystem,system threading=multi --layout=system release
The Error Message are as followed:
error: Name clash for 'libboost_atomic.a'
error:
error: Tried to build the target twice, with property sets having
error: these incompatible properties:
error:
error: - 64
error: - 32
error:
error: Please make sure to have consistent requirements for these
error: properties everywhere in your project, especially for install
error: targets.
Please share me any suggestions on how should I rectify the problem?

Which Protoc Does "Make" Command Use?

I am trying to build LAB which generate robust facial landmark.
In installation guide it says one needs to install Caffe prerequisites which I'd checked CUDA and BLAS well installed on my AWS EC2 instance.
Then I git cloned and typed make under the cloned git folder named in LAB
But it returns following error
CXX .build_release/src/caffe/proto/caffe.pb.cc
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:0:
.build_release/src/caffe/proto/caffe.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
#error This file was generated by a newer version of protoc which is
^
.build_release/src/caffe/proto/caffe.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
#error incompatible with your Protocol Buffer headers. Please update
^
.build_release/src/caffe/proto/caffe.pb.h:14:2: error: #error your headers.
#error your headers.
^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:0:
.build_release/src/caffe/proto/caffe.pb.h:23:35: fatal error: google/protobuf/arena.h: No such file or directory
compilation terminated.
Makefile:588: recipe for target '.build_release/src/caffe/proto/caffe.pb.o' failed
make: *** [.build_release/src/caffe/proto/caffe.pb.o] Error 1
The error above looks like I am using old version of libprotoc so if I type in which protoc it returns
/home/ubuntu/anaconda3/bin//protoc
and for protoc --version it returns libprotoc 3.5.1
and for whereis protoc it returns
protoc: /usr/local/bin/protoc /home/ubuntu/anaconda3/bin/protoc /usr/share/man/man1/protoc.1.gz
Thus since it looks like I have another protoc in /usr/local/bin I had checked its version via /usr/local/bin/protoc --version which returns
libprotoc 3.3.0
Hereby I have two problems:
1) I don't know if I use make cmd, which protoc being referred.
2) I don't know the error requires which version of protoc.
How can I check and get the proper information regarding above two problems?
Try something like PROTOC=/home/ubuntu/anaconda3/bin/protoc make
Make sure compiler got correct path to protobuf headers with appropriate -I option.

Bazel crashes compiling tensorflow

I did some customizations to tensorflow and to the included eigen library. When compiling, I get this (and other similar) error:
ERROR: /home/retisexp/tensorflow/tensorflow/python/BUILD:1285:1:
Executing genrule //tensorflow/python:audio_ops_pygenrule failed
(Segmentation fault): bash failed: error executing command /bin/bash
bazel-out/k8-opt/genfiles/tensorflow/python/audio_ops_pygenrule.genrule_script.sh
* Error in bazel-out/host/bin/tensorflow/python/gen_audio_ops_py_wrappers_cc':
free(): invalid pointer: 0x00007f57549c5b78 ***
*** Error inbazel-out/host/bin/tensorflow/python/gen_audio_ops_py_wrappers_cc':
free(): invalid size: 0x000000000141b090 *
I had this problem with other files, and I solved by passing the bash command contained in the file to xargs (see here). Unfortunately, some of this .sh files are generated (or modified) at compile time, so in this case I cannot solve in the same way.
Where this file are generated in the tensorflow build scripts? Is there any way to pass all the tensorflow .sh scripts to xargs? Other solutions?

Why am I getting this aclocal error?

I'm trying to compile libbsd from source on Ubuntu 13.04. I'm using a toolchain to cross-compile, but automake is on the local machine. I have aclocal-1.13 in the PATH and everything, but I'm still getting this error. I've tried looking them up but can't get any lead. What's going on here?
<...>
config.status: executing libtool commands
CDPATH="${ZSH_VERSION+.}:" && cd .. && /bin/bash /home/me/libbsd/build-aux/missing aclocal-1.13 -I m4
error: cannot get project version.
configure.ac:9: error: AC_INIT should be called with package and version arguments
/usr/share/aclocal-1.13/init.m4:23: AM_INIT_AUTOMAKE is expanded from...
configure.ac:9: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal-1.13: error: echo failed with exit status: 1
make: *** [../aclocal.m4] Error 1
Any help is greatly appreciated.
The error here is configure.ac:9: error: AC_INIT should be called with package and version arguments.
You are getting this error because on line 9 of your configure.ac you are not passing package and version arguments to AC_INIT.
The exact information can be found here: https://www.gnu.org/software/automake/manual/automake.html#Public-Macros
Namely,
If your configure.ac has:
AC_INIT([src/foo.c])
AM_INIT_AUTOMAKE([mumble], [1.5])
You should correct it as follows:
AC_INIT([mumble], [1.5])
AC_CONFIG_SRCDIR([src/foo.c])
AM_INIT_AUTOMAKE
Although the other notes around it are important too imho.

compilation issue with NDK

I am compiling one file using NDK android-ndk-5rc,
here is command
/media/Softwares/android-ndk-r5c/ndk-build APP_PLATFORM=android-8
but facing one strange compilation error
Fatal error: invalid -march= option: `armv5te'
make: * [/media/Softwares/Projects/FilterTest/obj/local/armeabi/objs/convolution/convolution.o] Error 1
i searched armv5te in whole folder android-ndk-r5c and modified to armv7-a, still facing same error.
Any help is great....

Resources