Skip to contentSkip to conversation

configure does not detect librados or librbd since the switch to meson

DISCUSSION Peter Lieven 2 participants 6 messages Jan 25, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

Hi,

on Dedian / Ubuntu configure does no longer detect librbd / librados since the switch to meson.

I need to add dirs: ['/usr/lib'] to the cc.find_library for librados and librbd. But I am not familiar with meson

and can't say if thats the appropriate fix.

I would be thankful for a hint. I would create a patch to fix this and include it upfront of my rbd driver rewrite

that I would like to respin asap.

Peter

#1 lore raw

Am 25.01.21 um 15:13 schrieb Peter Lieven:

Quoted 5 lines

Hi,

on Dedian / Ubuntu configure does no longer detect librbd / librados since the switch to meson.

Quoted 8 lines

I need to add dirs: ['/usr/lib'] to the cc.find_library for librados and librbd. But I am not familiar with meson

and can't say if thats the appropriate fix.

I would be thankful for a hint. I would create a patch to fix this and include it upfront of my rbd driver rewrite

that I would like to respin asap.

Further issue: if I specify configure --enable-rbd and cc.links fails the configure command succeeds and rbd support is disabled.

This seems to be an issue with all cc.links calls in the meson.build script.

Peter

#2 lore raw
Quoted 7 lines · Peter Lieven

on Dedian / Ubuntu configure does no longer detect librbd / librados since the switch to meson.

I need to add dirs: ['/usr/lib'] to the cc.find_library for librados and librbd. But I am not familiar with meson

and can't say if thats the appropriate fix.

Can you include the meson-logs/meson-log.txt output?

Quoted 2 lines

Further issue: if I specify configure --enable-rbd and cc.links fails the configure command succeeds and rbd support is disabled.

That's a separate bug.

Paolo

#3 lore raw

Am 25.01.21 um 16:24 schrieb Paolo Bonzini:

Quoted 10 lines · Peter Lieven
Quoted 7 lines

on Dedian / Ubuntu configure does no longer detect librbd / librados since the switch to meson.

I need to add dirs: ['/usr/lib'] to the cc.find_library for librados and librbd. But I am not familiar with meson

and can't say if thats the appropriate fix.

Can you include the meson-logs/meson-log.txt output?

Sure: https://pastebin.com/u3XtbDvQ

Quoted 5 lines
Quoted 3 lines

Further issue: if I specify configure --enable-rbd and cc.links fails the configure command succeeds and rbd support is disabled.

That's a separate bug.

For the rbd check I can address this as well in the series. Sadly, librbd has no pkg-config (yet). So, I have to create a C file that checks for the version.

Peter

#4 lore raw
Quoted 3 lines · Peter Lieven
Quoted 1 line

Can you include the meson-logs/meson-log.txt output?

Sure:https://pastebin.com/u3XtbDvQ

Does this work for you?

meson.build +8 -2
index 690d48a6fd..a662772c4a 100644
@@ -14,6 +14,9 @@ config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
 enable_modules = 'CONFIG_MODULES' in config_host
 enable_static = 'CONFIG_STATIC' in config_host
 
+# Allow both shared and static libraries unless --enable-static
+static_kwargs = enable_static ? {'static': true} : {}
+
 # Temporary directory used for files created while
 # configure runs. Since it is in the build directory
 # we can safely blow away any previous version of it
@@ -679,10 +682,10 @@ endif
 rbd = not_found
 if not get_option('rbd').auto() or have_block
   librados = cc.find_library('rados', required: get_option('rbd'),
-                             static: enable_static)
+                             kwargs: static_kwargs)
   librbd = cc.find_library('rbd', has_headers: ['rbd/librbd.h'],
                            required: get_option('rbd'),
-                           static: enable_static)
+                           kwargs: static_kwargs)
   if librados.found() and librbd.found() and cc.links('''
     #include <stdio.h>
     #include <rbd/librbd.h>
@@ -693,6 +696,9 @@ if not get_option('rbd').auto() or have_block
     }''', dependencies: [librbd, librados])
     rbd = declare_dependency(dependencies: [librbd, librados])
   endif
+  if not rbd.found() and get_option('rbd').enabled()
+    error('could not link librbd')
+  endif
 endif
 
 glusterfs = not_found

(It's not a complete patch, all instances of "static: enable_static" would need to be changed because other libraries could have the same issue).

Thanks,

Paolo

#5 lore raw

Am 25.01.21 um 22:57 schrieb Paolo Bonzini:

Quoted 43 lines · Peter Lieven
Quoted 3 lines
Quoted 1 line

Can you include the meson-logs/meson-log.txt output?

Sure:https://pastebin.com/u3XtbDvQ

Does this work for you?

meson.build +0 -0
index 690d48a6fd..a662772c4a 100644
@@ -14,6 +14,9 @@ config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')

 enable_modules = 'CONFIG_MODULES' in config_host
 enable_static = 'CONFIG_STATIC' in config_host

meson.build +3 -0
+# Allow both shared and static libraries unless --enable-static
+static_kwargs = enable_static ? {'static': true} : {}
+

 # Temporary directory used for files created while

 # configure runs. Since it is in the build directory
 # we can safely blow away any previous version of it
meson.build +0 -0
@@ -679,10 +682,10 @@ endif

 rbd = not_found
 if not get_option('rbd').auto() or have_block
   librados = cc.find_library('rados', required: get_option('rbd'), -                             static: enable_static)
+                             kwargs: static_kwargs) librbd = cc.find_library('rbd', has_headers: ['rbd/librbd.h'],
                            required: get_option('rbd'), -                           static: enable_static)
+                           kwargs: static_kwargs)
   if librados.found() and librbd.found() and cc.links(''' #include <stdio.h>
     #include <rbd/librbd.h>

meson.build +0 -0
@@ -693,6 +696,9 @@ if not get_option('rbd').auto() or have_block
      }''', dependencies: [librbd, librados])
      rbd = declare_dependency(dependencies: [librbd, librados])

   endif
+  if not rbd.found() and get_option('rbd').enabled() +    error('could not link librbd')
+  endif
 endif

Quoted 3 lines

 glusterfs = not_found

(It's not a complete patch, all instances of "static: enable_static" would need to be changed because other libraries could have the same issue).

Yes, it does.

Please CC me, when you submit a complete patch. I will build my V2 of the rbd driver rewrite on top of this then.

Thanks,

Peter