Skip to content

Commit

Permalink
new attempt at windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Coder committed Nov 16, 2023
1 parent 9a0508b commit 4e93144
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ] # windows-latest
os: [ ubuntu-latest, macos-latest, windows-latest ]

steps:
- uses: actions/checkout@v3
Expand Down
219 changes: 108 additions & 111 deletions fix_Array_windows.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,76 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/include/ogdf/basic/Array2D.h b/include/ogdf/basic/Array2D.h
--- a/include/ogdf/basic/Array2D.h (revision 7596a518d2b8a964523c2bbd86af360aa405c6cf)
+++ b/include/ogdf/basic/Array2D.h (date 1669110068224)
@@ -197,10 +197,11 @@
void copy(const Array2D<E> &array2);
--- a/include/ogdf/basic/Array2D.h (revision a4546cc009a133e174dceea02bca6eb45126e35a)
+++ b/include/ogdf/basic/Array2D.h (date 1700144964118)
@@ -201,9 +201,11 @@
void copy(const Array2D<E>& array2);
};

+}
+
//! Constructs the array with index set [\p a, ..., \p b]*[\p c, ..., \p d].
template<class E>
-void Array2D<E>::construct(int a, int b, int c, int d)
+void ogdf::Array2D<E>::construct(int a, int b, int c, int d)
{
-void Array2D<E>::construct(int a, int b, int c, int d) {
+void ogdf::Array2D<E>::construct(int a, int b, int c, int d) {
m_a = a;
m_b = b;
@@ -227,7 +228,7 @@
m_c = c;
@@ -229,7 +231,7 @@

//! Initializes the array with default constructor of \a E.
template<class E>
-void Array2D<E>::initialize()
+void ogdf::Array2D<E>::initialize()
{
E *pDest = m_pStart;
-void Array2D<E>::initialize() {
+void ogdf::Array2D<E>::initialize() {
E* pDest = m_pStart;
try {
@@ -244,7 +245,7 @@
for (; pDest < m_pStop; pDest++) {
@@ -246,7 +248,7 @@

//! Initializes the array with \p x.
template<class E>
-void Array2D<E>::initialize(const E &x)
+void ogdf::Array2D<E>::initialize(const E &x)
{
E *pDest = m_pStart;
-void Array2D<E>::initialize(const E& x) {
+void ogdf::Array2D<E>::initialize(const E& x) {
E* pDest = m_pStart;
try {
@@ -261,7 +262,7 @@
for (; pDest < m_pStop; pDest++) {
@@ -263,7 +265,7 @@

//! Call destructor of all elements.
template<class E>
-void Array2D<E>::deconstruct()
+void ogdf::Array2D<E>::deconstruct()
{
-void Array2D<E>::deconstruct() {
+void ogdf::Array2D<E>::deconstruct() {
if (!std::is_trivially_destructible<E>::value) {
for (E *pDest = m_pStart; pDest < m_pStop; pDest++)
@@ -272,7 +273,7 @@
for (E* pDest = m_pStart; pDest < m_pStop; pDest++) {
pDest->~E();
@@ -274,7 +276,7 @@

//! Copy \p array2.
template<class E>
-void Array2D<E>::copy(const Array2D<E> &array2)
+void ogdf::Array2D<E>::copy(const ogdf::Array2D<E> &array2)
{
-void Array2D<E>::copy(const Array2D<E>& array2) {
+void ogdf::Array2D<E>::copy(const ogdf::Array2D<E>& array2) {
construct(array2.m_a, array2.m_b, array2.m_c, array2.m_d);

@@ -287,7 +288,7 @@
if (m_pStart != 0) {
@@ -288,7 +290,7 @@

//! Computes the determinant via row expansion.
template<class E>
-float Array2D<E>::det() const
+float ogdf::Array2D<E>::det() const
{
-float Array2D<E>::det() const {
+float ogdf::Array2D<E>::det() const {
// matrix must be quadratic
OGDF_ASSERT(size1() == size2());
@@ -315,7 +316,7 @@

@@ -315,7 +317,7 @@

// Expanding along the first row (Laplace's Formula)
default:
- Array2D<E> remMatrix(0, n-2, 0, n-2); // the remaining matrix
+ ogdf::Array2D<E> remMatrix(0, n-2, 0, n-2); // the remaining matrix
for(column = c; column <= d; column++) {
- Array2D<E> remMatrix(0, n - 2, 0, n - 2); // the remaining matrix
+ ogdf::Array2D<E> remMatrix(0, n - 2, 0, n - 2); // the remaining matrix
for (column = c; column <= d; column++) {
int rem_i = 0;
int rem_j = 0;
@@ -340,4 +341,3 @@
@@ -339,4 +341,3 @@
return determinant;
}

Expand All @@ -84,134 +84,131 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/include/ogdf/basic/Array.h b/include/ogdf/basic/Array.h
--- a/include/ogdf/basic/Array.h (revision 7596a518d2b8a964523c2bbd86af360aa405c6cf)
+++ b/include/ogdf/basic/Array.h (date 1669110428195)
@@ -772,9 +772,11 @@
--- a/include/ogdf/basic/Array.h (revision a4546cc009a133e174dceea02bca6eb45126e35a)
+++ b/include/ogdf/basic/Array.h (date 1700145012037)
@@ -800,9 +800,11 @@
OGDF_NEW_DELETE
};

+}
+
// enlarges storage for array and moves old entries
template<class E, class INDEX>
-void Array<E, INDEX>::expandArray(INDEX add)
+void ogdf::Array<E, INDEX>::expandArray(INDEX add)
{
-void Array<E, INDEX>::expandArray(INDEX add) {
+void ogdf::Array<E, INDEX>::expandArray(INDEX add) {
INDEX sOld = size(), sNew = sOld + add;

@@ -793,7 +795,7 @@
// expand allocated memory block
@@ -822,7 +824,7 @@

// enlarges array by add elements and sets new elements to x
template<class E, class INDEX>
-void Array<E,INDEX>::grow(INDEX add, const E &x)
+void ogdf::Array<E,INDEX>::grow(INDEX add, const E &x)
{
if(add == 0) return;

@@ -807,7 +809,7 @@
-void Array<E, INDEX>::grow(INDEX add, const E& x) {
+void ogdf::Array<E, INDEX>::grow(INDEX add, const E& x) {
if (add == 0) {
return;
}
@@ -838,7 +840,7 @@

// enlarges array by add elements (initialized with default constructor)
template<class E, class INDEX>
-void Array<E,INDEX>::grow(INDEX add)
+void ogdf::Array<E,INDEX>::grow(INDEX add)
{
if(add == 0) return;

@@ -820,7 +822,7 @@
-void Array<E, INDEX>::grow(INDEX add) {
+void ogdf::Array<E, INDEX>::grow(INDEX add) {
if (add == 0) {
return;
}
@@ -853,7 +855,7 @@
}

template<class E, class INDEX>
-void Array<E,INDEX>::construct(INDEX a, INDEX b)
+void ogdf::Array<E,INDEX>::construct(INDEX a, INDEX b)
{
m_low = a; m_high = b;
INDEX s = b-a+1;
@@ -839,7 +841,7 @@

-void Array<E, INDEX>::construct(INDEX a, INDEX b) {
+void ogdf::Array<E, INDEX>::construct(INDEX a, INDEX b) {
m_low = a;
m_high = b;
INDEX s = b - a + 1;
@@ -873,7 +875,7 @@
}

template<class E, class INDEX>
-void Array<E,INDEX>::initialize()
+void ogdf::Array<E,INDEX>::initialize()
{
E *pDest = m_pStart;
-void Array<E, INDEX>::initialize() {
+void ogdf::Array<E, INDEX>::initialize() {
E* pDest = m_pStart;
try {
@@ -855,7 +857,7 @@

for (; pDest < m_pStop; pDest++) {
@@ -889,7 +891,7 @@
}

template<class E, class INDEX>
-void Array<E,INDEX>::initialize(const E &x)
+void ogdf::Array<E,INDEX>::initialize(const E &x)
{
E *pDest = m_pStart;
-void Array<E, INDEX>::initialize(const E& x) {
+void ogdf::Array<E, INDEX>::initialize(const E& x) {
E* pDest = m_pStart;
try {
@@ -871,7 +873,7 @@

for (; pDest < m_pStop; pDest++) {
@@ -905,7 +907,7 @@
}

template<class E, class INDEX>
-void Array<E, INDEX>::initialize(std::initializer_list<E> initList)
+void ogdf::Array<E, INDEX>::initialize(std::initializer_list<E> initList)
{
E *pDest = m_pStart;
-void Array<E, INDEX>::initialize(std::initializer_list<E> initList) {
+void ogdf::Array<E, INDEX>::initialize(std::initializer_list<E> initList) {
E* pDest = m_pStart;
try {
@@ -888,7 +890,7 @@

for (const E& x : initList) {
@@ -921,7 +923,7 @@
}

template<class E, class INDEX>
-void Array<E,INDEX>::deconstruct()
+void ogdf::Array<E,INDEX>::deconstruct()
{
-void Array<E, INDEX>::deconstruct() {
+void ogdf::Array<E, INDEX>::deconstruct() {
if (!std::is_trivially_destructible<E>::value) {
for (E *pDest = m_pStart; pDest < m_pStop; pDest++)
@@ -899,7 +901,7 @@

for (E* pDest = m_pStart; pDest < m_pStop; pDest++) {
pDest->~E();
@@ -931,7 +933,7 @@
}

template<class E, class INDEX>
-void Array<E,INDEX>::copy(const Array<E,INDEX> &array2)
+void ogdf::Array<E,INDEX>::copy(const ogdf::Array<E,INDEX> &array2)
{
-void Array<E, INDEX>::copy(const Array<E, INDEX>& array2) {
+void ogdf::Array<E, INDEX>::copy(const ogdf::Array<E, INDEX>& array2) {
construct(array2.m_low, array2.m_high);

@@ -918,7 +920,7 @@
if (m_pStart != nullptr) {
@@ -948,7 +950,7 @@
// permutes array a from a[l] to a[r] randomly
template<class E, class INDEX>
template<class RNG>
-void Array<E,INDEX>::permute (INDEX l, INDEX r, RNG &rng)
+void ogdf::Array<E,INDEX>::permute (INDEX l, INDEX r, RNG &rng)
{
-void Array<E, INDEX>::permute(INDEX l, INDEX r, RNG& rng) {
+void ogdf::Array<E, INDEX>::permute(INDEX l, INDEX r, RNG& rng) {
OGDF_ASSERT(low() <= l);
OGDF_ASSERT(l <= high());
@@ -933,9 +935,10 @@
OGDF_ASSERT(low() <= r);
@@ -962,6 +964,8 @@
}
}

+namespace ogdf{
//! Prints array \p a to output stream \p os using delimiter \p delim.
+namespace ogdf {
+
//! Prints array \p a to output stream \p os using delimiter \p delim.
template<class E, class INDEX>
-void print(std::ostream &os, const Array<E,INDEX> &a, char delim = ' ')
+void print(std::ostream &os, const ogdf::Array<E,INDEX> &a, char delim = ' ')
{
for (int i = a.low(); i <= a.high(); i++) {
if (i > a.low()) os << delim;
@@ -956,11 +959,10 @@
void print(std::ostream& os, const Array<E, INDEX>& a, char delim = ' ') {
@@ -984,11 +988,10 @@

#include <ogdf/basic/ArrayBuffer.h>

-namespace ogdf {

//! shift all items up to the last element of \p ind to the left
template<class E, class INDEX>
-void Array<E,INDEX>::leftShift(ArrayBuffer<INDEX, INDEX> &ind) {
+void ogdf::Array<E,INDEX>::leftShift(ogdf::ArrayBuffer<INDEX, INDEX> &ind) {
-void Array<E, INDEX>::leftShift(ArrayBuffer<INDEX, INDEX>& ind) {
+void ogdf::Array<E, INDEX>::leftShift(ogdf::ArrayBuffer<INDEX, INDEX>& ind) {
const INDEX nInd = ind.size();
if (nInd == 0) return;

@@ -983,9 +985,7 @@
if (nInd == 0) {
return;
@@ -1015,9 +1018,7 @@
}

template<class E, class INDEX>
-Array<E,INDEX>::Array(const ArrayBuffer<E, INDEX> &A) {
+ogdf::Array<E,INDEX>::Array(const ogdf::ArrayBuffer<E, INDEX> &A) {
construct(0,-1);
-Array<E, INDEX>::Array(const ArrayBuffer<E, INDEX>& A) {
+ogdf::Array<E, INDEX>::Array(const ogdf::ArrayBuffer<E, INDEX>& A) {
construct(0, -1);
A.compactCopy(*this);
}
-
Expand Down
17 changes: 12 additions & 5 deletions hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,20 @@ def initialize(self, version, build_data):

CONFIG = "Debug"
flags = [
"-DCMAKE_BUILD_TYPE=" + CONFIG, "-DBUILD_SHARED_LIBS=ON", "-DCMAKE_INSTALL_PREFIX=%s" % self.cmake_install_dir,
"-DOGDF_USE_ASSERT_EXCEPTIONS=ON", # "-DOGDF_USE_ASSERT_EXCEPTIONS_WITH=ON_LIBUNWIND",
"-DOGDF_MEMORY_MANAGER=POOL_TS",
# "-DOGDF_MEMORY_MANAGER=MALLOC_TS", "-DOGDF_LEAK_CHECK=ON",
"-DCMAKE_BUILD_TYPE=" + CONFIG, "-DBUILD_SHARED_LIBS=ON",
"-DCMAKE_INSTALL_PREFIX=%s" % self.cmake_install_dir,
"-DOGDF_WARNING_ERRORS=OFF",
"-DCMAKE_BUILD_RPATH=$ORIGIN;@loader_path", "-DCMAKE_INSTALL_RPATH=$ORIGIN;@loader_path", "-DMACOSX_RPATH=TRUE",
"-DCMAKE_BUILD_RPATH=$ORIGIN;@loader_path", "-DCMAKE_INSTALL_RPATH=$ORIGIN;@loader_path",
"-DMACOSX_RPATH=TRUE",
]
if CONFIG == "Debug" and not is_windows():
flags.extend([
"-DOGDF_USE_ASSERT_EXCEPTIONS=ON", # "-DOGDF_USE_ASSERT_EXCEPTIONS_WITH=ON_LIBUNWIND",
])
flags.extend([
"-DOGDF_MEMORY_MANAGER=POOL_TS",
# "-DOGDF_MEMORY_MANAGER=MALLOC_TS", "-DOGDF_LEAK_CHECK=ON",
])
self.run("cmake", self.ogdf_src_dir, *flags)

# import IPython
Expand Down

0 comments on commit 4e93144

Please sign in to comment.