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

julia fails to build on macos #114766

Closed
idontgetoutmuch opened this issue Mar 1, 2021 · 8 comments
Closed

julia fails to build on macos #114766

idontgetoutmuch opened this issue Mar 1, 2021 · 8 comments
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin

Comments

@idontgetoutmuch
Copy link
Contributor

Describe the bug

nix-build '<nixpkgs>' -A julia

produces

ld: library not found for -lgfortblas
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

Notify maintainers

@garrison

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

nix-shell -p nix-info --run "nix-info -m"
these paths will be fetched (0.01 MiB download, 0.03 MiB unpacked):
  /nix/store/6z3a76k322cwr63ndr6cni2csai5rcf6-DarwinTools-1
  /nix/store/wyjlk6rwj2krarb1i3yrn59h11k1vmmb-nix-info
copying path '/nix/store/6z3a76k322cwr63ndr6cni2csai5rcf6-DarwinTools-1' from 'https://cache.nixos.org'...
copying path '/nix/store/wyjlk6rwj2krarb1i3yrn59h11k1vmmb-nix-info' from 'https://cache.nixos.org'...
 - system: `"x86_64-darwin"`
 - host os: `Darwin 20.1.0, macOS 10.16`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.10`
 - channels(dom): `"nixpkgs-21.05pre272788.870dbb751f4"`
 - nixpkgs: `/Users/dom/.nix-defexpr/channels/nixpkgs`
@idontgetoutmuch idontgetoutmuch added the 0.kind: bug Something is broken label Mar 1, 2021
@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Mar 2, 2021
@thequicksort
Copy link

Just an extra data point: I just tried this on my MacOS Catalina machine (v10.15.6), and was able to install Julia okay. Through some digging, I found this issue with Julia failing to build due to GCC [1], so wonder if it's related to libtool (a dependency of GCC) not accounting for a Darwin major version change [2]? From what I understand, this would affect GCC on Big Sur . The good news is, I think they found the root cause and released a patch commit of GCC [3], the bad news is I don't think it's been incorporated into an official release patch branch.

[1] - JuliaLang/julia#19588 (comment)
[2] - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97865
[3] - https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1352bc88a0525743c952197fb2db6e4f8c091cde
image

@idontgetoutmuch
Copy link
Contributor Author

That's very useful - thanks for investigating - but I tried this on a catalina machine I had and it failed :( I think you must be using nixos-20.03 or earlier.

dom@MacBook-Pro depot % $(nix-build '<nixpkgs>' -A julia)/bin/julia
$(nix-build '<nixpkgs>' -A julia)/bin/julia
error: Package ‘julia-1.0.4’ in /nix/store/4gi6vkv28h2c68jaw90dyqnfnypxwx65-nixpkgs-20.09.3341.df8e3bd1109/nixpkgs/pkgs/development/compilers/julia/shared.nix:204 is marked as broken, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

(use '--show-trace' to show detailed location information)

and

dom@MacBook-Pro depot % nix-channel --list
nix-channel --list
nixpkgs https://nixos.org/channels/nixos-20.03
dom@MacBook-Pro depot % $(nix-build '<nixpkgs>' -A julia)/bin/julia
$(nix-build '<nixpkgs>' -A julia)/bin/julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.4 (2019-05-16)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

┌ Warning: Terminal not fully functional
└ @ Base client.jl:346
julia> 

This is a really old version of julia - I guess we can look at the diff between 20.03 and 20.09 and unstable.

@idontgetoutmuch
Copy link
Contributor Author

I tried against HEAD turning off the checks and setting

      "USE_SYSTEM_BLAS=0"

because I think the blas that comes with macos is probably the wrong thing to use - see this discussion: JuliaLang/LinearAlgebra.jl#521

But this gives me a different build error

make: *** [Makefile:60: julia-deps] Error 2
builder for '/nix/store/6adcbvidll19h8i9zwgl8hjn5v8qg6bf-julia-1.5.3.drv' failed with exit code 2
error: build of '/nix/store/6adcbvidll19h8i9zwgl8hjn5v8qg6bf-julia-1.5.3.drv' failed

@idontgetoutmuch
Copy link
Contributor Author

#114855 but obviously it needs work

@samuela
Copy link
Member

samuela commented Jun 5, 2021

See also #123394

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/need-special-build-of-nightly-julia-version/14504/4

@stale
Copy link

stale bot commented Apr 28, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 28, 2022
@SuperSandro2000
Copy link
Member

See also #123394

Closing as dupe of that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

6 participants