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

openblas 0.3.13 uses clock_gettime that is only available macOS 10.12 onwards #836

Closed
jaakkor2 opened this issue Apr 6, 2021 · 13 comments · Fixed by JuliaPackaging/Yggdrasil#2842 or JuliaLang/julia#40499
Labels
system:mac Affects only macOS upstream The issue is with an upstream dependency, e.g. LLVM

Comments

@jaakkor2
Copy link

jaakkor2 commented Apr 6, 2021

This version starts fine
https://julialangnightlies-s3.julialang.org/bin/mac/x64/1.7/julia-95a34a9020-mac64.dmg
JuliaLang/julia@95a34a9

julia> versioninfo()
Julia Version 1.7.0-DEV.609
Commit 95a34a9020 (2021-02-25 17:35 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Core(TM)2 Duo CPU     P7350  @ 2.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, penryn)

This does not start
https://julialangnightlies-s3.julialang.org/bin/mac/x64/1.7/julia-dc81980e0b-mac64.dmg
JuliaLang/julia@dc81980

$ exec '/Applications/Julia-1.7.app/Contents/Resources/julia/bin/julia'
ERROR: Unable to load dependent library /Applications/Julia-1.7.app/Contents/Resources/julia/bin/../lib/julia/libopenblas64_.dylib
Message: dlopen(/Applications/Julia-1.7.app/Contents/Resources/julia/bin/../lib/julia/libopenblas64_.dylib, 6): Symbol not found: _clock_gettime
  Referenced from: /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia//libgfortran.5.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia//libgfortran.5.dylib
Unable to load "/Applications/Julia-1.7.app/Contents/Resources/julia/bin/../lib/julia/libopenblas64_.dylib"
┌ Error: No loaded BLAS libraries were built with ILP64 support
└ @ LinearAlgebra.BLAS /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.7/LinearAlgebra/src/blas.jl:154
Quitting.

[Process completed]

I believe this is a separate issue from #834 and I created a new issue.

@jaakkor2
Copy link
Author

jaakkor2 commented Apr 6, 2021

@ViralBShah ViralBShah added upstream The issue is with an upstream dependency, e.g. LLVM and removed upstream The issue is with an upstream dependency, e.g. LLVM labels Apr 6, 2021
@vtjnash
Copy link
Member

vtjnash commented Apr 6, 2021

Seems to work for me, but I have an older kernel. What do you get with verbose=true?

