diff --git a/math/lemon/files/patch-CMakeLists.txt b/math/lemon/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..e445e2bcd5a8 --- /dev/null +++ b/math/lemon/files/patch-CMakeLists.txt @@ -0,0 +1,15 @@ +-- Fix configure with CMake 4 by raising the minimum required CMake version +-- from 2.8 to 3.5 and removing the obsolete CMP0048 policy override. +-- CMake 4 no longer supports compatibility with CMake versions below 3.5 +-- and removed the OLD behavior of CMP0048. + +--- CMakeLists.txt.orig 2014-07-07 14:40:24 UTC ++++ CMakeLists.txt +@@ -1,6 +1,4 @@ +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +- +-CMAKE_POLICY(SET CMP0048 OLD) ++CMAKE_MINIMUM_REQUIRED(VERSION 3.5) + + SET(PROJECT_NAME "LEMON") + PROJECT(${PROJECT_NAME}) diff --git a/math/lemon/files/patch-lemon_bits_array__map.h b/math/lemon/files/patch-lemon_bits_array__map.h index 404c1faba292..a62c080157e4 100644 --- a/math/lemon/files/patch-lemon_bits_array__map.h +++ b/math/lemon/files/patch-lemon_bits_array__map.h @@ -1,108 +1,108 @@ -- Replace deprecated std::allocator::construct/destroy (removed in C++20) with -- placement new and explicit destructor calls. These are compatible with C++11 -- through C++26 and fix compilation of C++20 consumers of LEMON (e.g. OpenROAD). ---- lemon/bits/array_map.h.orig +--- lemon/bits/array_map.h.orig 2014-07-07 14:40:24 UTC +++ lemon/bits/array_map.h -@@ -88,7 +88,7 @@ +@@ -88,7 +88,7 @@ namespace lemon { Item it; for (nf->first(it); it != INVALID; nf->next(it)) { int id = nf->id(it);; - allocator.construct(&(values[id]), Value()); + ::new(static_cast(&(values[id]))) Value(); } } -@@ -102,7 +102,7 @@ +@@ -102,7 +102,7 @@ namespace lemon { Item it; for (nf->first(it); it != INVALID; nf->next(it)) { int id = nf->id(it);; - allocator.construct(&(values[id]), value); + ::new(static_cast(&(values[id]))) Value(value); } } -@@ -121,7 +121,7 @@ +@@ -121,7 +121,7 @@ namespace lemon { Item it; for (nf->first(it); it != INVALID; nf->next(it)) { int id = nf->id(it);; - allocator.construct(&(values[id]), copy.values[id]); + ::new(static_cast(&(values[id]))) Value(copy.values[id]); } } -@@ -218,15 +218,15 @@ +@@ -218,15 +218,15 @@ namespace lemon { for (nf->first(it); it != INVALID; nf->next(it)) { int jd = nf->id(it);; if (id != jd) { - allocator.construct(&(new_values[jd]), values[jd]); - allocator.destroy(&(values[jd])); + ::new(static_cast(&(new_values[jd]))) Value(values[jd]); + values[jd].~Value(); } } if (capacity != 0) allocator.deallocate(values, capacity); values = new_values; capacity = new_capacity; } - allocator.construct(&(values[id]), Value()); + ::new(static_cast(&(values[id]))) Value(); } // \brief Adds more new keys to the map. -@@ -260,8 +260,8 @@ +@@ -260,8 +260,8 @@ namespace lemon { } } if (found) continue; - allocator.construct(&(new_values[id]), values[id]); - allocator.destroy(&(values[id])); + ::new(static_cast(&(new_values[id]))) Value(values[id]); + values[id].~Value(); } if (capacity != 0) allocator.deallocate(values, capacity); values = new_values; -@@ -269,7 +269,7 @@ +@@ -269,7 +269,7 @@ namespace lemon { } for (int i = 0; i < int(keys.size()); ++i) { int id = nf->id(keys[i]); - allocator.construct(&(values[id]), Value()); + ::new(static_cast(&(values[id]))) Value(); } } -@@ -279,7 +279,7 @@ +@@ -279,7 +279,7 @@ namespace lemon { // and it overrides the erase() member function of the observer base. virtual void erase(const Key& key) { int id = Parent::notifier()->id(key); - allocator.destroy(&(values[id])); + values[id].~Value(); } // \brief Erase more keys from the map. -@@ -289,7 +289,7 @@ +@@ -289,7 +289,7 @@ namespace lemon { virtual void erase(const std::vector& keys) { for (int i = 0; i < int(keys.size()); ++i) { int id = Parent::notifier()->id(keys[i]); - allocator.destroy(&(values[id])); + values[id].~Value(); } } -@@ -303,7 +303,7 @@ +@@ -303,7 +303,7 @@ namespace lemon { Item it; for (nf->first(it); it != INVALID; nf->next(it)) { int id = nf->id(it);; - allocator.construct(&(values[id]), Value()); + ::new(static_cast(&(values[id]))) Value(); } } -@@ -317,7 +317,7 @@ +@@ -317,7 +317,7 @@ namespace lemon { Item it; for (nf->first(it); it != INVALID; nf->next(it)) { int id = nf->id(it); - allocator.destroy(&(values[id])); + values[id].~Value(); } allocator.deallocate(values, capacity); capacity = 0; diff --git a/math/lemon/files/patch-lemon_network__simplex.h b/math/lemon/files/patch-lemon_network__simplex.h index 1be67435f9f7..2533fcd0ef8c 100644 --- a/math/lemon/files/patch-lemon_network__simplex.h +++ b/math/lemon/files/patch-lemon_network__simplex.h @@ -1,24 +1,24 @@ -- Guard the NetworkSimplex class against the MAX(a,b) macro defined by FreeBSD system -- headers via . LEMON uses MAX as a member variable name; the macro -- expansion corrupts the constructor initializer list in C++20 code. -- Uses #pragma push_macro/pop_macro, supported by GCC, Clang and MSVC. ---- lemon/network_simplex.h.orig +--- lemon/network_simplex.h.orig 2014-07-07 14:40:24 UTC +++ lemon/network_simplex.h -@@ -71,6 +71,8 @@ +@@ -71,6 +71,8 @@ namespace lemon { /// \note %NetworkSimplex provides five different pivot rule /// implementations, from which the most efficient one is used /// by default. For more information, see \ref PivotRule. +#pragma push_macro("MAX") +#undef MAX template class NetworkSimplex { -@@ -1651,6 +1653,7 @@ +@@ -1651,6 +1653,7 @@ namespace lemon { } }; //class NetworkSimplex +#pragma pop_macro("MAX") ///@}