无法使用Codeblocks或Qtcreator构建和调试项目

时间:2017-05-22 17:40:20

标签: c++ cmake linker cmake-gui

我正在尝试使用IDE(Qtcreator或Codeblocks)在Ubuntu 14.04 x64上从头构建Mince,因为我想调试源代码,以了解它如何更好地工作。

存储库:https://github.com/Kingsford-Group/mince/

编辑:因为我发现使用-pthread在外部构建项目的解决方法我想知道编辑make命令调用的文件是否允许我从一个IDE构建并调试代码。

我将cmake-gui

一起使用
BOOST_THREAD_LIBRARY: /usr/lib/x86_64-linux-gnu/libpthread.a
CMAKE_BUILD_TYPE: 
CMAKE_INSTALL_PREFIX: /home/federico/bioinfo/Mince

得到这个:

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

然后我使用# make并获取:

...
...
...
...
[ 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

所以我设法正确链接并通过选择失败命令来运行所有内容(即

/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/" 

并将-lpthread替换为-pthread但是因为我想了解我想要打开它的代码并使用Qtcreator或Codeblocks构建它并使用调试器这不起作用。

感谢任何帮助

EDIT = Title,因为我发现使用-pthread在外部构建项目的解决方法我想知道编辑make命令调用的文件是否允许我从其中一个IDE构建并调试代码。

0 个答案:

没有答案