julia> versioninfo(verbose=true)
Julia Version 1.7.0-DEV.847
Commit fedefe913a (2021-04-06 03:03 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  uname: Darwin 18.7.0 Darwin Kernel Version 18.7.0: Tue Jan 12 22:04:47 PST 2021; root:xnu-4903.278.56~1/RELEASE_X86_64 x86_64 i386
  CPU: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz: 
              speed         user         nice          sys         idle          irq
       JuliaLang/julia#1  2700 MHz     350469 s          0 s     196643 s    2802132 s          0 s
       JuliaLang/julia#2  2700 MHz      43470 s          0 s      22382 s    3283181 s          0 s
       JuliaLang/julia#3  2700 MHz     299995 s          0 s     137052 s    2911989 s          0 s
       JuliaLang/julia#4  2700 MHz      39964 s          0 s      16206 s    3292862 s          0 s
       JuliaLang/julia#5  2700 MHz     253623 s          0 s     106665 s    2988747 s          0 s
       JuliaLang/julia#6  2700 MHz      39651 s          0 s      14653 s    3294728 s          0 s
       JuliaLang/julia#7  2700 MHz     204878 s          0 s      74921 s    3069236 s          0 s
       JuliaLang/julia#8  2700 MHz      40513 s          0 s      13205 s    3295313 s          0 s
       
  Memory: 16.0 GB (438.875 MB free)
  Uptime: 651112.0 sec
  Load Avg:  1.5791015625  1.568359375  2.31005859375
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  XPC_FLAGS = 0x0
  HOME = /Users/jameson
  TERM = xterm-256color
  PATH = /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMwareFusion.app/Contents/Public:/opt/X11/bin:/Users/jameson/.rvm/bin

@jaakkor2
Copy link
Author

jaakkor2 commented Apr 6, 2021

julia> versioninfo(verbose=true)
Julia Version 1.7.0-DEV.609
Commit 95a34a9020 (2021-02-25 17:35 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  uname: Darwin 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 21 20:07:40 PDT 2018; root:xnu-3248.73.11~1/RELEASE_X86_64 x86_64 i386
  CPU: Intel(R) Core(TM)2 Duo CPU     P7350  @ 2.00GHz: 
              speed         user         nice          sys         idle          irq
       #1  2000 MHz       4022 s          0 s       5172 s     176147 s          0 s
       #2  2000 MHz       4236 s          0 s       3494 s     176298 s          0 s
       
  Memory: 8.0 GB (2885.98046875 MB free)
  Uptime: 30591.0 sec
  Load Avg:  51.3974609375  17.18359375  7.8505859375
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, penryn)
Environment:
  MANPATH = /opt/local/share/man:/opt/local/share/man:
  TERM = xterm-256color
  PATH = /Users/jaakko/anaconda/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
  XPC_FLAGS = 0x0
  HOME = /Users/jaakko

This is on OS X 10.11.6. OS in platform info seems to be the version of kernel where the compilation was done.

@vtjnash
Copy link
Member

vtjnash commented Apr 6, 2021

ah, right, I skimmed that too quickly (I was confused that penryn could run the latest version, so I should have double-checked).

We compile libjulia with -mmacosx-version-min=10.9, but looks here like gfortran might be missing that flag on https://github.com/JuliaPackaging/Yggdrasil / https://github.com/JuliaPackaging/BinaryBuilder.jl (@staticfloat)

@staticfloat
Copy link
Member

staticfloat commented Apr 6, 2021

We are setting -mmacosx-version-min=10.10 on Yggdrasil. Not great that it doesn't match Julia itself, but we had to bump for some software package at some point, I don't remember quite which one; perhaps something to do with GTK.

Right now that's kind of hardcoded, but we'll be able to control it in the future by building for x86_64-apple-darwin14 or x86_64-apple-darwin17, etc...

@ViralBShah
Copy link
Member

ViralBShah commented Apr 7, 2021

We should probably bump it on Julia to 10.10 (which released in 2014), so hopefully that is still old enough to support users on older releases.

@staticfloat
Copy link
Member

Can someone impacted by this try building with Julia set to 10.10 to verify that it fixes the issue?

@ViralBShah
Copy link
Member

ViralBShah commented Apr 7, 2021

According to https://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x clock_gettime was only introduced in 10.12.

@ViralBShah ViralBShah added upstream The issue is with an upstream dependency, e.g. LLVM system:mac Affects only macOS labels Apr 7, 2021
@ViralBShah ViralBShah changed the title LIbtrampoline changes prevents 1.7 from starting on mac openblas 0.3.13 uses clock_gettime that is only available macOS 10.12 onwards Apr 7, 2021
@jaakkor2
Copy link
Author

jaakkor2 commented Apr 8, 2021

JuliaLang/julia#40396 did not fix this issue for me.

I created JuliaLang/julia#40400 to be able to download a binary with -mmacosx-version-min=10.10.

@jaakkor2
Copy link
Author

jaakkor2 commented Apr 8, 2021

-mmacosx-version-min=10.10 on Julia side does not fix this, tested with JuliaLang/julia#40400.

OpenMathLib/OpenBLAS#2814 (comment) and the linked issue pocoproject/poco#1453 show many similar issues about _clock_gettime.

@Keno
Copy link
Member

Keno commented Apr 8, 2021

The compiler can do OS x version detection. OpenBlas should not be using those symbols without checking that.

@vtjnash
Copy link
Member

vtjnash commented Apr 8, 2021

Those issues are pretty closely related to this: it seems that the Apple headers are broken, so gcc/gfortran/openblas mis-detect the symbol as existing, when it should not (the ability to compile this header correctly is predicated on the existence of the clang extension #if __has_extension(enumerator_attributes))

@staticfloat
Copy link
Member

I have identified the issue, and I have a fix making its way through the ecosystem: JuliaPackaging/BinaryBuilderBase.jl#134

staticfloat referenced this issue in JuliaPackaging/Yggdrasil Apr 15, 2021
This should fix https://github.com/JuliaLang/julia/issues/40375 which is
due to the compiler shards containing `clock_gettime` symbol references
which are not allowed for macOS < 10.12.  The fix to the GCC shards was
made in #2836 and was
integrated into BinaryBuilderBase in JuliaPackaging/BinaryBuilderBase.jl#134
staticfloat referenced this issue in JuliaPackaging/Yggdrasil Apr 15, 2021
This should fix https://github.com/JuliaLang/julia/issues/40375 which is
due to the compiler shards containing `clock_gettime` symbol references
which are not allowed for macOS < 10.12.  The fix to the GCC shards was
made in #2836 and was
integrated into BinaryBuilderBase in JuliaPackaging/BinaryBuilderBase.jl#134
@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:mac Affects only macOS upstream The issue is with an upstream dependency, e.g. LLVM
Projects
None yet
5 participants