All of lore.kernel.org
 help / color / mirror / Atom feed
* [ndctl PATCH] meson.build: be specific for library path
@ 2022-08-18  1:23 Luis Chamberlain
  2022-08-19  6:26 ` Verma, Vishal L
  0 siblings, 1 reply; 3+ messages in thread
From: Luis Chamberlain @ 2022-08-18  1:23 UTC (permalink / raw)
  To: nvdimm, linux-cxl; +Cc: mcgrof

If you run the typical configure script on a typical linux software
project say with ./configure --prefix=/usr/ then the libdir defaults
to /usr/lib/ however this is not true with meson.

With meson the current libdir path follows the one set by the prefix,
and so with the current setup with prefix forced by default to /usr/
we end up with libdir set to /usr/ as well and so libraries built
and installed also placed into /usr/ as well, not /usr/lib/ as we
would typically expect.

So you if you use today's defaults you end up with the libraries placed
into /usr/ and then a simple error such as:

cxl: error while loading shared libraries: libcxl.so.1: cannot open shared object file: No such file or directory

Folks may have overlooked this as their old library is still usable.

Fix this by forcing the default library path to /usr/lib, and so
requiring users to set both prefix and libdir if they want to
customize both.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meson.build b/meson.build
index aecf461..802b38c 100644
--- a/meson.build
+++ b/meson.build
@@ -9,6 +9,7 @@ project('ndctl', 'c',
   default_options : [
     'c_std=gnu99',
     'prefix=/usr',
+    'libdir=/usr/lib',
     'sysconfdir=/etc',
     'localstatedir=/var',
   ],
-- 
2.35.1


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

* Re: [ndctl PATCH] meson.build: be specific for library path
  2022-08-18  1:23 [ndctl PATCH] meson.build: be specific for library path Luis Chamberlain
@ 2022-08-19  6:26 ` Verma, Vishal L
  2022-09-07 19:37   ` Luis Chamberlain
  0 siblings, 1 reply; 3+ messages in thread
From: Verma, Vishal L @ 2022-08-19  6:26 UTC (permalink / raw)
  To: linux-cxl, mcgrof, nvdimm

On Wed, 2022-08-17 at 18:23 -0700, Luis Chamberlain wrote:
> If you run the typical configure script on a typical linux software
> project say with ./configure --prefix=/usr/ then the libdir defaults
> to /usr/lib/ however this is not true with meson.
> 
> With meson the current libdir path follows the one set by the prefix,
> and so with the current setup with prefix forced by default to /usr/
> we end up with libdir set to /usr/ as well and so libraries built
> and installed also placed into /usr/ as well, not /usr/lib/ as we
> would typically expect.
> 
> So you if you use today's defaults you end up with the libraries
> placed
> into /usr/ and then a simple error such as:
> 
> cxl: error while loading shared libraries: libcxl.so.1: cannot open
> shared object file: No such file or directory
> 
> Folks may have overlooked this as their old library is still usable.
> 
> Fix this by forcing the default library path to /usr/lib, and so
> requiring users to set both prefix and libdir if they want to
> customize both.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
>  meson.build | 1 +
>  1 file changed, 1 insertion(+)

Hi Luis,

This sounds reasonable, but I've not observed the behavior you
described unless I'm missing something in my quick test.

Both before and after this patch, the default path for the library for
me was /usr/lib64. This is on Fedora 36 with meson 0.62.2.

> 
> diff --git a/meson.build b/meson.build
> index aecf461..802b38c 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -9,6 +9,7 @@ project('ndctl', 'c',
>    default_options : [
>      'c_std=gnu99',
>      'prefix=/usr',
> +    'libdir=/usr/lib',
>      'sysconfdir=/etc',
>      'localstatedir=/var',
>    ],


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

* Re: [ndctl PATCH] meson.build: be specific for library path
  2022-08-19  6:26 ` Verma, Vishal L
@ 2022-09-07 19:37   ` Luis Chamberlain
  0 siblings, 0 replies; 3+ messages in thread
From: Luis Chamberlain @ 2022-09-07 19:37 UTC (permalink / raw)
  To: Verma, Vishal L; +Cc: linux-cxl, nvdimm

On Fri, Aug 19, 2022 at 06:26:46AM +0000, Verma, Vishal L wrote:
> On Wed, 2022-08-17 at 18:23 -0700, Luis Chamberlain wrote:
> > If you run the typical configure script on a typical linux software
> > project say with ./configure --prefix=/usr/ then the libdir defaults
> > to /usr/lib/ however this is not true with meson.
> > 
> > With meson the current libdir path follows the one set by the prefix,
> > and so with the current setup with prefix forced by default to /usr/
> > we end up with libdir set to /usr/ as well and so libraries built
> > and installed also placed into /usr/ as well, not /usr/lib/ as we
> > would typically expect.
> > 
> > So you if you use today's defaults you end up with the libraries
> > placed
> > into /usr/ and then a simple error such as:
> > 
> > cxl: error while loading shared libraries: libcxl.so.1: cannot open
> > shared object file: No such file or directory
> > 
> > Folks may have overlooked this as their old library is still usable.
> > 
> > Fix this by forcing the default library path to /usr/lib, and so
> > requiring users to set both prefix and libdir if they want to
> > customize both.
> > 
> > Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> > ---
> >  meson.build | 1 +
> >  1 file changed, 1 insertion(+)
> 
> Hi Luis,
> 
> This sounds reasonable, but I've not observed the behavior you
> described unless I'm missing something in my quick test.
> 
> Both before and after this patch, the default path for the library for
> me was /usr/lib64. This is on Fedora 36 with meson 0.62.2.

FWIW, my results was with debian testing. I see this is now merged, great,
thanks.

  Luis

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

end of thread, other threads:[~2022-09-07 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18  1:23 [ndctl PATCH] meson.build: be specific for library path Luis Chamberlain
2022-08-19  6:26 ` Verma, Vishal L
2022-09-07 19:37   ` Luis Chamberlain

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.