All of lore.kernel.org
 help / color / mirror / Atom feed
* configure does not detect librados or librbd since the switch to meson
@ 2021-01-25 14:13 Peter Lieven
  2021-01-25 14:31 ` Peter Lieven
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Lieven @ 2021-01-25 14:13 UTC (permalink / raw)
  To: dillaman, qemu-devel, pbonzini, philmd

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: configure does not detect librados or librbd since the switch to meson
  2021-01-25 14:13 configure does not detect librados or librbd since the switch to meson Peter Lieven
@ 2021-01-25 14:31 ` Peter Lieven
  2021-01-25 15:24   ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Lieven @ 2021-01-25 14:31 UTC (permalink / raw)
  To: dillaman, qemu-devel, pbonzini, philmd

Am 25.01.21 um 15:13 schrieb Peter Lieven:
> 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.


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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: configure does not detect librados or librbd since the switch to meson
  2021-01-25 14:31 ` Peter Lieven
@ 2021-01-25 15:24   ` Paolo Bonzini
  2021-01-25 19:47     ` Peter Lieven
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2021-01-25 15:24 UTC (permalink / raw)
  To: Peter Lieven, dillaman, qemu-devel, philmd

On 25/01/21 15:31, Peter Lieven wrote:
> 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?

> 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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: configure does not detect librados or librbd since the switch to meson
  2021-01-25 15:24   ` Paolo Bonzini
@ 2021-01-25 19:47     ` Peter Lieven
  2021-01-25 21:57       ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Lieven @ 2021-01-25 19:47 UTC (permalink / raw)
  To: Paolo Bonzini, dillaman, qemu-devel, philmd

Am 25.01.21 um 16:24 schrieb Paolo Bonzini:
> On 25/01/21 15:31, Peter Lieven wrote:
>> 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


>
>> 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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: configure does not detect librados or librbd since the switch to meson
  2021-01-25 19:47     ` Peter Lieven
@ 2021-01-25 21:57       ` Paolo Bonzini
  2021-01-25 22:20         ` Peter Lieven
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2021-01-25 21:57 UTC (permalink / raw)
  To: Peter Lieven, dillaman, qemu-devel, philmd

On 25/01/21 20:47, Peter Lieven wrote:
>> Can you include the meson-logs/meson-log.txt output?
> 
> Sure:https://pastebin.com/u3XtbDvQ

Does this work for you?

diff --git a/meson.build b/meson.build
index 690d48a6fd..a662772c4a 100644
--- a/meson.build
+++ b/meson.build
@@ -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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: configure does not detect librados or librbd since the switch to meson
  2021-01-25 21:57       ` Paolo Bonzini
@ 2021-01-25 22:20         ` Peter Lieven
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Lieven @ 2021-01-25 22:20 UTC (permalink / raw)
  To: Paolo Bonzini, dillaman, qemu-devel, philmd

Am 25.01.21 um 22:57 schrieb Paolo Bonzini:
> On 25/01/21 20:47, Peter Lieven wrote:
>>> Can you include the meson-logs/meson-log.txt output?
>>
>> Sure:https://pastebin.com/u3XtbDvQ
>
> Does this work for you?
>
> diff --git a/meson.build b/meson.build
> index 690d48a6fd..a662772c4a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -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).


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




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-25 22:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 14:13 configure does not detect librados or librbd since the switch to meson Peter Lieven
2021-01-25 14:31 ` Peter Lieven
2021-01-25 15:24   ` Paolo Bonzini
2021-01-25 19:47     ` Peter Lieven
2021-01-25 21:57       ` Paolo Bonzini
2021-01-25 22:20         ` Peter Lieven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.