CMake: cannot create target because another target with the same name already exists - cmake

I'm trying to install plexe-sumo with cmake. I followed the tutorial at plexe.car2x.org and here's the results:
-- CMAKE_BUILD_TYPE: Release
-- CMAKE_BINARY_DIR: /home/cc/src/plexe-sumo/build-release
-- CMAKE_SOURCE_DIR: /home/cc/src/plexe-sumo
--
-- Platform:
-- Host: Linux4.15.0-34-genericx86_64
-- CMake: 3.12.2
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
--
-- Found Proj: /usr/lib/x86_64-linux-gnu/libproj.so
CMake Error at /usr/local/share/cmake-3.12/Modules/UseSWIG.cmake:627 (add_custom_target):
add_custom_target cannot create target "libsumo_swig_compilation" because
another target with the same name already exists. The existing target is a
custom target created in source directory
"/home/cc/src/plexe-sumo/src/libsumo". See documentation for policy
CMP0002 for more details.
Call Stack (most recent call first):
src/libsumo/CMakeLists.txt:39 (SWIG_ADD_LIBRARY)
-- Enabled features: Linux-4.15.0-34-generic Proj GUI GDAL OSG GL2PS SWIG
-- Configuring incomplete, errors occurred!
There is no file named 'libsumo_swig_compilation' under "/home/cc/src/plexe-sumo/src/libsumo".
Then I checked the error log file, but the errors shown are about pthread saying 'undefined reference to pthread_creat' and 'cannot find -lpthreads'. Actually my pthread library is installed at 'libc6: /lib/x86_64-linux-gnu/libpthread.so.0'.
So I was wondering what's the exact problem here and how to solve it. I'm using a virtual machine with ubuntu 16. I appreciate your help!
Following is the error log file:
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_050d5/fast"
/usr/bin/make -f CMakeFiles/cmTC_050d5.dir/build.make CMakeFiles/cmTC_050d5.dir/build
make[1]: Entering directory '/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o
/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
/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c: In function ‘main’:
/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]
return ((int*)(&pthread_create))[argc];
^
Linking C executable cmTC_050d5
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_050d5.dir/link.txt --verbose=1
/usr/bin/cc -Wall -pedantic -Wextra -rdynamic CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o -o cmTC_050d5
CMakeFiles/cmTC_050d5.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_050d5.dir/build.make:86: recipe for target 'cmTC_050d5' failed
make[1]: *** [cmTC_050d5] Error 1
make[1]: Leaving directory '/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_050d5/fast' failed
make: *** [cmTC_050d5/fast] Error 2
File /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_9f654/fast"
/usr/bin/make -f CMakeFiles/cmTC_9f654.dir/build.make CMakeFiles/cmTC_9f654.dir/build
make[1]: Entering directory '/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9f654.dir/CheckFunctionExists.c.o
/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
Linking C executable cmTC_9f654
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9f654.dir/link.txt --verbose=1
/usr/bin/cc -Wall -pedantic -Wextra -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_9f654.dir/CheckFunctionExists.c.o -o cmTC_9f654 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_9f654.dir/build.make:86: recipe for target 'cmTC_9f654' failed
make[1]: *** [cmTC_9f654] Error 1
make[1]: Leaving directory '/home/cc/src/plexe-sumo/build-release/CMakeFiles/CMakeTmp'
Makefile:121: recipe for target 'cmTC_9f654/fast' failed
make: *** [cmTC_9f654/fast] Error 2

My assumption is that this is really a behavior which only the new cmake shows. You could try to rename all references to libsumo in the java part of the CMakeLists.txt or simply use the CMakeLists of the main line sumo here: https://github.com/eclipse/sumo/blob/master/src/libsumo/CMakeLists.txt

Related

Cmake Configuring incomplete, error occurred | Box2d / Linux

