with the usage:
ExternalProject_Add(tbb
PREFIX ${CMAKE_SOURCE_DIR}/deps
DOWNLOAD_NO_PROGRESS 1
DOWNLOAD_NAME v2021.4.0
# TODO: add wb cdn link
URL https://codeload.github.com/oneapi-src/oneTBB/tar.gz/refs/tags/v2021.4.0
URL_HASH SHA1=2641f9a1ead4621a8660ee07a1664627fa0eb477
BUILD_IN_SOURCE 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
CMAKE_COMMAND ${CMAKE_COMMAND}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DBUILD_SHARED_LIBS=OFF
-DTBB_TEST=OFF
-DTBB_EXAMPLES=OFF
-DTBB_BENCH=OFF
#CONFIGURE_COMMAND ""
BUILD_COMMAND make extra_inc=big_iron.inc ${ENABLE_STD_LIB}
INSTALL_COMMAND bash -c "/bin/cp -f */libtbb.${TBB_LIB_SUFFIX}* ${CMAKE_SOURCE_DIR}/deps/lib/"
BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/deps/lib/libtbb.${TBB_LIB_SUFFIX}
)
lead to
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_group.h:271: error: undefined reference to 'tbb::detail::r1::initialize(tbb::detail::d1::task_group_context&)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/detail/_small_object_pool.h:61: error: undefined reference to 'tbb::detail::r1::allocate(tbb::detail::d1::small_object_pool*&, unsigned long)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_arena.h:466: error: undefined reference to 'tbb::detail::r1::max_concurrency(tbb::detail::d1::task_arena_base const*)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/detail/_task.h:191: error: undefined reference to 'tbb::detail::r1::execute_and_wait(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_group.h:367: error: undefined reference to 'tbb::detail::r1::destroy(tbb::detail::d1::task_group_context&)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_group.h:367: error: undefined reference to 'tbb::detail::r1::destroy(tbb::detail::d1::task_group_context&)'
In mac OS , it works well, but centos 7.2(gcc 7.2) and ubuntu(clang 6) it lead to the errors .
Any one can help??
Related
I'm using Raspberry pi 4, here I cloned this repo, and after I followed instructions they have given
First I run ./configure without any error
After that I tried to clean
make clean
Then I tried to make
After that I got some error as shown below:
~/qtcam/src $ make
Makefile:1725: warning: overriding recipe for target 'install_itemfolder_01'
Makefile:1716: warning: ignoring old recipe for target 'install_itemfolder_01'
Makefile:1729: warning: overriding recipe for target 'uninstall_itemfolder_01'
Makefile:1720: warning: ignoring old recipe for target 'uninstall_itemfolder_01'
g++ -Wl,-O1 -o Qtcam main.o logger.o about.o cameraproperty.o videostreaming.o uvccamera.o v4l2-api.o seecam_10cug_m.o seecam_10cug_bayer.o seecam_11cug.o seecam_cu50.o seecam_ar0130.o videoencoder.o seecam_cu51.o see3cam_cu130.o h264decoder.o ascella.o seecam_cu30.o see3cam_130.o see3cam_30.o seecam_81.o see3cam_cu135.o see3cam_cu40.o see3cam_cu20.o uvcExtCx3sni.o keyEventReceive.o nilecam20_usb.o nilecam30_usb.o h264camera.o see3cam_cu55.o see3cam_130A.o audioinput.o see3cam_cu38.o alsa.o fscam_cu135.o see3camcu55_mh.o see3cam_20cug.o see3cam_cu22.o see3cam_130d.o see3cam_24cug.o see3cam_cu81.o seecam_cu80.o see3cam_160.o ecam51_usb.o ecam82_usb.o see3cam_cu27.o see3cam_1332.o ecam83_usb.o see3cam_cu1330m.o see3cam_135m.o see3cam_cu136m.o barcode_camera.o qtquick2applicationviewer.o moc_qtquick2applicationviewer.o moc_about.o moc_cameraproperty.o moc_videostreaming.o moc_uvccamera.o moc_seecam_10cug_m.o moc_seecam_10cug_bayer.o moc_seecam_11cug.o moc_seecam_cu80.o moc_seecam_cu50.o moc_seecam_ar0130.o moc_seecam_cu51.o moc_see3cam_cu130.o moc_h264decoder.o moc_ascella.o moc_seecam_cu30.o moc_see3cam_130.o moc_common_enums.o moc_see3cam_30.o moc_seecam_81.o moc_see3cam_cu135.o moc_see3cam_cu40.o moc_see3cam_cu20.o moc_uvcExtCx3sni.o moc_keyEventReceive.o moc_nilecam30_usb.o moc_nilecam20_usb.o moc_h264camera.o moc_see3cam_cu55.o moc_see3cam_130A.o moc_audioinput.o moc_see3cam_cu38.o moc_fscam_cu135.o moc_see3camcu55_mh.o moc_see3cam_20cug.o moc_see3cam_cu22.o moc_see3cam_130d.o moc_see3cam_24cug.o moc_see3cam_cu81.o moc_see3cam_160.o moc_ecam51_usb.o moc_ecam82_usb.o moc_see3cam_cu27.o moc_see3cam_1332.o moc_ecam83_usb.o moc_see3cam_cu1330m.o moc_see3cam_135m.o moc_see3cam_cu136m.o moc_barcode_camera.o /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so /usr/lib/arm-linux-gnueabihf/libQt5Multimedia.so /usr/lib/arm-linux-gnueabihf/libQt5Quick.so /usr/lib/arm-linux-gnueabihf/libQt5Gui.so /usr/lib/arm-linux-gnueabihf/libQt5Concurrent.so /usr/lib/arm-linux-gnueabihf/libQt5QmlModels.so /usr/lib/arm-linux-gnueabihf/libQt5Qml.so /usr/lib/arm-linux-gnueabihf/libQt5Network.so /usr/lib/arm-linux-gnueabihf/libQt5Core.so -lGLESv2 -lpthread -latomic
/usr/bin/ld: audioinput.o: undefined reference to symbol 'pa_context_disconnect##PULSE_0'
/usr/bin/ld: /lib/arm-linux-gnueabihf/libpulse.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:468: Qtcam] Error 1
Can anyone tell me how to solve this error?
This is not the first time I compiled caffe, but I still have problems that I can't solve. The caffe version I used is https://github.com/chuanqi305/ssd, the compiled version is GPU, I successfully compiled and run on my computer ( Ubuntu 16.04 GTX1080TI*1 cuda9.0) , but in the school server (Ubuntu 14.04 Tesla k80*2+Tesla k40*2 cuda8.0), the same code, the same configuration, but the compilation failed。The error occurred in the code compilation phase rather than the link phase, but the code itself is definitely no problem, because it has been compiled successfully on another computer, I don't know if it is because of my gcc/g++ version.
I tried to compile the parallel.cpp file myself using the g++ command. When I don't specify the header file path, the same error will occur, but in the Makefile, the location of the header file has been added.
The error message is below:
SGM#user-SMBIOS-implementations-newer-thandmidecode-Super-Server:~/ssd-ssd$ sudo make all
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/parallel.cpp
src/caffe/parallel.cpp:70:1: error: ‘Params’ does not name a type
Params<Dtype>::Params(shared_ptr<Solver<Dtype> > root_solver)
^
src/caffe/parallel.cpp:77:1: error: ‘GPUParams’ does not name a type
GPUParams<Dtype>::GPUParams(shared_ptr<Solver<Dtype> > root_solver, int device)
^
src/caffe/parallel.cpp:102:1: error: ‘GPUParams’ does not name a type
GPUParams<Dtype>::~GPUParams() {
^
src/caffe/parallel.cpp:110:15: error: expected initializer before ‘<’ token
void GPUParams<Dtype>::configure(Solver<Dtype>* solver) const {
^
src/caffe/parallel.cpp:117:6: error: ‘DevicePair’ has not been declared
void DevicePair::compute(const vector<int> devices, vector<DevicePair>* pairs) {
^
src/caffe/parallel.cpp:117:60: error: ‘DevicePair’ was not declared in this scope
void DevicePair::compute(const vector<int> devices, vector<DevicePair>* pairs) {
^
src/caffe/parallel.cpp:117:70: error: template argument 1 is invalid
void DevicePair::compute(const vector<int> devices, vector<DevicePair>* pairs) {
^
src/caffe/parallel.cpp:117:70: error: template argument 2 is invalid
src/caffe/parallel.cpp: In function ‘void caffe::compute(std::vector<int>, int*)’:
src/caffe/parallel.cpp:133:20: error: request for member ‘push_back’ in ‘* pairs’, which is of non-class type ‘int’
pairs->push_back(DevicePair(remaining[i], remaining[j]));
^
src/caffe/parallel.cpp:133:67: error: ‘DevicePair’ was not declared in this scope
pairs->push_back(DevicePair(remaining[i], remaining[j]));
^
src/caffe/parallel.cpp:157:18: error: request for member ‘push_back’ in ‘* pairs’, which is of non-class type ‘int’
pairs->push_back(DevicePair(remaining[i], remaining[j]));
^
src/caffe/parallel.cpp:157:65: error: ‘DevicePair’ was not declared in this scope
pairs->push_back(DevicePair(remaining[i], remaining[j]));
^
src/caffe/parallel.cpp:175:14: error: request for member ‘push_back’ in ‘* pairs’, which is of non-class type ‘int’
pairs->push_back(DevicePair(remaining[i], remaining[i + 1]));
^
src/caffe/parallel.cpp:175:65: error: ‘DevicePair’ was not declared in this scope
pairs->push_back(DevicePair(remaining[i], remaining[i + 1]));
^
src/caffe/parallel.cpp:185:10: error: request for member ‘insert’ in ‘* pairs’, which is of non-class type ‘int’
pairs->insert(pairs->begin(), DevicePair(-1, remaining[0]));
^
src/caffe/parallel.cpp:185:24: error: request for member ‘begin’ in ‘* pairs’, which is of non-class type ‘int’
pairs->insert(pairs->begin(), DevicePair(-1, remaining[0]));
^
src/caffe/parallel.cpp:185:60: error: ‘DevicePair’ was not declared in this scope
pairs->insert(pairs->begin(), DevicePair(-1, remaining[0]));
^
In file included from src/caffe/parallel.cpp:4:0:
src/caffe/parallel.cpp:187:16: error: request for member ‘size’ in ‘* pairs’, which is of non-class type ‘int’
CHECK(pairs->size() == devices.size());
^
src/caffe/parallel.cpp:188:30: error: request for member ‘size’ in ‘* pairs’, which is of non-class type ‘int’
for (int i = 0; i < pairs->size(); ++i) {
^
In file included from src/caffe/parallel.cpp:4:0:
src/caffe/parallel.cpp:189:21: error: invalid types ‘int[int]’ for array subscript
CHECK((*pairs)[i].parent() != (*pairs)[i].device());
^
src/caffe/parallel.cpp:189:45: error: invalid types ‘int[int]’ for array subscript
CHECK((*pairs)[i].parent() != (*pairs)[i].device());
^
src/caffe/parallel.cpp:190:36: error: request for member ‘size’ in ‘* pairs’, which is of non-class type ‘int’
for (int j = i + 1; j < pairs->size(); ++j) {
^
In file included from src/caffe/parallel.cpp:4:0:
src/caffe/parallel.cpp:191:23: error: invalid types ‘int[int]’ for array subscript
CHECK((*pairs)[i].device() != (*pairs)[j].device());
^
src/caffe/parallel.cpp:191:47: error: invalid types ‘int[int]’ for array subscript
CHECK((*pairs)[i].device() != (*pairs)[j].device());
^
src/caffe/parallel.cpp: At global scope:
src/caffe/parallel.cpp:202:1: error: ‘P2PSync’ does not name a type
P2PSync<Dtype>::P2PSync(shared_ptr<Solver<Dtype> > root_solver,
^
src/caffe/parallel.cpp:249:1: error: ‘P2PSync’ does not name a type
P2PSync<Dtype>::~P2PSync() {
^
src/caffe/parallel.cpp:271:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::InternalThreadEntry() {
^
src/caffe/parallel.cpp:287:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::on_start() {
^
src/caffe/parallel.cpp:325:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::on_gradients_ready() {
^
src/caffe/parallel.cpp:383:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::Prepare(const vector<int>& gpus,
^
src/caffe/parallel.cpp:421:13: error: expected initializer before ‘<’ token
void P2PSync<Dtype>::Run(const vector<int>& gpus) {
^
In file included from /usr/local/include/caffe/blob.hpp:8:0,
from /usr/local/include/caffe/caffe.hpp:7,
from src/caffe/parallel.cpp:12:
src/caffe/parallel.cpp:439:19: error: ‘Params’ is not a class template
INSTANTIATE_CLASS(Params);
^
src/caffe/parallel.cpp:439:19: error: explicit instantiation of non-template type ‘caffe::Params’
src/caffe/parallel.cpp:439:19: error: ‘Params’ is not a class template
INSTANTIATE_CLASS(Params);
^
src/caffe/parallel.cpp:439:19: error: explicit instantiation of non-template type ‘caffe::Params’
src/caffe/parallel.cpp:440:19: error: ‘GPUParams’ is not a class template
INSTANTIATE_CLASS(GPUParams);
^
src/caffe/parallel.cpp:440:19: error: explicit instantiation of non-template type ‘caffe::GPUParams’
src/caffe/parallel.cpp:440:19: error: ‘GPUParams’ is not a class template
INSTANTIATE_CLASS(GPUParams);
^
src/caffe/parallel.cpp:440:19: error: explicit instantiation of non-template type ‘caffe::GPUParams’
src/caffe/parallel.cpp:441:19: error: ‘P2PSync’ is not a class template
INSTANTIATE_CLASS(P2PSync);
^
src/caffe/parallel.cpp:441:19: error: explicit instantiation of non-template type ‘caffe::P2PSync’
src/caffe/parallel.cpp:441:19: error: ‘P2PSync’ is not a class template
INSTANTIATE_CLASS(P2PSync);
^
src/caffe/parallel.cpp:441:19: error: explicit instantiation of non-template type ‘caffe::P2PSync’
make: *** [.build_release/src/caffe/parallel.o] Error 1
Makefile.config
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0
# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
# You should not set this flag if you will be reading LMDBs with any
# possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1
# Uncomment if you're using OpenCV 3
OPENCV_VERSION := 3
# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr
# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the lines after *_35 for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52 \
-gencode arch=compute_60,code=sm_60 \
-gencode arch=compute_61,code=sm_61 \
-gencode arch=compute_61,code=compute_61
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
# BLAS := atlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas
# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib
# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
#PYTHON_INCLUDE := /usr/include/python2.7 \
# /usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
ANACONDA_HOME := /home/SGM/anaconda3
PYTHON_INCLUDE := /home/SGM/anaconda3/include \
/home/SGM/anaconda3/include/python3.6m \
/home/SGM/anaconda3/lib/python3.6/site-packages/numpy/core/include
# Uncomment to use Python 3 (default is Python 2)
PYTHON_LIBRARIES := boost_python3 python3.6m
PYTHON_INCLUDE := /home/SGM/anaconda3/include/python3.6m \
/home/SGM/anaconda3/lib/python3.6/site-packages/numpy/core/include
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(ANACONDA_HOME)/lib
# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib
# Uncomment to support layers written in Python (will link against Python libs)
WITH_PYTHON_LAYER := 1
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/hdf5/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/hdf5/lib /home/SGM/anaconda3/lib/
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib
# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1
# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1
# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0
# enable pretty build (comment to see full commands)
Q ?= #
When you change the environment,have you edit the path in Makefile.config?
Please make the python path correct and make sure cudnn is installed,if you want to compile with cuDNN.
Not very clear with your issue, try comment USE_CUDNN := 1
I have the following setup to add boost library to my c++ project.
/opt/boost/release contains my boost include & lib directories.My boost version is 1.65.1 and built with following command as per the documentation.
$ sudo ./bootstrap.sh --prefix=release --with-python=python3 --with-icu=
$ ./b2 install -j 4
I tried both with and without --with-python=python3 flag.
WORKSPACE
new_local_repository(
name = "boost",
build_file = "boost.BUILD",
path = "/opt/boost/release",
)
boost.BUILD
cc_library(
name = "boost",
srcs = glob(["lib/*.so*"]),
hdrs = glob(["include/**/*.hpp", "include/**/*.h"]),
includes = ["include"],
visibility = ["//visibility:public"],
linkstatic = 1,
)
BUILD
cc_binary(
name = "experiments",
srcs = ["main.cpp"],
deps = [
"#boost//:boost",
],
)
main.cpp
#include <boost/progress.hpp>
int main()
{
return 0;
}
And when I build this using the bazel build command
bazel build //experiments:experiments
I get the following error.
ERROR: /home/nipuna/vinci/engine/experiments/BUILD:1:1: Linking of rule '//experiments:experiments' failed (Exit 1): gcc failed: error executing command
(cd /home/nipuna/.cache/bazel/_bazel_nipuna/d2b463266f25f5449a4796ce18e325db/execroot/__main__ && \
exec env - \
LD_LIBRARY_PATH=/home/nipuna/software/clion-2017.2.3/bin: \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
PWD=/proc/self/cwd \
/usr/bin/gcc -o bazel-out/local-fastbuild/bin/experiments/experiments '-Wl,-rpath,$ORIGIN/../_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib' -Lbazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib '-fuse-ld=gold' -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -B/usr/bin -pass-exit-codes -Wl,-S -Wl,#bazel-out/local-fastbuild/bin/experiments/experiments-2.params)
Use --sandbox_debug to see verbose messages from the sandbox.
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyCObject_Type'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_CallFunction'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyErr_SetString'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyImport_ImportModule'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyEval_CallFunction'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyExc_AttributeError'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyErr_Print'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to '_Py_NoneStruct'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_GetAttrString'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyExc_RuntimeError'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyCObject_AsVoidPtr'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyInt_FromLong'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_Size'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyErr_Occurred'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyErr_Format'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_IsTrue'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyBool_FromLong'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyLong_FromUnsignedLong'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyExc_ValueError'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_CallMethod'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyExc_ImportError'
collect2: error: ld returned 1 exit status
Target //experiments:experiments failed to build
INFO: Elapsed time: 0.422s, Critical Path: 0.10s
Since you're linking your executable to Boost Python/Numpy, you also need to provide Python symbols.
If you don't need Python, the easiest solution is add libboost_numpy.so to exclude in your glob. If you actually need Python, a quick fix would be to add -lpython to linkopts in BOOST.build (this is not a solution that I would recommend for production, since you have no control over Python versions, etc..)
You can use rules_foreign_cc , which is maintained by the Bazel organization.
WORKSPACE
workspace(name = "example")
load("#bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
http_archive(
name = "rules_foreign_cc",
strip_prefix = "rules_foreign_cc-master",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/master.zip",
)
load("#rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies()
http_archive(
name = "boost",
build_file_content = all_content,
strip_prefix = "boost_1_68_0",
sha256 = "da3411ea45622579d419bfda66f45cd0f8c32a181d84adfa936f5688388995cf",
urls = ["https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz"],
)
BUILD
load("#rules_foreign_cc//tools/build_defs:boost_build.bzl", "boost_build")
boost_build(
name = "boost_fiber",
lib_source = "#boost//:all",
static_libraries = ["libboost_fiber.a"],
user_options = ["--with-fiber"],
visibility = ["//visibility:public"],
deps = [":boost_context"],
)
boost_build(
name = "boost_context",
lib_source = "#boost//:all",
static_libraries = ["libboost_context.a"],
user_options = ["--with-context"],
visibility = ["//visibility:public"],
)
cc_binary(
name = "helloworld",
srcs = [
"main.cc",
],
deps = [
":boost_fiber",
],
)
I'm having a problem building a library. In the Makefile I tell g++ that I need tclstub8.6 by putting -ltclstub8.6, and g++ takes it into account (sorry for these messages in French):
make: AVERTISSEMENT : le fichier « ../Linux-PORT/i586-GCC4/Makefile » a une date de modification 609 s dans le futur
*** Compile c [gcc] libtestGuiMnt_info.Linux-PORT.i586-GCC4.c
*** Compile C++ [g++] mntdisplay.cc
*** Compile C++ [g++] mntogl.cc
mntogl.cc: In member function 'virtual int MNTOgl::Display() const':
mntogl.cc:228:12: warning: unused variable 'ErrorCheckValue' [-Wunused-variable]
*** Compile C++ [g++] mntdisplaylist.cc
*** Compile C++ [g++] mntmanager.cc
*** Compile C++ [g++] mntdisplay_wrap.cc
*** Link (g++) librairie partagée /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1 -Wl,-Bdynamic -L/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib -Wl,-rpath,/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib -lapcomutil -lapmntcom -lapmntdata -lapmntnoyau -lapcomenvEtude -lapcomenv -ltclstub8.6 -lGLEW -lGLU -lGL -lglut
make: AVERTISSEMENT : décalage d'horloge détecté. La construction peut être incomplète.
But when I call a tcl function, a segfault occurs.
In fact if I check the library I just built with ldd -r command, it shows that every external library is included, except tclstub8.6.
Below is the output messages of ldd -r command. Note that libtclstub8.6 does not appear..
And the list ends with all undefined symbols of libtclstub8.6.
ldd -r /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1
linux-gate.so.1 (0xb777e000)
libapcomutil.2 => /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libapcomutil.2 (0xb7743000)
libapmntcom.1 => /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libapmntcom.1 (0xb773f000)
libapmntdata.3 => /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libapmntdata.3 (0xb770f000)
libapmntnoyau.4 => /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libapmntnoyau.4 (0xb76e9000)
libapcomenvEtude.1 => /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libapcomenvEtude.1 (0xb76cc000)
libapcomenv.1 => /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libapcomenv.1 (0xb76b8000)
libGLEW.so.1.9 => /usr/lib/libGLEW.so.1.9 (0xb762e000)
libGLU.so.1 => /usr/lib/libGLU.so.1 (0xb75a6000)
libGL.so.1 => /usr/lib/libGL.so.1 (0xb7546000)
libglut.so.3 => /usr/lib/libglut.so.3 (0xb750a000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb741e000)
libm.so.6 => /lib/libm.so.6 (0xb73dc000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb73be000)
libc.so.6 => /lib/libc.so.6 (0xb7244000)
libapcomfichier.3 => /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libapcomfichier.3 (0xb7235000)
libapcomitineraire.3 => /apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libapcomitineraire.3 (0xb7190000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7036000)
libz.so.1 => /lib/libz.so.1 (0xb701f000)
libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0xb6f22000)
libglapi.so.0 => /usr/lib/libglapi.so.0 (0xb6f0c000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb6ef9000)
libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb6ef5000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb6eef000)
libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0xb6eeb000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb6db1000)
libxcb-glx.so.0 => /usr/lib/libxcb-glx.so.0 (0xb6d98000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb6d75000)
libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0xb6d6f000)
libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb6d61000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb6d45000)
libdl.so.2 => /lib/libdl.so.2 (0xb6d40000)
libXi.so.6 => /usr/lib/libXi.so.6 (0xb6d30000)
libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0xb6d25000)
/lib/ld-linux.so.2 (0xb777f000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0xb6cfb000)
libquadmath.so.0 => /usr/lib/libquadmath.so.0 (0xb6c82000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb6c7e000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb6c73000)
undefined symbol: Tcl_DeleteCommandFromToken (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_NewStringObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_GetCommandInfo (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_SetObjResult (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_GetLongFromObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_InitHashTable (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_CreateObjCommand (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_NewBooleanObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_SetResult (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_GetStringResult (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_SetVar (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_VarEval (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_GetVar (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_AppendResult (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_AppendElement (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_ObjSetVar2 (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_ResetResult (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_SetErrorCode (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_PkgProvide (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: _ZN10MNTManager10DisplayAllEv (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_GetStringFromObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_NewDoubleObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_GetBooleanFromObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_GetObjResult (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: TclFreeObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_GetDoubleFromObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_DuplicateObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_DeleteHashEntry (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
undefined symbol: Tcl_NewIntObj (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
Could someone help me with this issue?
Thank you very much!
I found it.
In fact everything was because of this line:
undefined symbol: _ZN10MNTManager10DisplayAllEv (/apollo/Developpement/Build-GCC4/Obj/Linux-PORT/i586-GCC4/lib/libtestGuiMnt.1)
There is an undefined symbol of MY library. I defined it and problem solved!
Please see my original post:
segfault using SWIG converted code for tcl
The confusion was, my program crashed in the middle of tcl wrapper functions (where my undefined symbol was not involved at all). I don't really know why but that's it..
Hope it will help others!
okay, i'm trying to compile the fileshare example called 'pcp' using the following command
wolfgang#den-pc:~/tejesh/libjingle-0.6.14/programs$ g++ -g -Wall -DPOSIX
-DEXPAT_RELATIVE_PATH -DFEATURE_ENABLE_SSL -DHAVE_OPENSSL_SSL_H=1 -I ../ pcp_main.cc
../talk/build/dbg/lib/libxmpphelp.a ../talk/build/dbg/lib/libjingle.a ../talk/build
/dbg/lib/libexpat.a ../talk/build/dbg/lib/libsrtp.a -lpthread -lssl
And i get the following 'typeinfo' error...
pcp_main.cc: In member function ‘virtual void
CustomXmppPump::OnStateChange(buzz::XmppEngine::State)’:
pcp_main.cc:348:12: warning: enumeration value ‘STATE_NONE’ not handled in switch
[-Wswitch]
/tmp/ccVe8JUg.o:(.rodata._ZTI14CustomXmppPump[typeinfo for CustomXmppPump]+0x18):
undefined reference to `typeinfo for XmppPump'
/tmp/ccVe8JUg.o:(.rodata._ZTIN7cricket18SessionManagerTaskE[typeinfo for
cricket::SessionManagerTask]+0x8): undefined reference to `typeinfo for buzz::XmppTask'
/tmp/ccVe8JUg.o:(.rodata._ZTIN7cricket15SessionSendTaskE[typeinfo for
cricket::SessionSendTask]+0x8): undefined reference to `typeinfo for buzz::XmppTask'
/tmp/ccVe8JUg.o:(.rodata._ZTI17AutoPortAllocator[typeinfo for AutoPortAllocator]+0x8):
undefined reference to `typeinfo for cricket::HttpPortAllocator'
collect2: ld returned 1 exit status
Anybody have some idea on this issue?
If you compile with gyp, you can change trunk/talk/libjingle_examples.gyp:
# target pcp
{
'target_name': 'pcp',
'type': 'executable',
'dependencies': [
'libjingle_xmpphelp',
'libjingle.gyp:libjingle',
'libjingle.gyp:libjingle_p2p',
],
'sources': [
'examples/pcp/pcp_main.cc',
],
}, # target pcp
run gclient runhooks again and make.
This error may be caused by some virtual method not having a definition - i.e. you have declared it but you have not defined its body.
Probably you did not include some .c/.cpp file(s) in the compilation/linking?
Did manage to compile pcp succesfully by scons,......... in your talk/ directory append the following line to 'libjingle.scons'
talk.App(env, name = "pcp",
posix_libs = [
"crypto",
"ssl",
],
srcs = [
"examples/pcp/pcp_main.cc",
],
libs = [
"jingle",
"expat",
"srtp",
"xmpphelp",
],
)
And then build it using instructions from the README of libjingle.. pcp binary will be built in your /talk/build/dbg/staging/ directory..