14 Commits

Author SHA256 Message Date
59534ce49a Accepting request 1254896 from science
OBS-URL: https://build.opensuse.org/request/show/1254896
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netgen?expand=0&rev=18
2025-03-21 19:22:46 +00:00
5f33d2102e - drop unneeded pcre build dependency
OBS-URL: https://build.opensuse.org/package/show/science/netgen?expand=0&rev=53
2025-03-21 03:43:29 +00:00
8f79138675 Accepting request 1245195 from science
OBS-URL: https://build.opensuse.org/request/show/1245195
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netgen?expand=0&rev=17
2025-02-12 20:31:59 +00:00
b4c9102644 Accepting request 1245160 from openSUSE:Factory:RISCV
- Ignore tolerance failures on riscv64

OBS-URL: https://build.opensuse.org/request/show/1245160
OBS-URL: https://build.opensuse.org/package/show/science/netgen?expand=0&rev=51
2025-02-12 05:48:31 +00:00
b15e1e15ae Accepting request 1238758 from science
OBS-URL: https://build.opensuse.org/request/show/1238758
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netgen?expand=0&rev=16
2025-01-19 20:49:48 +00:00
da4818d4cd Accepting request 1238657 from home:StefanBruens:branches:science
- update to version 6.2.2406
  * no changelog provided
- Update patch:
  * 0001-Include-filesystem-from-experimental-for-GCC-7.patch

OBS-URL: https://build.opensuse.org/request/show/1238657
OBS-URL: https://build.opensuse.org/package/show/science/netgen?expand=0&rev=49
2025-01-19 04:33:04 +00:00
11785789a7 Accepting request 1233007 from science
OBS-URL: https://build.opensuse.org/request/show/1233007
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netgen?expand=0&rev=15
2024-12-22 17:05:08 +00:00
a53562e5e2 Accepting request 1232861 from home:StefanBruens:branches:science
- Enable python tests on Tumbleweed (requires python-check).
- Fix crash in boundarylayer tests, add
  * 0001-Fix-invalid-string-access-in-BoundaryLayerTool.patch

OBS-URL: https://build.opensuse.org/request/show/1232861
OBS-URL: https://build.opensuse.org/package/show/science/netgen?expand=0&rev=47
2024-12-22 04:42:23 +00:00
1cf43ebd78 Accepting request 1231976 from science
OBS-URL: https://build.opensuse.org/request/show/1231976
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netgen?expand=0&rev=14
2024-12-19 20:40:44 +00:00
b51157575e Accepting request 1231975 from home:StefanBruens:branches:science
- Amend patches for Leap 15.x
  * 0001-Include-filesystem-from-experimental-for-GCC-7.patch
- Fix crash due to wrong initialization order, add
  * 0001-Fix-static-initialization-order-for-UserFormatRegist.patch

OBS-URL: https://build.opensuse.org/request/show/1231975
OBS-URL: https://build.opensuse.org/package/show/science/netgen?expand=0&rev=45
2024-12-19 02:03:55 +00:00
9c893b204f Accepting request 1231385 from science
OBS-URL: https://build.opensuse.org/request/show/1231385
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netgen?expand=0&rev=13
2024-12-16 18:17:59 +00:00
8605d458dd Accepting request 1231282 from home:StefanBruens:branches:science
- Remove erroneous dependency on the python module, add
  * 0001-Do-not-EXPORT-python-modules-as-CMake-targets.patch

OBS-URL: https://build.opensuse.org/request/show/1231282
OBS-URL: https://build.opensuse.org/package/show/science/netgen?expand=0&rev=43
2024-12-16 11:44:32 +00:00
39b7617f7c Accepting request 1229018 from science
OBS-URL: https://build.opensuse.org/request/show/1229018
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netgen?expand=0&rev=12
2024-12-08 10:37:58 +00:00
7171ae0433 Accepting request 1228737 from home:StefanBruens:branches:science
- update to version 6.2.2404
  * no changelog provided
- Rebase:
  * 0001-Include-filesystem-from-experimental-for-GCC-7.patch
  * 0001-Disable-backtrace-generation.patch
- Add:
  * 0001-Fix-ODR-violation-for-struct-class-Line.patch
  * 0002-Add-missing-includes-for-std-string-std-cerr-fix-nam.patch

OBS-URL: https://build.opensuse.org/request/show/1228737
OBS-URL: https://build.opensuse.org/package/show/science/netgen?expand=0&rev=41
2024-12-07 10:28:17 +00:00
11 changed files with 619 additions and 43 deletions

View File

