C++/Cmake - Unable to compile MySQL Connector - c++

This is what I do:
git clone https://github.com/mysql/mysql-connector-cpp.git
Than I do:
cd mysql-connector-cpp
git checkout 8.0
cmake .
And than I receive the following output:
-- 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
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
Building version 8.0.26
Building on system: Linux-5.11.0-27-generic (x86_64)
Using cmake generator: Unix Makefiles
Using toolset:
Building 64bit code
Building shared connector library
Configuring CDK as part of MySQL_CONCPP project
-- Looking for SSL library.
CMake Error at cdk/cmake/DepFindSSL.cmake:79 (message):
Cannot find appropriate system libraries for SSL. Make sure you've
specified a supported SSL version. Consult the documentation for WITH_SSL
alternatives
Call Stack (most recent call first):
cdk/cmake/DepFindSSL.cmake:354 (main)
cdk/cmake/dependency.cmake:42 (include)
cdk/CMakeLists.txt:96 (find_dependency)
-- Setting up Protobuf.
==== Configuring Protobuf build using cmake generator: Unix Makefiles -DCMAKE_SYSTEM_NAME=Linux;-DCMAKE_SYSTEM_VERSION=5.11.0-27-generic
-- 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
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
-- 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
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/armegon/mysql-connector-cpp/cdk/protobuf
==== Protobuf build configured.
Processor Count: 8
-- Setting up RapidJSON.
Skipping second declaration of config option: THROW_AS_ASSERT (found in: /home/armegon/mysql-connector-cpp/cdk/CMakeLists.txt)
-- Performing Test HAVE_STATIC_ASSERT
-- Performing Test HAVE_STATIC_ASSERT - Success
-- Performing Test HAVE_IS_SAME
-- Performing Test HAVE_IS_SAME - Failed
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- ZSTD_LEGACY_SUPPORT not defined!
-- Performing Test HAVE_SHARED_PTR
-- Performing Test HAVE_SHARED_PTR - Success
-- Performing Test HAVE_SYSTEM_ERROR
-- Performing Test HAVE_SYSTEM_ERROR - Success
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Looking for sys/endian.h
-- Looking for sys/endian.h - not found
-- Looking for sys/byteorder.h
-- Looking for sys/byteorder.h - not found
Wrote configuration header: /home/armegon/mysql-connector-cpp/cdk/include/mysql/cdk/config.h
Preparing to merge SHARED library: connector (xapi;devapi)
Connector library name: mysqlcppconn8
Building version 8.0.26
Generating INFO_SRC
Generating INFO_BIN
Install location: /usr/local/mysql/connector-c++-
Connector libraries will be installed at: lib64
Project configuration options:
: BUILD_STATIC: OFF
Build static version of connector library
: WITH_SSL: system
Either 'system' to use system-wide OpenSSL library, or custom OpenSSL location. (default : system)
: WITH_JDBC: OFF
Whether to build a variant of connector library which implements legacy JDBC API
-- Configuring incomplete, errors occurred!
See also "/home/armegon/mysql-connector-cpp/CMakeFiles/CMakeOutput.log".
See also "/home/armegon/mysql-connector-cpp/CMakeFiles/CMakeError.log".
The content of CMakeOutput.log is here and the content of CMakeError.log is here.
Any idea how can I fix this issue ?

Never, ever do an in-source build. cmake . is always wrong. It even says so in the MySQL documentation: https://dev.mysql.com/doc/connector-cpp/8.0/en/connector-cpp-installation-source-cpp.html
This worked for me:
$ git clone --depth 1 --branch 8.0 https://github.com/mysql/mysql-connector-cpp.git
$ cmake -G "Unix Makefiles" -S mysql-connector-cpp -B mysql-connector-cpp-build -DCMAKE_BUILD_TYPE=Release
$ cmake --build mysql-connector-cpp-build
It also looks like you're missing the SSL dependency. If you're running a Debian derivative (Ubuntu, Mint), you can install this with:
$ sudo apt install libssl-dev

Related

How do I find the path of CUDA on linux?