I am not able to configure cmake.
The issue is as described below about I am unable to make most of it:
CMake error at /snap/cmake/936/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake230 (message):Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)
Call Stack (most recent call first):
/snap/cmake/936/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake594 (_FPHSA_FAILURE_MESSAGE)
/snap/cmake/936/share/cmake-3.21/Modules/FindXII.camke:457 (find_package_handle_Standard_args)
extern/glfx/CMakeLists.txt:27 (find package)
Below is the error log (CmakeErrorLog):
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_81640/fast && /usr/bin/make -f CMakeFiles/cmTC_81640.dir/build.make CMakeFiles/cmTC_81640.dir/build
make[1]: Entering directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_81640.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_81640.dir/src.c.o -c /home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_81640
/snap/cmake/936/bin/cmake -E cmake_link_script CMakeFiles/cmTC_81640.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_81640.dir/src.c.o -o cmTC_81640
/usr/bin/ld: CMakeFiles/cmTC_81640.dir/src.c.o: in function `main':
src.c:(.text+0x46): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x5e): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x6f): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_81640.dir/build.make:99: cmTC_81640] Error 1
make[1]: Leaving directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_81640/fast] Error 2
Source file was:
#include <pthread.h>
static void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_f6423/fast && /usr/bin/make -f CMakeFiles/cmTC_f6423.dir/build.make CMakeFiles/cmTC_f6423.dir/build
make[1]: Entering directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f6423.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_f6423.dir/CheckFunctionExists.c.o -c /snap/cmake/936/share/cmake-3.21/Modules/CheckFunctionExists.c
Linking C executable cmTC_f6423
/snap/cmake/936/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f6423.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_f6423.dir/CheckFunctionExists.c.o -o cmTC_f6423 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_f6423.dir/build.make:99: cmTC_f6423] Error 1
make[1]: Leaving directory '/home/hariton/Box2D/Box2D/Testbed/Build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_f6423/fast] Error 2
The output log is too big and I cannot post it (maybe can post parts of it).
I am positive that I have all needed libraries installed. The issue must lie with the cmake implementation.
What is did is the following
Basically I was at the CMake master file and I wanted to run it at the testbed folder of box2d.
Can anyone help me out please?
If more information is needed let me know
Eventually was able to configure cmake without error
Initially the problem was because the following library was not installed: x11-dev
Then another error came up, as noted in the above comment.
After installing the following xorg-dev libglu1-mesa-dev the configuration was completed without any errors.
Thank you both for the help!

why 'target_link_libraries' command is not working? (cplex)

I tried to compile an project with cmake command(all implementation is written by other people. my job is just compile and run.)
error messages after cmake
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: bad revision 'HEAD'
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.10")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- CPLEX Library: /opt/ibm/ILOG/CPLEX_Studio1210/cplex/lib/x86-64_linux/static_pic/libcplex.a
-- ILOCPLEX Library: /opt/ibm/ILOG/CPLEX_Studio1210/cplex/lib/x86-64_linux/static_pic/libilocplex.a
-- CONCERT Library: /opt/ibm/ILOG/CPLEX_Studio1210/concert/lib/x86-64_linux/static_pic/libconcert.a
-- CPLEX Bin Dir: /opt/ibm/ILOG/CPLEX_Studio1210/cplex/bin/x86-64_linux
-- Found CPLEX: /opt/ibm/ILOG/CPLEX_Studio1210/cplex/lib/x86-64_linux/static_pic/libcplex.a
-- Configuring done
CMake Error at cpxutils/CMakeLists.txt:25 (add_executable):
Target "cpx_solver" links to target "Cplex::Cplex" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at cpxutils/CMakeLists.txt:13 (add_library):
Target "cpxutils" links to target "Cplex::Cplex" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
CMake Error at feaspump/CMakeLists.txt:17 (add_executable):
Target "fp2" links to target "Cplex::Cplex" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?
CMake Error at feaspump/CMakeLists.txt:5 (add_library):
Target "fp" links to target "Cplex::Cplex" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
and this is cpxutils/CMakeLists.txt file.
cmake_minimum_required(VERSION 3.6)
# Find CPLEX library
find_package(CPLEX)
# Export CPLEX_FOUND for CMakeLists.txt files in other subdirectories
set(CPLEX_FOUND ${CPLEX_FOUND} PARENT_SCOPE)
if (CPLEX_FOUND)
# Define libcpxutils
add_library(cpxutils STATIC cpxutils.cpp cpxmacro.cpp model.cpp gomory.cpp cpxapp.cpp)
target_include_directories(cpxutils PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(cpxutils PUBLIC utils Cplex::Cplex)
add_library(Cpxutils::Lib ALIAS cpxutils)
# Define cpx_solver executable
add_executable(cpx_solver EXCLUDE_FROM_ALL cpx_solver.cpp)
target_include_directories(cpx_solver PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(cpx_solver PUBLIC utils Cpxutils::Lib)
else()
message(WARNING "Disabling CPXUTILS subproject")
endif()
i don't know why cannot find target despite CPLEX package is found.
i'm using WSL1 (Ubuntu) environment.
↑ problem solved. thanks for #Tsyvarev.
=== additional problem ===
Even though cmake commad works without any error, I cant find execution file. So I checked 'CMakeError.log' file then, there are some error.
This is CMakeError.log file.
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /mnt/c/Users/aero5010/Desktop/CBC+FP/CBC+FP/fp2/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_92254/fast && /usr/bin/make -f CMakeFiles/cmTC_92254.dir/build.make CMakeFiles/cmTC_92254.dir/build
make[1]: Entering directory '/mnt/c/Users/aero5010/Desktop/CBC+FP/CBC+FP/fp2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_92254.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_92254.dir/src.c.o -c /mnt/c/Users/aero5010/Desktop/CBC+FP/CBC+FP/fp2/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_92254
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_92254.dir/link.txt --verbose=1
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD CMakeFiles/cmTC_92254.dir/src.c.o -o cmTC_92254
/usr/bin/ld: CMakeFiles/cmTC_92254.dir/src.c.o: in function `main':
src.c:(.text+0x46): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x63): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_92254.dir/build.make:87: cmTC_92254] Error 1
make[1]: Leaving directory '/mnt/c/Users/aero5010/Desktop/CBC+FP/CBC+FP/fp2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_92254/fast] Error 2
Source file was:
#include <pthread.h>
void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /mnt/c/Users/aero5010/Desktop/CBC+FP/CBC+FP/fp2/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_8ae2b/fast && /usr/bin/make -f CMakeFiles/cmTC_8ae2b.dir/build.make CMakeFiles/cmTC_8ae2b.dir/build
make[1]: Entering directory '/mnt/c/Users/aero5010/Desktop/CBC+FP/CBC+FP/fp2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8ae2b.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_8ae2b.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_8ae2b
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8ae2b.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_8ae2b.dir/CheckFunctionExists.c.o -o cmTC_8ae2b -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_8ae2b.dir/build.make:87: cmTC_8ae2b] Error 1
make[1]: Leaving directory '/mnt/c/Users/aero5010/Desktop/CBC+FP/CBC+FP/fp2/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_8ae2b/fast] Error 2
I think this is why i cant find execution file. But I dont know why this error occured despite pthread library is installed well...
** thank you for every advice about Stackoverflow Manners.

