unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Make fails with xapian custom installation
@ 2021-12-09 14:23 Al Haji-Ali
  2021-12-09 15:38 ` David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: Al Haji-Ali @ 2021-12-09 14:23 UTC (permalink / raw)
  To: notmuch

Hello,

I have an old version of Xapian installed in root and a new one installed in my home folder which I want to use. My pkgconfig is configured correctly

,----
| ~ pkg-config --libs xapian-core
| -L/home/al/.local/stow/xapian/lib -lxapian
`----

So compiling notmuch works until linking when the following command fails

,----
| ~ c++ lib/filenames.o lib/string-list.o lib/message-file.o lib/message-id.o lib/messages.o lib/sha1.o lib/built-with.o lib/string-map.o lib/indexopts.o lib/tags.o lib/database.o lib/parse-time-vrp.o lib/directory.o lib/index.o lib/message.o lib/add-message.o lib/message-property.o lib/query.o lib/query-fp.o lib/config.o lib/regexp-fields.o lib/thread.o lib/thread-fp.o lib/features.o lib/prefix.o lib/open.o lib/init.o lib/parse-sexp.o  -Wl,--as-needed -L/home/al/.local/stow/gmime/lib -L/usr/lib64 -lgmime-3.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -L/usr/lib64 -ltalloc -L/usr/lib64 -lz -L/home/al/.local/stow/xapian/lib -lxapian  -shared -Wl,--version-script=./lib/notmuch.sym,-soname=libnotmuch.so.5 -Wl,--no-undefined -o lib/libnotmuch.so.5.5.0 util/libnotmuch_util.a parse-time-string/libparse-time-string.a
`----

The problem is that GCC orders the library folders left-to-right and the directory `/usr/lib64` is added (multiple times) before the my local directory `/home/al/.local/stow/xapian/lib`. So that the Xapian library file in the /usr/lib64 has a higher priority and is used. Removing all `-L/usr/lib64` manually and running the linking commands, I am able to compile notmuch correctly.

Is there a better way to do this via configure?

Thanks,
-- Al

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

* Re: Make fails with xapian custom installation
  2021-12-09 14:23 Make fails with xapian custom installation Al Haji-Ali
@ 2021-12-09 15:38 ` David Bremner
  2021-12-09 15:49   ` Al Haji-Ali
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2021-12-09 15:38 UTC (permalink / raw)
  To: Al Haji-Ali, notmuch

Al Haji-Ali <abdo.haji.ali@gmail.com> writes:

> Hello,
>
> I have an old version of Xapian installed in root and a new one installed in my home folder which I want to use. My pkgconfig is configured correctly
>
> ,----
> | ~ pkg-config --libs xapian-core
> | -L/home/al/.local/stow/xapian/lib -lxapian
> `----
>

configure actually invokes xapian-config rather than pkg-config (I
forget why offhand). So you probably need to set XAPIAN_CONFIG in the
environment to the one in your /home when running configure.

d

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

* Re: Make fails with xapian custom installation
  2021-12-09 15:38 ` David Bremner
@ 2021-12-09 15:49   ` Al Haji-Ali
  2021-12-09 16:27     ` David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: Al Haji-Ali @ 2021-12-09 15:49 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch


On 09/12/2021, David Bremner wrote:
> configure actually invokes xapian-config rather than pkg-config (I
> forget why offhand). So you probably need to set XAPIAN_CONFIG in the
> environment to the one in your /home when running configure.

Ah OK. My xapian-config is also correctly configured

,----
| ~ xapian-config --libs
| -L/home/al/.local/stow/xapian/lib -lxapian
`----

Notmuch's configure has the correct paths for Xapian as seen in the compilation command I included before. The issue is the order of library folders.

-- Al

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

* Re: Make fails with xapian custom installation
  2021-12-09 15:49   ` Al Haji-Ali
@ 2021-12-09 16:27     ` David Bremner
  2021-12-09 16:36       ` Al Haji-Ali
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2021-12-09 16:27 UTC (permalink / raw)
  To: Al Haji-Ali; +Cc: notmuch

Al Haji-Ali <abdo.haji.ali@gmail.com> writes:

> On 09/12/2021, David Bremner wrote:
>> configure actually invokes xapian-config rather than pkg-config (I
>> forget why offhand). So you probably need to set XAPIAN_CONFIG in the
>> environment to the one in your /home when running configure.
>
> Ah OK. My xapian-config is also correctly configured
>
> ,----
> | ~ xapian-config --libs
> | -L/home/al/.local/stow/xapian/lib -lxapian
> `----
>
> Notmuch's configure has the correct paths for Xapian as seen in the compilation command I included before. The issue is the order of library folders.
>
> -- Al

Does it help if you set LDFLAGS on the make command line?  Looking at
Makefile.global,  LDFLAGS are added before the other computed flags. So
something like

% make V=1 LDFLAGS=-L/home/al/.local/stow/xapian/lib

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

* Re: Make fails with xapian custom installation
  2021-12-09 16:27     ` David Bremner
@ 2021-12-09 16:36       ` Al Haji-Ali
  0 siblings, 0 replies; 5+ messages in thread
From: Al Haji-Ali @ 2021-12-09 16:36 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch


On 09/12/2021, David Bremner wrote:
> Does it help if you set LDFLAGS on the make command line?  Looking at
> Makefile.global,  LDFLAGS are added before the other computed flags. So
> something like
>
> % make V=1 LDFLAGS=-L/home/al/.local/stow/xapian/lib

Yep, this works. Thanks!

I feel that gcc should really have a right-to-left order rather than left-to-right libraries are usually preceded by their directory (like in xapian-config and pkg-config). It's curious that I never ran into this problem before.

-- Al

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

end of thread, other threads:[~2021-12-09 16:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 14:23 Make fails with xapian custom installation Al Haji-Ali
2021-12-09 15:38 ` David Bremner
2021-12-09 15:49   ` Al Haji-Ali
2021-12-09 16:27     ` David Bremner
2021-12-09 16:36       ` Al Haji-Ali

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).