Linker error when using cinder and poco - c++

I'm trying to use libcinder to make some visualizations. In integrating in my existing codebase, I've run into some linker errors that I can't figure out.
I've boiled the problem down to a minimal example, with the following results:
cd /build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/BasicApp.dir/link.txt --verbose=1
/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/BasicApp.dir/BasicApp.cpp.o -o ../bin/BasicApp -rdynamic -lPocoUtil -lPocoFoundation
make[2]: Leaving directory '/build'
[100%] Built target BasicApp
make[1]: Leaving directory '/build'
/usr/bin/cmake -E cmake_progress_start /build/CMakeFiles 0
If don't involve cinder at all, everything works fine, as seen above. if I add my function to the minimal cinder example (BasicApp), I get the following output on compilation:
cd /build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/BasicApp.dir/link.txt --verbose=1
/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/BasicApp.dir/BasicApp.cpp.o -o ../bin/BasicApp -rdynamic -lPocoUtil -lPocoFoundation /cinder/lib/linux/x86_64/ogl/Release/libcinder.a -lGLU -lGL -lSM -lICE -lX11 -lXext -lXcursor -lXinerama -lXrandr -lXi -lz -lcurl -lfontconfig -lpulse -lmpg123 -lsndfile -lgobject-2.0 -lglib-2.0 -lgstreamer-1.0 -lgstbase-1.0 -lgstapp-1.0 -lgstvideo-1.0 -lgstgl-1.0 /cinder/lib/linux/x86_64//libboost_system.a /cinder/lib/linux/x86_64//libboost_filesystem.a -ldl -lpthread
CMakeFiles/BasicApp.dir/BasicApp.cpp.o: In function `load_images(std::string, std::string, int, int)':
BasicApp.cpp:(.text+0xca2): undefined reference to `Poco::DirectoryIterator::DirectoryIterator(std::string const&)'
BasicApp.cpp:(.text+0xd57): undefined reference to `Poco::DirectoryIterator::DirectoryIterator(std::string const&)'
collect2: error: ld returned 1 exit status
src/CMakeFiles/BasicApp.dir/build.make:118: recipe for target 'bin/BasicApp' failed
make[2]: *** [bin/BasicApp] Error 1
make[2]: Leaving directory '/build'
CMakeFiles/Makefile2:1244: recipe for target 'src/CMakeFiles/BasicApp.dir/all' failed
make[1]: *** [src/CMakeFiles/BasicApp.dir/all] Error 2
make[1]: Leaving directory '/build'
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
I'm assuming that some configuration set in the cinder cmake files is messing things up, but I don't understand why or how to fix it.
This is with gcc version 5.4.0 and cmake version 3.5.1.
Here is a reduced cmake file that has this issue:
cmake_minimum_required(VERSION 3.2)
project(segslam C CXX)
set(CMAKE_CXX_STANDARD 11)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/poco")
find_package(Poco REQUIRED)
#include($ENV{CINDER_PATH}/proj/cmake/configure.cmake)
#set(cinder_DIR $ENV{CINDER_PATH}/${CINDER_LIB_DIRECTORY})
#find_package(cinder REQUIRED PATHS " $ENV{CINDER_PATH}/${CINDER_LIB_DIRECTORY}")
add_executable(BasicApp BasicApp.cpp)
#target_include_directories(BasicApp PUBLIC $ENV{CINDER_PATH}/include)
#target_link_libraries(BasicApp cinder)
target_link_libraries(BasicApp ${Poco_LIBRARIES})
set_target_properties(BasicApp PROPERTIES
DEBUG_POSTFIX "d"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
install(TARGETS BasicApp RUNTIME DESTINATION bin COMPONENT main)
install(FILES ${srcs} DESTINATION app COMPONENT main)
If the commented lines are uncommented, it links in cinder and things break. I'm using a FindPoco.cmake file from here. The cinder cmake files are located here.
It doesn't seem to matter what the linking order is, and none of the other libraries I'm using have this issue.

So it turns out that the issue is an ABI mismatch. Cinder ships with precompiled boost libraries that use a gcc version <5.1, which will cause conflicts if you try to use libraries that have been compiled with gcc version >= 5.1.
My fix was to remove the cinder precompiled boost libraries and recompile with the version of boost in the ubuntu repos.
See this thread on the cinder discourse for more info.

Related

Undefined reference to `fftw_init_threads' while installing pHash library

