Problem building R on 10.15.5 with homebrew

44 views
Skip to first unread message

Zachary Scherr

unread,
Jun 1, 2020, 2:37:41 PM6/1/20
to sage-devel
Hi All,

   I recently tried building Sage on Catalina 10.15.5.  I have homebrew with all recommended packages installed and I tried building sage via the commands

make distclean
source .homebrew-build-env
./configure
MAKE='make -j18' make build

   and it crashed with the error

Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make all-build'):

* package:         r-3.6.2.p0
  last build time: Jun 1 14:21
  log file:        /Users/zscherr/SageMath/logs/pkgs/r-3.6.2.p0.log
  build directory: /Users/zscherr/SageMath/local/var/tmp/sage/build/r-3.6.2.p0

   I'm not entirely sure why it's building R in the first place since I already have it installed via homebrew.  I briefly checked the log file and saw ld: library not found for -lssl which I'm thinking might be somehow related
to the fact that openssl and curl-openssl are keg-only.  My best guess might be that "source .homebrew-build-env" ends up missing some environment variables, but I'd really appreciate any help you can offer.

Thanks,
Zach
config.log
r-3.6.2.p0.log
config.log

Dima Pasechnik

unread,
Jun 1, 2020, 3:27:19 PM6/1/20
to sage-devel
On Mon, Jun 1, 2020 at 7:37 PM Zachary Scherr <zsc...@gmail.com> wrote:
>
> Hi All,
>
> I recently tried building Sage on Catalina 10.15.5. I have homebrew with all recommended packages installed and I tried building sage via the commands
>
your config.log says that e.g. sqlite is not installed.
At the end of ./configure run, please have a look at the advice to
install packages it now prints.

> make distclean
> source .homebrew-build-env
> ./configure
> MAKE='make -j18' make build
>
> and it crashed with the error
>
> Error building Sage.
>
> The following package(s) may have failed to build (not necessarily
> during this run of 'make all-build'):
>
> * package: r-3.6.2.p0
> last build time: Jun 1 14:21
> log file: /Users/zscherr/SageMath/logs/pkgs/r-3.6.2.p0.log
> build directory: /Users/zscherr/SageMath/local/var/tmp/sage/build/r-3.6.2.p0
>
> I'm not entirely sure why it's building R in the first place since I already have it installed via homebrew. I briefly checked the log file and saw ld: library not found for -lssl which I'm thinking might be somehow related
> to the fact that openssl and curl-openssl are keg-only. My best guess might be that "source .homebrew-build-env" ends up missing some environment variables, but I'd really appreciate any help you can offer.
>
> Thanks,
> Zach
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/6a84dd22-2e9e-4139-aab7-6582cb0bf598%40googlegroups.com.

Zachary Scherr

unread,
Jun 1, 2020, 3:30:44 PM6/1/20
to sage-devel
Hi Dima,

   I already have all of the homebrew packages installed, I'm not sure why it offers that suggestion.  I also updated from OS 10.14 to 10.15 right before building sage.  I had previously built sage on 10.14 without these problems.

Best,
Zach
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.

Dima Pasechnik

unread,
Jun 1, 2020, 3:51:23 PM6/1/20
to sage-devel
On Mon, Jun 1, 2020 at 8:30 PM Zachary Scherr <zsc...@gmail.com> wrote:
>
> Hi Dima,
>
> I already have all of the homebrew packages installed, I'm not sure why it offers that suggestion.

By looking at your config.log, I see that flint and ntl are keg-only,
which actually results in sqlite ,zlib, and curl tests failing
(because the tests for libcurl and libsqlite actually try to link and
run programs linked to an already detected list of libs,
but locations of some of these libs need extra -L flags, oops)

brew link ntl
brew link flint
make zlib-clean sqlite-clean python3-clean

run
./configure
it should tell you that zlib, sqlite, python3, r should come from the system...
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/0be2e81e-9df9-432f-b3b5-19d93f698508%40googlegroups.com.

Zachary Scherr

unread,
Jun 1, 2020, 9:39:11 PM6/1/20
to sage-devel
Hi Dima,

   It looks like both were already linked but I ended up reinstalling them and everything worked, thank you so much.  

In general, do you recommend installing libraries like flint from sagemath/homebrew-science before building sage? I see that there are a lot of formulas there but I'm not sure any of them have Catalina bottles.  I don't know too much about homebrew, but I'd be happy to try to contribute Catalina bottles if this is something worth doing. 

Best,
Zach

John H Palmieri

unread,
Jun 1, 2020, 10:47:20 PM6/1/20
to sage-devel


On Monday, June 1, 2020 at 6:39:11 PM UTC-7, Zachary Scherr wrote:
Hi Dima,

   It looks like both were already linked but I ended up reinstalling them and everything worked, thank you so much.  

In general, do you recommend installing libraries like flint from sagemath/homebrew-science before building sage? I see that there are a lot of formulas there but I'm not sure any of them have Catalina bottles.  I don't know too much about homebrew, but I'd be happy to try to contribute Catalina bottles if this is something worth doing. 

To build Sage, you should run "./configure" and look at the message at the end, which will say something like

hint: installing the following system packages is recommended and may avoid building some of the above SPKGs from source:
   $ brew install cmake
# To automatically take care of homebrew messages regarding
# keg-only packages for the current shell session:
  $ source
/Users/palmieri/Desktop/Sage_stuff/git/sage/.homebrew-build-env

So you should run those two commands.

To help with Sage development, you could try to create more homebrew packages which Sage would then use, or maybe there are some already in existence which the Sage build process needs to be told about.

Dima Pasechnik

unread,
Jun 2, 2020, 5:01:08 AM6/2/20
to sage-devel
Hi Zach,

On Tue, Jun 2, 2020 at 2:39 AM Zachary Scherr <zsc...@gmail.com> wrote:
>
> It looks like both were already linked but I ended up reinstalling them and everything worked, thank you so much.
>
> In general, do you recommend installing libraries like flint from sagemath/homebrew-science before building sage? I see that there are a lot of formulas there but I'm not sure any of them have Catalina bottles. I don't know too much about homebrew, but I'd be happy to try to contribute Catalina bottles if this is something worth doing.
>
as we are proceeding towards making SageMath a pip-installable
library, we are unvendoring everything we can,
see https://trac.sagemath.org/ticket/27330
And yes, indeed, maintaining our own patches on many OSs is a lot of
effort we can ill afford, so e.g.
we very much would like to use Python from the system rather than build our own
(we are also planning to allow the use of system Python packages, but
this is not yet there)

So yes, everything listed in the latter ticket as "already done" or
"in progress" ought to get a Brew formula
providing the corresponding package.
Some existing Brew formulas are not compatible with what Sage needs,
e.g. https://formulae.brew.sh/formula/flint does not provide the NTL
interface, so we have a few of our own in
https://github.com/sagemath/homebrew-science (as you most probably know).
Ideally these formulas/updates/fixes should be upstreamed, but without that
having bottles for these (as well as everything else needed for Sage!)
would be great.

E.g. speaking about Flint formula, probably the correct way to deal
with it is to use

depends_on "ntl" => :optional

in its "canonical" formula https://formulae.brew.sh/formula/flint

I don't know much about Homebrew, and am not an active macOS user
either, so if anything on Sagemath side
needs to be done to facilitate this, please speak up.

Cheers
Dima
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/8d6dc490-8108-4960-a540-3af992126e23%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages