MACOSX_DEPLOYMENT_TARGET problems

112 views
Skip to first unread message

John H Palmieri

unread,
Dec 14, 2020, 4:37:22 PM12/14/20
to sage-devel
I am having problems building Sage with a recently updated homebrew Python 3.9 on OS X Big Sur, apparently because it sets MACOSX_DEPLOYMENT_TARGET to 11. (Insert Spinal Tap joke here.) If you run `brew update` on Big Sur, I'm guessing that you will run into this.

- There is a problem because of wheel: see https://github.com/pypa/wheel/issues/385. (Update at #31050.) This leads to failures when building gmpy2 and cython.

- There is a problem with cffi because its setup.py has

get_config_var("MACOSX_DEPLOYMENT_TARGET").split('.')

This fails because `get_config_var` returns an `int` in this case rather than a string.

(No trac ticket yet. The most recent version of cffi doesn't fix this, as far as I can tell, but it's easy to write a patch.)

- There is a similar problem with numpy:

    os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
    ...
   TypeError: str expected, not int

I haven't tried to fix that one yet, so I don't know if there are more problems.

--
John

John H Palmieri

unread,
Dec 14, 2020, 5:40:09 PM12/14/20
to sage-devel
I can also produce a simple patch for the numpy issue. But scipy is also failing, and I don't know how to fix that. I get

  /usr/local/bin/gfortran -Wall -g -Wall -g -undefined dynamic_lookup -bundle -bundle -undefined dynamic_lookup -L/Users/palmieri/Desktop/Sage/sage_builds/TESTING/TEMP/sage-9.3.beta3/local/lib -Wl,-rpath,/Users/palmieri/Desktop/Sage/sage_builds/TESTING/TEMP/sage-9.3.beta3/local/lib build/temp.macosx-11-x86_64-3.9/scipy/integrate/_quadpackmodule.o -L/usr/local/Cellar/openblas/0.3.12_1/lib -L/usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin20/10.2.0 -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/sqlite/lib -Lbuild/temp.macosx-11-x86_64-3.9 -lquadpack -lmach -lopenblas -lopenblas -lgfortran -o build/lib.macosx-11-x86_64-3.9/scipy/integrate/_quadpack.cpython-39-darwin.so
  gfortran: warning: couldn't understand version 11
  ld: library not found for -lgcc_s.10.4
  collect2: error: ld returned 1 exit status

Any suggestions would be appreciated.
scipy-1.5.4.log

Zachary Scherr

unread,
Dec 29, 2020, 12:58:54 AM12/29/20
to sage-devel
I posted over on Trac, but I'm new to sage development so I'll repost here.  The cffi issue has been fixed in 1.14.4 so it's probably best to update that package.  I created a https://trac.sagemath.org/ticket/31128 to do this.

As for scipy, it's possible to get scipy to build in the terminal by doing

MACOSX_DEPLOYMENT_TARGET=11.0 make scipy

or

MACOSX_DEPLOYMENT_TARGET=11.1 make scipy.

This is exactly what homebrew's scipy formula does.  It appears that the issue is that gfortran doesn't like whole number versions.  There's a discussion about this on Iain Sandoe's ARM gcc fork at https://github.com/iains/gcc-darwin-arm64/issues/31#issuecomment-750343944

A sensible idea might be to set MACOSX_DEPLOYMENT_TARGET in the makefile for scipy, and then possibly unset it if it causes issues with other packages.

Reply all
Reply to author
Forward
0 new messages