Compile MariaDB errors occur (could not find GnuTLS, but it installed)

Viewed 5918
    cmake . -DCMAKE_INSTALL_PREFIX=/root/mariadb -DDEFAULT_CHARSET=utf8 -
DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -
DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -
DWITH_FEDERATED_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_USER=mariadb

Then errors:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find GnuTLS (missing: GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR) (Required is at least version "3.3.24") Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake/Modules/FindGnuTLS.cmake:61 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) libmariadb/CMakeLists.txt:291 (FIND_PACKAGE)

The below is my screenshot

enter image description here

3 Answers

Try installing gnutls-dev with the command:

sudo apt-get install gnutls-dev

have encountered the same Error :

Could NOT find GnuTLS (Required is at least version "3.3.24")

I have downgraded to v3.3.24 although having a newer , to avoid if the exact 3.3.24 is required, but the Error reoccurred ;

Installation of follow packages resolved the problem for me on CentOS 7 ;do not forget to remove CMakeCache.txt before rerunning cmake .

yum -y install libaio
yum -y install libaio-devel
yum -y install bison
yum -y install bison-devel
yum -y install zlib-devel
yum -y install openssl
yum -y install openssl-devel
yum -y install ncurses
yum -y install ncurses-devel
yum -y install libcurl-devel
yum -y install libarchive-devel
yum -y install boost
yum -y install boost-devel
yum -y install lsof
yum -y install wget
yum -y install gcc
yum -y install gcc-c++
yum -y install make
yum -y install cmake
yum -y install perl
yum -y install kernel-headers
yum -y install kernel-devel
yum -y install pcre-devel

I was able to work around some of these problems, but was ultimately unsuccessful building on centos 6.

mkdir build-mariadb; cd build-mariadb
cmake .. -DBUILD_CONFIG=mysql_release -DWITH_SSL=system

But this led to more problems during make:

CMakeFiles/CMakeError.log:cc1plus: 
error: unrecognized command line option "-std=gnu++11"

To resolve this, I added to the top of all CMakeLists.txt:

SET(CMAKE_CXX_FLAGS "-std=gnu++0x")

I used find to do this:

cd ..
find . -type f -name 'CMakeLists.txt' -exec sed -i '1iSET(CMAKE_CXX_FLAGS "-std=gnu++0x")' {} \+

I gave up trying to build External Atomics Library as per https://gcc.gnu.org/wiki/Atomic/GCCMM

The errors were:

undefined reference to `my_atomic_storeptr'
Related