有人能帮忙解决 Netgen 5.3.1 的运行时错误吗?网络生成器是自动 3d 四面体网格生成器。错误信息如下:
:/opt/netgen/bin$ ./netgen
NETGEN-5.3.1
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
optfile ./ng.opt does not exist - using default values
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 558
Current serial number in output stream: 559
给出了安装 netgen-5.3.1 的说明这里。
该软件似乎已经遵循./configure
,make
并且sudo make install
正确。
我按照网页出现类似的错误消息,但并未解决问题。即安装Togl-1.7
。
最终输出结果为sudo make install
:
libtool: relink: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o .libs/nglib.o -Wl,-rpath -Wl,/opt/netgen/lib -L/opt/netgen/lib -linterface -lgeom2d -lcsg -lstl -locc -lmesh -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lstdc++ -lm -lgomp -lpthread -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/5/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o -O2 -fopenmp -fopenmp -Wl,-soname -Wl,libnglib.so -o .libs/libnglib.so
libtool: install: /usr/bin/install -c .libs/libnglib.soT /opt/netgen/lib/libnglib.so
libtool: install: /usr/bin/install -c .libs/libnglib.lai /opt/netgen/lib/libnglib.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /opt/netgen/lib
----------------------------------------------------------------------
Libraries have been installed in:
/opt/netgen/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/opt/netgen/bin" || /bin/mkdir -p "/opt/netgen/bin"
/bin/bash ../libtool --mode=install /usr/bin/install -c ng_vol ng_stl '/opt/netgen/bin'
libtool: install: /usr/bin/install -c .libs/ng_vol /opt/netgen/bin/ng_vol
libtool: install: /usr/bin/install -c .libs/ng_stl /opt/netgen/bin/ng_stl
test -z "/opt/netgen/share/netgen" || /bin/mkdir -p "/opt/netgen/share/netgen"
/usr/bin/install -c -m 644 cube.surf '/opt/netgen/share/netgen'
test -z "/opt/netgen/include" || /bin/mkdir -p "/opt/netgen/include"
/usr/bin/install -c -m 644 nglib.h '/opt/netgen/include'
make[2]: Leaving directory '/home/brendan/Documents/hpfem-mpt/netgen-5.3.1/nglib'
make[1]: Leaving directory '/home/brendan/Documents/hpfem-mpt/netgen-5.3.1/nglib'
make[1]: Entering directory '/home/brendan/Documents/hpfem-mpt/netgen-5.3.1'
make[2]: Entering directory '/home/brendan/Documents/hpfem-mpt/netgen-5.3.1'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/brendan/Documents/hpfem-mpt/netgen-5.3.1'
make[1]: Leaving directory '/home/brendan/Documents/hpfem-mpt/netgen-5.3.1'
答案1
这似乎是一个众所周知的错误 1556445。
如果您使用官方存储库中的 4.9.13 版本(随安装sudo apt-get install netgen
),则可以通过手动运行以下命令来“修补”它:
sudo sed -i "s/\-indirect\ true\ \}/\-indirect\ false\ \}/g" \
/usr/share/netgen/drawing.tcl
该方法来自于Netgen SourceForge 邮件列表:
Joachim Schoeberl - 2016-02-04
编辑文件 ng/drawing.tcl 第 14 行:
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true }] } { ....
-indirect true
改成”-indirect false
”约阿希姆
也可以使用手动编译的版本(需要更改文件路径- /opt/netgen/bin/drawing.tcl
)。
答案2
我发现我需要遵循我的以前的方法,编辑文件/opt/netgen/bin/drawing.tcl
第 14 行
更改-indirect true
为-indirect false
/opt/netgen/bin
&使用执行./netgen
成功!
我发现执行它会netgen &!
产生相同的错误消息。
错误在于/opt/netgen/bin/drawing.tcl
:
# use this one for Togl 2.0
# if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect false -create init -display draw -reshape reshape }] } {
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true }] } { puts "no OpenGL"
} {
我把注释的代码从第 14 行改为第 12 行,因为这两行看起来相似。