@@ -20,7 +20,7 @@ index b89d721e..335e3411 100644
// ********* STUFF FOR GETBACKTRACE ***************************
-#ifdef __GNUC__
-#if defined __GNUC__ && !defined __EMSCRIPTEN__
+#if 0
#include <execinfo.h>

View File

@@ -0,0 +1,39 @@
From bdda2186743ce98bd538337f6a7114152d5615a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 15 Dec 2024 21:11:15 +0100
Subject: [PATCH] Do not EXPORT python modules as CMake targets
These are not build time linkable libraries, thus not useful targets,
and EXPORTing these make them (and all transitive python dependencies)
a hard dependency in the CMake config.
Fixes #200.
---
ng/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ng/CMakeLists.txt b/ng/CMakeLists.txt
index b5a1985..51bc03c 100644
--- a/ng/CMakeLists.txt
+++ b/ng/CMakeLists.txt
@@ -45,7 +45,7 @@ if(USE_PYTHON)
set_target_properties( ngpy PROPERTIES OUTPUT_NAME "libngpy")
endif()
set_target_properties(ngpy PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/../${NETGEN_PYTHON_RPATH}")
- install(TARGETS ngpy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen EXPORT netgen-targets)
+ install(TARGETS ngpy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen)
if(USE_GUI)
add_library(ngguipy SHARED ngguipy.cpp)
@@ -57,7 +57,7 @@ if(USE_PYTHON)
set_target_properties( ngguipy PROPERTIES OUTPUT_NAME "libngguipy")
endif()
set_target_properties(ngguipy PROPERTIES INSTALL_RPATH "${NG_RPATH_TOKEN}/../${NETGEN_PYTHON_RPATH}")
- install(TARGETS ngguipy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen EXPORT netgen-targets)
+ install(TARGETS ngguipy DESTINATION ${NG_INSTALL_DIR_PYTHON}/${NG_INSTALL_SUFFIX} COMPONENT netgen)
endif(USE_GUI)
endif(USE_PYTHON)
--
2.47.1

View File

@@ -0,0 +1,33 @@
From b1bfab8f1df38ff35b87edeb033be3aec6b35ce3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Fri, 6 Dec 2024 01:20:31 +0100
Subject: [PATCH 1/2] Fix ODR violation for struct/class Line
Another class Line is defined in occ/occgeom.hpp.
---
libsrc/meshing/basegeom.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp
index 379185f..56d8135 100644
--- a/libsrc/meshing/basegeom.cpp
+++ b/libsrc/meshing/basegeom.cpp
@@ -213,6 +213,7 @@ namespace netgen
}
}
+namespace {
struct Line
{
Point<3> p0, p1;
@@ -229,6 +230,7 @@ namespace netgen
return 1e99;
}
};
+}
void NetgenGeometry :: Clear()
{
--
2.47.1

View File

@@ -0,0 +1,28 @@
From cd9a7c5dd2e0a195f521bf316641b2e8b189b153 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Fri, 20 Dec 2024 14:29:28 +0100
Subject: [PATCH] Fix invalid string access in BoundaryLayerTool
When AddFaceDescriptor reallocates the array the fd reference becomes
dangling.
---
libsrc/meshing/boundarylayer.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libsrc/meshing/boundarylayer.cpp b/libsrc/meshing/boundarylayer.cpp
index 9db4601..bcfc8c2 100644
--- a/libsrc/meshing/boundarylayer.cpp
+++ b/libsrc/meshing/boundarylayer.cpp
@@ -722,7 +722,8 @@ namespace netgen
new_fd.SetBCProperty(new_si);
mesh.AddFaceDescriptor(new_fd);
si_map[facei] = new_si;
- mesh.SetBCName(new_si-1, fd.GetBCName());
+ // AddFaceDescriptor may reallocate, fd is invalidated
+ mesh.SetBCName(new_si-1, mesh.GetFaceDescriptor(facei).GetBCName());
face_done.SetBit(facei);
}
}
--
2.47.1

View File