Percona5.7 cmake failed on centos 7

I get the source code of percona-server from github. And I install boost 1.59 and gcc gcc-c ncurses-devel. I enter the directory of percona-server and run "cmake --DWITH_BOOST=/data/boost" but get the following error. I cannot find some solution so I came to here. Thanks!!
-- Performing Test HAVE_UNUSED_PARAMETER - Success
-- Googletest was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an https proxy: export https_proxy=http://example.com:80
-- Performing Test HAVE_MISLEADING_INDENTATION
-- Performing Test HAVE_MISLEADING_INDENTATION - Failed
-- executable target mysqld debug_target /home/teg/Downloads/debug/sql/mysqld
-- Library mysqlserver depends on OSLIBS -lpthread;/usr/lib64/libz.so;m;rt;crypt;dl;aio;numa
-- MERGE_CONVENIENCE_LIBRARIES TARGET mysqlserver
-- MERGE_CONVENIENCE_LIBRARIES LIBS dbug;strings;regex;mysys;mysys_ssl;vio;/usr/lib64/libz.so;yassl;taocrypt;crypt;dl;archive_embedded;b lackhole_embedded;csv_embedded;federated_embedded; heap_embedded;innobase_embedded;lz4_lib;numa;myisa m_embedded;myisammrg_embedded;partition_embedded;n gram_parser_embedded;sql_embedded
-- MERGE_CONVENIENCE_LIBRARIES MYLIBS dbug;strings;regex;mysys;mysys_ssl;vio;yassl;taocr ypt;archive_embedded;blackhole_embedded;csv_embedd ed;federated_embedded;heap_embedded;innobase_embed ded;lz4_lib;myisam_embedded;myisammrg_embedded;par tition_embedded;ngram_parser_embedded;sql_embedded
-- library target mysqlserver debug_target /home/teg/Downloads/debug/archive_output_directory/libmysqld.a
-- INSTALL perconaserverclient.pc lib/pkgconfig
-- Skipping deb packaging on unsupported platform Core.
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: _GNU_SOURCE;_FILE_OFFSET_BITS=64;HAVE_CONFIG_H;HAV E_LIBEVENT1
-- CMAKE_C_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS: -std=gnu++03 -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter
-- CMAKE_C_LINK_FLAGS:
-- CMAKE_CXX_LINK_FLAGS:
-- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -D_FORTIFY_SOURCE=2 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -DNDEBUG
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -D_FORTIFY_SOURCE=2 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -DNDEBUG
-- Configuring incomplete, errors occurred!
See also "/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeOutput.log".
See also "/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeError.log".
.................................................. .........................
And I open the /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeError.log and find the following errors. There are too many errors and I only list part of it.
Run Build Command:/usr/bin/gmake "cmTryCompileExec1295500228/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1295500228.dir/build.make CMakeFiles/cmTryCompileExec1295500228.dir/build
gmake[1]: Entering directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1295500228.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec1295500228.dir/CheckSymbolExists.c.o -c /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec1295500228
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1295500228.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTryCompileExec1295500228.dir/CheckSymbolExists.c.o -o cmTryCompileExec1295500228 -rdynamic
CMakeFiles/cmTryCompileExec1295500228.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
gmake[1]: Leaving directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec1295500228] Error 1
gmake: *** [cmTryCompileExec1295500228/fast] Error 2
File /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
Run Build Command:/usr/bin/gmake "cmTryCompileExec1916958743/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1916958743.dir/build.make CMakeFiles/cmTryCompileExec1916958743.dir/build
gmake[1]: Entering directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1916958743.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec1916958743.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec1916958743
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1916958743.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec1916958743.dir/CheckFunctionExists.c.o -o cmTryCompileExec1916958743 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: Leaving directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec1916958743] Error 1
gmake: *** [cmTryCompileExec1916958743/fast] Error 2
Determining if the function floor exists failed with the following output:
Change Dir: /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec1596718479/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1596718479.dir/build.make CMakeFiles/cmTryCompileExec1596718479.dir/build
gmake[1]: Entering directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1596718479.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=floor -o CMakeFiles/cmTryCompileExec1596718479.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
<command-line>:0:23: warning: conflicting types for built-in function ‘floor’ [enabled by default]
/usr/share/cmake/Modules/CheckFunctionExists.c:3:6: note: in expansion of macro ‘CHECK_FUNCTION_EXISTS’
char CHECK_FUNCTION_EXISTS();
^
Linking C executable cmTryCompileExec1596718479
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1596718479.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=floor CMakeFiles/cmTryCompileExec1596718479.dir/CheckFunctionExists.c.o -o cmTryCompileExec1596718479 -rdynamic
CMakeFiles/cmTryCompileExec1596718479.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c.text+0x15): undefined reference to `floor'
collect2: error: ld returned 1 exit status
gmake[1]: Leaving directory `/home/teg/Downloads/percona-server-5.7/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec1596718479] Error 1
gmake: *** [cmTryCompileExec1596718479/fast] Error 2
it seems you haven't all needed dependencies installed.
These are the steps which are needed:
sudo yum install epel-release
sudo yum install git gcc gcc-c++ openssl check cmake bison boost-devel asio-devel
libaio-devel ncurses-devel readline-devel pam-devel wget perl-Env time numactl-devel
rpmdevtools rpm-build curl-devel
git clone https://github.com/percona/percona-server.git
cd percona-server
git submodule init
git submodule update
cmake . -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<PATCH_TO_BOOST_DIR>
Then boost will be downloaded automatically

