I am brand new to ngsolve but installed it today and and keen to learn to use it. There are a couple of problems that I found in the docs and I am not sure if it is well known or not.
First, in installing ngsolve on jupyter on my ubuntu system, I needed to install jupyter-notebook as well, and the install command did not work but needed to use enable, as copied below.
Second, I found about 6 or so examples in the notebooks that did not run, the first of which was the notebook on Maxwells equations. I can provide a longer list if need be.
I presume these are known but wanted to try and contribute in case they aren’t.
When I am in a notebook and I type the line that you suggested, after importing ngsolve, I get an error
NameError Traceback (most recent call last)
in
1 from ngsolve import *
----> 2 print (ngsolve.version)
NameError: name ‘ngsolve’ is not defined
However, when I am in the terminal and typ in netgen I see I’m using a very old version,
$ netgen
NETGEN-6.2.2007
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
Including OpenCascade geometry kernel
optfile ./ng.opt does not exist - using default values
togl-version : 2
OCC module loaded
loading ngsolve library
NGSolve-6.2.2007
Using Lapack
Including sparse direct solver UMFPACK
Running parallel using 36 thread(s)
importing NGSolve-6.2.2007
This is what installed in ubuntu usin apt-get.
To get a newer version do you recommend I build them from source?
To get the latest version I decided to build from source. Everything seemed to go well until it was scannin gdependencies of target ngstd, and that’s where it failed because of an error. Should I post this until a different problem?
Scanning dependencies of target ngstd
[ 1%] Building CXX object ngstd/CMakeFiles/ngstd.dir/blockalloc.cpp.o
In file included from /home/fpoulin/software/ngsolve-src/ngstd/ngstd.hpp:14,
from /home/fpoulin/software/ngsolve-src/ngstd/blockalloc.cpp:12:
/home/fpoulin/software/ngsolve-src/include/ngs_stdcpp_include.hpp:43:2: error: #error “GCC 9.1/9.2 generates wrong code on AVX512 platforms (see 93009 – [9 Regression] AVX512 FMA - wrong code generation since r265288 ). Either build for a different architecture (cmake -DUSE_NATIVE=OFF), or use a different compiler (like GCC 8.3 or Clang)”
43 | #error “GCC 9.1/9.2 generates wrong code on AVX512 platforms (see 93009 – [9 Regression] AVX512 FMA - wrong code generation since r265288 ). Either build for a different architecture (cmake -DUSE_NATIVE=OFF), or use a different compiler (like GCC 8.3 or Clang)”
| ^~~~~
make[5]: *** [ngstd/CMakeFiles/ngstd.dir/build.make:63: ngstd/CMakeFiles/ngstd.dir/blockalloc.cpp.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:173: ngstd/CMakeFiles/ngstd.dir/all] Error 2
make[3]: *** [Makefile:141: all] Error 2
make[2]: *** [CMakeFiles/ngsolve.dir/build.make:116: dependencies/Stamp/ngsolve/ngsolve-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:222: CMakeFiles/ngsolve.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Concerning the apt-get version: Which Ubuntu version do you have? Note that 19.10 is already end-of-life and not receiving updates anymore.
Concerning the compiler error: Your compiler version is buggy, that’s why we had to explicitly block it. One way to work around it, is configuring cmake with
-DUSE_NATIVE_ARCH=OFF
which results in sub-optimal performance of the generated code (no AVX instructions used).
I think both of your issues could be solved by an Ubuntu upgrade.
For the moment I have used the configuration that you suggested and have been able to install version 6.2.2008 with success. I admit that the instructions I found in the docs did not quite work in setting up the PYTHONPATH but I figured out what it should be so I’m happy about that.
I can also verify that the Maxwells example does work, and I suspect the others will work as well.