我正在尝试使用 cmake 安装 plexe-sumo。我按照 plexe.car2x.org 上的教程进行操作,结果如下:
\n\n-- CMAKE_BUILD_TYPE: Release\n-- CMAKE_BINARY_DIR: /home/cc/src/plexe-sumo/build-release\n-- CMAKE_SOURCE_DIR: /home/cc/src/plexe-sumo\n-- \n-- Platform: \n-- Host: Linux4.15.0-34-genericx86_64\n-- CMake: 3.12.2\n-- CMake generator: Unix Makefiles\n-- CMake build tool: /usr/bin/make\n-- \n-- Found Proj: /usr/lib/x86_64-linux-gnu/libproj.so\nCMake Error at /usr/local/share/cmake-3.12/Modules/UseSWIG.cmake:627 (add_custom_target):\n add_custom_target cannot create target "libsumo_swig_compilation" because\n another target with the same name already exists. The existing target is a\n custom target created in source directory\n "/home/cc/src/plexe-sumo/src/libsumo". See documentation for policy\n CMP0002 for more details.\nCall Stack (most recent call first):\n src/libsumo/CMakeLists.txt:39 (SWIG_ADD_LIBRARY)\n\n\n-- Enabled features: Linux-4.15.0-34-generic Proj GUI GDAL OSG GL2PS SWIG\n-- Configuring incomplete, errors occurred!\n
Run Code Online (Sandbox Code Playgroud)\n\n“/home/cc/src/plexe-sumo/src/libsumo”下没有名为“libsumo_swig_compilation”的文件。
\n\n然后我检查了错误日志文件,但显示的错误是关于 pthread 的“未定义的对 pthread_creat 的引用”和“找不到 -lpthreads”。实际上我的pthread库安装在\'libc6:/lib/x86_64-linux-gnu/libpthread.so.0\'。
\n\n所以我想知道这里的确切问题是什么以及如何解决它。我正在使用 ubuntu 16 虚拟机。感谢您的帮助!
\n\n以下是错误日志文件:
\n\nDetermining if the pthread_create exist failed with the following output:\nChange Dir: /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp\n\nRun Build Command:"/usr/bin/make" "cmTC_050d5/fast"\n/usr/bin/make -f CMakeFiles/cmTC_050d5.dir/build.make CMakeFiles/cmTC_050d5.dir/build\nmake[1]: Entering directory \'/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp\'\nBuilding C object CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o\n/usr/bin/cc -Wall -pedantic -Wextra -o CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o -c /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c\n/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c: In function \xe2\x80\x98main\xe2\x80\x99:\n/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]\n return ((int*)(&pthread_create))[argc];\n ^\nLinking C executable cmTC_050d5\n/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_050d5.dir/link.txt --verbose=1\n/usr/bin/cc -Wall -pedantic -Wextra -rdynamic CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o -o cmTC_050d5 \nCMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o: In function `main\':\nCheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create\'\ncollect2: error: ld returned 1 exit status\nCMakeFiles/cmTC_050d5.dir/build.make:86: recipe for target \'cmTC_050d5\' failed\nmake[1]: *** [cmTC_050d5] Error 1\nmake[1]: Leaving directory \'/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp\'\nMakefile:121: recipe for target \'cmTC_050d5/fast\' failed\nmake: *** [cmTC_050d5/fast] Error 2\n\nFile /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c:\n/* */\n#include <pthread.h>\n\nint main(int argc, char** argv)\n{\n (void)argv;\n#ifndef pthread_create\n return ((int*)(&pthread_create))[argc];\n#else\n (void)argc;\n return 0;\n#endif\n}\n\nDetermining if the function pthread_create exists in the pthreads failed with the following output:\nChange Dir: /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp\n\nRun Build Command:"/usr/bin/make" "cmTC_9f654/fast"\n/usr/bin/make -f CMakeFiles/cmTC_9f654.dir/build.make CMakeFiles/cmTC_9f654.dir/build\nmake[1]: Entering directory \'/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp\'\nBuilding C object CMakeFiles/cmTC_9f654.dir/CheckFunctionExists.c.o\n/usr/bin/cc -Wall -pedantic -Wextra -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_9f654.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake-3.12/Modules/CheckFunctionExists.c\nLinking C executable cmTC_9f654\n/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9f654.dir/link.txt --verbose=1\n/usr/bin/cc -Wall -pedantic -Wextra -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_9f654.dir/CheckFunctionExists.c.o -o cmTC_9f654 -lpthreads \n/usr/bin/ld: cannot find -lpthreads\ncollect2: error: ld returned 1 exit status\nCMakeFiles/cmTC_9f654.dir/build.make:86: recipe for target \'cmTC_9f654\' failed\nmake[1]: *** [cmTC_9f654] Error 1\nmake[1]: Leaving directory \'/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp\'\nMakefile:121: recipe for target \'cmTC_9f654/fast\' failed\nmake: *** [cmTC_9f654/fast] Error 2\n
Run Code Online (Sandbox Code Playgroud)\n
我的假设是,这实际上是只有新的 cmake 显示的行为。您可以尝试重命名 CMakeLists.txt 的 java 部分中对 libsumo 的所有引用,或者简单地使用主线 sumo 的 CMakeLists:https: //github.com/eclipse/sumo/blob/master/src/libsumo/ CMakeLists.txt
归档时间: |
|
查看次数: |
12311 次 |
最近记录: |