Skip to content

Commit

Permalink
Check Netgen version at run-time, update Netgen
Browse files Browse the repository at this point in the history
  • Loading branch information
mhochsteger committed Jul 23, 2020
1 parent d5c93d7 commit 6eaeccc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
16 changes: 16 additions & 0 deletions ngstd/templates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <ngstd.hpp>
#include <ngsolve_version.hpp>
#include <netgen_version.hpp>

namespace ngstd
{
Expand All @@ -29,4 +30,19 @@ namespace ngstd
}();
#endif // USE_MKL

static bool dummy = [] ()
{
ngcore::SetLibraryVersion("ngsolve", NGSOLVE_VERSION);
auto ng_version_compiled = ngcore::VersionInfo(NETGEN_VERSION);
auto ng_version=ngcore::GetLibraryVersion("netgen");
if( ng_version != ng_version_compiled )
{
cerr << "================================================================" << endl;
cerr << "WARNING: NGSolve was compiled with Netgen " << endl;
cerr << " version " << ng_version_compiled.to_string() << " but" << endl;
cerr << " version " << ng_version.to_string() << " is loaded at run-time!!!" << endl;
cerr << "================================================================" << endl;
}
return true;
}();
}
8 changes: 6 additions & 2 deletions solve/ngsolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,13 @@ static shared_ptr<PDE> pde;
Socket & sock;
public:
SocketOutArchive (Socket & asock) : Archive(true), sock(asock)
{ (*this) & GetLibraryVersions(); }
{
auto versions = GetLibraryVersions();
(*this) & versions;
}

const VersionInfo& GetVersion(const std::string& library)
{ return GetLibraryVersions()[library]; }
{ return GetLibraryVersions().at(library); }

using Archive::operator&;
virtual Archive & operator & (double & d)
Expand Down

0 comments on commit 6eaeccc

Please sign in to comment.