From: Felipe Contreras <felipe.contreras@gmail.com>
To: Michal Sapka <michal@sapka.me>
Cc: notmuch@notmuchmail.org
Subject: Re: can't compile on MacOS
Date: Wed, 13 Nov 2024 08:19:28 -0600 [thread overview]
Message-ID: <CAMP44s1yhFDknxmNApMYjOooupdhr7d8TYLW7ujXH8QU75pd3A@mail.gmail.com> (raw)
In-Reply-To: <c399f004-4ef7-4e9b-88dd-9fa6733b1b3d@app.fastmail.com>
[-- Attachment #1: Type: text/plain, Size: 1596 bytes --]
On Tue, Nov 12, 2024 at 4:03 AM Michal Sapka <michal@sapka.me> wrote:
> On Mon, Nov 11, 2024, at 1:43 PM, Felipe Contreras wrote:
> > It's not just CFLAGS, you need to set LIBPATH too. According to the
> > Makefile that should work. Did you try adding V=1 too? What's the
> > final link command?
> >
> > make -C bindings/ruby V=1 CFLAGS='-g -O2 -pipe -fno-plt -fPIC
> > -I/opt/homebrew/Cellar/talloc/2.4.2/include' LIBPATH='-L. -L/usr/lib
> > -L/opt/homebrew/Cellar/talloc/2.4.2/lib'
>
> I cleaned the entire local repo dir
All right, but just to check:
> All required packages were found. You may now run the following
> commands to compile and install notmuch:
>
> make
>
> --------------
Instead of this, try running `make V=1`, that should output all the
details so we can see how the Ruby bindings were actually compiled.
From what I can tell the build should not have worked unless the
location is added to the global variables CPATH and LIBRARY_PATH.
I see some people recommending:
export CPATH=$(brew --prefix)/include LIBRARY_PATH=$(brew --prefix)/lib
Maybe you have something like that in your environment.
I also in your commands some mixtures of `make` and `sudo make`. The
only time you need sudo is on `make install`.
Anyway, I tried to install talloc on a non-standard location on my
Linux machine, and the build fails, so this can be improved. Attached
is a test patch, if you want to give it a try.
I'll clean up the ruby build stuff and send a proposed patch series later on.
Cheers.
--
Felipe Contreras
[-- Attachment #2: ruby-build.patch --]
[-- Type: text/x-patch, Size: 972 bytes --]
diff --git a/bindings/Makefile.local b/bindings/Makefile.local
index 9875123a..ef422da7 100644
--- a/bindings/Makefile.local
+++ b/bindings/Makefile.local
@@ -8,7 +8,8 @@ ruby-bindings: $(dir)/ruby.stamp
$(dir)/ruby.stamp: lib/$(LINKER_NAME)
ifeq ($(HAVE_RUBY_DEV),1)
cd $(dir)/ruby && \
- EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \
+ EXTRA_LDFLAGS="$(TALLOC_LDFLAGS) $(NO_UNDEFINED_LDFLAGS)" \
+ EXTRA_INCFLAGS="$(TALLOC_CFLAGS)" \
LIBNOTMUCH="../../lib/$(LINKER_NAME)" \
NOTMUCH_SRCDIR='$(NOTMUCH_SRCDIR)' \
$(RUBY) extconf.rb --vendor
diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb
index d914537c..ba825e8a 100644
--- a/bindings/ruby/extconf.rb
+++ b/bindings/ruby/extconf.rb
@@ -8,7 +8,7 @@ require 'mkmf'
dir = File.join(ENV['NOTMUCH_SRCDIR'], 'lib')
# includes
-$INCFLAGS = "-I#{dir} #{$INCFLAGS}"
+$INCFLAGS = "-I#{dir} #{ENV['EXTRA_INCFLAGS']} #{$INCFLAGS}"
if ENV['EXTRA_LDFLAGS']
$LDFLAGS += " " + ENV['EXTRA_LDFLAGS']
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
prev parent reply other threads:[~2024-11-13 14:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 14:31 can't compile on MacOS Michal Sapka
2024-11-08 11:52 ` Tomi Ollila
[not found] ` <87h68iui5c.fsf@tethera.net>
[not found] ` <CAMP44s11Jhbc59iBqAN6sjm_cKph_BB4rHeaeEXVOXjjDvG=hA@mail.gmail.com>
2024-11-08 22:42 ` Michal Sapka
2024-11-08 23:54 ` Felipe Contreras
2024-11-10 21:10 ` Michal Sapka
2024-11-11 12:43 ` Felipe Contreras
2024-11-12 10:02 ` Michal Sapka
2024-11-12 20:21 ` David Bremner
2024-11-13 14:23 ` Felipe Contreras
2024-11-13 14:19 ` Felipe Contreras [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMP44s1yhFDknxmNApMYjOooupdhr7d8TYLW7ujXH8QU75pd3A@mail.gmail.com \
--to=felipe.contreras@gmail.com \
--cc=michal@sapka.me \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).