Problem updating ngsxfem

Recently, I updated NGSolve, which went through fine. But then I tried to run something that uses ngsxfem, and I got some unrecognized symbol error.

So I updated ngsxfem (compiling from source, with NGSolve already installed). However, when I get to the make step, I get a lot of C++11 warnings or errors about “template argument deduction/substitution failed”, and then the compile stops.

Any suggestion? Do I need to reinstall everything from scratch?

Hi Shawn,

Hard to say. I just checked, but most recent NGSolve and most recent ngsxfem, both rebuild from source are compatible and should work. Perhaps something was not cleanly reset and you have some part that remained in-between and generated the troubles?!
If you say “Do I need to reinstall everything from scratch”, what else did you try?


I only tried updating NGSolve and updating ngsxfem. I guess I could try uninstalling ngsxfem and reinstall first. Reinstalling NGSolve takes a while.

For future updates, what should I do? Should I run make clean first, or something like that?

If you build both from source and have updated the sources for NGSolve, netgen und ngsxfem, a simple rebuild (starting with ngsolve, then ngsxfem) should suffice. CMake should detect changed dependencies automatically. But if you want to be sure, you delete the Caches and old compiled objects.

Ok, I tried rebuilding ngsxfem, but this happens:

/home/walker/ngsuite/xfem-src/python/…/spacetime/python_spacetime.cpp:70:35: error: no matching function for call to ‘regex_match(std::string_view, std::__cxx11::regex&)’
70 | if (std::regex_match (ma->GetMaterial(BND, i), pattern))
| ~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/regex:63,
from /home/walker/ngsuite/xfem-src/python/…/spacetime/python_spacetime.cpp:2,
from /home/walker/ngsuite/xfem-src/python/python_ngsxfem.cpp:7:

The error is near the top. It seems like a weird error to get. Did the required compiler change recently?

Are you sure that you updated ngsxfem? if yes, did you use the master branch? The release branch of ngsxfem may only be compatible with the NGSolve 6.2.2304 release.

Well, I completely deleted the old directories and redid this:

git clone xfem-src

but I guess that gets the most recent. How do I specify the master branch?

This is the version of NGSolve I have:


As you do not specify the branch it pull the default branch which is the release branch. This however is not compatible with the most recent NGSolve, only with the latest NGSolve-release.

You can switch the branch to master or directly clone the “correct” branch:
git clone -b master xfem-src

Ok, it worked. My code runs fine now.