I have pytorch installed and working no problem, making use of the GPU. While trying to install Libtorch, I kept getting errors like:
CUDA_TOOLKIT_ROOT_DIR not found or specified
I can't find where this path is. I will edit the post with the output of commands.
CMake error:
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 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
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY)
Caffe2: CUDA cannot be found. Depending on whether you are building Caffe2
or a Caffe2 dependent library, the next warning / error will give you more
info
output of sudo find / |grep nvcc:
/usr/local/share/cmake-3.24/Modules/FindCUDA/run_nvcc.cmake
/usr/local/boost_1_80_0/boost/predef/compiler/nvcc.h
/usr/local/boost_1_80_0/boost/config/compiler/nvcc.hpp
/usr/share/cmake-3.16/Modules/FindCUDA/run_nvcc.cmake
/usr/include/boost/predef/compiler/nvcc.h
/usr/include/boost/config/compiler/nvcc.hpp
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
find: ‘/run/user/125/gvfs’: Permission denied
/home/xxx/.local/share/Trash/files/libtorch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
/home/xxx/.local/share/xmake/modules/core/tools/nvcc.lua
/home/xxx/.local/share/xmake/modules/detect/tools/find_nvcc.lua
/home/xxx/.local/share/xmake/modules/detect/tools/nvcc
/home/xxx/.local/share/xmake/modules/detect/tools/nvcc/has_flags.lua
/home/xxx/Documents/xxx/mongo/env/lib/python3.8/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
/home/xxx/Documents/pytorch/libtorch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
/home/xxx/Documents/mongo/env/lib/python3.8/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
/home/xxx/Documents/xxx/xx/env/lib/python3.8/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
find: ‘/home/midas/mydrive’: Permission denied
/home/xxx/git/xxx-projects/xx/Script/env/lib/python3.8/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
/home/xxx/git/midas-engine/cicd-venv/lib/python3.8/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
/home/xxx/git/xxx-xx/venv/lib/python3.8/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
/var/lib/docker/overlay2/<large-string>/diff/usr/local/lib/python3.8/dist-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
/var/lib/docker/overlay2/<large-string>/diff/usr/local/lib/python3.8/dist-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake

Undefined reference to `mysqlx::abi2::r0::Schema::Schema(mysqlx ::abi2::r0::Session&)'

I had a problem when linking to mysqlcppconn (version 8.0.30) (similar to the issue described here).
Here is my code:
mysqlx::Session sess2("localhost", 33060,
"root", "test",
"postManufDB");
Schema mySchema(sess2);
CMakeLists.txt (used to compile my app):
cmake_minimum_required(VERSION 3.5)
project(PostManuf VERSION 0.1 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CPP_CON_VERSION_MAJOR 8)
set(CPP_CON_LIB mysqlcppconn${CPP_CON_VERSION_MAJOR})
set(FULL_PATH_TO_MYSQL_CONNECTOR_CPP_DIR "/usr/local/mysql/connector-c++-8.0.30")
set(CPP_CON_LIB_INC ${FULL_PATH_TO_MYSQL_CONNECTOR_CPP_DIR}/include/)
set(CPP_CON_LIB_LINK ${FULL_PATH_TO_MYSQL_CONNECTOR_CPP_DIR}/lib64/debug/)
include_directories(${CPP_CON_LIB_INC})
link_directories(${CPP_CON_LIB_LINK})
set(PROJECT_SOURCES
main.cpp
mainwindow.cpp
mainwindow.h
)
add_executable(PostManuf ${PROJECT_SOURCES})
target_link_libraries(PostManuf PRIVATE ${CPP_CON_LIB})
Error:
mainwindow.cpp:(.text+0x3ab6): undefined reference to `mysqlx::abi2::r0::Schema::Schema(mysqlx
::abi2::r0::Session&)'
collect2: error: ld returned 1 exit status
Steps I've followed:
Download mysqlcppconn binaries and used it for development
Compiled mysqlcppconn binary from source and linked to it
Added add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) to CMakeLists.txt, but
then I have a lot more errors:
mainwindow.cpp:(.text+0x3bb2): undefined reference to `mysqlx::abi2::r0::Schema::Schema(mysqlx
::abi2::r0::Session&)'
/usr/bin/ld: CMakeFiles/PostManuf.dir/mainwindow.cpp.o: in function `mysqlx::abi2::r0::string:
:traits<char>::from_str(mysqlx::abi2::r0::string&, std::string const&)':
mainwindow.cpp:(.text._ZN6mysqlx4abi22r06string6traitsIcE8from_strERS2_RKSs[_ZN6mysqlx4abi22r0
6string6traitsIcE8from_strERS2_RKSs]+0x23): undefined reference to `mysqlx::abi2::r0::string::
Impl::from_utf8(mysqlx::abi2::r0::string&, std::string const&)'
/usr/bin/ld: CMakeFiles/PostManuf.dir/mainwindow.cpp.o: in function `void mysqlx::abi2::r0::in
ternal::Settings_detail<mysqlx::abi2::r0::internal::Settings_traits>::set<true, mysqlx::abi2::
r0::SessionOption, std::string const&, mysqlx::abi2::r0::SessionOption::Enum, unsigned int&, m
ysqlx::abi2::r0::SessionOption::Enum, mysqlx::abi2::r0::string const&>(mysqlx::abi2::r0::Sessi
onOption, std::string const&, mysqlx::abi2::r0::SessionOption::Enum&&, unsigned int&, mysqlx::
abi2::r0::SessionOption::Enum&&, mysqlx::abi2::r0::string const&)':
mainwindow.cpp:(.text._ZN6mysqlx4abi22r08internal15Settings_detailINS2_15Settings_traitsEE3set
ILb1ENS1_13SessionOptionEJRKSsNS7_4EnumERjSA_RKNS1_6stringEEEEvT0_DpOT1_[_ZN6mysqlx4abi22r08in
ternal15Settings_detailINS2_15Settings_traitsEE3setILb1ENS1_13SessionOptionEJRKSsNS7_4EnumERjS
A_RKNS1_6stringEEEEvT0_DpOT1_]+0xbc): undefined reference to `mysqlx::abi2::r0::internal::Sett
ings_detail<mysqlx::abi2::r0::internal::Settings_traits>::do_set(std::list<std::pair<int, mysq
lx::abi2::r0::Value>, std::allocator<std::pair<int, mysqlx::abi2::r0::Value> > >&&)'
/usr/bin/ld: CMakeFiles/PostManuf.dir/mainwindow.cpp.o: in function `void mysqlx::abi2::r0::in
ternal::Settings_detail<mysqlx::abi2::r0::internal::Settings_traits>::set<true, mysqlx::abi2::
r0::SessionOption, std::string>(mysqlx::abi2::r0::SessionOption, std::string&&)':
mainwindow.cpp:(.text._ZN6mysqlx4abi22r08internal15Settings_detailINS2_15Settings_traitsEE3set
ILb1ENS1_13SessionOptionEJSsEEEvT0_DpOT1_[_ZN6mysqlx4abi22r08internal15Settings_detailINS2_15S
ettings_traitsEE3setILb1ENS1_13SessionOptionEJSsEEEvT0_DpOT1_]+0x56): undefined reference to `
mysqlx::abi2::r0::internal::Settings_detail<mysqlx::abi2::r0::internal::Settings_traits>::do_s
et(std::list<std::pair<int, mysqlx::abi2::r0::Value>, std::allocator<std::pair<int, mysqlx::ab
i2::r0::Value> > >&&)'
/usr/bin/ld: CMakeFiles/PostManuf.dir/mainwindow.cpp.o: in function `void mysqlx::abi2::r0::in
ternal::Settings_detail<mysqlx::abi2::r0::internal::Settings_traits>::set<true, mysqlx::abi2::
r0::SessionOption, mysqlx::abi2::r0::string const&>(mysqlx::abi2::r0::SessionOption, mysqlx::a
bi2::r0::string const&)':
mainwindow.cpp:(.text._ZN6mysqlx4abi22r08internal15Settings_detailINS2_15Settings_traitsEE3set
ILb1ENS1_13SessionOptionEJRKNS1_6stringEEEEvT0_DpOT1_[_ZN6mysqlx4abi22r08internal15Settings_de
tailINS2_15Settings_traitsEE3setILb1ENS1_13SessionOptionEJRKNS1_6stringEEEEvT0_DpOT1_]+0x56):
undefined reference to `mysqlx::abi2::r0::internal::Settings_detail<mysqlx::abi2::r0::internal
::Settings_traits>::do_set(std::list<std::pair<int, mysqlx::abi2::r0::Value>, std::allocator<s
td::pair<int, mysqlx::abi2::r0::Value> > >&&)'
collect2: error: ld returned 1 exit status
I can run the application successfully when using more common classes (e.g. Session).
But when using Schema, I can't link.
CMake configuration to compile mysqlcppconn from source (contains compiler info):
=== Booststrap ===
-- generator: Unix Makefiles
-- build type: Debug
-- ----
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.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
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zmpl/tmp/mysql-connector-cpp/build/platform-cache
=== Booststrap done ===
-- Check if the system is big endian
-- Searching 16 bit integer
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
Building version 8.0.30
Building on system: Linux-5.15.0-46-generic (x86_64)
Using cmake generator: Unix Makefiles
Using toolset:
Building 64bit code
Building shared connector library
Configuring CDK as part of MySQL_CONCPP project
-- Looking for SSL library.
-- found OpenSSL headers at: /usr/include
-- OpenSSL library: /usr/lib/x86_64-linux-gnu/libssl.so
-- OpenSSL crypto library: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- Using OpenSSL version: 1.1.1f
-- Looking for SHA512_DIGEST_LENGTH
-- Looking for SHA512_DIGEST_LENGTH - found
-- Looking for X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS
-- Looking for X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS - found
-- Looking for SSL_get0_param
-- Looking for SSL_get0_param - found
-- Looking for X509_VERIFY_PARAM_set_hostflags
-- Looking for X509_VERIFY_PARAM_set_hostflags - found
-- Looking for X509_VERIFY_PARAM_set1_host
-- Looking for X509_VERIFY_PARAM_set1_host - found
-- found required X509 extensions
-- Setting up RapidJSON.
Skipping second declaration of config option: THROW_AS_ASSERT (found in: /home/zmpl/tmp/mysql-
connector-cpp/cdk/CMakeLists.txt)
-- Performing Test HAVE_STATIC_ASSERT
-- Performing Test HAVE_STATIC_ASSERT - Success
-- Performing Test HAVE_IS_SAME
-- Performing Test HAVE_IS_SAME - Failed
-- Performing Test HAVE_SHARED_PTR
-- Performing Test HAVE_SHARED_PTR - Success
-- Performing Test HAVE_SYSTEM_ERROR
-- Performing Test HAVE_SYSTEM_ERROR - Success
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Setting up Protobuf.
== configuring external build of protobuf
-- sources at: /home/zmpl/tmp/mysql-connector-cpp/cdk/extra/protobuf
-- generator: Unix Makefiles
-- option CMAKE_BUILD_TYPE: Debug
-- option CMAKE_SYSTEM_NAME: Linux
-- option CMAKE_SYSTEM_VERSION: 5.15.0-46-generic
-- option CMAKE_SYSTEM_PROCESSOR: x86_64
-- option CMAKE_C_COMPILER: /usr/bin/cc
-- option CMAKE_CXX_COMPILER: /usr/bin/c++
-- ----
Not searching for unused variables given on the command line.
-- Check if the system is big endian
-- Searching 16 bit integer
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
-- 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
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zmpl/tmp/mysql-connector-cpp/build/cdk/protocol/mys
qlx/protobuf
== done configuring external build of protobuf
-- Setting up compression libraries.
== configuring external build of zlib
-- sources at: /home/zmpl/tmp/mysql-connector-cpp/cdk/extra/zlib
-- generator: Unix Makefiles
-- option CMAKE_BUILD_TYPE: Debug
-- option CMAKE_SYSTEM_NAME: Linux
-- option CMAKE_SYSTEM_VERSION: 5.15.0-46-generic
-- option CMAKE_SYSTEM_PROCESSOR: x86_64
-- option CMAKE_C_COMPILER: /usr/bin/cc
-- option CMAKE_CXX_COMPILER: /usr/bin/c++
-- ----
Not searching for unused variables given on the command line.
-- Check if the system is big endian
-- Searching 16 bit integer
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zmpl/tmp/mysql-connector-cpp/build/cdk/protocol/mys
qlx/zlib
== done configuring external build of zlib
== configuring external build of lz4
-- sources at: /home/zmpl/tmp/mysql-connector-cpp/cdk/extra/lz4
-- generator: Unix Makefiles
-- option CMAKE_BUILD_TYPE: Debug
-- option CMAKE_SYSTEM_NAME: Linux
-- option CMAKE_SYSTEM_VERSION: 5.15.0-46-generic
-- option CMAKE_SYSTEM_PROCESSOR: x86_64
-- option CMAKE_C_COMPILER: /usr/bin/cc
-- option CMAKE_CXX_COMPILER: /usr/bin/c++
-- ----
Not searching for unused variables given on the command line.
-- Check if the system is big endian
-- Searching 16 bit integer
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zmpl/tmp/mysql-connector-cpp/build/cdk/protocol/mys
qlx/lz4
== done configuring external build of lz4
== configuring external build of zstd
-- sources at: /home/zmpl/tmp/mysql-connector-cpp/cdk/extra/zstd
-- generator: Unix Makefiles
-- option CMAKE_BUILD_TYPE: Debug
-- option CMAKE_SYSTEM_NAME: Linux
-- option CMAKE_SYSTEM_VERSION: 5.15.0-46-generic
-- option CMAKE_SYSTEM_PROCESSOR: x86_64
-- option CMAKE_C_COMPILER: /usr/bin/cc
-- option CMAKE_CXX_COMPILER: /usr/bin/c++
-- ----
Not searching for unused variables given on the command line.
-- Check if the system is big endian
-- Searching 16 bit integer
-- Using unsigned short
-- Check if the system is big endian - little endian
-- BIG_ENDIAN: 0
-- ZSTD_LEGACY_SUPPORT not defined!
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zmpl/tmp/mysql-connector-cpp/build/cdk/protocol/mys
qlx/zstd
== done configuring external build of zstd
-- Looking for sys/endian.h
-- Looking for sys/endian.h - not found
-- Looking for sys/byteorder.h
-- Looking for sys/byteorder.h - not found
Wrote configuration header: /home/zmpl/tmp/mysql-connector-cpp/build/cdk/include/mysql/cdk/con
fig.h
Preparing to merge SHARED library: connector (xapi;devapi)
Connector library name: mysqlcppconn8
Building version 8.0.30
Generating INFO_SRC
Generating INFO_BIN
Install location: /usr/local/mysql/connector-c++-8.0.30
Connector libraries will be installed at: lib64
Project configuration options:
: BUILD_STATIC: OFF
Build static version of connector library
: WITH_SSL: system
Either 'system' to use system-wide OpenSSL library, or custom OpenSSL location. (default : sys
tem)
: WITH_JDBC: OFF
Whether to build a variant of connector library which implements legacy JDBC API
-- Configuring done
-- Generating done

Cmake FindBoost error-POP without matching PUSH

I am trying to install LightGBM-gpu on Centos. It seems boost 1.56 can be find, but this error occurred.I google it all day but can not solve it.
Here is the Message
$ cmake -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda/lib64/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/local/cuda/include/ ..
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- 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
-- Found OpenMP_C: -fopenmp (found version "3.1")
-- Found OpenMP_CXX: -fopenmp (found version "3.1")
-- Looking for CL_VERSION_2_0
-- Looking for CL_VERSION_2_0 - not found
-- Looking for CL_VERSION_1_2
-- Looking for CL_VERSION_1_2 - found
-- Found OpenCL: /usr/local/cuda/lib64/libOpenCL.so (found version "1.2")
-- OpenCL include directory: /usr/local/cuda/include
Boost 1.56.0 found.
Found Boost components:
filesystem;system
CMake Error in /usr/local/share/cmake-3.9/Modules/FindBoost.cmake:
cmake_policy POP without matching PUSH
Call Stack (most recent call first):
CMakeLists.txt:144 (find_package)
-- Performing Test MM_PREFETCH
-- Performing Test MM_PREFETCH - Success
-- Using _mm_prefetch
-- Performing Test MM_MALLOC
-- Performing Test MM_MALLOC - Success
-- Using _mm_malloc
-- Configuring incomplete, errors occurred!
See also "/home/rd/LightGBM/build/CMakeFiles/CMakeOutput.log".
See also "/home/rd/LightGBM/build/CMakeFiles/CMakeError.log".
This question was cross-posted to the LightGBM issues page as microsoft/LightGBM#3613. The issue was solved there.
Updating CMake to at least version 3.14 fixes this issue.

GCC C++/G++ [NOT VC++] connect to MySQL on Windows 8.1 (MinGW/Cygwin) and Installing Connector/C++ from Source

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.

Artery( Veins extension ) example is not working

I do not have much experience with Omnet,I would like to know if I correctly running the command to run the example.
First when I type make Vanetza, I realized that COHDA_MK2_ROOT is missing, however, the Vanetza compiles without error:
mkdir extern/vanetza/build
cd extern/vanetza/build && cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.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
-- Boost version: 1.58.0
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- date_time
-- serialization
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- date_time
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- date_time
-- Found GeographicLib: /usr/local/include (found suitable version "1.46", minimum required is "1.37")
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- serialization
-- Found CryptoPP: /usr/include (found suitable version "5.6.1", minimum required is "5.6.1")
**-- Could NOT find Cohda (missing: COHDA_MK2_ROOT)**
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- Configuring done
-- Generating done
When I try to run the ./run command with root into the /artery/scenarios/artery, it returns:
./run: 2: ./run: ../../run: not found
When I try to run the opp_run command into the same folder, I can open the Omnet, however, the simulation does not run since the Scenario.ned is missing.
What can I do?
Those run scripts are obsolete by now. You can run simulations through the new run targets, i.e. the scenario from the scenarios/artery folder can be executed by the run_example target in your build directory.
If you have followed the build instructions in Artery's README then it looks like this:
cd build
make run_example
You can also start the simulation environment trough the debug_exampletarget if you have built with CMAKE_BUILD_TYPE set to "Debug",
PS: "Could NOT find Cohda (missing: COHDA_MK2_ROOT)" is not a severe error at all, it just informs about a build configuration without features requiring this optional dependency.