Preserving the directory structure of include files using 'make install'

Hello everyone,

For my project I am using an in-house written HDG-code that is built by including header files of the install directory ngsolve-install. To date, I have been using Netgen/NGSolve 5.0.0 for this purpose.

After the User Meeting I wanted to compile the code with the latest version of NGSolve. Off course, many syntax changes have to be made in the c+±files of the HDG-code, but I cannot manage to compile the code without adapting the header files in ngsolve-install/include (which I want to avoid at all times).

The problem are header files such as nginterface.h that include header files in wrong directories,

#include "../core/ngcore.hpp"

This should be:

#include "core/ngcore.hpp"

However, this would be incorrect if you consider the directory
From here you indeed get access to ngcore.hpp by first going back to libsrc.

Moreover, I noticed that the directory libsrc/include contains nginterface.h, nginterface_v2.hpp and nginterface_v2_impl.hpp.
The directory ngsolve-install/include contains only the first two, whereas nginterface_v2_impl.hpp is put into the subdirectory ngsolve-install/include/include/.

[size=2](I am not very experienced with Make in general, so my next question may be very generic/basic)[/size]

Is there a specific reason why make install does not preserve the directory structure as in the Netgen/NGSolve source directories?

Friendly greetings,

Hello Jeremy,

Thank you for the report. There were many changes concerning the ngcore lib recently. Please check again with the latest master if your issues still remain.


Hello Matthias,

Thank you for offering your help.

The header files in nginterface.h and nginterface_v2.hpp are now set correctly. However, I stumbled upon a few more issues. Here is a quick summary:


#include <myadt.hpp>[/code] changed to [code]#include "include/myadt.hpp"


#include <../general/myadt.hpp>[/code] changed to [code]#include "../general/myadt.hpp"

All instances of ‘ELEMENT_MAXPOINTS’ changed to ‘NG_ELEMENT_MAXPOINTS’[/li]

Changing the above lines is however not sufficient to build the HDG-code. Now I get stuck on a more intrinsic issue.
In nginterface_v2.hpp:251 there is a class Mesh that is a forward declaration, which results in the following compilation error

/home/ngsolve19/ngsuite2/ngsolve-install/include/core/archive.hpp: In instantiation of ‘ngcore::Archive& ngcore::Archive::operator&(std::shared_ptr<_Tp>&) [with T = netgen::Mesh]’: ... error: invalid use of incomplete type ‘class netgen::Mesh’ logger->debug("Store shared ptr of type {}", Demangle(typeid(T).name()));
(full compilation log can be found in

If I change the class declaration in nginterface_v2.hpp:251 (class Mesh {}), then I get a more problematic error:

/home/ngsolve19/ngsuite2/ngsolve-install/include/core/archive.hpp:474:55: error: no match for ‘operator&’ (operand types are ‘ngcore::Archive’ and ‘netgen::Mesh’) return (*this) << -1 & (*p);
(full compilation log can be found in

I’m not sure if this is due to some incorrect implementation in the HDG-code. Any help is very much appreciated.

Friendly greetings,

Attachment: compile1log.txt

Attachment: compile2log.txt