I had installed gcc-11/g++-11 and tbb
$ dpkg -l | grep tbb
ii libtbb-dev:amd64 2020.1-2 amd64 parallelism library for C++ - development files
ii libtbb2:amd64 2020.1-2 amd64 parallelism library for C++ - runtime files
$ dpkg -l | grep gcc-11
ii gcc-11 11.1.0-1ubuntu1~20.04 amd64 GNU C compiler
ii gcc-11-base:amd64 11.1.0-1ubuntu1~20.04 amd64 GCC, the GNU Compiler Collection (base package)
ii libgcc-11-dev:amd64 11.1.0-1ubuntu1~20.04 amd64 GCC support library (development files)
$ dpkg -l | grep g++-11
ii g++-11 11.1.0-1ubuntu1~20.04 amd64 GNU C++ compiler
then, I wrote cmake like below
https://github.com/yumetodo/SigContrastFastAviUtl/blob/master/test/CMakeLists.txt
...
find_package(TBB REQUIRED tbb)
...
target_link_libraries(SigContrastFastAviUtl_test ${TBB_IMPORTED_TARGETS})
...
However, it's seemed me that find_package doesn't work and link error was occurred.
$ cmake -B build -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= g++-11
CMAKE_C_COMPILER= gcc-11
CMAKE_CXX_COMPILER= g++-11
-- The CXX compiler identification is GNU 11.1.0
-- Check for working CXX compiler: /usr/bin/g++-11
-- Check for working CXX compiler: /usr/bin/g++-11 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include 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
-- The C compiler identification is GNU 11.1.0
-- Check for working C compiler: /usr/bin/gcc-11
-- Check for working C compiler: /usr/bin/gcc-11 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yumetodo/SigContrastFastAviUtl/test/build
$ cmake --build build/
Scanning dependencies of target SigContrastFastAviUtl_test
[ 16%] Building CXX object CMakeFiles/SigContrastFastAviUtl_test.dir/LUT.cpp.o
[ 33%] Building CXX object CMakeFiles/SigContrastFastAviUtl_test.dir/random.cpp.o
[ 50%] Building CXX object CMakeFiles/SigContrastFastAviUtl_test.dir/RSigmoidTable.cpp.o
[ 66%] Building CXX object CMakeFiles/SigContrastFastAviUtl_test.dir/SigmoidTable.cpp.o
[ 83%] Building CXX object CMakeFiles/SigContrastFastAviUtl_test.dir/test.cpp.o
/home/yumetodo/SigContrastFastAviUtl/test/test.cpp: In member function ‘virtual void iu_Analyzer_x_iutest_x_calcAverage_Test::Body()’:
/home/yumetodo/SigContrastFastAviUtl/test/test.cpp:114:19: warning: unused variable ‘_’ [-Wunused-variable]
114 | for (auto _ : std::views::iota(0, 1000)) input.emplace_back(d(engine));
| ^
/home/yumetodo/SigContrastFastAviUtl/test/test.cpp: In member function ‘virtual void iu_Analyzer_x_iutest_x_calcStdev_Test::Body()’:
/home/yumetodo/SigContrastFastAviUtl/test/test.cpp:124:19: warning: unused variable ‘_’ [-Wunused-variable]
124 | for (auto _ : std::views::iota(0, 1000)) input.emplace_back(d(engine));
| ^
[100%] Linking CXX executable SigContrastFastAviUtl_test
/usr/bin/ld: CMakeFiles/SigContrastFastAviUtl_test.dir/test.cpp.o: in function `tbb::task_group_context::task_group_context(tbb::internal::string_index)':
test.cpp:(.text._ZN3tbb18task_group_contextC2ENS_8internal12string_indexE[_ZN3tbb18task_group_contextC5ENS_8internal12string_indexE]+0x41): undefined reference to `tbb::task_group_context::init()'
/usr/bin/ld: CMakeFiles/SigContrastFastAviUtl_test.dir/test.cpp.o: in function `tbb::task::task()':
test.cpp:(.text._ZN3tbb4taskC2Ev[_ZN3tbb4taskC5Ev]+0x13): undefined reference to `vtable for tbb::task'
/usr/bin/ld: CMakeFiles/SigContrastFastAviUtl_test.dir/test.cpp.o: in function `tbb::task::~task()':
.
.
.
(full log is here)
I watched below but not resolved.
c++17 parallel algorithms and CMake
https://github.com/oneapi-src/oneTBB/blob/tbb_2020/cmake/README.rst#binary-package-integration
How should I do?
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 46dcc93..8b662dc 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
## -60,6 +60,7 ## if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUC)
if(WIN32)
target_link_libraries(SigContrastFastAviUtl_test wsock32 ws2_32)
endif()
- target_link_libraries(SigContrastFastAviUtl_test ${TBB_IMPORTED_TARGETS})
+ #target_link_libraries(SigContrastFastAviUtl_test ${TBB_IMPORTED_TARGETS})
+ target_link_libraries(SigContrastFastAviUtl_test TBB::tbb)
endif()
target_link_libraries(SigContrastFastAviUtl_test Threads::Threads)
-- Configuring done
CMake Error at CMakeLists.txt:58 (add_executable):
Target "SigContrastFastAviUtl_test" links to target "TBB::tbb" 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.
make: *** [Makefile:296: cmake_check_build_system] Error 1
Related
When I try OpenPose Building, I get error: identifier “nullptr” is undefined.
I follow the instructions on the site to install OpenPose and I have error in "OpenPose Building".
https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md#clone-openpose
my#PC:~/openpose/build$ make -j`nproc`
Scanning dependencies of target openpose_caffe
[ 12%] Creating directories for 'openpose_caffe'
[ 25%] No download step for 'openpose_caffe'
[ 37%] [ 50%] No patch step for 'openpose_caffe'
No update step for 'openpose_caffe'
[ 62%] Performing configure step for 'openpose_caffe'
-- The C compiler identification is GNU 4.9.4
-- The CXX compiler identification is GNU 4.9.4
-- 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
-- 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
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- system
-- thread
-- filesystem
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- 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 GFlags: /usr/include
-- Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Found Glog: /usr/include
-- Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
-- Found PROTOBUF: /usr/lib/x86_64-linux-gnu/libprotobuf.so
-- Found PROTOBUF Compiler: /usr/bin/protoc
-- Found HDF5: /usr/lib/x86_64-linux-gnu/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/libhdf5.so
-- CUDA detected: 8.0
-- Found cuDNN: ver. 5.1.10 found (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Automatic GPU detection failed. Building for all known architectures.
-- Added CUDA NVCC flags for: sm_30 sm_35 sm_50 sm_52 sm_60 sm_61
-- Found Atlas: /usr/include
-- Found Atlas (include: /usr/include library: /usr/lib/libatlas.so lapack: /usr/lib/liblapack.so
-- Python interface is disabled or not all required dependencies found. Building without it...
-- Found Git: /usr/bin/git (found version "1.9.1")
--
-- ******************* Caffe Configuration Summary *******************
-- General:
-- Version : 1.0.0
-- Git : 1.0-141-g974172c
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -std=c++11 -Wno-sign-compare -Wno-uninitialized
-- Debug CXX flags : -g -fPIC -Wall -std=c++11 -Wno-sign-compare -Wno-uninitialized
-- Build type : Release
--
-- BUILD_SHARED_LIBS : ON
-- BUILD_python : OFF
-- BUILD_matlab : OFF
-- BUILD_docs : OFF
-- CPU_ONLY : OFF
-- USE_OPENCV : OFF
-- USE_LEVELDB : OFF
-- USE_LMDB : OFF
-- USE_NCCL : OFF
-- ALLOW_LMDB_NOLOCK : OFF
-- USE_HDF5 : ON
--
-- Dependencies:
-- BLAS : Yes (Atlas)
-- Boost : Yes (ver. 1.54)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 2.5.0)
-- CUDA : Yes (ver. 8.0)
--
-- NVIDIA CUDA:
-- Target GPU(s) : Auto
-- GPU arch(s) : sm_30 sm_35 sm_50 sm_52 sm_60 sm_61
-- cuDNN : Yes (ver. 5.1.10)
--
-- Install:
-- Install path : /home/miyo/openpose/build/caffe
--
CMake Warning (dev) in src/caffe/CMakeLists.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "caffe" has an INTERFACE_LINK_LIBRARIES property which differs from
its LINK_INTERFACE_LIBRARIES properties.
INTERFACE_LINK_LIBRARIES:
caffeproto;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libglog.so;/usr/lib/x86_64-linux-gnu/libgflags.so;$<$<NOT:$<CONFIG:DEBUG>>:/usr/lib/x86_64-linux-gnu/libprotobuf.so>;$<$<CONFIG:DEBUG>:/usr/lib/x86_64-linux-gnu/libprotobuf.so>;-lpthread;/usr/lib/x86_64-linux-gnu/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/lib/x86_64-linux-gnu/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/lib/x86_64-linux-gnu/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/lib/x86_64-linux-gnu/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/local/cuda-8.0/lib64/libcudart.so;/usr/local/cuda-8.0/lib64/libcurand.so;/usr/local/cuda-8.0/lib64/libcublas.so;/usr/lib/x86_64-linux-gnu/libcudnn.so;/usr/lib/liblapack.so;/usr/lib/libcblas.so;/usr/lib/libatlas.so
LINK_INTERFACE_LIBRARIES:
caffeproto;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libglog.so;/usr/lib/x86_64-linux-gnu/libgflags.so;/usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread;/usr/lib/x86_64-linux-gnu/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/lib/x86_64-linux-gnu/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/lib/x86_64-linux-gnu/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/lib/x86_64-linux-gnu/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/libhdf5.so;/usr/local/cuda-8.0/lib64/libcudart.so;/usr/local/cuda-8.0/lib64/libcurand.so;/usr/local/cuda-8.0/lib64/libcublas.so;/usr/lib/x86_64-linux-gnu/libcudnn.so;/usr/lib/liblapack.so;/usr/lib/libcblas.so;/usr/lib/libatlas.so
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/miyo/openpose/build/caffe/src/openpose_caffe-build
[ 75%] Performing build step for 'openpose_caffe'
[ 1%] Running C++/Python protocol buffer compiler on /home/miyo/openpose/3rdparty/caffe/src/caffe/proto/caffe.proto
Scanning dependencies of target caffeproto
[ 1%] Building CXX object src/caffe/CMakeFiles/caffeproto.dir/__/__/include/caffe/proto/caffe.pb.cc.o
Linking CXX static library ../../lib/libcaffeproto.a
[ 1%] Built target caffeproto
[ 1%] [ 1%] [ 2%] [ 2%] [ 4%] [ 5%] [ 6%] [ 6%] [ 6%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/solvers/./cuda_compile_generated_sgd_solver.cu.o
Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/util/./cuda_compile_generated_math_functions.cu.o
[ 6%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/solvers/./cuda_compile_generated_adam_solver.cu.o
Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_deconv_layer.cu.o
Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/util/./cuda_compile_generated_im2col.cu.o
Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/solvers/./cuda_compile_generated_adagrad_solver.cu.o
Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/solvers/./cuda_compile_generated_rmsprop_solver.cu.o
Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/solvers/./cuda_compile_generated_nesterov_solver.cu.o
Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/solvers/./cuda_compile_generated_adadelta_solver.cu.o
[ 8%] [ 8%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_lrn_layer.cu.o
Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_hdf5_data_layer.cu.o
Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_cudnn_sigmoid_layer.cu.o
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/stddef.h(432): error: identifier "nullptr" is undefined
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/stddef.h(432): error: expected a ";"
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/stddef.h(432): error: identifier "nullptr" is undefined
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/stddef.h(432): error: expected a ";"
...
/usr/include/c++/4.9/cmath(202): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.9/cmath(202): error: expected a ";"
/usr/include/c++/4.9/cmath(221): error: inline specifier allowed on function declarations only
/usr/include/c++/4.9/cmath(221): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.9/cmath(221): error: expected a ";"
/usr/include/c++/4.9/cmath(240): error: inline specifier allowed on function declarations only
/usr/include/c++/4.9/cmath(240): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.9/cmath(240): error: expected a ";"
Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_00001d71_00000000-17_math_functions.compute_61.cpp1.ii".
Compilation terminated.
CMake Error at cuda_compile_generated_math_functions.cu.o.cmake:264 (message):
Error generating file
/home/miyo/openpose/build/caffe/src/openpose_caffe-build/src/caffe/CMakeFiles/cuda_compile.dir/util/./cuda_compile_generated_math_functions.cu.o
make[5]: *** [src/caffe/CMakeFiles/cuda_compile.dir/util/./cuda_compile_generated_math_functions.cu.o] Error 1
make[4]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [caffe/src/openpose_caffe-stamp/openpose_caffe-build] Error 2
make[1]: *** [CMakeFiles/openpose_caffe.dir/all] Error 2
make: *** [all] Error 2
Please tell me how to solve this problem.
Ubuntu 14.04,
Cuda 8.0,
cudnn 5.1,
gcc 4.9,
g++ 4.9
Additional notes -
I am multiposting here.
https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/981
https://ja.stackoverflow.com/questions/51408/openpose%e3%81%ae%e3%83%93%e3%83%ab%e3%83%89%e6%99%82%e3%81%aberror-identifier-nullptr-is-undefined%e3%81%ae%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%8c%e7%99%ba%e7%94%9f%e3%81%99%e3%82%8b
I ran the following code but I could not improve this problem.
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
Additional notes2 -
my#PC:~$ cc --version
cc (Ubuntu 4.9.4-2ubuntu1~14.04.1) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
my#PC:~$ c++ --version
c++ (Ubuntu 4.9.4-2ubuntu1~14.04.1) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I believe that GCC 4.9 should be sufficient. The caveat is that it does not use C++11 by default, so you have to add --std=c++11 somewhere in the Makefile where the CXXFLAGS are defined. The developers of the software package might use a newer version of GCC which uses C++14 by default, like GCC 8.2.
As this is a CMake project, you can either add
add_definitions('--std=c++11')
to the CMakeLists.txt or add
set(CMAKE_CXX_STANDARD 11)
if your version of CMake supports it.
Please help fix the error on Installing Connector/C++ from Source, while "make clean". There are two parts to the question:
Part 1 of the Question: What is the error (cdk/parser/CMakeFiles/cdk_parser.dir/flags.make) missing separator?
[E:\Working\SQL\MySQL\C++>git clone https://github.com/mysql/mysql-connector-cpp
Cloning into 'mysql-connector-cpp'...
remote: Counting objects: 16511, done.
remote: Total 16511 (delta 0), reused 0 (delta 0), pack-reused 16511
Receiving objects: 100% (16511/16511), 7.77 MiB | 48.00 KiB/s, done.
Resolving deltas: 100% (13018/13018), done.
Checking connectivity... done.
Checking out files: 100% (739/739), done.
E:\Working\SQL\MySQL\C++>cd mysql-connector-cpp
E:\Working\SQL\MySQL\C++\mysql-connector-cpp>"C:\Program Files\CMake\bin\cmake.exe" -G "MinGW Makefiles" -DWITH_BOOST="E:\Working\SQL\MySQL\C++\Boost\Unix-Varia
nts\boost_1_63_0"
-- The C compiler identification is GNU 5.1.0
-- The CXX compiler identification is GNU 5.1.0
-- Check for working C compiler: C:/TDM-GCC-64/bin/gcc.exe
-- Check for working C compiler: C:/TDM-GCC-64/bin/gcc.exe -- 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: C:/TDM-GCC-64/bin/g++.exe
-- Check for working CXX compiler: C:/TDM-GCC-64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Building on system: Windows-6.3.9600 (AMD64)
Using cmake generator: MinGW Makefiles
Using 64bit generator
Building shared connector library
-- Boost version: 1.63.0
Configuring CDK as part of MySQL_CONCPP project
WITH_TESTS: OFF
CDK include path: E:/Working/SQL/MySQL/C++/mysql-connector-cpp/cdk/include;E:/Working/SQL/MySQL/C++/mysql-connector-cpp/cdk/include
-- Performing Test HAVE_MOVE_SEMANTICS
-- Performing Test HAVE_MOVE_SEMANTICS - Failed
-- Boost version: 1.63.0
Configuring Protobuf build using cmake generator: MinGW Makefiles
-- The C compiler identification is GNU 5.1.0
-- The CXX compiler identification is GNU 5.1.0
-- Check for working C compiler: C:/TDM-GCC-64/bin/gcc.exe
-- Check for working C compiler: C:/TDM-GCC-64/bin/gcc.exe -- 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: C:/TDM-GCC-64/bin/g++.exe
-- Check for working CXX compiler: C:/TDM-GCC-64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
Using pthreads for protobuf code
-- Configuring done
-- Generating done
-- Build files have been written to: E:/Working/SQL/MySQL/C++/mysql-connector-cpp/cdk/protobuf
Protobuf include path: E:/Working/SQL/MySQL/C++/mysql-connector-cpp/cdk/protobuf/protobuf-2.6.0/src
WITH_SSL: OFF
-- Performing Test HAVE_STATIC_ASSERT
-- Performing Test HAVE_STATIC_ASSERT - Failed
-- Performing Test HAVE_IS_SAME
-- Performing Test HAVE_IS_SAME - Failed
-- Performing Test HAVE_SHARED_PTR
-- Performing Test HAVE_SHARED_PTR - Failed
-- Looking for sys/endian.h
-- Looking for sys/endian.h - not found
-- Looking for sys/byteorder.h
-- Looking for sys/byteorder.h - not found
-adding static library: cdk_mysqlx_objs
-adding static library: cdk_proto_mysqlx_objs
-adding static library: cdk_foundation_objs
-adding static library: cdk_parser_objs
Merging static libraries into cdk:
- cdk
- protobuf-lite
- cdk_mysqlx_objs
- cdk_proto_mysqlx_objs
- cdk_foundation_objs
- cdk_parser_objs
Wrote configuration header: E:/Working/SQL/MySQL/C++/mysql-connector-cpp/cdk/include/mysql/cdk/config.h
Connector library name: mysqlcppconn2
Connector library will be installed at: lib64
Install location: C:/Users/Aspire/MySQL/MySQL Connector C++ 2.0
-- Configuring done
-- Generating done
-- Build files have been written to: E:/Working/SQL/MySQL/C++/mysql-connector-cpp
E:\Working\SQL\MySQL\C++\mysql-connector-cpp>"C:\Program Files (x86)\GnuWin32\bin\make.exe" clean
cdk/parser/CMakeFiles/cdk_parser.dir/flags.make:6: *** missing separator. Stop.
make\[1\]: *** \[cdk/parser/CMakeFiles/cdk_parser.dir/clean\] Error 2
make: *** \[clean\] Error 2
E:\Working\SQL\MySQL\C++\mysql-connector-cpp>][1]
Please note that Boost has been installed successfully and is working fine as evident from the following output of example.cpp:
$ c++ /e/Working/SQL/MySQL/C++/Boost/Unix-Variants/example.cpp -o example \
> -I /e/Working/SQL/MySQL/C++/Boost/Unix-Variants/boost_1_63_0 \
> /e/Working/SQL/MySQL/C++/Boost/Unix-Variants/boost_1_63_0/Boost-Build/boost/bin.v2/libs/regex/build/gcc-mingw-5.1.0/release/link-static/threading-multi/libboost_regex-mgw51-mt-1_63.a
$ ./example.exe < /e/Working/SQL/MySQL/C++/Boost/Unix-Variants/jayne.txt
Will Success Spoil Rock Hunter?
Part 2 of the Question:
Also, tried in vain the GCC C++/G++ [NOT VC++] connect to MySQL on Windows 8.1 (MinGW/Cygwin) as in the Getting Started with Connector/C++: Usage Examples - Example1:
$ g++ -o Example1 Example1.cpp \
> -I /e/Working/SQL/MySQL/C++/Boost/Unix-Variants/boost_1_63_0 \
> -I/e/Working/SQL/MySQL/C++/mysql-connector-c++-noinstall-1.1.8-winx64/include \
> -I/e/Working/SQL/MySQL/C++/mysql-connector-c++-noinstall-1.1.8-winx64/include/cppconn \
> -L/e/Working/SQL/MySQL/C++/mysql-connector-c++-noinstall-1.1.8-winx64/lib/mysqlcppconn
C:\Users\Aspire\AppData\Local\Temp\ccDVNizG.o:Example1.cpp:(.text+0x4f): undefined reference to `__imp_get_driver_instance'
collect2.exe: error: ld returned 1 exit status
Please help explain the error: undefined reference to `__imp_get_driver_instance', although perhaps the wrong library (format) mysqlcppconn.lib (mysql-connector-c++-noinstall-1.1.8-winx64) linked while compiling, and possibly help resolve this error.
This question already has an answer here:
CMake - set_property could not find CACHE variable
(1 answer)
Closed 6 years ago.
cmakelist.txt
cmake_minimum_required(VERSION 3.7)
project(multithreading)
# Find ITK.
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
FIND_PACKAGE( OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS “${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}”)
set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}“)
set(CMAKE_EXE_LINKER_FLAGS “${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}”)
endif()
add_executable(multithreading multithreading.cpp )
target_link_libraries(multithreading ${ITK_LIBRARIES})
TARGET_LINK_LIBRARIES(multithreading ${OpenMP_CXX_LIBRARIES})
And then I change default compiler which is AppleClang to gcc-6.2.0, and then cmake
,all openmp flags find, and configure is fine.
cmake -DCMAKE_C_COMPILER=/usr/local/gcc-6.2.0/bin/gcc-6.2.0 -DCMAKE_CXX_COMPILER=/usr/local/gcc-6.2.0/bin/g++-6.2.0 ./
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/local/gcc-6.2.0/bin/gcc-6.2.0
-- Check for working C compiler: /usr/local/gcc-6.2.0/bin/gcc-6.2.0 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/gcc-6.2.0/bin/g++-6.2.0
-- Check for working CXX compiler: /usr/local/gcc-6.2.0/bin/g++-6.2.0 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
OPENMP FOUND
-- Configuring done
-- Generating done
then next when I do ‘make’ it shows me
canning dependencies of target multithreading
[ 50%] Building CXX object CMakeFiles/multithreading.dir/multithreading.cpp.o
g++-6.2.0: error: “: No such file or directory
g++-6.2.0: fatal error: no input files
compilation terminated.
/bin/sh: -fopenmp“: command not found
make[2]: *** [CMakeFiles/multithreading.dir/multithreading.cpp.o] Error 127
make[1]: *** [CMakeFiles/multithreading.dir/all] Error 2
make: *** [all] Error 2
If I do g++ -fopenmp myproject.cpp it will not link ITK Library
g++ -fopenmp multithreading.cpp
multithreading.cpp:4:44: fatal error: itkRescaleIntensityImageFilter.h: No such file or directory
#include "itkRescaleIntensityImageFilter.h"
^
compilation terminated.
So I am wondering how can I fix that issue, so use itk and openmp as library at the same time.
You're using language/locale-specific double quotes. Most programming languages don't support these, including CMake. Use the "normal" double quotes: "
I am trying to compile my project with CMake which includes the Ceres Solver library. I'm using macOS Sierra with Xcode 8.1 dev tools.
I installed the library with Homebrew (brew install ceres-solver). I downloaded and tested the binary manually (http://ceres-solver.org/building.html#mac-os-x), and that works just fine. But I can't include it in my own project because it can't seem to find Eigen. Here is a complete example:
ceres-test/CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)
project(CeresTest)
find_package(ceres REQUIRED)
add_executable(
TestCeres
src/test_ceres.cpp
)
target_link_libraries(
TestCeres
ceres
)
ceres-test/src/test_ceres.cpp
#include <iostream>
#include "ceres/ceres.h"
int main(int argc, char** argv) {
std::cout << "Works." << std::endl;
return 0;
}
How I compile it:
mkdir build
cd build
cmake ..
make
Full output:
me: ceres-test $ mkdir build
me: ceres-test $ cd build/
cmake
me: build $ cmake ..
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found required Ceres dependency: Eigen version 3.2.10 in /usr/local/include/eigen3
-- Found required Ceres dependency: Glog in /usr/local/include
-- Found Ceres version: 1.11.0 installed in: /usr/local
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/me/Tests/ceres-test/build
make
me: build $ make
Scanning dependencies of target TestCeres
[ 50%] Building CXX object CMakeFiles/TestCeres.dir/src/test_ceres.cpp.o
In file included from /Users/me/Tests/ceres-test/src/test_ceres.cpp:3:
In file included from /usr/local/include/ceres/ceres.h:37:
In file included from /usr/local/include/ceres/autodiff_cost_function.h:132:
In file included from /usr/local/include/ceres/internal/autodiff.h:145:
/usr/local/include/ceres/jet.h:165:10: fatal error: 'Eigen/Core' file not found
#include "Eigen/Core"
^
1 error generated.
make[2]: *** [CMakeFiles/TestCeres.dir/src/test_ceres.cpp.o] Error 1
make[1]: *** [CMakeFiles/TestCeres.dir/all] Error 2
make: *** [all] Error 2
I have no idea how to resolve this. None of the solutions I found online helped. CMake seems to be finding the Eigen library just fine, so I'm not sure how to add it in.
On a side note I cannot include "Eigen/Core" directly either, but the tests that I was able to compile do include it and those are fine. I'm not familiar how to deal with these kinds of problems with CMake.
Edit: I can get it to compile if I include it as "eigen3/Eigen/Core" but I can't change the source code for Ceres.
Fixed with
include_directories(${EIGEN_INCLUDE_DIR})
in the CMakeLists....
For my mac mini m1.
I found the eigen library through
brew link --overwrite eigen.
It's located on
/opt/homebrew/Cellar/eigen/3.4.0_1/include/eigen3
I have create a project that uses Cmake and Coin3D libraries: https://github.com/tuxdna/phyloviz
I am getting a fatal error: Inventor/Qt/SoQt.h: No such file or directory. This is what I am doing:
$ sudo yum install cmake SoQt-devel
$ cd path/to/phyloviz
[phyloviz] $ mkdir build
[phyloviz] $ cd build/
[phyloviz/build] $ cmake ../ -DCOIN3D_INCLUDE_DIRS=/usr/include/Coin2/
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /bin/pkg-config (found version "0.28")
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /bin/qmake-qt4 (found version "4.8.5")
-- Found Coin3D: /usr/lib64/libCoin.so
-- Configuring done
-- Generating done
-- Build files have been written to: .../phyloviz/build
Now lets compile the code
[phyloviz/build] $ make
Scanning dependencies of target ev-iv
[ 50%] Building CXX object CMakeFiles/ev-iv.dir/src/ev-iv/ev-iv.cc.o
.../phyloviz/src/ev-iv/ev-iv.cc:1:30: fatal error: Inventor/Qt/SoQt.h: No such file or directory
#include <Inventor/Qt/SoQt.h>
^
compilation terminated.
make[2]: *** [CMakeFiles/ev-iv.dir/src/ev-iv/ev-iv.cc.o] Error 1
make[1]: *** [CMakeFiles/ev-iv.dir/all] Error 2
make: *** [all] Error 2
[phyloviz/build]$
Even though I have specified the include directory using cmake ../ -DCOIN3D_INCLUDE_DIRS=/usr/include/Coin2/, I am getting the fatal error above.
This works fine on Ubuntu 14.04. How can I resolve this?