I am trying to install pHash library on ubuntu, i installed libfftw3 and all the required libraries. Everything is Ok when I run ./configure command, but when i try to run the 'make' command this error always appear : undefined reference to `fftw_init_threads'.
make command :
g551683#sst-p1310007fl:~/Documents/pHash-0.2.9.6$ make
make all-recursive
make[1]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6'
Making all in src
make[2]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6/src'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6/src'
Making all in bindings
make[2]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6/bindings'
make[3]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6/bindings'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6/bindings'
make[2]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6/bindings'
Making all in examples
make[2]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6/examples'
/bin/sh ../libtool --tag=CXX --mode=link g++ -O2 -ffast-math -O3 -L/usr/local/lib -lssl -lcrypto -o test_texthash test_texthash.o ../src/libpHash.la -lmpg123 -lsamplerate -lsndfile -lswscale -lavformat -lavutil -lavcodec -lpng -ljpeg -lfftw3
libtool: link: g++ -O2 -ffast-math -O3 -o .libs/test_texthash test_texthash.o -L/usr/local/lib ../src/.libs/libpHash.so -lssl -lcrypto /usr/local/lib/libmpg123.so /usr/lib/x86_64-linux-gnu/libltdl.so -ldl /usr/local/lib/libsamplerate.so -lsndfile -lswscale -lavformat -lavutil -lavcodec /usr/local/lib/libpng16.so -lz /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/local/lib/libfftw3.a -lm
test_texthash.o: In function `_GLOBAL__sub_I_main':
test_texthash.cpp:(.text.startup+0x1b1): undefined reference to `fftw_init_threads'
collect2: error: ld returned 1 exit status
Makefile:323: recipe for target 'test_texthash' failed
make[2]: *** [test_texthash] Error 1
make[2]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6/examples'
Makefile:419: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6'
Makefile:298: recipe for target 'all' failed
make: *** [all] Error 2
Can someone help me to solve this error!
From the documentation:
First, programs using the parallel complex transforms should be linked with -lfftw3_threads -lfftw3 -lm on Unix, or -lfftw3_omp -lfftw3 -lm if you compiled with OpenMP. You will also need to link with whatever library is responsible for threads on your system (e.g. -lpthread on GNU/Linux) or include whatever compiler flag enables OpenMP (e.g. -fopenmp with gcc).
You are not linking against this fftw3_threads library, nor to the pthread library.

Problems linking Bonmin using Cmake under macOS High Sierra with "ld: framework not found -lAccelerate"

I am currently trying to link Bonmin using cmake in my project under macOS High Sierra (10.13.4) with Xcode version 9.3. Before I describe the setup I should mention that the Bonmin example (/PATH_TO_BONMIN/Bonmin/examples/CppExample) compiles with the included make files. Later example I try to get to work in my environment, but it is not working. Thus, I think there must be an incompatibility.
Bonmin 1.8 (https://www.coin-or.org/Tarballs/Bonmin/) was build on my Mac using
../configure -C --disable-shared F77="/usr/local/bin/gfortran" FFLAGS="-fexceptions -m64 -fbackslash" CFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64" CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64"
My FindBonmin.cmake uses the package configuration files from "${BONMIN_LIBRARY_DIR}/pkgconfig":
find_path(BONMIN_LIBRARY_DIR
NAMES libbonmin.a
HINTS ...
HINTS /usr/local/include/coin
HINTS ${BONMIN_ROOT_DIR}/include/coin
HINTS ${BONMIN_ROOT_DIR}/include
)
if(IS_DIRECTORY "${BONMIN_LIBRARY_DIR}/pkgconfig")
set(CMAKE_PREFIX_PATH "${BONMIN_LIBRARY_DIR}/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "${BONMIN_LIBRARY_DIR}/pkgconfig")
else()
message("Directory ${BONMIN_LIBRARY_DIR}/pkgconfig does not exist!")
endif()
From this I get the following:
${BONMIN_LIBRARY_DIR}/pkgconfig =
/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig
${PKG_BONMIN_INCLUDE_DIRS} =
/Users/<PATH>/Bonmin-1.8/build/include/coin;/Users/<PATH>/Bonmin-1.8/build/include/coin/ThirdParty;/Users/<PATH>/Bonmin-1.8/build/include/coin;/Users/<PATH>/Bonmin-1.8/build/include/coin/ThirdParty
${PKG_BONMIN_LDFLAGS} = -L/Users/<PATH>/Bonmin-1.8/build/lib;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../../x86_64;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../..;-lbonmin;-lCbcSolver;-lCbc;-lCgl;-lOsiClp;-lClpSolver;-lClp;-lcoinasl;-lm;-ldl;-lOsi;-lCoinUtils;-lbz2;-lz;-framework;Accelerate;-lm;-lipopt;-framework;Accelerate;-lm;-ldl;-lcoinmumps;-framework;Accelerate;-lgfortranbegin;-lgfortran;-lSystem
This is used for the example:
include_directories(${PKG_BONMIN_INCLUDE_DIRS} )
add_executable(bonminExample runnables/bonminExample.cpp)
target_link_libraries(bonminExample ${PKG_BONMIN_LDFLAGS})
Additional information:
cmake_minimum_required(VERSION 3.6)
project(MyProject CXX)
# The version number.
set (MyProject_VERSION_MAJOR 1)
set (MyProject_VERSION_MINOR 0)
set(CMAKE_C_COMPILER "/usr/local/Cellar/llvm/5.0.1/bin/clang" CACHE FILEPATH "Path to the used C compiler; default clang." FORCE)
set(CMAKE_CXX_COMPILER "/usr/local/Cellar/llvm/5.0.1/bin/clang++" CACHE FILEPATH "Path to the used C++ compiler; default clang++." FORCE)
set(OPENMP_LIBRARIES "/usr/local/Cellar/llvm/5.0.1/lib" CACHE FILEPATH "Path to the OpenMP libraries." FORCE)
set(OPENMP_INCLUDES "/usr/local/Cellar/llvm/5.0.1/include" CACHE FILEPATH "Path to the OpenMP includes." FORCE)
## Set c++14
set(CMAKE_CXX_STANDARD 14)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
...
The error message I get, while trying to link Bonmin is:
ld: framework not found -lAccelerate
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/<PATH>/myproject/bin/bonminExample] Error 1
make[1]: *** [src/CMakeFiles/bonminExample.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
With the details:
[ 3%] Linking CXX executable /Users/<PATH>/myproject/bin/bonminExample
cd /Users/<PATH>/build_debug/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/bonminExample.dir/link.txt --verbose=1
cd /Users/<PATH>/build_debug && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/<PATH>/myproject /Users/<PATH>/build_debug/googletest-src/googlemock /Users/<PATH>/build_debug /Users/<PATH>/build_debug/googletest-build/googlemock /Users/<PATH>/build_debug/googletest-build/googlemock/CMakeFiles/gmock_autogen.dir/DependInfo.cmake --color=
cd /Users/<PATH>/build_debug && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/<PATH>/myproject/ /Users/<PATH>/myproject/src /Users/<PATH>/build_debug /Users/<PATH>/build_debug/src /Users/<PATH>/build_debug/src/CMakeFiles/PGT.dir/DependInfo.cmake --color=
/usr/local/Cellar/llvm/5.0.1/bin/clang++ -fopenmp=libomp -Wno-unused-command-line-argument -DCOIN_USE_MUMPS_MPI_H -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD -march=native -g -Wall -ggdb -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/bonminExample.dir/runnables/BonminExample.cpp.o CMakeFiles/bonminExample.dir/bonminExample_autogen/mocs_compilation.cpp.o -o /Users/<PATH>/myproject/bin/bonminExample -L/usr/local/Cellar/llvm/5.0.1/lib -L/Users/<PATH>/external_libraries/ogdf20170723 -Wl,-rpath,/usr/local/Cellar/llvm/5.0.1/lib -Wl,-rpath,/Users/<PATH>/external_libraries/ogdf20170723 -L/Users/<PATH>/external_libraries/Bonming-1.8/build/lib -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../../x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../.. -lbonmin -lCbcSolver -lCbc -lCgl -lOsiClp -lClpSolver -lClp -lcoinasl -lm -ldl -lOsi -lCoinUtils -lbz2 -lz -framework -lAccelerate -lm -lipopt -framework -lAccelerate -lm -ldl -lcoinmumps -framework -lAccelerate -lgfortranbegin -lgfortran -lSystem -lm -ldl -lOsi -lCoinUtils -lbz2 -lz -lipopt -lcoinmumps -lgfortranbegin -lgfortran -lSystem
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f googletest-build/googlemock/CMakeFiles/gmock_autogen.dir/build.make googletest-build/googlemock/CMakeFiles/gmock_autogen.dir/build
[ 4%] Automatic MOC for target gmock
cd /Users/<PATH>/build_debug/googletest-build/googlemock && /opt/local/bin/cmake -E cmake_autogen /Users/<PATH>/build_debug/googletest-build/googlemock/CMakeFiles/gmock_autogen.dir Debug
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/CMakeFiles/PGT.dir/build.make src/CMakeFiles/PGT.dir/build
ld: framework not found -lAccelerate
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/<PATH>/myproject/bin/bonminExample] Error 1
make[1]: *** [src/CMakeFiles/bonminExample.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/CMakeFiles/PGTIP.dir/build.make src/CMakeFiles/PGTIP.dir/build
Does anybody know what might be an issue or even has a solution to it?
Note that the make file from the Bonmin example gives me the following:
MBP:CppExample myname$ make VERBOSE=1
clang++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD `PKG_CONFIG_PATH=/Users/<PATH>/Bonmin-1.8/build/lib64/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/share/pkgconfig:/opt/X11/lib/pkgconfig pkg-config --cflags bonmin` -c -o MyBonmin.o `test -f '../../../../Bonmin/examples/CppExample/MyBonmin.cpp' || echo '../../../../Bonmin/examples/CppExample/'`../../../../Bonmin/examples/CppExample/MyBonmin.cpp
clang++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD `PKG_CONFIG_PATH=/Users/<PATH>/Bonmin-1.8/build/lib64/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/share/pkgconfig:/opt/X11/lib/pkgconfig pkg-config --cflags bonmin` -c -o MyTMINLP.o `test -f '../../../../Bonmin/examples/CppExample/MyTMINLP.cpp' || echo '../../../../Bonmin/examples/CppExample/'`../../../../Bonmin/examples/CppExample/MyTMINLP.cpp
bla=;\
for file in MyBonmin.o MyTMINLP.o; do bla="$bla `echo $file`"; done; \
clang++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD -o CppExample $bla `PKG_CONFIG_PATH=/Users/<PATH>/Bonmin-1.8/build/lib64/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/share/pkgconfig:/opt/X11/lib/pkgconfig pkg-config --libs bonmin`
Before XXX_LDFLAGS variable, obtained from PkgConfig module, is used in target_link_libraries call, modify that variable:
string(REPLACE "-framework;" "-framework " PKG_BONMIN_LDFLAGS "${PKG_BONMIN_LDFLAGS}")
(The quotation marks at "${PKG_BONMIN_LDFLAGS}" are important.)
After that, -framework option will be processed correctly:
target_link_libraries(... ${PKG_BONMIN_LDFLAGS})
Explanations
It seems that CMake incorrectly works with pkg-config when framework is used. When extract
-framework Acceletate
from the pkg-config output, these 2 words are interpreted as separate arguments. So, when passed to target_link_libraries:
target_link_libraries(... -framework Acceletate)
-l is appended to the second word according to the command's rules:
ld .... -framework -lAccelerate
Proper command's call should be
target_link_libraries(... "-framework Acceletate")
And this is exactly the purpose of above-mentioned string(REPLACE): It replaces CMake arguments delimiter ;, following -framework option, with normal space .

Cannot build and debug project using either Codeblocks or Qtcreator

I am trying to build from scratch Mince on Ubuntu 14.04 x64 using an IDE(either Qtcreator or Codeblocks) because I want to debug the source, to understand how it works better.
Repository: https://github.com/Kingsford-Group/mince/
EDIT: since I found a workaround to build the project externally using -pthread I wonder if editing the file invoked by the make command would allow me to build from one of the IDE and debug the code.
I use cmake-gui with
BOOST_THREAD_LIBRARY: /usr/lib/x86_64-linux-gnu/libpthread.a
CMAKE_BUILD_TYPE:
CMAKE_INSTALL_PREFIX: /home/federico/bioinfo/Mince
and get this:
Boost version: 1.54.0
Found the following Boost libraries:
iostreams
filesystem
system
thread
timer
program_options
serialization
BOOST INCLUDE DIR = /usr/include
BOOST INCLUDE DIRS = /usr/include
BOOST LIB DIR = /usr/lib/x86_64-linux-gnu
BOOST LIBRAREIS = /usr/lib/x86_64-linux-gnu/libboost_iostreams.a;/usr/lib/x86_64-linux-gnu/libboost_filesystem.a;/usr/lib/x86_64-linux-gnu/libboost_system.a;/usr/lib/x86_64-linux-gnu/libboost_thread.a;/usr/lib/x86_64-linux-gnu/libboost_timer.a;/usr/lib/x86_64-linux-gnu/libboost_program_options.a;/usr/lib/x86_64-linux-gnu/libboost_serialization.a;/usr/lib/x86_64-linux-gnu/libpthread.a
Build system will fetch and build the Cereal serialization library
==================================================================
Build system will fetch and build Jellyfish
==================================================================
Found Intel TBB
TBB_LIBRARIES = /usr/lib/libtbb.so;/usr/lib/libtbbmalloc.so
CPACK_SOURCE_IGNORE_FILES = /build/;/bin/;/lib/;/external/;/src/obsolete/;/include/obsolete/;.git/
TBB_LIBRARIES = /usr/lib/libtbb.so;/usr/lib/libtbbmalloc.so
Boost_LIBRARIES = /usr/lib/x86_64-linux-gnu/libboost_iostreams.a;/usr/lib/x86_64-linux-gnu/libboost_filesystem.a;/usr/lib/x86_64-linux-gnu/libboost_system.a;/usr/lib/x86_64-linux-gnu/libboost_thread.a;/usr/lib/x86_64-linux-gnu/libboost_timer.a;/usr/lib/x86_64-linux-gnu/libboost_program_options.a;/usr/lib/x86_64-linux-gnu/libboost_serialization.a;/usr/lib/x86_64-linux-gnu/libpthread.a
Configuring done
Generating done
Then I use # make and get:
...
...
...
...
[ 67%] Built target minceutils
make -f src/CMakeFiles/canoncmp.dir/build.make src/CMakeFiles/canoncmp.dir/depend
make[2]: ingresso nella directory "/home/federico/bioinfo/Mince/build"
cd /home/federico/bioinfo/Mince/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/federico/bioinfo/Mince /home/federico/bioinfo/Mince/src /home/federico/bioinfo/Mince/build /home/federico/bioinfo/Mince/build/src /home/federico/bioinfo/Mince/build/src/CMakeFiles/canoncmp.dir/DependInfo.cmake --color=
Scanning dependencies of target canoncmp
make[2]: uscita dalla directory "/home/federico/bioinfo/Mince/build"
make -f src/CMakeFiles/canoncmp.dir/build.make src/CMakeFiles/canoncmp.dir/build
make[2]: ingresso nella directory "/home/federico/bioinfo/Mince/build"
/usr/bin/cmake -E cmake_progress_report /home/federico/bioinfo/Mince/build/CMakeFiles 1
[ 71%] Building CXX object src/CMakeFiles/canoncmp.dir/CanonicalCompare.cpp.o
cd /home/federico/bioinfo/Mince/build/src && /usr/bin/c++ -DHAVE_LOGGER -funroll-loops -fPIC -O3 -DHAVE_ANSI_TERM -DHAVE_SSTREAM -DHAVE_CONFIG_H -Wall -std=c++11 -Wno-unused-local-typedefs -I/home/federico/bioinfo/Mince/include -I/home/federico/bioinfo/Mince/external -I/home/federico/bioinfo/Mince/external/cereal/include -I/home/federico/bioinfo/Mince/external/install/include -I/home/federico/bioinfo/Mince/external/install/include/jellyfish-2.1.3 -o CMakeFiles/canoncmp.dir/CanonicalCompare.cpp.o -c /home/federico/bioinfo/Mince/src/CanonicalCompare.cpp
In file included from /home/federico/bioinfo/Mince/include/MinceUtils.hpp:15:0,
from /home/federico/bioinfo/Mince/src/CanonicalCompare.cpp:20:
/home/federico/bioinfo/Mince/include/ReadLibrary.hpp: In copy constructor ‘ReadLibrary::ReadLibrary(const ReadLibrary&)’:
/home/federico/bioinfo/Mince/include/ReadLibrary.hpp:35:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t i = 0; i < mc; ++i) { libTypeCounts_[i].store(rl.libTypeCounts_[i].load()); }
^
/home/federico/bioinfo/Mince/include/ReadLibrary.hpp: In constructor ‘ReadLibrary::ReadLibrary(ReadLibrary&&)’:
/home/federico/bioinfo/Mince/include/ReadLibrary.hpp:48:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t i = 0; i < mc; ++i) { libTypeCounts_[i].store(rl.libTypeCounts_[i].load()); }
^
/home/federico/bioinfo/Mince/src/CanonicalCompare.cpp: In function ‘std::vector<std::basic_string<char> > parseReadFile(const string&)’:
/home/federico/bioinfo/Mince/src/CanonicalCompare.cpp:37:7: warning: variable ‘isFastq’ set but not used [-Wunused-but-set-variable]
bool isFastq{false};
^
/home/federico/bioinfo/Mince/src/CanonicalCompare.cpp: In function ‘int main(int, char**)’:
/home/federico/bioinfo/Mince/src/CanonicalCompare.cpp:74:13: warning: unused variable ‘nb_threads’ [-Wunused-variable]
const int nb_threads = 10;
^
/home/federico/bioinfo/Mince/src/CanonicalCompare.cpp:75:13: warning: unused variable ‘concurrent_file’ [-Wunused-variable]
const int concurrent_file = 1; // Number of files to read simultaneously
^
/home/federico/bioinfo/Mince/src/CanonicalCompare.cpp:76:13: warning: unused variable ‘max_read_group’ [-Wunused-variable]
const int max_read_group = 100; // Number of reads in each "job" group
^
/home/federico/bioinfo/Mince/src/CanonicalCompare.cpp:82:12: warning: unused variable ‘bucketStringLength’ [-Wunused-variable]
uint32_t bucketStringLength;
^
Linking CXX executable canoncmp
cd /home/federico/bioinfo/Mince/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/canoncmp.dir/link.txt --verbose=1
/usr/bin/c++ -DHAVE_LOGGER -funroll-loops -fPIC -O3 -DHAVE_ANSI_TERM -DHAVE_SSTREAM -DHAVE_CONFIG_H -Wall -std=c++11 -Wno-unused-local-typedefs CMakeFiles/canoncmp.dir/CanonicalCompare.cpp.o -o canoncmp -L/home/federico/bioinfo/Mince/lib -L/home/federico/bioinfo/Mince/external/install/lib -rdynamic libminceutils.a -Wl,-Bstatic -lboost_iostreams -lboost_filesystem -lboost_system -lboost_thread -lboost_timer -lboost_program_options -lboost_serialization -lpthread -lz -Wl,-Bdynamic ../../external/install/lib/libjellyfish-2.0.a -lpthread -lm -ltbb -ltbbmalloc -lgomp -lrt -Wl,-rpath,"\$ORIGIN/../lib:\$ORIGIN/../../lib:\$ORIGIN/"
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libpthread.a(ptw-pause.o): nella funzione "__pause_nocancel":
/build/eglibc-MjiXCM/eglibc-2.19/nptl/../sysdeps/unix/syscall-template.S:81: riferimento non definito a "__syscall_error"
/build/eglibc-MjiXCM/eglibc-2.19/nptl/../sysdeps/unix/syscall-template.S:81: riferimento non definito a "__syscall_error"
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libpthread.a(nptl-init.o): nella funzione "__pthread_initialize_minimal_internal":
/build/eglibc-MjiXCM/eglibc-2.19/nptl/nptl-init.c:285: undefined reference to "__libc_setup_tls"
/build/eglibc-MjiXCM/eglibc-2.19/nptl/nptl-init.c:303: undefined reference to "_dl_cpuclock_offset"
/build/eglibc-MjiXCM/eglibc-2.19/nptl/nptl-init.c:419: undefined reference to "_dl_pagesize"
/build/eglibc-MjiXCM/eglibc-2.19/nptl/nptl-init.c:428: undefined reference to "_dl_pagesize"
/build/eglibc-MjiXCM/eglibc-2.19/nptl/nptl-init.c:448: undefined reference to "_dl_init_static_tls"
/build/eglibc-MjiXCM/eglibc-2.19/nptl/nptl-init.c:450: undefined reference to "_dl_wait_lookup_done"
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libpthread.a(nptl-init.o): nella funzione "__pthread_get_minstack":
/build/eglibc-MjiXCM/eglibc-2.19/nptl/nptl-init.c:471: undefined reference to "_dl_pagesize"
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libpthread.a(pthread_create.o): nella funzione "allocate_stack":
/build/eglibc-MjiXCM/eglibc-2.19/nptl/allocatestack.c:475: undefined reference to "_dl_stack_flags"
/build/eglibc-MjiXCM/eglibc-2.19/nptl/allocatestack.c:614: undefined reference to "_dl_stack_flags"
collect2: error: ld returned 1 exit status
make[2]: *** [src/canoncmp] Error 1
make[2]: uscita dalla directory "/home/federico/bioinfo/Mince/build"
make[1]: *** [src/CMakeFiles/canoncmp.dir/all] Errore 2
make[1]: uscita dalla directory "/home/federico/bioinfo/Mince/build"
make: *** [all] Error 2
So I managed to link correctly and run everything by selecting the failing command (i.e.
/usr/bin/cmake -E cmake_link_script CMakeFiles/canoncmp.dir/link.txt --verbose=1
/usr/bin/c++ -DHAVE_LOGGER -funroll-loops -fPIC -O3 -DHAVE_ANSI_TERM -DHAVE_SSTREAM -DHAVE_CONFIG_H -Wall -std=c++11 -Wno-unused-local-typedefs CMakeFiles/canoncmp.dir/CanonicalCompare.cpp.o -o canoncmp -L/home/federico/bioinfo/Mince/lib -L/home/federico/bioinfo/Mince/external/install/lib -rdynamic libminceutils.a -Wl,-Bstatic -lboost_iostreams -lboost_filesystem -lboost_system -lboost_thread -lboost_timer -lboost_program_options -lboost_serialization -lpthread -lz -Wl,-Bdynamic ../../external/install/lib/libjellyfish-2.0.a -lpthread -lm -ltbb -ltbbmalloc -lgomp -lrt -Wl,-rpath,"\$ORIGIN/../lib:\$ORIGIN/../../lib:\$ORIGIN/"
and replace -lpthread with -pthread but since I wanted to understand the code I wanted to open it and build it using Qtcreator or Codeblocks and use the debugger this is not working.
Any help is appreciated
EDIT= Title, since I found a workaround to build the project externally using -pthread I wonder if editing the file invoked by the make command would allow me to build from one of the IDE and debug the code.

Cannot compile RGBdemo 0.7 Linux Mint 17 - undefined reference to symbol 'glOrtho'

This is my very first post here. I am trying to compile RGBdemo to test its reconstruction capabilities with kinect.
I have followed these instructions
RGBdemo compiling instructions
I was able to follow all the instructions more or less consistently but I stomp at the ending (compiling RGBdemo 0.7). Here is the make code.
[ 48%] Built target XnSensorServer
make -f nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/build.make nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/depend
make[2]: Entering directory `/home/andre/.RGBDemo-0.7.0-Source/build'
cd /home/andre/.RGBDemo-0.7.0-Source/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/andre/.RGBDemo-0.7.0-Source /home/andre/.RGBDemo-0.7.0-Source/nestk/deps/openni/Nite/Samples/Players /home/andre/.RGBDemo-0.7.0-Source/build /home/andre/.RGBDemo-0.7.0-Source/build/nestk/deps/openni/Nite/Samples/Players /home/andre/.RGBDemo-0.7.0-Source/build/nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/andre/.RGBDemo-0.7.0-Source/build'
make -f nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/build.make nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/build
make[2]: Entering directory `/home/andre/.RGBDemo-0.7.0-Source/build'
Linking CXX executable ../../../../../../bin/Sample-Players
cd /home/andre/.RGBDemo-0.7.0-Source/build/nestk/deps/openni/Nite/Samples/Players && /usr/bin/cmake -E cmake_link_script CMakeFiles/Sample-Players.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O2 -g -DNDEBUG CMakeFiles/Sample-Players.dir/signal_catch.cpp.o CMakeFiles/Sample-Players.dir/SceneDrawer.cpp.o CMakeFiles/Sample-Players.dir/main.cpp.o CMakeFiles/Sample-Players.dir/kbhit.cpp.o -o ../../../../../../bin/Sample-Players -L/home/andre/.RGBDemo-0.7.0-Source/nestk/deps/openni/Nite/Lib/Linux64 -rdynamic ../../../../../../lib/libOpenNI.so -lglut -lusb-1.0 -ldl ../../../../../../lib/libTinyXml.a -Wl,-rpath,/home/andre/.RGBDemo-0.7.0-Source/nestk/deps/openni/Nite/Lib/Linux64:/home/andre/.RGBDemo-0.7.0-Source/build/lib
/usr/bin/ld: CMakeFiles/Sample-Players.dir/main.cpp.o: undefined reference to symbol 'glOrtho'
//usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [bin/Sample-Players] Error 1
make[2]: Leaving directory `/home/andre/.RGBDemo-0.7.0-Source/build'
make[1]: *** [nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/all] Error 2
make[1]: Leaving directory `/home/andre/.RGBDemo-0.7.0-Source/build'
make: *** [all] Error 2
I have not much experience in compiling programs although I have some programming skills.
I have searched extensively how to solve this issue searching for the errors
"reference to symbol 'glOrtho'" and "adding symbols: DSO missing from command line" but I can't find a decent solution that helped me.
For example this case
Linker error : undefined reference to symbol 'glOrtho'
states that I should link an OpenGL library to a certain file. In my case I think it should be main.cpp but I am unable to find it :-(.
Any help is much appreciated.
Update
Here is the current progress that I was able to achieve in the make
Scanning dependencies of target nestk
make[2]: Leaving directory `/home/andre/.rgbdemo/build'
make -f nestk/ntk/CMakeFiles/nestk.dir/build.make nestk/ntk/CMakeFiles/nestk.dir/build
make[2]: Entering directory `/home/andre/.rgbdemo/build'
/usr/bin/cmake -E cmake_progress_report /home/andre/.rgbdemo/build/CMakeFiles 56
[ 59%] Building CXX object nestk/ntk/CMakeFiles/nestk.dir/aruco/board.o
cd /home/andre/.rgbdemo/build/nestk/ntk && /usr/bin/c++ -DHAVE_OPENCV_GREATER_THAN_2_2 -DHAVE_OPENCV_GREATER_THAN_2_3_0 -DNESTK_USE_CUSTOM_OPENNI -DNESTK_USE_EIGEN -DNESTK_USE_FREENECT -DNESTK_USE_GLEW -DNESTK_USE_OPENNI -DNESTK_USE_QT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_XML_LIB -Dnestk_EXPORTS -fPIC -Wall -W -Wno-unused -Wno-sign-compare -O2 -g -DNDEBUG -fPIC -I/home/andre/.rgbdemo/build/nestk/deps -I/home/andre/.rgbdemo/nestk/deps -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtOpenGL -isystem /usr/include/qt4/QtSvg -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtXml -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4/QtCore -I/home/andre/.rgbdemo/nestk/deps/include -I/home/andre/.rgbdemo/nestk/deps/eigen -I/home/andre/.rgbdemo/nestk/deps/libfreenect/include -I/home/andre/.rgbdemo/nestk/deps/openni/Include -I/home/andre/.rgbdemo/nestk/deps/openni/Nite/Include -I/home/andre/.rgbdemo/nestk/deps/glew/include -I/home/andre/.rgbdemo/nestk -I/home/andre/.rgbdemo/build/nestk -o CMakeFiles/nestk.dir/aruco/board.o -c /home/andre/.rgbdemo/nestk/ntk/aruco/board.cpp
In file included from /home/andre/.rgbdemo/nestk/ntk/geometry/pose_3d.h:23:0,
from /home/andre/.rgbdemo/nestk/ntk/aruco/marker.h:17,
from /home/andre/.rgbdemo/nestk/ntk/aruco/board.h:19,
from /home/andre/.rgbdemo/nestk/ntk/aruco/board.cpp:1:
/home/andre/.rgbdemo/nestk/ntk/core.h:31:38: fatal error: opencv2/legacy/compat.hpp: No such file or directory
# include "opencv2/legacy/compat.hpp"
^
compilation terminated.
make[2]: *** [nestk/ntk/CMakeFiles/nestk.dir/aruco/board.o] Error 1
make[2]: Leaving directory `/home/andre/.rgbdemo/build'
make[1]: *** [nestk/ntk/CMakeFiles/nestk.dir/all] Error 2
make[1]: Leaving directory `/home/andre/.rgbdemo/build'
make: *** [all] Error 2
I will try to find how to correct those directories but I would really apreciate some help on this. Please, I am doing this a bit by trial and error and I know this is not the right way to go. I am not an expert on cmake compilation.
I had to remove and reinstall OpenCV 2.3.1 with these instructions
http://www.ozbotz.org/opencv-installation-2-3-1/
And after some magic...voilá. It works. I hope that this tips can somehow help anyone.

libboost_*.so: file not recognized: File truncated When dynamically linking using libtool and automake to generate makefile

I am getting the following error:
../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib/libboost_system.so: file not recognized: File truncated
If I swap the order of boost_filesystem and boost_system I get the following error:
../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib/libboost_filesystem.so: file not recognized: File truncated
Boost built correctly to my knowledge. There were no errors during the build. The makefile that is doing the linking is as follows:
libtool: link: g++ -g -O2 -pthread -Wl,-rpath=../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib -o xml_wrapper_tester xml_wrapper_tester-runner.o - L../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib -lboost_wserialization -lboost_timer -lboost_date_time -lboost_iostreams -lboost_chrono -lboost_atomic -lboost_serialization -lboost_locale -lboost_log -lboost_thread -lboost_regex -lboost_log_setup -lboost_system -lboost_filesystem ../xml_wrapper/.libs/libxml_wrapper.a-pthread
../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib/libboost_system.so: file not recognized: File truncated
collect2: error: ld returned 1 exit status
make[2]: *** [xml_wrapper_tester] Error 1
make[2]: Leaving directory /home/mehoggan/Devel/RuleSimulator/src/xml/xml_wrapper_tester'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mehoggan/Devel/RuleSimulator/src/xml'
make: *** [all] Error 2
It sounds like your libboost* files are corrupt.
Q: Did you build them yourself? If so, I'd suggest "make clean" (or "rm -rf" from your build root), and rebuild from scratch.
Check carefully for any build errors when you do so.
I would very carefully follow these instructions:
http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html
'Hope that helps