Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Try install lithium with cmake - Missing Mysql Lib #80

Open
marioidival opened this issue Jun 26, 2021 · 9 comments
Open

[BUG] Try install lithium with cmake - Missing Mysql Lib #80

marioidival opened this issue Jun 26, 2021 · 9 comments

Comments

@marioidival
Copy link

When I going to install lithium locally, I got an error on cmake command.

-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.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
X86 detected
CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find MYSQL (missing: MYSQL_LIBRARY MYSQL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindMYSQL.cmake:96 (find_package_handle_standard_args)
  CMakeLists.txt:12 (find_package)


-- Configuring incomplete, errors occurred!
@Burnett01
Copy link
Sponsor Contributor

Burnett01 commented Jun 30, 2021

Hello @marioidival, please make sure you are using the mariadb dev packages.
apt-get install libmariadb-dev mariadb-server

See: #29 (comment)

@marioidival
Copy link
Author

@Burnett01 thank you, I pass this error, but now I got this:
I have curl already installed but I don't know what package is boost.

X86 detected
MYSQL_INCLUDE_DIRS/usr/include/mariadb
/usr/lib/x86_64-linux-gnu/libmariadbclient.so
CMake Error at /usr/share/cmake-3.13/Modules/FindBoost.cmake:2100 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  CMakeLists.txt:13 (find_package)


CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.13/Modules/FindCURL.cmake:74 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:15 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/kakarotto/codes/lithium/CMakeFiles/CMakeOutput.log".

@marioidival
Copy link
Author

What's from POSTGRESQL I need install?

X86 detected
MYSQL_INCLUDE_DIRS/usr/include/mariadb
/usr/lib/x86_64-linux-gnu/libmariadbclient.so
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   context
--   thread
--   chrono
--   system
--   date_time
--   atomic
CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) (found
  version "11.12 (Debian 11.12-0+deb10u1)")
Call Stack (most recent call first):
  /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.13/Modules/FindPostgreSQL.cmake:175 (find_package_handle_standard_args)
  CMakeLists.txt:16 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/kakarotto/codes/lithium/CMakeFiles/CMakeOutput.log".
See also "/home/kakarotto/codes/lithium/CMakeFiles/CMakeError.log".

@Burnett01
Copy link
Sponsor Contributor

Burnett01 commented Jun 30, 2021

Hello @marioidival,

you can install the curl and boost packages with

apt-get install libboost-all-dev libcurl4-openssl-dev

and the postgresql packages with

apt-get install postgresql-server-dev-all libpq-dev

Also your compiler version GCC 8.3.x ist not supported. Please upgrade to G++ 9.3.x or a more recent version as described here #62 (comment)

Greetings, Steve

Sources: #15 and #62

@marioidival
Copy link
Author

marioidival commented Jun 30, 2021

strange, anyway, thank you for information!

☁  ~  cc --version                         
clang version 12.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@marioidival
Copy link
Author

make install -j 4

🤕

/usr/bin/ld: CMakeFiles/li_symbol_generator.dir/symbol/symbol_generator.cc.o: in function `std::filesystem::__cxx11::path::path<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::filesystem::__cxx11::path>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::filesystem::__cxx11::path::format)':
symbol_generator.cc:(.text._ZNSt10filesystem7__cxx114pathC2INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES1_EERKT_NS1_6formatE[_ZNSt10filesystem7__cxx114pathC2INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES1_EERKT_NS1_6formatE]+0x5b): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libraries/symbol/CMakeFiles/li_symbol_generator.dir/build.make:87: libraries/symbol/li_symbol_generator] Error 1
make[2]: Leaving directory '/home/kakarotto/codes/lithium'
make[1]: *** [CMakeFiles/Makefile2:893: libraries/symbol/CMakeFiles/li_symbol_generator.dir/all] Error 2
make[1]: Leaving directory '/home/kakarotto/codes/lithium'
make: *** [Makefile:144: all] Error 2

@Burnett01
Copy link
Sponsor Contributor

Hmm quite hard to tell what's causing the issue. I have been using Clang 9.0 hence I don't know if Clang 12 behaves differently.
The linker error message points to missing support for std::filesystem hence it indicates that maybe C++17 (std) is not supported in your dev environment?

@marioidival
Copy link
Author

@Burnett01 I already create c++17 code there :( It's strange

@matt-42
Copy link
Owner

matt-42 commented Jul 1, 2021

I never had this error but never tried clang 12. Did you try this ?
target_link_libraries(your_program stdc++fs)

Found this here: https://stackoverflow.com/questions/33149878/experimentalfilesystem-linker-error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants