[MDEV-8128] cmake fails to detect boost libraries Created: 2015-05-10  Updated: 2020-05-11  Resolved: 2015-06-17

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - OQGRAPH
Affects Version/s: 10.0.19
Fix Version/s: 10.0.20

Type: Bug Priority: Major
Reporter: Bernard Spil Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

FreeBSD 10.1 amd64


Sprint: 10.0.20

 Description   

When building MariaDB 10.0.19 (as well as 10.0.17, 10.0.18 and possibly earlier) cmake fails to pick up the installed boost libraries.

# cmake . -LAH
-- Running cmake version 3.1.3
-- MariaDB 10.0.19
-- Packaging as: mariadb-10.0.19-FreeBSD10.1-x86_64
getconf: no such configuration parameter `LEVEL1_DCACHE_LINESIZE'
-- suffixes <.so;.a>
-- OPENSSL_INCLUDE_DIR = /usr/local/include
-- OPENSSL_LIBRARIES = /usr/local/lib/libssl.so
-- CRYPTO_LIBRARY = /usr/local/lib/libcrypto.so
-- OPENSSL_MAJOR_VERSION = 1
-- SSL_LIBRARIES = /usr/local/lib/libssl.so;/usr/local/lib/libcrypto.so
-- Configuring OQGraph
-- Boost version: 1.55.0
-- Requisites for OQGraph not met. OQGraph will not be compiled

When I add LDFLAGS and CXXFLAGS cmake starts detecting Boost OK and reports Requisites for OQGraph are OK but then fails to compile storage/perfschema/pfs.cc

/usr/ports/databases/mariadb100-server/work/mariadb-10.0.19/storage/perfschema/pfs.cc:5285:3: error: cannot initialize
       a member subobject of type 'digest_add_token_v1_t' (aka 'struct PSI_digest_locker *(*)(struct PSI_digest_locker
       *, uint, struct OPAQUE_LEX_YYSTYPE *)') with an lvalue of type 'void (PSI_digest_locker *, const
       sql_digest_storage *)': different number of parameters (3 vs 2)
   pfs_digest_end_v1,



 Comments   
Comment by Bernard Spil [ 2015-05-10 ]

At least I've fixed the Boost detection problem... Thanks to ngladitz on #cmake@Freenode

--- storage/oqgraph/CMakeLists.txt.orig	2015-05-08 14:37:46 UTC
+++ storage/oqgraph/CMakeLists.txt
@@ -24,6 +24,8 @@ IF(MSVC)
 #  ENDIF()
 ELSE()
 # See if that works. On old gcc it'll fail because of -fno-rtti
+SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
+SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${Boost_INCLUDES_DIRS}")
 CHECK_CXX_SOURCE_COMPILES(
 "
 #define BOOST_NO_RTTI 1
@@ -32,6 +34,7 @@ CHECK_CXX_SOURCE_COMPILES(
 #include <boost/property_map/property_map.hpp>
 int main() { return 0; }
 " BOOST_OK)
+SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
 ENDIF()
 
 IF(BOOST_OK)

Now back to failing with

[ 21%] Building CXX object storage/perfschema/CMakeFiles/perfschema.dir/pfs.cc.o
/usr/ports/databases/mariadb100-server/work/mariadb-10.0.19/storage/perfschema/pfs.cc:4511:10: error: no member named 'm_digest' in
      'PSI_statement_locker_state_v1'
  state->m_digest= NULL;
  ~~~~~  ^
/usr/ports/databases/mariadb100-server/work/mariadb-10.0.19/storage/perfschema/pfs.cc:4799:30: error: no member named 'm_digest' in
      'PSI_statement_locker_state_v1'
      digest_storage= state->m_digest;
                      ~~~~~  ^
/usr/ports/databases/mariadb100-server/work/mariadb-10.0.19/storage/perfschema/pfs.cc:4875:32: error: no member named 'm_digest' in
      'PSI_statement_locker_state_v1'
        digest_storage= state->m_digest;
                        ~~~~~  ^
/usr/ports/databases/mariadb100-server/work/mariadb-10.0.19/storage/perfschema/pfs.cc:5145:22: error: no member named 'm_digest' in
      'PSI_statement_locker_state_v1'
    statement_state->m_digest= digest;
    ~~~~~~~~~~~~~~~  ^
/usr/ports/databases/mariadb100-server/work/mariadb-10.0.19/storage/perfschema/pfs.cc:5285:3: error: cannot initialize a member
      subobject of type 'digest_add_token_v1_t' (aka 'struct PSI_digest_locker *(*)(struct PSI_digest_locker *, uint, struct
      OPAQUE_LEX_YYSTYPE *)') with an lvalue of type 'void (PSI_digest_locker *, const sql_digest_storage *)': different number of
      parameters (3 vs 2)
  pfs_digest_end_v1,
  ^~~~~~~~~~~~~~~~~
5 errors generated.
storage/perfschema/CMakeFiles/perfschema.dir/build.make:169: recipe for target 'storage/perfschema/CMakeFiles/perfschema.dir/pfs.cc.o
' failed

Comment by Sergei Golubchik [ 2015-06-17 ]

I'll fix boost detection, but oqgraph still won't compile with clang.

Generated at Thu Feb 08 07:24:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.