PaulSt / NGSTrefftz

Add-On to NGSolve for Trefftz methods

Home Page:https://paulst.github.io/NGSTrefftz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while compiling `master` branch of `NGSTrefftz` against the `master` branch of `NGSolve`

thelfer opened this issue · comments

This issue is created as part of the review of the JOSS paper (openjournals/joss-reviews#4135).

The compilation of master branch of NGSTrefftz against the master branch of NGSolve fails. Please find below a complete log.

The README.md file in the top level directory of NGSTrefftz do not seem to mention compatible versions. Would you provide some insights to get started ?

$ cmake ../NGSTrefftz/src/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/th202608/codes/NGSTrefftz/master/install
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Netgen: /home/th202608/codes/NGSolve/master/install/lib/cmake/netgen
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is "3") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.7m.so (found suitable version "3.7.3", minimum required is "3") 
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libopenblas.so  
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
With 'make install' the python package will be installed to: /home/th202608/codes/NGSTrefftz/master/install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/th202608/codes/NGSTrefftz/master/src/build
th202608@pleiades093:~/codes/NGSTrefftz/master/src/build$ make
Scanning dependencies of target _pytents
[  9%] Building CXX object CMakeFiles/_pytents.dir/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/python_tents.cpp.o
[ 18%] Building CXX object CMakeFiles/_pytents.dir/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp.o
/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp: In member function ‘virtual void GradPhiCoefficientFunction::GenerateCode(ngfem::Code&, ngcore::FlatArray<int>, int) const’:
/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp:31:3: error: ‘TraverseDimensions’ was not declared in this scope
   TraverseDimensions( dims, [&](int ind, int i, int j) {
   ^~~~~~~~~~~~~~~~~~
/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp:31:3: note: suggested alternative: ‘SetDimensions’
   TraverseDimensions( dims, [&](int ind, int i, int j) {
   ^~~~~~~~~~~~~~~~~~
   SetDimensions
make[2]: *** [CMakeFiles/_pytents.dir/build.make:76: CMakeFiles/_pytents.dir/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/external_dependencies/ngstents/src/tents.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:622: CMakeFiles/_pytents.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Hi @thelfer,
thank you! This was fixed in c10852a, it is possible that you have to update the submodules in your local version!

With the recent change NGSolve/ngsolve@eda758d the TraverseDimensions function was removed from ngsolve, which causes this error in the package ngstents, see jayggg/ngstents#28 . Until my pull request is resolve, I have updated the external dependencies in ngstrefftz.

I will update the readme with clearer dependencies asap!

Hi @PaulSt

I updated the submodules and went a bit further:

In file included from /home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/src/trefftzfespace.hpp:5,
                 from /home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/src/python_trefftz.cpp:7:
/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/src/planewavefe.hpp: In constructor ‘ngfem::PlaneWaveElement<D>::PlaneWaveElement(int, int, ngfem::ELEMENT_TYPE, ngbla::Vec<S>, double, float, int)’:
/home/th202608/codes/NGSTrefftz/master/src/NGSTrefftz/src/planewavefe.hpp:23:56: error: cannot deduce template arguments for ‘Matrix’ from ()
             ScalarMappedElement<D>(andof, aord, Matrix(), aeltype, aelcenter, aelsize, ac),

Ok, great that this worked!
Unfortunately, I am unable to reproduce the error you are getting now.
I tested with gcc/g++ 11.1.0 and clang 13.0.0, what are you using?
I tried a possible fix with the newest commit f099522 hope it works!

@PaulSt I am using gcc-8.3.0 on debian buster

With you fix, it goes a bit further. Now I have a huge log. Please find the attached file

out.zip
.

BTW, it indeed builds with gcc-11.0

Thank you again, I am happy it compiles now! I fixed the error from

out.zip

and it should compile with gcc-8 now. However, for the future I would suggest clang >= 10 or at least gcc >= 9, I updated the readme with the dependencies for the build.