-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlapack95.nix
48 lines (41 loc) · 973 Bytes
/
lapack95.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
stdenv,
fetchurl,
gfortran,
lapack,
pkg-config,
}: let
version = "3.0";
in
stdenv.mkDerivation {
inherit version;
pname = "lapack95";
src = fetchurl {
url = "https://www.netlib.org/lapack95/lapack95.tgz";
hash = "sha256-VXEeWxxd3Jx90dPqFcN/xbQAeDrG6lc6deKxNYwsR5s=";
};
nativeBuildInputs = [gfortran pkg-config];
buildInputs = [lapack];
configurePhase = ''
cp ${./lapack95-make.inc} make.inc
'';
buildPhase = ''
pushd SRC
make single_double_complex_dcomplex
popd
'';
installPhase = ''
mkdir -p $out/lib
mkdir -p $out/lib/pkgconfig
mkdir -p $out/include
cp lapack95.* $out/lib
cp lapack95_modules/* $out/include
cat <<EOF > $out/lib/pkgconfig/lapack95.pc
Name: lapack95
Version: ${version}
Description: LAPACK FORTRAN 95 wrapper
Cflags: -I$out/include
Libs: -L$out/lib -l:lapack95.a
EOF
'';
}