Build problem new version

More
5 years 4 months ago #1473 by jhauser
I tried to update my NGSolve today and got an error for the file "python_comp.cpp" about "optional<Region> definedon". I got the following error message:
Code:
------------------------------------------------------------------------ -- Configuring done -- Generating done -- Build files have been written to: /home/jhauser/Dokumente/NGSolve/ngsuite/ngsolve-build/ngsolve [ 84%] Performing check_submodules1 step for 'ngsolve' [ 88%] Performing check_submodules step for 'ngsolve' [ 92%] Performing build step for 'ngsolve' -- Found Git: /usr/bin/git (found version "2.11.0") [ 0%] Built target generate_version_file [ 9%] Built target ngstd [ 10%] Built target kernel_generator [ 10%] Built target kernel_generated [ 17%] Built target ngbla [ 18%] Linking CXX shared library libngla.so [ 32%] Built target ngla [ 64%] Built target ngfem [ 64%] Building CXX object comp/CMakeFiles/ngcomp.dir/python_comp.cpp.o /home/jhauser/Dokumente/NGSolve/ngsuite/ngsolve-src/comp/python_comp.cpp: In function ‘void ExportNgcomp(pybind11::module&)’: /home/jhauser/Dokumente/NGSolve/ngsuite/ngsolve-src/comp/python_comp.cpp:1122:14: error: ‘optional’ has not been declared optional<Region> definedon) -> shared_ptr<BaseMatrix> ^~~~~~~~ /home/jhauser/Dokumente/NGSolve/ngsuite/ngsolve-src/comp/python_comp.cpp:1122:22: error: expected ‘,’ or ‘...’ before ‘<’ token optional<Region> definedon) -> shared_ptr<BaseMatrix> ^ /home/jhauser/Dokumente/NGSolve/ngsuite/ngsolve-src/comp/python_comp.cpp: In lambda function: /home/jhauser/Dokumente/NGSolve/ngsuite/ngsolve-src/comp/python_comp.cpp:1125:16: error: ‘definedon’ was not declared in this scope if (definedon) spdefon = make_shared<Region> (*definedon); ^~~~~~~~~ comp/CMakeFiles/ngcomp.dir/build.make:686: die Regel für Ziel „comp/CMakeFiles/ngcomp.dir/python_comp.cpp.o“ scheiterte make[5]: *** [comp/CMakeFiles/ngcomp.dir/python_comp.cpp.o] Fehler 1 CMakeFiles/Makefile2:501: die Regel für Ziel „comp/CMakeFiles/ngcomp.dir/all“ scheiterte make[4]: *** [comp/CMakeFiles/ngcomp.dir/all] Fehler 2 Makefile:138: die Regel für Ziel „all“ scheiterte make[3]: *** [all] Fehler 2 CMakeFiles/ngsolve.dir/build.make:115: die Regel für Ziel „dependencies/Stamp/ngsolve/ngsolve-build“ scheiterte make[2]: *** [dependencies/Stamp/ngsolve/ngsolve-build] Fehler 2 CMakeFiles/Makefile2:216: die Regel für Ziel „CMakeFiles/ngsolve.dir/all“ scheiterte make[1]: *** [CMakeFiles/ngsolve.dir/all] Fehler 2 Makefile:149: die Regel für Ziel „all“ scheiterte make: *** [all] Fehler 2

Do you use a new package that I should install? Thank you for your help in advance.
More
5 years 4 months ago - 5 years 4 months ago #1474 by christopher
Hi, which compiler do you use and on what operating system? Can you try to add
Code:
#include <optional>
to the top of the file and see if that fixes the problem?

Best Christopher
Last edit: 5 years 4 months ago by christopher.
More
5 years 4 months ago #1475 by jhauser
Replied by jhauser on topic Build problem new version
Thanks for the quick replay. We have Debian and GCC-6. The next update will be with the new debian version. (I already asked..)

With which compilers did you test it?

If nothing works: Do you have a list of your program versions that I might grab an older version?
More
5 years 4 months ago #1476 by christopher
We need c++17 support for std::optional, which comes with gcc7. Note that up to gcc7.2 there is a critical bug that affects us. So gcc >= 7.3 should work.

Best Christopher
More
5 years 4 months ago - 5 years 4 months ago #1477 by jhauser
Replied by jhauser on topic Build problem new version
Thank you! Did you try different compilers? Do you know which one works?

To patch it up I now used std::experimental::optional with which it seems to compile properly.

The next problem I got with /solve/python_solve.cpp:
I changed the following lines to avoid an error:
330: "if constexpr(is_simd)" into " if (is_simd)"
and
335: "if constexpr(!is_complex)" to "if(!is_complex)"

Afterwards I get the following error:
Code:
/ngsuite/ngsolve-src/solve/python_solve.cpp:337:21: error: ‘class ngfem::BaseMappedIntegrationRule’ has no member named ‘TransformGradientTrans’ mir.TransformGradientTrans(values);
I thought the quickest way to solve it would be a cast of mir to SIMD_BaseMappedIntegrationRule, but this gives quit a few errors as well. Do you have an idea for a quick solution for this?
Last edit: 5 years 4 months ago by jhauser.
More
5 years 4 months ago #1478 by christopher
I would recommend using a newer compiler which supports c++17, either gcc>=7.3 or clang 7. I think compiling them yourself and using a local installation of them is easier than modifying ngsolve and it enables you to upgrade afterwards. For example clang builds using cmake and is quite easy to compile yourself. See here:
github.com/llvm-mirror/clang

Best Christopher
Time to create page: 0.115 seconds