Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS linker error, MACOSX_DEPLOYMENT_TARGET needs updating. #1580

Closed
andyfaff opened this issue May 30, 2018 · 12 comments · Fixed by #1619
Closed

macOS linker error, MACOSX_DEPLOYMENT_TARGET needs updating. #1580

andyfaff opened this issue May 30, 2018 · 12 comments · Fixed by #1619

Comments

@andyfaff
Copy link

I am currently trying to compile OpenBlas on macOS (10.13.4) with Xcode 9.3.1:

an:OpenBLAS-0.2.20 anz$ clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
an:OpenBLAS-0.2.20 anz$ gfortran --version
GNU Fortran (GCC) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I tried to build out of the box by just invoking make - it didn't work. I then tried to copy the travisCI config for a build: make QUIET_MAKE=1 DYNAMIC_ARCH=1 TARGET=NEHALEM NUM_THREADS=32 BINARY=64 INTERFACE64=1. That didn't work either. The error code was:

[INFO] : TIMER value: INT_ETIME (given by make.inc)
[INFO] : TIMER value: INT_ETIME (given by make.inc)
ld: library not found for -lcrt1.10.6.o
ld: library not found for -lcrt1.10.6.o
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make[2]: *** [testslamch] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [testlsame] Error 1
ld: library not found for -lcrt1.10.6.o
collect2: error: ld returned 1 exit status
make[2]: *** [testdlamch] Error 1
ld: library not found for -lcrt1.10.6.o
collect2: error: ld returned 1 exit status
make[2]: *** [testieee] Error 1
ld: library not found for -lcrt1.10.6.o
collect2: error: ld returned 1 exit status
make[2]: *** [testversion] Error 1
ld: library not found for -lcrt1.10.6.o
collect2: error: ld returned 1 exit status
ld: library not found for -lcrt1.10.6.o
make[2]: *** [testdsecnd] Error 1
collect2: error: ld returned 1 exit status
make[2]: *** [testsecond] Error 1
make[1]: *** [lapack_install] Error 2
make: *** [netlib] Error 2

However, I got the library to successfully build by changing Makefile.system, L239, to:
export MACOSX_DEPLOYMENT_TARGET=10.9

@brada4
Copy link
Contributor

brada4 commented May 30, 2018

You need to install 10.6 runtimes in xcode providing that library.
If you dont care about compatibility with current OSX releases you can safely remove line 239 and compile for current machine.

@martin-frbg
Copy link
Collaborator

I see MACOSX_DEPLOYMENT_TARGET has been changed in the past already (#593), on the other hand it should now be possible to override this with an environment variable if necessary, rather than having to edit the Makefile.system itself.
With updating the minimum version, OpenBLAS would lose (default) compatibility with earlier versions of OSX. Not sure how much of a problem that would be, seeing that 10.6 appeared in 2009 - though jumping to 10.9 would seem to cut off anything before 2013.

@andyfaff
Copy link
Author

It's clearer how to compile on macOS now. However, I'd be interested to know why the flag gets set at all. For example, those compiling for their own machine wouldn't need to set it. Those compiling for old versions should presumably know enough about that kind of flag to know to set it.

@andyfaff
Copy link
Author

Is it a way of advertising what macOS version the library should be compatible to?

As it is the library didn't compile out of the box and it took a bit of ferreting around to get it to work.

@martin-frbg
Copy link
Collaborator

Yes, this setting makes sure that the library will be compatible with the named version - probably useful for deploying to a mix of machine generations. This flag was already set (to 10.2 back then) in the original libGoto2 from around 2009 that OpenBLAS builds upon.

@martin-frbg
Copy link
Collaborator

Calling for an opinion poll among those who use (or at least build) OpenBLAS on/for OSX - does the
deployment target need updating, or is staying at 10.6 and requiring installation of its files in current xcode the preferred solution ?

@andyfaff
Copy link
Author

andyfaff commented Jun 7, 2018

10.6 is pretty old now. 10.9 is 5 years old. I would've thought bumping to 10.9 would be reasonable.

@brada4
Copy link
Contributor

brada4 commented Jun 11, 2018

10.8 is still supported. Please check with your latest xcode how old SDK-s you can still add.

@martin-frbg
Copy link
Collaborator

What do the people think who package OpenBLAS MacOS binaries for Julia, condaforge or macports ? @jakirkham @staticfloat

@staticfloat
Copy link
Contributor

Over in Julia-land, we use 10.8 as the minimum OSX version by default. That seems to be a nice balance between features and compatibility. It's difficult for us to estimate the distribution of user's computers, but our 10.8+ binaries do not meet with many complaints. There were 1-2 users complaining that we had dropped 10.7- support when we first switched over a year or two ago, but that was it, and for as sizeable a community as we are, I think that means there really aren't that many people still on 10.7-.

The other consideration is automated testing; we've been bitten by upgrading something that then stops working on older CI bots, but all Travis builder versions are at 10.10+, so no worries there.

I would be totally fine with OpenBLAS moving to 10.8+.

@jakirkham
Copy link
Contributor

What do the people think who package OpenBLAS MacOS binaries for Julia, condaforge or macports ?

Sorry to get here late, @martin-frbg.

We set macOS 10.9 as our minimum supported version for all binaries produced in conda-forge (including OpenBLAS). That's when clang was fully supported on macOS (as opposed to gcc used on macOS 10.6). So it is a pretty good minimum to pick.

@martin-frbg
Copy link
Collaborator

Thanks. I have moved it to 10.8 now to let #1618 pass the CI tests.

mys721tx added a commit to mys721tx/vsearch that referenced this issue Dec 19, 2018
Pumps MACOSX_DEPLOYMENT_TARGET to 10.9. Xcode 10 on macOS 10.14 warns of
libstdc++ deperation with the current target (10.7); the warning can be
fixed by pumping the target version. The last release of Mac OS X 10.7
is 6 years old and according to
[StatCounter](http://gs.statcounter.com/os-version-market-share/macos/desktop/worldwide),
OS X 10.9 and later makes up for more than 95% of all mac OS machine online. Per OpenMathLib/OpenBLAS#1580, 10.9 should be a good minimal release target.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants