Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/extra/python-qdldl/0001-Fix-i686-builds.patch
blob: e8eb42bb636f19d2571ff88bbf7295cb4e84447e (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From 3516c7a43624d991b05669064ec1c00549f1d853 Mon Sep 17 00:00:00 2001
From: Tasos Sahanidis <tasos@tasossah.com>
Date: Sun, 8 Sep 2024 20:31:05 +0300
Subject: [PATCH] Fix i686 builds

---
 c/amd/include/SuiteSparse_config.h | 1 -
 c/amd/include/amd_internal.h       | 3 ---
 cpp/qdldl.cpp                      | 5 +++++
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/c/amd/include/SuiteSparse_config.h b/c/amd/include/SuiteSparse_config.h
index ea3cea4..5a15deb 100644
--- a/c/amd/include/SuiteSparse_config.h
+++ b/c/amd/include/SuiteSparse_config.h
@@ -43,7 +43,6 @@ extern "C" {
 #endif
 
 #include "qdldl_types.h"
-#define DLONG
 typedef QDLDL_float c_float;
 
 #include <limits.h>
diff --git a/c/amd/include/amd_internal.h b/c/amd/include/amd_internal.h
index eccde9f..cd745fd 100644
--- a/c/amd/include/amd_internal.h
+++ b/c/amd/include/amd_internal.h
@@ -38,9 +38,6 @@
 #endif
 
 #include "qdldl_types.h"
-#ifndef DLONG
-#define DLONG
-#endif
 
 /*
     To enable debugging, uncomment the following line:
diff --git a/cpp/qdldl.cpp b/cpp/qdldl.cpp
index e304dbe..4751926 100644
--- a/cpp/qdldl.cpp
+++ b/cpp/qdldl.cpp
@@ -1,5 +1,6 @@
 #include "qdldl.hpp"
 
+#include "qdldl/include/qdldl_types.h"
 using namespace qdldl;
 
 
@@ -31,7 +32,11 @@ Solver::Solver(QDLDL_int n, QDLDL_int * Ap, QDLDL_int *Ai, QDLDL_float * Ax){
 	Pinv = new QDLDL_int[n];
 
 	// Permutation
+#ifdef DLONG
 	QDLDL_int amd_status = amd_l_order(nx, Ap, Ai, P, NULL, NULL);
+#else
+	QDLDL_int amd_status = amd_order(nx, Ap, Ai, P, NULL, NULL);
+#endif
 	if (amd_status < 0)
 		throw std::runtime_error(std::string("Error in AMD computation ") + std::to_string(amd_status));
 
-- 
2.34.1