Building the NGS-Suite and ngsxfem together

Hi,
I’m quite a newby to Linux (using Ubuntu 19.10) and had some troubles while installing NGS and xfem together. I did the following (sudo where necessary):

cd usr/share
git clone https://github.com/ngsxfem/ngsxfem.git
cd ngsxfem
mkdir build
git submodule update --init
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/share -DBUILD_NGSOLVE=ON

and got the following response:

[code]…

[ 81%] Building CXX object comp/CMakeFiles/ngcomp.dir/pde.cpp.o
/usr/share/ngsxfem/external_dependencies/ngsolve/comp/pde.cpp:8:10: fatal error: tcl.h: Datei oder Verzeichnis nicht gefunden
8 | #include <tcl.h>
| ^~~~~~~
compilation terminated.
make[5]: *** [comp/CMakeFiles/ngcomp.dir/build.make:479: comp/CMakeFiles/ngcomp.dir/pde.cpp.o] Fehler 1
make[4]: *** [CMakeFiles/Makefile2:507: comp/CMakeFiles/ngcomp.dir/all] Fehler 2
make[3]: *** [Makefile:141: all] Fehler 2
make[2]: *** [CMakeFiles/ngsolve.dir/build.make:116: dependencies/Stamp/ngsolve/ngsolve-build] Fehler 2
make[1]: *** [CMakeFiles/Makefile2:222: CMakeFiles/ngsolve.dir/all] Fehler 2
make: *** [Makefile:152: all] Fehler 2
[ 30%] Built target netgen_project


[ 61%] Built target ngfem
[ 61%] Building CXX object comp/CMakeFiles/ngcomp.dir/pde.cpp.o
/usr/share/ngsxfem/external_dependencies/ngsolve/comp/pde.cpp:8:10: fatal error: tcl.h: Datei oder Verzeichnis nicht gefunden
8 | #include <tcl.h>
| ^~~~~~~
compilation terminated.
make[5]: *** [comp/CMakeFiles/ngcomp.dir/build.make:479: comp/CMakeFiles/ngcomp.dir/pde.cpp.o] Fehler 1
make[4]: *** [CMakeFiles/Makefile2:507: comp/CMakeFiles/ngcomp.dir/all] Fehler 2
make[3]: *** [Makefile:141: all] Fehler 2
make[2]: *** [CMakeFiles/ngsolve.dir/build.make:116: dependencies/Stamp/ngsolve/ngsolve-build] Fehler 2
make[1]: *** [CMakeFiles/Makefile2:222: CMakeFiles/ngsolve.dir/all] Fehler 2
make: *** [Makefile:152: all] Fehler 2
CMake Error at CMakeLists.txt:91 (find_package):
Could not find a package configuration file provided by “NGSolve” with any
of the following names:

NGSolveConfig.cmake
ngsolve-config.cmake

Add the installation prefix of “NGSolve” to CMAKE_PREFIX_PATH or set
“NGSolve_DIR” to a directory containing one of the above files. If
“NGSolve” provides a separate development package or SDK, be sure it has
been installed.

– Configuring incomplete, errors occurred!
See also “/usr/share/ngsxfem/build/CMakeFiles/CMakeOutput.log”.
[/code]

I attached the CMakeOutput.log

What went wrong - what should I do? Thanks a lot for the help!

Attachment: CMakeOutputlog.txt

Hi nepomuk,

To build from sources you require a few libraries, see Build on Linux — NGS-Py 6.2.2302 documentation

You should do the following first:
sudo apt-get update && sudo apt-get -y install python3 python3-tk libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev liblapacke-dev

Furthermore as installation location you should use /usr instead of /usr/share. Even better is to use a user local installation.

Best,
Christoph

Hi Christoph,

thanks for your quick reply.

So I first did the commands you told me, then I cloned ngsxfem to /home/nepomuk. Should I do also the other steps performed at ngsolve.org/docu/latest/install/installlinux.html first, or can I proceed with the cmake command?

Best, Nepomuk

Hi,

ngsxfem builds ngsolve, so you can directly step to the cmake command. However, the section “Finishing the installation” is again relevant to make use of the local installation once the installation was successful.

Good luck,
Christoph

Hi Christoph,
doing the cmake command (what took a lot of time as the other times I tried) it hanged up again and threw an error at the same point I describe in my first post.

Trying to do the make command anyway didn’t work.

What went wrong?

BR, Nepomuk

Hi,

I don’t really know. As it is a problem already appearing in the NGSolve-part of the installation, I recommend you try to install ngsolve from scratch first (without xfem) and only afterwards try to involve ngsxfem.

Alternatively, you can also install ngsolve binaries on ubuntu, see Downloads . Check if the corresponding ngsolve installation works. If yes, try to build ngsxfem, but this time with BUILD_NGSOLVE=OFF .

Best,
Christoph

Hi Christoph,
I totally reset my Ubuntu and followed all the steps, it worked ;)))
Thank You!