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

More
5 years 4 months ago #1702 by Jeremy
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,
Code:
#include "../core/ngcore.hpp"
This should be:
Code:
#include "core/ngcore.hpp"

However, this would be incorrect if you consider the directory
ngsolve-src/external_dependencies/netgen/libsrc/include.
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/.

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

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

Friendly greetings,
Jeremy
More
5 years 4 months ago #1705 by matthiash
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.

Best,
Matthias
More
5 years 4 months ago #1707 by Jeremy
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:
  • soldata.hpp
    Code:
    #include <myadt.hpp>
    changed to
    Code:
    #include "include/myadt.hpp"

  • include/myadt.hpp
    Code:
    #include <../general/myadt.hpp>
    changed to
    Code:
    #include "../general/myadt.hpp"

  • vtkoutput.hpp
    All instances of 'ELEMENT_MAXPOINTS' changed to 'NG_ELEMENT_MAXPOINTS'

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
Code:
/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

File Attachment:

File Name: compile1log.txt
File Size:29 KB
)

If I change the class declaration in nginterface_v2.hpp:251 (class Mesh {}), then I get a more problematic error:
Code:
/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

File Attachment:

File Name: compile2log.txt
File Size:83 KB
)

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

Friendly greetings,
Jeremy
Time to create page: 0.107 seconds