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: fix static musl build #76832

Merged
merged 1 commit into from Jan 3, 2020
Merged

openblas: fix static musl build #76832

merged 1 commit into from Jan 3, 2020

Conversation

@FRidh
Copy link
Member

@FRidh FRidh commented Jan 2, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@FRidh
Copy link
Member Author

@FRidh FRidh commented Jan 2, 2020

Normal and cross builds still function.

@FRidh FRidh force-pushed the FRidh:openblas branch from e175388 to bf4b2f8 Jan 2, 2020
@FRidh FRidh changed the title openblas: fix pkgsStatic.openblas build openblas: fix static musl build Jan 2, 2020
@veprbl veprbl mentioned this pull request Jan 2, 2020
3 of 10 tasks complete
@veprbl
Copy link
Member

@veprbl veprbl commented Jan 2, 2020

#75798 currently implements a following change:

diff a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix
--- a/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/pkgs/development/libraries/science/math/openblas/default.nix
@@ -115,6 +115,9 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     perl
     which
+  ];
+
+  depsBuildBuild = [
     buildPackages.gfortran
     buildPackages.stdenv.cc
   ];

It may (or may not be) useful here.

@@ -60,7 +61,7 @@ let
TARGET = setTarget "ATHLON";
DYNAMIC_ARCH = true;
NO_AVX512 = true;
USE_OPENMP = true;
USE_OPENMP = !stdenv.hostPlatform.isMusl;

This comment has been minimized.

@FRidh

FRidh Jan 3, 2020
Author Member

just this seems to be sufficient actually to solve the omp issue

FC = "${stdenv.cc.targetPrefix}gfortran";
CC = "${stdenv.cc.targetPrefix}${if stdenv.cc.isClang then "clang" else "cc"}";
PREFIX = placeholder "out";
NUM_THREADS = 64;
INTERFACE64 = blas64;
NO_STATIC = !enableStatic;
NO_SHARED = !enableShared;

This comment has been minimized.

@FRidh

FRidh Jan 3, 2020
Author Member

this does speed up the build

This comment has been minimized.

@FRidh

FRidh Jan 3, 2020
Author Member

actually, it is also needed to prevent

/nix/store/394p75bacqaiv0xvyna0kazf2lg16sjs-x86_64-unknown-linux-musl-binutils-2.31.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/cmrar1sgj5jpr9h1ypf3s6sbphaxp8zk-x86_64-unknown-linux-musl-stage-final-gfortran-debug-9.2.0/lib/gcc/x86_64-unknown-linux-musl/9.2.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/nix/store/394p75bacqaiv0xvyna0kazf2lg16sjs-x86_64-unknown-linux-musl-binutils-2.31.1/bin/x86_64-unknown-linux-musl-ld: /nix/store/cmrar1sgj5jpr9h1ypf3s6sbphaxp8zk-x86_64-unknown-linux-musl-stage-final-gfortran-debug-9.2.0/lib/gcc/x86_64-unknown-linux-musl/9.2.0/crtend.o: relocation R_X86_64_32 against `.ctors' can not be used when making a shared object; recompile with -fPIC
/nix/store/394p75bacqaiv0xvyna0kazf2lg16sjs-x86_64-unknown-linux-musl-binutils-2.31.1/bin/x86_64-unknown-linux-musl-ld: final link failed: nonrepresentable section on output
CROSS = stdenv.hostPlatform != stdenv.buildPlatform;
HOSTCC = "cc";
HOSTCC = if stdenv.hostPlatform.isMusl then CC else "cc";

This comment has been minimized.

@FRidh

FRidh Jan 3, 2020
Author Member

this was fixed by using depsBuildBuild

@FRidh FRidh force-pushed the FRidh:openblas branch from 9dd93cc to dc48a32 Jan 3, 2020
@FRidh FRidh changed the title WIP openblas: fix static musl build openblas: fix static musl build Jan 3, 2020
@FRidh FRidh requested a review from tobim Jan 3, 2020
@FRidh FRidh merged commit 8675529 into NixOS:staging Jan 3, 2020
15 of 16 checks passed
15 of 16 checks passed
openblas on aarch64-linux
Details
openblas on x86_64-darwin Timed out, unknown build status
Details
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
openblas on x86_64-linux Success
Details
@FRidh FRidh deleted the FRidh:openblas branch Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.