Can not load OpenBabel forcefields (and set up optimization menu) during program start up. OBminimize seems to be working although all charges are set to 0 and even optimized cyclohexane runs for full 2500 steps. libavogadro/src/extentions/forcefieldextention.cpp:58 m_forceField = OBForceField::FindForceField( "MMFF94" ); Avogadro links to the right library: libopenbabel.so.3 => /usr/lib/libopenbabel.so.3 Tried rebuilding both OpenBabel and Avogadro. Tried setting locale to C in .bashrc: export LANG="C" export LC_COLLATE="C" export LC_ALL="C" Reproducible: Always Steps to Reproduce: 1. unmask avogadro-0.9.2 2. emerge -a avogadro 3. run: avogadro Actual Results: Unable to set up and use any force fields. Expected Results: Load OpenBabel forcefields and set up optimization menu Portage 2.1.6.7 (default/linux/amd64/2008.0/desktop, gcc-4.1.2, glibc-2.8_p20080602-r1, 2.6.27-gentoo-r8 x86_64) ================================================================= System uname: Linux-2.6.27-gentoo-r8-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7300_@_2.00GHz-with-glibc2.2.5 Timestamp of tree: Mon, 02 Mar 2009 19:15:01 +0000 app-shells/bash: 3.2_p39 dev-java/java-config: 1.3.7-r1, 2.1.6-r1 dev-lang/python: 2.4.4-r14, 2.5.2-r7 dev-python/pycrypto: 2.0.1-r6 dev-util/cmake: 2.6.2-r1 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=nocona -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-march=nocona -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://ftp.linux.ee/pub/gentoo/distfiles/ ftp://ftp.linux.ee/pub/gentoo/distfiles/ " LANG="lv_LV.UTF-8" LDFLAGS="-Wl,-O1" LINGUAS="lv en" MAKEOPTS="-s -j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/layman/science /usr/portage/local/layman/sunrise /usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="7zip X a52 aac aalib acl acpi alsa amd64 avahi avi bash-completion berkdb bluethooth bluetooth branding bzip2 cairo cdparanoia cdr cli cracklib crypt css cups dbus divx dri dv dvd dvdr dvdread eds emboss encode esd evo fam ffmpeg flac fortran freetype gdbm gif gnome gnutls gpm gstreamer gtk gtk2 hal iconv ieee1394 ipv6 isdnlog java jpeg kerberos lame ldap libnotify live lm_sensors mad matroska midi mikmod mjpeg mmx mp3 mpeg mudflap multilib ncurses networkmanager nls nptl nptlonly nsplugin nvidia ogg opengl openmp pam pcmcia pcre pdf perl png ppds pppd python qt3support quicktime rar readline reflection sdl session spell spl sse sse2 sse3 ssl ssse3 startup-notification subversion svg sysfs tcl tcpd theora tiff tk truetype udev unicode usb v4l vcd vorbis wifi wmf x264 xml xorg xulrunner xv xvid zlib" ALSA_CARDS="via82xx hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" FOO2ZJS_DEVICES="hp1018" INPUT_DEVICES="evdev keyboard mouse synaptic" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="lv en" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
>$ avogadro Avogadro version: 0.9.2 LibAvogadro version: "0.9.2" Locale: "C" path = "/usr/bin/../share/avogadro/i18n/" "/usr/bin/../share/avogadro/i18n/avogadro_C.qm" not found. "System has OpenGL support." "About to test OpenGL capabilities." "OpenGL capabilities found: " "Double Buffering." "Direct Rendering." "Antialiasing." Searching for plugins in "/usr/bin/../lib64/avogadro/colors" Searching for plugins in "/usr/bin/../lib64/avogadro/engines" Searching for plugins in "/usr/bin/../lib64/avogadro/extensions" Searching for plugins in "/usr/bin/../lib64/avogadro/tools" Unable to set up and use any force fields. error 9 request 160 minor 1 serial 2117800 error 3 request 20 minor 0 serial 2117801 error 3 request 15 minor 0 serial 2117802 Versioned config - loading. GLWidget initialisation... GLSL support enabled, OpenGL 2.0 support confirmed. GLWidget initialised... createObjects() ('paint(', <Avogadro.GLWidget object at 0xf50c20>, ')') libpng warning: Ignoring attempt to set cHRM RGB triangle with zero area ('paint(', <Avogadro.GLWidget object at 0xf50c20>, ')')
Same issue on my other machine
I will look into this, but after talking on IRC cannot see why you are having such issues with the forcefields.
Created attachment 183833 [details] a part from "strace avogadro > avostra.txt 2>&1"
Created attachment 183925 [details] example program to test OpenBabel forcefield loading compiled using: >$ g++ obmtester.cpp -o obmt -I/usr/include/openbabel-2.0 -lopenbabel and ran using: >$ strace -o obmtstrace.txt ./obmt grepping gives: >$ grep txt obmstrace.txt open("plugindefines.txt", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/openbabel/2.2.1/plugindefines.txt", O_RDONLY) = 3 open("aromatic.txt", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/openbabel/2.2.1/aromatic.txt", O_RDONLY) = 3 open("atomtyp.txt", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/openbabel/2.2.1/atomtyp.txt", O_RDONLY) = 3 open("phmodel.txt", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/openbabel/2.2.1/phmodel.txt", O_RDONLY) = 3 open("element.txt", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/openbabel/2.2.1/element.txt", O_RDONLY) = 3 And for Avogadro: >$ strace -o avostrace.txt avogadro >$ grep txt avostrace1.txt stat("/usr/bin/../lib64/../CMakeCache.txt", 0x7c8e68) = -1 ENOENT (No such file or directory) lstat("/usr/bin/../lib64/../CMakeCache.txt", 0x7fff7368e1f0) = -1 ENOENT (No such file or directory) open("plugindefines.txt", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/openbabel/2.2.1/plugindefines.txt", O_RDONLY) = 18 open("element.txt", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/openbabel/2.2.1/element.txt", O_RDONLY) = 18 It looks like is trying to set up a forecfield, though it has been asked only to find one.
Created attachment 183927 [details] Even simpler program which doesn't try to set up a forcefield >$ g++ obmlt.cpp -Wall -o obmlt -I/usr/include/openbabel-2.0 -lopenbabel >$ strace -o obmltstrace.txt ./obmlt Grepping for "txt" gives nothing.
Created attachment 183928 [details] strace output for the little program
The straces would be different, as Avogadro does its own initialization. When you instantiate the forcefield class OpenBabel sets up the forcefield you asked for. This next couple of weeks is really busy with conferences and stuff. I am still not able to reproduce your bug here unfortunately and nothing in the bug report has helped me to track it down in the limited time I have had. I will try to come up with some code to probe more fully what is going wrong. I think the simplest in terms of set up is the UFF forcefield, so you could try changing both Avogadro and your test program to set up a UFF forcefield. It should try to load /usr/share/openbabel/2.2.1/UFF.prm, for MMFF94 you are looking for mmff94.ff I think.
This problem went away after upgrade to gcc-4.3.2. Checked with Avogadro-0.9.3. So this is gcc-4.1.2 related problem.
Glad it is fixed, not sure how long I was ever on GCC 4.1. I never could reproduce it. I am going to mark this as fixed for now, unless you have further information. No other OpenBabel bug has been opened with these issues as far as I know. If you know of a patch, but OpenBabel just uses standard system calls to open its plugins.