@@ -0,0 +1,137 @@
From 8ac2961d1ac7522c018fe05ce95ba39cc63cf75a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Thu, 19 Dec 2024 01:28:35 +0100
Subject: [PATCH] Fix static initialization order for UserFormatRegister map
A std::map is in an invalid state when just zero-initialized, and needs
to be initialized by its constructor. As this initilization may be done
after the first call to Register, a crash will typically happen.
To fix this wrap all accesses to the map with a Meyers Singleton. Also
remove the extra Array - most accesses are using the key, and the few
format list iterations all sort the result afterwards anyway.
---
libsrc/interface/writeuser.cpp | 31 +++++++++++++++++++++++++------
libsrc/interface/writeuser.hpp | 25 ++++++++-----------------
libsrc/meshing/python_mesh.cpp | 4 +++-
3 files changed, 36 insertions(+), 24 deletions(-)
diff --git a/libsrc/interface/writeuser.cpp b/libsrc/interface/writeuser.cpp
index 04f3780..68af173 100644
--- a/libsrc/interface/writeuser.cpp
+++ b/libsrc/interface/writeuser.cpp
@@ -16,19 +16,38 @@
namespace netgen
{
- extern MeshingParameters mparam;
+ std::map<std::string, UserFormatRegister::UserFormatEntry>& UserFormatRegister::getFormats()
+ {
+ static std::map<std::string, UserFormatRegister::UserFormatEntry> formats = {};
+ return formats;
+ }
- Array<UserFormatRegister::UserFormatEntry> UserFormatRegister::entries;
- std::map<string, int> UserFormatRegister::format_to_entry_index;
+ void UserFormatRegister::Register(UserFormatRegister::UserFormatEntry && entry)
+ {
+ getFormats()[entry.format] = std::move(entry);
+ }
+
+ const bool UserFormatRegister::HaveFormat(string format)
+ {
+ const auto formats = getFormats();
+ return formats.find(format) != formats.end();
+ }
+
+ const UserFormatRegister::UserFormatEntry & UserFormatRegister::Get(string format)
+ {
+ return getFormats()[format];
+ }
+
+ extern MeshingParameters mparam;
void RegisterUserFormats (NgArray<const char*> & names,
NgArray<const char*> & extensions)
{
- for (const auto & entry : UserFormatRegister::entries)
+ for (const auto & entry : UserFormatRegister::getFormats())
{
- names.Append (entry.format.c_str());
- extensions.Append (entry.extensions[0].c_str());
+ names.Append (entry.second.format.c_str());
+ extensions.Append (entry.second.extensions[0].c_str());
}
}
diff --git a/libsrc/interface/writeuser.hpp b/libsrc/interface/writeuser.hpp
index 1835707..961d1e4 100644
--- a/libsrc/interface/writeuser.hpp
+++ b/libsrc/interface/writeuser.hpp
@@ -32,32 +32,23 @@ struct UserFormatRegister {
optional<FRead> read;
optional<FWrite> write;
};
- DLL_HEADER static Array<UserFormatEntry> entries;
- DLL_HEADER static std::map<string, int> format_to_entry_index;
+ static void Register(UserFormatEntry && entry);
- static void Register(UserFormatEntry && entry) {
- format_to_entry_index[entry.format] = entries.Size();
- entries.Append( std::move(entry) );
- }
-
- static const bool HaveFormat(string format) {
- return format_to_entry_index.count(format) > 0;
- }
- static const UserFormatEntry & Get(string format) {
- return entries[format_to_entry_index[format]];
- }
+ static const bool HaveFormat(string format);
+ DLL_HEADER static const UserFormatEntry & Get(string format);
template<typename TFunc>
static void IterateFormats(TFunc func, bool need_read=false, bool need_write=false) {
Array<string> import_formats;
- for(const auto & e: entries)
- if((!need_read || e.read) && (!need_write || e.write))
- import_formats.Append(e.format);
+ for(const auto & e: getFormats())
+ if((!need_read || e.second.read) && (!need_write || e.second.write))
+ import_formats.Append(e.second.format);
QuickSort(import_formats);
for(auto format : import_formats)
- func(entries[format_to_entry_index[format]]);
+ func(Get(format));
}
+ DLL_HEADER static std::map<std::string, UserFormatEntry>& getFormats();
};
struct RegisterUserFormat {
diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp
index 3a652e0..bd774d8 100644
--- a/libsrc/meshing/python_mesh.cpp
+++ b/libsrc/meshing/python_mesh.cpp
@@ -660,7 +660,8 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
string export_docu = "Export mesh to other file format. Supported formats are:\n";
Array<string> export_formats;
- for(auto & e : UserFormatRegister::entries)
+ for(auto & kv : UserFormatRegister::getFormats()) {
+ const auto e = kv.second;
if(e.write) {
string s = '\t'+e.format+"\t("+e.extensions[0];
for(auto & ext : e.extensions.Range(1, e.extensions.Size()))
@@ -668,6 +669,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
s += ")\n";
export_formats.Append(s);
}
+ }
QuickSort(export_formats);
for(const auto & s : export_formats)
export_docu += s;
--
2.47.1

View File

@@ -1,21 +1,40 @@
From b74697b6151f78b3952c8378f98ecbff3b6f9f73 Mon Sep 17 00:00:00 2001
From cc76ca399f1782d94583512ca7d7a0199ca83457 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Wed, 13 Jul 2022 15:58:16 +0200
Subject: [PATCH] Include filesystem from experimental for GCC 7
---
libsrc/core/archive.hpp | 16 +++++++++++-----
libsrc/core/utils.cpp | 6 ++----
libsrc/core/utils.hpp | 13 +++++++------
libsrc/general/mystring.hpp | 5 +++++
libsrc/meshing/meshclass.hpp | 7 ++++++-
5 files changed, 31 insertions(+), 16 deletions(-)
libsrc/core/CMakeLists.txt | 3 +++
libsrc/core/archive.hpp | 16 +++++++++++-----
libsrc/core/utils.cpp | 12 +++++-------
libsrc/core/utils.hpp | 21 +++++++++++----------
libsrc/general/gzstream.cpp | 6 +++---
libsrc/general/gzstream.h | 22 +++++++++++++++-------
libsrc/general/mystring.hpp | 5 +++++
libsrc/interface/writeuser.hpp | 10 +++++++---
libsrc/meshing/meshclass.hpp | 7 ++++++-
ng/ngpkg.cpp | 4 ++--
10 files changed, 68 insertions(+), 38 deletions(-)
diff --git a/libsrc/core/CMakeLists.txt b/libsrc/core/CMakeLists.txt
index 39d7fd6..a85a414 100644
--- a/libsrc/core/CMakeLists.txt
+++ b/libsrc/core/CMakeLists.txt
@@ -46,6 +46,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(ngcore PUBLIC "-fabi-version=${cxx_abi_version}")
endif()
endif(USE_PYTHON)
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)
+ target_link_libraries(ngcore PRIVATE stdc++fs)
+ endif()
endif()
if(USE_PYTHON)
diff --git a/libsrc/core/archive.hpp b/libsrc/core/archive.hpp
index 4271e725..a4dee54b 100644
index 8a3d7a3..be5ea23 100644
--- a/libsrc/core/archive.hpp
+++ b/libsrc/core/archive.hpp
@@ -5,7 +5,13 @@
@@ -6,7 +6,13 @@
#include <array> // for array
#include <complex> // for complex
#include <cstring> // for size_t, strlen
@@ -30,7 +49,7 @@ index 4271e725..a4dee54b 100644
#include <fstream> // for ifstream, ofstream
#include <functional> // for function
#include <map> // for map
@@ -741,7 +747,7 @@ namespace ngcore
@@ -862,7 +868,7 @@ namespace ngcore
BinaryOutArchive(std::shared_ptr<std::ostream>&& astream)
: Archive(true), stream(std::move(astream))
{ }
@@ -39,7 +58,7 @@ index 4271e725..a4dee54b 100644
: BinaryOutArchive(std::make_shared<std::ofstream>(filename)) {}
~BinaryOutArchive () override { FlushBuffer(); }
@@ -829,7 +835,7 @@ namespace ngcore
@@ -958,7 +964,7 @@ namespace ngcore
BinaryInArchive (std::shared_ptr<std::istream>&& astream)
: Archive(false), stream(std::move(astream))
{ }
@@ -48,7 +67,7 @@ index 4271e725..a4dee54b 100644
: BinaryInArchive(std::make_shared<std::ifstream>(filename)) { ; }
using Archive::operator&;
@@ -904,7 +910,7 @@ namespace ngcore
@@ -1058,7 +1064,7 @@ namespace ngcore
TextOutArchive (std::shared_ptr<std::ostream>&& astream)
: Archive(true), stream(std::move(astream))
{ }
@@ -57,7 +76,7 @@ index 4271e725..a4dee54b 100644
TextOutArchive(std::make_shared<std::ofstream>(filename)) { }
using Archive::operator&;
@@ -959,7 +965,7 @@ namespace ngcore
@@ -1113,7 +1119,7 @@ namespace ngcore
TextInArchive (std::shared_ptr<std::istream>&& astream) :
Archive(false), stream(std::move(astream))
{ }
@@ -67,19 +86,19 @@ index 4271e725..a4dee54b 100644
using Archive::operator&;
diff --git a/libsrc/core/utils.cpp b/libsrc/core/utils.cpp
index 62d4d136..184342ae 100644
index 4ab08f3..ba454f6 100644
--- a/libsrc/core/utils.cpp
+++ b/libsrc/core/utils.cpp
@@ -7,8 +7,6 @@
#include <cxxabi.h>
#endif
@@ -13,8 +13,6 @@
#endif //WIN32
//
#include <array>
-#include <filesystem>
-#include <iostream>
#include <regex>
#include "ngstream.hpp"
@@ -112,10 +110,10 @@ namespace ngcore
#include <string>
#include <thread>
@@ -135,16 +133,16 @@ namespace ngcore
#endif
}
@@ -92,8 +111,33 @@ index 62d4d136..184342ae 100644
path += ".temp_netgen_file_"+ToString(counter++)+"_"+ToString(GetTimeCounter());
return path;
}
- SharedLibrary :: SharedLibrary(const std::filesystem::path & lib_name_, std::optional<std::filesystem::path> directory_to_delete_, bool global )
+ SharedLibrary :: SharedLibrary(const filesystem::path & lib_name_, std::optional<filesystem::path> directory_to_delete_, bool global )
: lib_name(lib_name_),directory_to_delete(directory_to_delete_)
{
Load(lib_name, global);
@@ -160,7 +158,7 @@ namespace ngcore
// wait for it to finish (up to a second)
try
{
- std::filesystem::remove_all(*directory_to_delete);
+ filesystem::remove_all(*directory_to_delete);
directory_to_delete = std::nullopt;
break;
}
@@ -173,7 +171,7 @@ namespace ngcore
std::cerr << "Could not delete " << directory_to_delete->string() << std::endl;
}
- void SharedLibrary :: Load( const std::filesystem::path & lib_name_, bool global )
+ void SharedLibrary :: Load( const filesystem::path & lib_name_, bool global )
{
Unload();
lib_name = lib_name_;
diff --git a/libsrc/core/utils.hpp b/libsrc/core/utils.hpp
index d072be47..32f4c9f6 100644
index a503d53..a7a8f51 100644
--- a/libsrc/core/utils.hpp
+++ b/libsrc/core/utils.hpp
@@ -3,7 +3,13 @@
@@ -109,8 +153,8 @@ index d072be47..32f4c9f6 100644
+#endif
#include <map>
#include <ostream>
#include <sstream>
@@ -96,11 +102,6 @@ namespace ngcore
#include <optional>
@@ -99,11 +105,6 @@ namespace ngcore
return res;
}
@@ -119,20 +163,143 @@ index d072be47..32f4c9f6 100644
- return ToLower(p.string());
- }
-
template<typename T1, typename T2>
std::ostream& operator << (std::ostream& ost, const std::map<T1,T2>& map)
{
@@ -221,7 +222,7 @@ namespace ngcore
template <class T>
@@ -346,7 +347,7 @@ namespace ngcore
NGCORE_API int GetCompiledSIMDSize();
NGCORE_API bool IsRangeCheckEnabled();
- NGCORE_API std::filesystem::path GetTempFilename();
+ NGCORE_API filesystem::path GetTempFilename();
} // namespace ngcore
NGCORE_API void* GetRawSymbol( std::string func_name );
@@ -359,13 +360,13 @@ namespace ngcore
// Class to handle/load shared libraries
class NGCORE_API SharedLibrary
{
- std::filesystem::path lib_name;
- std::optional<std::filesystem::path> directory_to_delete = std::nullopt;
+ filesystem::path lib_name;
+ std::optional<filesystem::path> directory_to_delete = std::nullopt;
void *lib = nullptr;
public:
SharedLibrary() = default;
- SharedLibrary(const std::filesystem::path & lib_name_, std::optional<std::filesystem::path> directory_to_delete_ = std::nullopt, bool global = false );
+ SharedLibrary(const filesystem::path & lib_name_, std::optional<filesystem::path> directory_to_delete_ = std::nullopt, bool global = false );
SharedLibrary(const SharedLibrary &) = delete;
SharedLibrary & operator =(const SharedLibrary &) = delete;
@@ -378,7 +379,7 @@ namespace ngcore
return reinterpret_cast<TFunc>(GetRawSymbol(func_name));
}
- void Load( const std::filesystem::path & lib_name_, bool global = true);
+ void Load( const filesystem::path & lib_name_, bool global = true);
void Unload();
void* GetRawSymbol( std::string func_name );
};
diff --git a/libsrc/general/gzstream.cpp b/libsrc/general/gzstream.cpp
index 968c07f..78a67a3 100644
--- a/libsrc/general/gzstream.cpp
+++ b/libsrc/general/gzstream.cpp
@@ -44,7 +44,7 @@ namespace GZSTREAM_NAMESPACE {
// class gzstreambuf:
// --------------------------------------
- gzstreambuf* gzstreambuf::open( const std::filesystem::path & name, int open_mode) {
+ gzstreambuf* gzstreambuf::open( const filesystem::path & name, int open_mode) {
if ( is_open())
return (gzstreambuf*)0;
mode = open_mode;
@@ -143,7 +143,7 @@ int gzstreambuf::sync() {
// class gzstreambase:
// --------------------------------------
- gzstreambase::gzstreambase( const std::filesystem::path & name, int mode) {
+ gzstreambase::gzstreambase( const filesystem::path & name, int mode) {
init( &buf);
open( name.c_str(), mode);
}
@@ -152,7 +152,7 @@ gzstreambase::~gzstreambase() {
buf.close();
}
- void gzstreambase::open( const std::filesystem::path & name, int open_mode) {
+ void gzstreambase::open( const filesystem::path & name, int open_mode) {
if ( ! buf.open( name.c_str(), open_mode))
clear( rdstate() | std::ios::badbit);
}
diff --git a/libsrc/general/gzstream.h b/libsrc/general/gzstream.h
index 20a7779..d05826a 100644
--- a/libsrc/general/gzstream.h
+++ b/libsrc/general/gzstream.h
@@ -34,6 +34,14 @@
#include <fstream>
#include <zlib.h>
+#if defined(__GNUC__) && (__GNUC__ < 8)
+#include <experimental/filesystem>
+namespace filesystem = std::experimental::filesystem;
+#else
+#include <filesystem> // for filesystem::path
+namespace filesystem = std::filesystem;
+#endif
+
#ifdef GZSTREAM_NAMESPACE
namespace GZSTREAM_NAMESPACE {
#endif
@@ -62,7 +70,7 @@ public:
// ASSERT: both input & output capabilities will not be used together
}
int is_open() { return opened; }
- gzstreambuf* open( const std::filesystem::path & name, int open_mode);
+ gzstreambuf* open( const filesystem::path & name, int open_mode);
gzstreambuf* close();
~gzstreambuf() { close(); }
@@ -76,9 +84,9 @@ protected:
gzstreambuf buf;
public:
gzstreambase() { init(&buf); }
- gzstreambase( const std::filesystem::path & name, int open_mode);
+ gzstreambase( const filesystem::path & name, int open_mode);
~gzstreambase();
- void open( const std::filesystem::path & name, int open_mode);
+ void open( const filesystem::path & name, int open_mode);
void close();
gzstreambuf* rdbuf() { return &buf; }
};
@@ -92,10 +100,10 @@ public:
class DLL_HEADER igzstream : public gzstreambase, public std::istream {
public:
igzstream() : std::istream( &buf) {}
- igzstream( const std::filesystem::path & name, int open_mode = std::ios::in)
+ igzstream( const filesystem::path & name, int open_mode = std::ios::in)
: gzstreambase( name, open_mode), std::istream( &buf) {}
gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); }
- void open( const std::filesystem::path & name, int open_mode = std::ios::in) {
+ void open( const filesystem::path & name, int open_mode = std::ios::in) {
gzstreambase::open( name, open_mode);
}
};
@@ -103,10 +111,10 @@ public:
class DLL_HEADER ogzstream : public gzstreambase, public std::ostream {
public:
ogzstream() : std::ostream( &buf) {}
- ogzstream( const std::filesystem::path & name, int mode = std::ios::out)
+ ogzstream( const filesystem::path & name, int mode = std::ios::out)
: gzstreambase( name, mode), std::ostream( &buf) {}
gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); }
- void open( const std::filesystem::path & name, int open_mode = std::ios::out) {
+ void open( const filesystem::path & name, int open_mode = std::ios::out) {
gzstreambase::open( name, open_mode);
}
};
diff --git a/libsrc/general/mystring.hpp b/libsrc/general/mystring.hpp
index ee364d77..5eb39df9 100644
index 4f2167e..edb2b9b 100644
--- a/libsrc/general/mystring.hpp
+++ b/libsrc/general/mystring.hpp
@@ -19,7 +19,12 @@
@@ -148,8 +315,36 @@ index ee364d77..5eb39df9 100644
namespace netgen
{
diff --git a/libsrc/interface/writeuser.hpp b/libsrc/interface/writeuser.hpp
index 99dc21e..1835707 100644
--- a/libsrc/interface/writeuser.hpp
+++ b/libsrc/interface/writeuser.hpp
@@ -7,7 +7,13 @@
/* Date: 10. Dec. 97 */
/**************************************************************************/
-#include <filesystem>
+#if defined(__GNUC__) && (__GNUC__ < 8)
+#include <experimental/filesystem>
+namespace filesystem = std::experimental::filesystem;
+#else
+#include <filesystem> // for filesystem::path
+namespace filesystem = std::filesystem;
+#endif
#include <functional>
#include <optional>
@@ -15,8 +21,6 @@
namespace netgen {
-using namespace std::filesystem;
-
typedef std::function<void (const Mesh & mesh, const filesystem::path & filename)> FWrite;
typedef std::function<void (Mesh & mesh, const filesystem::path & filename)> FRead;
typedef std::function<bool (const filesystem::path & filename)> FTest;
diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp
index 0d063963..5f278107 100644
index 4be51c8..9635863 100644
--- a/libsrc/meshing/meshclass.hpp
+++ b/libsrc/meshing/meshclass.hpp
@@ -11,7 +11,12 @@
@@ -164,8 +359,30 @@ index 0d063963..5f278107 100644
+#include <filesystem>
+#endif
namespace netgen
{
#include <gprim/adtree.hpp>
#include <gprim/transform3d.hpp>
diff --git a/ng/ngpkg.cpp b/ng/ngpkg.cpp
index 8b6a245..fe728cd 100644
--- a/ng/ngpkg.cpp
+++ b/ng/ngpkg.cpp
@@ -2132,7 +2132,7 @@ namespace netgen
#endif // JPEGLIB
{
string command;
- std::filesystem::path filepath(filename);
+ filesystem::path filepath(filename);
bool need_conversion = filepath.extension() != ".ppm";
if (need_conversion)
@@ -2163,7 +2163,7 @@ namespace netgen
return TCL_ERROR;
}
- std::filesystem::remove(filepath);
+ filesystem::remove(filepath);
}
return TCL_OK;
--
2.37.0
2.48.1

View File

@@ -0,0 +1,46 @@
From 8b281f03f2972be460d690cf5eb6e4d8129dc0bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Fri, 6 Dec 2024 01:22:02 +0100
Subject: [PATCH 2/2] Add missing includes for std::string/std::cerr, fix
namespaces
---
ng/encoding.hpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ng/encoding.hpp b/ng/encoding.hpp
index 9ea2ffb..f6ee27c 100644
--- a/ng/encoding.hpp
+++ b/ng/encoding.hpp
@@ -15,6 +15,8 @@ extern "C" {
#include <libswscale/swscale.h>
#include <libswresample/swresample.h>
}
+#include <string>
+#include <iostream>
constexpr int BITRATE = 50000000;
@@ -55,6 +57,8 @@ class Mpeg {
int height;
bool IsStarted() { return is_started; }
int AddFrame() {
+ using std::cerr;
+ using std::endl;
int ret;
int got_packet = 0;
AVPacket pkt = { 0 };
@@ -113,7 +117,9 @@ class Mpeg {
return 0;
}
- int Start(string filename) {
+ int Start(std::string filename) {
+ using std::cerr;
+ using std::endl;
AVCodec *video_codec;
if(is_started) {
cerr << "Stream already started" << endl;
--
2.47.1

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c8d62a193ffd9a6350eeaa56bcbfc2016fc65c93a496fa9fe2f1104d29982317
size 3394480

3
netgen-6.2.2406.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b11e0b52ae9d54b8da5984d33e75616ef23d56ca37872004d8125f0b8b94e199
size 3452436

View File

@@ -1,3 +1,54 @@
-------------------------------------------------------------------
Thu Mar 20 21:10:12 UTC 2025 - Andreas Stieger <andreas.stieger@gmx.de>
- drop unneeded pcre build dependency
-------------------------------------------------------------------
Tue Feb 11 17:08:12 UTC 2025 - Andreas Schwab <schwab@suse.de>
- Ignore tolerance failures on riscv64
-------------------------------------------------------------------
Sat Jan 18 09:51:50 UTC 2025 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- update to version 6.2.2406
* no changelog provided
- Update patch:
* 0001-Include-filesystem-from-experimental-for-GCC-7.patch
-------------------------------------------------------------------
Fri Dec 20 13:30:27 UTC 2024 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- Enable python tests on Tumbleweed (requires python-check).
- Fix crash in boundarylayer tests, add
* 0001-Fix-invalid-string-access-in-BoundaryLayerTool.patch
-------------------------------------------------------------------
Wed Dec 18 00:09:50 UTC 2024 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- Amend patches for Leap 15.x
* 0001-Include-filesystem-from-experimental-for-GCC-7.patch
- Fix crash due to wrong initialization order, add
* 0001-Fix-static-initialization-order-for-UserFormatRegist.patch
-------------------------------------------------------------------
Sun Dec 15 20:11:26 UTC 2024 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- Remove erroneous dependency on the python module, add
* 0001-Do-not-EXPORT-python-modules-as-CMake-targets.patch
-------------------------------------------------------------------
Thu Dec 5 16:28:50 UTC 2024 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
- update to version 6.2.2404
* no changelog provided
- Rebase:
* 0001-Include-filesystem-from-experimental-for-GCC-7.patch
* 0001-Disable-backtrace-generation.patch
- Add:
* 0001-Fix-ODR-violation-for-struct-class-Line.patch
* 0002-Add-missing-includes-for-std-string-std-cerr-fix-nam.patch
-------------------------------------------------------------------
Fri Jan 27 05:39:24 UTC 2023 - Stefan Brüns <stefan.bruens@rwth-aachen.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package netgen
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,11 +19,15 @@
%bcond_with openmpi
%bcond_without ffmpeg
%bcond_without opencascade
%if 0%{?suse_version} > 1500
%bcond_without pytest
%else
# pytest-check is not available
%bcond_with pytest
%bcond_with pytest
%endif
Name: netgen
Version: 6.2.2301
Version: 6.2.2406
Release: 0
Summary: Automatic 3D tetrahedral mesh generator
License: LGPL-2.1-only
@@ -42,6 +46,16 @@ Patch7: 0001-Avoid-installation-of-Togl-static-library.patch
Patch9: 0001-Include-filesystem-from-experimental-for-GCC-7.patch
# PATCH-FIX-UPSTREAM
Patch10: 0001-Fix-netgen-executable-and-library-RUNPATHs.patch
# PATCH-FIX-OPENSUSE
Patch11: 0001-Fix-ODR-violation-for-struct-class-Line.patch
# PATCH-FIX-OPENSUSE
Patch12: 0002-Add-missing-includes-for-std-string-std-cerr-fix-nam.patch
# PATCH-FIX-UPSTREAM -- https://github.com/NGSolve/netgen/issues/200
Patch13: 0001-Do-not-EXPORT-python-modules-as-CMake-targets.patch
# PATCH-FIX-UPSTREAM -- https://github.com/NGSolve/netgen/issues/201
Patch14: 0001-Fix-static-initialization-order-for-UserFormatRegist.patch
# PATCH-FIX-UPSTREAM -- https://github.com/NGSolve/netgen/issues/203
Patch15: 0001-Fix-invalid-string-access-in-BoundaryLayerTool.patch
%if %{with opencascade}
BuildRequires: occt-devel
BuildRequires: (pkgconfig(catch2) >= 2.13.4 with pkgconfig(catch2) < 3)
@@ -64,7 +78,6 @@ BuildRequires: python3-pytest-check
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(icu-uc)
BuildRequires: pkgconfig(libpcre)
BuildRequires: pkgconfig(tcl)
BuildRequires: pkgconfig(tk)
BuildRequires: pkgconfig(x11)
@@ -205,8 +218,19 @@ find %{buildroot}%{python3_sitearch} -iname \*.pyi -exec sed -i -e '/^_[^_].*=/
%check
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}/%{name}
export PYTHONDONTWRITEBYTECODE=1
%ctest %{!?with_pytest: --exclude-regex pytest}
# Test if the binary actually works
%{buildroot}/%{_bindir}/netgen -batchmode || true
%ctest --exclude-regex pytest
%if %{with pytest}
# run manually, to see progress/failures
# tolerance failures on aarch64 and ppc64le, see https://github.com/NGSolve/netgen/issues/167
%ifarch %{arm64} %{ppc64} riscv64
export PYTEST_ADDOPTS='-k "not (boxcyl.geo-mp11-5 or cylsphere.geo-mp58-4 or hinge.stl-mp93-5 or part1.stl-mp123-1 or part1.stl-mp126-4 or sculpture.geo-mp143-4 or sphereincube.geo-mp162-5 or twobricks.geo-mp195-2 or twocubes.geo-mp201-2)"'
%endif
export COLUMNS=120
(cd tests/pytest; %{python3_pytest_arch})
%endif
%files
%license LICENSE
@@ -227,6 +251,7 @@ export PYTHONDONTWRITEBYTECODE=1
%files -n python3-%{name}
%{python3_sitearch}/netgen
%{python3_sitearch}/pyngcore
%{python3_sitearch}/netgen_mesher-*.egg-info
%files devel
%dir %{_prefix}/lib/cmake