cmake 3.10 cant internally test the blas library

I cant get working my blas library with cmake. I have arch-linxux, both blas and cmake are installed with pacman. Cant understand where is problem :-(. I made cmake to print out the output of macro CHECK_FORTRAN_FUNCTION_EXISTS, because it fails there. Maybe I dont have proper configuration of ld?
My simple testing CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(Test C Fortran)
find_package(BLAS)
Error part from output:
-- Looking for Fortran sgemm
-- Change Dir: /home/jiri/test_lapack/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_486fc/fast"
/usr/bin/make -f CMakeFiles/cmTC_486fc.dir/build.make CMakeFiles/cmTC_486fc.dir/build
make[1]: Entering directory '/home/jiri/test_lapack/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_486fc.dir/testFortranCompiler.f.o
/usr/bin/gfortran -c /home/jiri/test_lapack/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_486fc.dir/testFortranCompiler.f.o
Linking Fortran executable cmTC_486fc
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_486fc.dir/link.txt --verbose=1
/usr/bin/gfortran CMakeFiles/cmTC_486fc.dir/testFortranCompiler.f.o -o cmTC_486fc /usr/local/lib64/libblas.a
/usr/bin/ld: /usr/local/lib64/libblas.a(sgemm.f.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib64/libblas.a(xerbla.f.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_486fc.dir/build.make:99: cmTC_486fc] Error 1
make[1]: Leaving directory '/home/jiri/test_lapack/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_486fc/fast] Error 2
-- Looking for Fortran sgemm - not found

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Error Cmake

I am trying to run a python script, but I stumble upon the following errors while running it.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
P2PSP_LIBRARY
linked by target "splitter" in directory /home/billy/Desktop/p2psp-console-master
linked by target "peer" in directory /home/billy/Desktop/p2psp-console-master
-- Configuring incomplete, errors occurred!
See also "/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeError.log".
This is my cmake error log.
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec2187325408/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2187325408.dir/build.make CMakeFiles/cmTryCompileExec2187325408.dir/build
make[1]: Entering directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2187325408.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec2187325408.dir/CheckSymbolExists.c.o -c /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec2187325408
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2187325408.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTryCompileExec2187325408.dir/CheckSymbolExists.c.o -o cmTryCompileExec2187325408 -rdynamic
CMakeFiles/cmTryCompileExec2187325408.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec2187325408.dir/build.make:88: recipe for target 'cmTryCompileExec2187325408' failed
make[1]: *** [cmTryCompileExec2187325408] Error 1
make[1]: Leaving directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec2187325408/fast' failed
make: *** [cmTryCompileExec2187325408/fast] Error 2
File /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec2407202235/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2407202235.dir/build.make CMakeFiles/cmTryCompileExec2407202235.dir/build
make[1]: Entering directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2407202235.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec2407202235.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.2/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec2407202235
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2407202235.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec2407202235.dir/CheckFunctionExists.c.o -o cmTryCompileExec2407202235 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec2407202235.dir/build.make:88: recipe for target 'cmTryCompileExec2407202235' failed
make[1]: *** [cmTryCompileExec2407202235] Error 1
make[1]: Leaving directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec2407202235/fast' failed
make: *** [cmTryCompileExec2407202235/fast] Error 2
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec1093226452/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1093226452.dir/build.make CMakeFiles/cmTryCompileExec1093226452.dir/build
make[1]: Entering directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1093226452.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTryCompileExec1093226452.dir/CheckSymbolExists.c.o -c /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec1093226452
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1093226452.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTryCompileExec1093226452.dir/CheckSymbolExists.c.o -o cmTryCompileExec1093226452 -rdynamic
CMakeFiles/cmTryCompileExec1093226452.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec1093226452.dir/build.make:88: recipe for target 'cmTryCompileExec1093226452' failed
make[1]: *** [cmTryCompileExec1093226452] Error 1
make[1]: Leaving directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec1093226452/fast' failed
make: *** [cmTryCompileExec1093226452/fast] Error 2
File /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTryCompileExec3293591889/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3293591889.dir/build.make CMakeFiles/cmTryCompileExec3293591889.dir/build
make[1]: Entering directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3293591889.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3293591889.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.2/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec3293591889
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3293591889.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3293591889.dir/CheckFunctionExists.c.o -o cmTryCompileExec3293591889 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec3293591889.dir/build.make:88: recipe for target 'cmTryCompileExec3293591889' failed
make[1]: *** [cmTryCompileExec3293591889] Error 1
make[1]: Leaving directory '/home/billy/Desktop/p2psp-console-master/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec3293591889/fast' failed
make: *** [cmTryCompileExec3293591889/fast] Error 2
I have been trying different solutions. But the same error occurs again and again. Can anyone suggest me a solution? Thanks in advance.