Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.1.7
-
None
-
Ubuntu 16.04 LTS
Description
The build is not finding mysql.h, and (I think) claims to find it on a directory that is not on my machine.
After unpacking the tarball to xxx, I create a build directory, and
cd build && cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCONC_WITH_UNIT_TESTS=Off \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DWITH_SSL=OPENSSL
Re-run cmake no build system arguments
– Libraries installation dir: lib
– Autentication Plugins installation dir: lib/mariadb/plugin
^^^ spelling error
– Configuring to build with OpenSSL /usr/local/lib/libssl.so;/usr/local/lib/lib
– There is no Connector/C sub-project folder, linking against libmariadb instal
– Found odbc_config: /usr/local/bin/odbc_config
– Found ODBC Driver Manager libraries: /home/ilan/minonda/envs/_build/lib
^^^ not found: no such directory
– Checking if SQLColAttribute expects SQLPOINTER FALSE
– Linking Connector/C library statically(mariadbclient)
– Version script: /home/jklowden/projects/Symas/sql/maria-db/mariadb-connector-
– Documetnation installed to ./share/doc/mariadb-connector-odbc/
^^^^ spelling error
[...]
The eventual compilation error is:
{{In file included from [...]/maria-db/mariadb-connector-odbc-3.1.7-ga-src/odbc_3_api.c:21:0:
[...]/maria-db/mariadb-connector-odbc-3.1.7-ga-src/ma_odbc.h:32:19: fatal error: mysql.h: No such file or directory
}}
Notes:
- mariadb server is not installed on this machine; it's only a client.
- The ODBC driver is the only mariadb component I am building from source.
- I did install the ubuntu package` libmariadb-client-lgpl-dev`
- I am building from source because Ubuntu does not include the ODBC driver in their repositories and, afaict, neither does mariadb for x86_64. (I found amd64.)
- I tried adding `-DCMAKE_INCLUDE_PATH=/usr/include/mariadb` to the cmake command line, with no joy.
- IMHO it would be kind of the ODBC driver folks to include mysql.h, if that's all they need, in case it's not found.
The file I want to include is
{{$ find /usr/include/ -name mysql.h
/usr/include/mariadb/mysql.h}}
Thank you for your report - I've already fixed the typos you've pointed at.
Could you please run odbc_config --lib-prefix
I guess it will show you the mysterious /home/ilan/minonda/envs/_build/lib in its output. C/ODBC cmake script just trusts odbc_config, and assumes libs are there.
You can try to reinstall UnixODBC to fix that. If that is not an option or does not help, them you may try to remove/hide odbc_config, and see if cmake finds driver manager's libs and includes. If that does not work either, then you can provide ODBC_LIB_DIR and ODBC_INCLUDE_DIR in cmake command line parameters, i.e. smth like cmake -DODBC_INCLUDE_DIR=/path/to/odbc/includes -DODBC_LIB_DIR=/path/to/odbc/libs codbcsourcedir
obdc_config has to be still hidden for that to work. in the new release command line parameters will have priority over odbc_config. But not in the release you have on hands. Or you can use git repository checkout.
Now, mysql.h. cmake does not look for it at all, since the main build method is from git repository checkout, and C/C is there as a submodule, and everything required for the build is picked automatically. For build from source package, if headers could not be found automatically, you need to point to their location. Something like
cmake -DCMAKE_C_FLAGS_RELWITHDEBINFO="-I/usr/linclude/mariadb"
And if you also later face linking issues, you may also need to add "-L/path/to/dirwithlib"