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

MariaDB issue - Unable to build locally (in Docker) #115

Open
Mickael-van-der-Beek opened this issue Jun 21, 2022 · 2 comments
Open

MariaDB issue - Unable to build locally (in Docker) #115

Mickael-van-der-Beek opened this issue Jun 21, 2022 · 2 comments

Comments

@Mickael-van-der-Beek
Copy link

Hello,

I'm trying to setup a Docker image with lithium installed.

Here is the Dockerfile that I wrote:

FROM debian:stable-20220527-slim

RUN apt-get update -yqq \
	&& apt-get install -yqq curl zip unzip tar \
	&& apt-get install -yqq git gnupg cmake pkg-config \
	&& apt-get install -yqq g++-10 libboost-context-dev libboost-dev libcurl4-openssl-dev libssl-dev libpq-dev  \
	&& apt-get install -yqq postgresql-server-dev-all  \
  && ln -sv /usr/bin/g++-10 /usr/bin/g++

RUN apt-get install -yqq software-properties-common \
  && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 \
  && add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.netcologne.de/mariadb/repo/10.4/ubuntu bionic main' \
  && apt-get update -yqq \
  && apt-get remove -yqq libmysqlclient-dev mysql-server \
  && apt-get install -yqq libmariadb-dev mariadb-server

RUN mkdir -p /opt/app
WORKDIR /opt/app

RUN git clone --recursive https://github.com/matt-42/lithium.git

RUN mkdir -p ./lithium/build \
  && cd lithium \
  && ./vcpkg/bootstrap-vcpkg.sh \
  && ./vcpkg/vcpkg install

RUN cd lithium/build \
  && cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/opt/app/local \
  && make -j12 install

Even with a successfully installed MariaDB driver, I am getting the following error from CMake:

#12 6.812 CMake Error at CMakeLists.txt:25 (find_package):
#12 6.812   Could not find a package configuration file provided by
#12 6.812   "unofficial-libmariadb" with any of the following names:
#12 6.812 
#12 6.812     unofficial-libmariadbConfig.cmake
#12 6.812     unofficial-libmariadb-config.cmake
#12 6.812 
#12 6.812   Add the installation prefix of "unofficial-libmariadb" to CMAKE_PREFIX_PATH
#12 6.812   or set "unofficial-libmariadb_DIR" to a directory containing one of the
#12 6.812   above files.  If "unofficial-libmariadb" provides a separate development
#12 6.812   package or SDK, be sure it has been installed.
#12 6.812 
#12 6.812 
#12 6.813 -- Configuring incomplete, errors occurred!
#12 6.813 See also "/opt/app/lithium/build/CMakeFiles/CMakeOutput.log".
#12 6.813 See also "/opt/app/lithium/build/CMakeFiles/CMakeError.log".

Is there any way to fix it or to completely disable certain databases from being included in the build?

Thank you very much in advance.

@jmafc
Copy link

jmafc commented Sep 7, 2022

Is there any way ... to completely disable certain databases from being included in the build?

That is exactly what I wanted to know. I'm building on Debian, not docker and when I hit the "unofficial-libmariadb" problem, I simply edited the CMakeLists.txt to comment out those lines, as well as the "unofficial-sqlite3" lines. That allowed me to get past the cmake configuration step, but then compilation stopped with

In file included from include/li/sql/mysql.hh:3:
include/li/sql/mysql_database.hh:12:10: fatal error: 'mysql.h' file not found
#include <mysql.h>

This occurs during compilation of test programs and also docs/sql.cc. I would think that compilation of what I presume are optional dependencies ought to be bypassed based on what is actually installed in a given environment.

To check further, I installed the libmariadb-dev package (I already had mariadb server/client), and that added /usr/include/mariadb/mysql.h, and even added a find_package(MYSQL REQUIRED), but it still couldn't find the file.

@wuhanhui
Copy link

wuhanhui commented Sep 24, 2022

I am on manjaro linux and have the same problem with unofficial-libmariadb not found. I have alread installed mariadb and mariadb libs

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