tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
avy: fixes to work with clang and musl
Will Dietz
8 years ago
2974ed92
7eba45d0
+149
-1
3 changed files
expand all
collapse all
unified
split
pkgs
applications
science
logic
avy
default.nix
glucose-fenv.patch
minisat-fenv.patch
+19
-1
pkgs/applications/science/logic/avy/default.nix
···
12
12
};
13
13
14
14
buildInputs = [ cmake zlib boost.out boost.dev ];
15
15
-
NIX_CFLAGS_COMPILE = [ "-Wno-narrowing" ];
15
15
+
NIX_CFLAGS_COMPILE = [ "-Wno-narrowing" ]
16
16
+
# Squelch endless stream of warnings on same few things
17
17
+
++ stdenv.lib.optionals stdenv.cc.isClang [
18
18
+
"-Wno-empty-body"
19
19
+
"-Wno-tautological-compare"
20
20
+
"-Wc++11-compat-deprecated-writable-strings"
21
21
+
"-Wno-deprecated"
22
22
+
];
23
23
+
24
24
+
prePatch = ''
25
25
+
sed -i -e '1i#include <stdint.h>' abc/src/bdd/dsd/dsd.h
26
26
+
substituteInPlace abc/src/bdd/dsd/dsd.h --replace \
27
27
+
'((Child = Dsd_NodeReadDec(Node,Index))>=0);' \
28
28
+
'((intptr_t)(Child = Dsd_NodeReadDec(Node,Index))>=0);'
29
29
+
30
30
+
patch -p1 -d minisat -i ${./minisat-fenv.patch}
31
31
+
patch -p1 -d glucose -i ${./glucose-fenv.patch}
32
32
+
'';
33
33
+
16
34
patches =
17
35
[ ./0001-no-static-boost-libs.patch
18
36
];
+65
pkgs/applications/science/logic/avy/glucose-fenv.patch
···
1
1
+
From d6e0cb60270e8653bda3f339e3a07ce2cd2d6eb0 Mon Sep 17 00:00:00 2001
2
2
+
From: Will Dietz <w@wdtz.org>
3
3
+
Date: Tue, 17 Oct 2017 23:01:36 -0500
4
4
+
Subject: [PATCH] glucose: use fenv to set double precision
5
5
+
6
6
+
---
7
7
+
core/Main.cc | 8 ++++++--
8
8
+
simp/Main.cc | 8 ++++++--
9
9
+
utils/System.h | 2 +-
10
10
+
3 files changed, 13 insertions(+), 5 deletions(-)
11
11
+
12
12
+
diff --git a/core/Main.cc b/core/Main.cc
13
13
+
index c96aadd..994132b 100644
14
14
+
--- a/core/Main.cc
15
15
+
+++ b/core/Main.cc
16
16
+
@@ -96,8 +96,12 @@ int main(int argc, char** argv)
17
17
+
// printf("This is MiniSat 2.0 beta\n");
18
18
+
19
19
+
#if defined(__linux__)
20
20
+
- fpu_control_t oldcw, newcw;
21
21
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
22
22
+
+ fenv_t fenv;
23
23
+
+
24
24
+
+ fegetenv(&fenv);
25
25
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
26
26
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
27
27
+
+ fesetenv(&fenv);
28
28
+
printf("c WARNING: for repeatability, setting FPU to use double precision\n");
29
29
+
#endif
30
30
+
// Extra options:
31
31
+
diff --git a/simp/Main.cc b/simp/Main.cc
32
32
+
index 4f4772d..70c2e4b 100644
33
33
+
--- a/simp/Main.cc
34
34
+
+++ b/simp/Main.cc
35
35
+
@@ -97,8 +97,12 @@ int main(int argc, char** argv)
36
36
+
37
37
+
38
38
+
#if defined(__linux__)
39
39
+
- fpu_control_t oldcw, newcw;
40
40
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
41
41
+
+ fenv_t fenv;
42
42
+
+
43
43
+
+ fegetenv(&fenv);
44
44
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
45
45
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
46
46
+
+ fesetenv(&fenv);
47
47
+
printf("WARNING: for repeatability, setting FPU to use double precision\n");
48
48
+
#endif
49
49
+
// Extra options:
50
50
+
diff --git a/utils/System.h b/utils/System.h
51
51
+
index 004d498..a768e99 100644
52
52
+
--- a/utils/System.h
53
53
+
+++ b/utils/System.h
54
54
+
@@ -22,7 +22,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
55
55
+
#define Glucose_System_h
56
56
+
57
57
+
#if defined(__linux__)
58
58
+
-#include <fpu_control.h>
59
59
+
+#include <fenv.h>
60
60
+
#endif
61
61
+
62
62
+
#include "glucose/mtl/IntTypes.h"
63
63
+
--
64
64
+
2.14.2
65
65
+
+65
pkgs/applications/science/logic/avy/minisat-fenv.patch
···
1
1
+
From 7f1016ceab9b0f57a935bd51ca6df3d18439b472 Mon Sep 17 00:00:00 2001
2
2
+
From: Will Dietz <w@wdtz.org>
3
3
+
Date: Tue, 17 Oct 2017 22:57:02 -0500
4
4
+
Subject: [PATCH] use fenv instead of non-standard fpu_control
5
5
+
6
6
+
---
7
7
+
core/Main.cc | 8 ++++++--
8
8
+
simp/Main.cc | 8 ++++++--
9
9
+
utils/System.h | 2 +-
10
10
+
3 files changed, 13 insertions(+), 5 deletions(-)
11
11
+
12
12
+
diff --git a/core/Main.cc b/core/Main.cc
13
13
+
index 2b0d97b..8ad95fb 100644
14
14
+
--- a/core/Main.cc
15
15
+
+++ b/core/Main.cc
16
16
+
@@ -78,8 +78,12 @@ int main(int argc, char** argv)
17
17
+
// printf("This is MiniSat 2.0 beta\n");
18
18
+
19
19
+
#if defined(__linux__)
20
20
+
- fpu_control_t oldcw, newcw;
21
21
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
22
22
+
+ fenv_t fenv;
23
23
+
+
24
24
+
+ fegetenv(&fenv);
25
25
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
26
26
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
27
27
+
+ fesetenv(&fenv);
28
28
+
printf("WARNING: for repeatability, setting FPU to use double precision\n");
29
29
+
#endif
30
30
+
// Extra options:
31
31
+
diff --git a/simp/Main.cc b/simp/Main.cc
32
32
+
index 2804d7f..39bfb71 100644
33
33
+
--- a/simp/Main.cc
34
34
+
+++ b/simp/Main.cc
35
35
+
@@ -79,8 +79,12 @@ int main(int argc, char** argv)
36
36
+
// printf("This is MiniSat 2.0 beta\n");
37
37
+
38
38
+
#if defined(__linux__)
39
39
+
- fpu_control_t oldcw, newcw;
40
40
+
- _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
41
41
+
+ fenv_t fenv;
42
42
+
+
43
43
+
+ fegetenv(&fenv);
44
44
+
+ fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
45
45
+
+ fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
46
46
+
+ fesetenv(&fenv);
47
47
+
printf("WARNING: for repeatability, setting FPU to use double precision\n");
48
48
+
#endif
49
49
+
// Extra options:
50
50
+
diff --git a/utils/System.h b/utils/System.h
51
51
+
index 1758192..c0ad13a 100644
52
52
+
--- a/utils/System.h
53
53
+
+++ b/utils/System.h
54
54
+
@@ -22,7 +22,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
55
55
+
#define Minisat_System_h
56
56
+
57
57
+
#if defined(__linux__)
58
58
+
-#include <fpu_control.h>
59
59
+
+#include <fenv.h>
60
60
+
#endif
61
61
+
62
62
+
#include "mtl/IntTypes.h"
63
63
+
--
64
64
+
2.14.2
65
65
+