mychem / mychem-code

Mychem is an extension for MySQL that makes possible to use cheminformatics functions within SQL queries.
GNU General Public License v2.0
21 stars 14 forks source link

CMake failing - MYSQL_LIBRARIES_atomic NOTFOUND #30

Closed paulo-maia closed 3 years ago

paulo-maia commented 3 years ago

Hi and thanks for mychem,

I'm having problems in Ubuntu 18.04 LTS, CMake is failing with:

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.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
-- The build type is RelWithDebInfo
-- Test module disabled
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- WARNING: you are using the obsolete 'PKGCONFIG' macro, use FindPkgConfig
-- OPENBABEL_MINI_FOUND <TRUE>
-- Found OpenBabel2: /usr/lib/libopenbabel.so
-- Open Babel Exe: /usr/bin/babel
-- Using mysql-config: /usr/bin/mysql_config
-- MySQL Version: 5.7.34
-- MySQL Plugin Dir: /usr/lib/mysql/plugin
-- Found MySQL 5.7.34: /usr/include/mysql, /usr/lib/x86_64-linux-gnu/libmysqlclient.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/librt.so;MYSQL_LIBRARIES_atomic-NOTFOUND;/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;/usr/lib/x86_64-linux-gnu/libdl.so
-- Mychem installation directory: /usr/lib/mysql/plugin
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for stdio.h
-- Looking for stdio.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for C++ include sstream
-- Looking for C++ include sstream - found
-- Defining dlhandler source files
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:
MYSQL_LIBRARIES_atomic
    linked by target "mychem-lib" in directory xxx/mychem-code-1.0.1/src
    linked by target "molmatch_test" in directory xxx/mychem-code-1.0.1/tests
    linked by target "property_test" in directory xxx/mychem-code-1.0.1/tests
    linked by target "conversion_test" in directory xxx/mychem-code-1.0.1/tests
    linked by target "helper_test" in directory /xxx/mychem-code-1.0.1/tests
    linked by target "modification_test" in directoryxxx/mychem-code-1.0.1/tests

It seems FindMySQL.cmake is unable to locate the atomic lib. The output from mysql_config is

Usage: /usr/bin/mysql_config [OPTIONS]
Compiler: GNU 7.5.0
Options:
        --cflags         [-I/usr/include/mysql ]
        --cxxflags       [-I/usr/include/mysql ]
        --include        [-I/usr/include/mysql]
        --libs           [-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl]
        --libs_r         [-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl]
        --plugindir      [/usr/lib/mysql/plugin]
        --socket         [/var/run/mysqld/mysqld.sock]
        --port           [0]
        --version        [5.7.34]
        --libmysqld-libs [-L/usr/lib/x86_64-linux-gnu -lmysqld -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -lcrypt -laio -llz4 -lnuma]
        --variable=VAR   VAR is one of:
                pkgincludedir [/usr/include/mysql]
                pkglibdir     [/usr/lib/x86_64-linux-gnu]
                plugindir     [/usr/lib/mysql/plugin]

Any idea about what might be happening? Any help is welcome. Kind regards

Pansanel commented 3 years ago

Hi, Are you using a tagged release, like https://github.com/mychem/mychem-code/releases/tag/1.0.1 or are you compiling directly the master branch? Can you give me the output of mysql_config --libs? Best, Jerome

paulo-maia commented 3 years ago

Hi Jerome,

I tried both the tagged release (1.0.1) and cloning the master branch. Both result in the same error. The output of mysql_config --libs is:

-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl

Best, Paulo

paulo-maia commented 3 years ago

Hi Jerome @Pansanel ,

Any update on this? Any recommendation?

KR, Paulo

paulo-maia commented 3 years ago

Gave up on MySQL and installed MariaDB, working fine now.

paulo-maia commented 3 years ago

Hi @Pansanel ,

If you're interested, I found this patch that fixes this problem. It's rather simple but works perfectly https://github.com/maxbube/mydumper/pull/35/commits/ea90eab4c36268cd5b3f780887b80efcdc8699d7

KR, Paulo

Pansanel commented 2 years ago

Hi @paulo-maia,

I have added your fix into a larger development: https://github.com/Pansanel/mychem-code The code has been successfully tested on: Ubuntu 18.04 and CentOS 7. I will work now on OS with a more recent version of OpenBabel (>= v2.4.0).

Many thanks!

Jerome

paulo-maia commented 2 years ago

Thanks @Pansanel, those are great news! Will keep an eye on the project.