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

Blas/Lapack cross fixes #92412

Merged
merged 3 commits into from
Aug 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/build-support/alternatives/blas/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ stdenv.mkDerivation {
exit 1
fi

nm -an "$libblas" | cut -f3 -d' ' > symbols
$NM -an "$libblas" | cut -f3 -d' ' > symbols
for symbol in ${toString blasFortranSymbols}; do
grep "^$symbol_$" symbols || { echo "$symbol" was not found in "$libblas"; exit 1; }
done
Expand Down
5 changes: 3 additions & 2 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ stdenv.mkDerivation {
wrap ${targetPrefix}gfortran $wrapper $ccPath/${targetPrefix}gfortran
ln -sv ${targetPrefix}gfortran $out/bin/${targetPrefix}g77
ln -sv ${targetPrefix}gfortran $out/bin/${targetPrefix}f77
export named_fc=${targetPrefix}gfortran
''

+ optionalString cc.langJava or false ''
Expand All @@ -232,8 +233,8 @@ stdenv.mkDerivation {

setupHooks = [
../setup-hooks/role.bash
./setup-hook.sh
];
] ++ stdenv.lib.optional (cc.langC or true) ./setup-hook.sh
++ stdenv.lib.optional (cc.langFortran or false) ./fortran-hook.sh;

postFixup =
''
Expand Down
11 changes: 11 additions & 0 deletions pkgs/build-support/cc-wrapper/fortran-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
getTargetRole
getTargetRoleWrapper

export FC${role_post}=@named_fc@

# If unset, assume the default hardening flags.
# These are different for fortran.
: ${NIX_HARDENING_ENABLE="stackprotector pic strictoverflow relro bindnow"}
export NIX_HARDENING_ENABLE
Comment on lines +6 to +9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this fortran-specific?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah - fortify & format don't work well in fortran. it's non-fatal, but we shouldn't need to set it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess this is kind of an issue since it does effect cc/c++ as well


unset -v role_post
2 changes: 1 addition & 1 deletion pkgs/development/libraries/science/math/arpack/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ stdenv.mkDerivation {
];

preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib:${blas}/lib:${lapack}/lib
'' else ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
'' + ''
Expand Down