Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Compile error when both MPI and GUI are turned on

More
6 years 6 months ago #179 by massing
Dear all,

Following the description from

ngsolve.org/docu/latest/install/installlinux.html

I am trying to compile netgen/ngsolve on Debian 9.0 with cmake flags
Code:
cmake -DCMAKE_INSTALL_PREFIX=${BASEDIR}/ngsolve-install \ -DUSE_GUI=ON \ -DUSE_MPI=ON \ ${BASEDIR}/ngsolve-src

This results in a compile error when build the target visual
Code:
[ 42%] Linking CXX shared library libmesh.so [ 42%] Built target mesh Scanning dependencies of target visual [ 42%] Building CXX object libsrc/visualization/CMakeFiles/visual.dir/meshdoc.cpp.o [ 43%] Building CXX object libsrc/visualization/CMakeFiles/visual.dir/mvdraw.cpp.o /home/andre/ngsuite/ngsolve-src/external_dependencies/netgen/libsrc/visualization/mvdraw.cpp: In member function ‘void netgen::VisualScene::Broadcast()’: /home/andre/ngsuite/ngsolve-src/external_dependencies/netgen/libsrc/visualization/mvdraw.cpp:835:5: error: ‘vssolution’ was not declared in this scope vssolution.Broadcast (); ^~~~~~~~~~ libsrc/visualization/CMakeFiles/visual.dir/build.make:86: recipe for target 'libsrc/visualization/CMakeFiles/visual.dir/mvdraw.cpp.o' failed make[8]: *** [libsrc/visualization/CMakeFiles/visual.dir/mvdraw.cpp.o] Error 1 CMakeFiles/Makefile2:1333: recipe for target 'libsrc/visualization/CMakeFiles/visual.dir/all' failed

With either one of the MPI/GUI options turned off, the code compiles just fine.

I did a quick grepping of the source code and understood that many vssolution.MEMBERFUNCTION() calls have been replaced by netgen::GetVSSolution().MEMBERFUNCTION() calls.
So while not being sure what I was doing, I tried my luck and replaced the corresponding line 835 in mvdraw.cpp by
Code:
netgen::GetVSSolution().Broadcast();


The the code compiled fine, but I now get a linking error
Code:
Scanning dependencies of target netgen [ 99%] Building CXX object ng/CMakeFiles/netgen.dir/ngappinit.cpp.o [ 99%] Building CXX object ng/CMakeFiles/netgen.dir/onetcl.cpp.o [100%] Linking CXX executable netgen libgui.so: undefined reference to `netgen::vssolution' collect2: error: ld returned 1 exit status ng/CMakeFiles/netgen.dir/build.make:142: recipe for target 'ng/netgen' failed make[8]: *** [ng/netgen] Error 1

Any advice on how to fix this compile/linking error?

Thanks and best,
Andre
More
6 years 6 months ago #180 by matthiash
Hello Andre,

Thank you for the concise report. I fixed the build errors of both Netgen and NGSolve on master.
Note that the GUI might currently be in an unstable state if you run netgen with mpi, like
mpirun -np x netgen

Best,
Matthias
More
6 years 6 months ago #182 by massing
Many thanks for the superfast fixes, works like a charm now!
Time to create page: 0.142 seconds