Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 232292 - sci-chemistry/ghemical-2.95: not properly linking against libf2c (needed if MOPAC is installed)
Summary: sci-chemistry/ghemical-2.95: not properly linking against libf2c (needed if M...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Chemistry-Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-19 04:52 UTC by maurerpe
Modified: 2010-06-21 14:34 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Updated ebuild fixes the issue on my machine, your mileage my vary (ghemical-2.95.ebuild,2.00 KB, text/plain)
2008-07-19 04:55 UTC, maurerpe
Details
Modified link command: libf2c near the end (debug1.sh,2.89 KB, text/plain)
2008-07-22 01:11 UTC, maurerpe
Details
emerge build.log (build.log,14.09 KB, text/plain)
2008-08-21 13:31 UTC, Reinis Danne
Details
emerge environment (environment,96.54 KB, text/plain)
2008-08-21 13:32 UTC, Reinis Danne
Details
emerge info (emerge_info.txt,3.76 KB, text/plain)
2008-08-21 13:37 UTC, Reinis Danne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maurerpe 2008-07-19 04:52:20 UTC
Compilation failure when emerging sci-chemistry/ghemical with MOPAC installed.

Reproducible: Always

Steps to Reproduce:
1. emerge sci-chemistry/ghemical

Actual Results:  
[on final linking step]
Make command:
x86_64-pc-linux-gnu-g++ -march=athlon64 -mtune=native -msse3 -O2 -pipe -Wl,-O1 -o ghemical fileio.o filetrans.o custom_app.o custom_camera.o custom_lights.o project.o spline.o oglview_wcl.o ac_stor_wcl.o p1dview_wcl.o p2dview_wcl.o eldview_wcl.o rcpview_wcl.o gpcview_wcl.o ogl_plane.o ogl_surface.o ogl_ribbon.o gtk_simple_dialogs.o gtk_glade_dialog.o gtk_file_export_dialog.o gtk_file_import_dialog.o gtk_geomopt_dialog.o gtk_moldyn_dialog.o gtk_progress_dialog.o gtk_setup_dialog.o gtk_stereo_dialog.o gtk_trajview_dialog.o gtk_wnd.o gtk_oglview_wnd.o gtk_p1dview_wnd.o gtk_p2dview_wnd.o gtk_eldview_wnd.o gtk_rcpview_wnd.o gtk_gpcview_wnd.o gtk_app.o gtk_project.o gtk_main.o -pthread -Wl,--export-dynamic  /usr/lib64/libXi.so /usr/lib64/libXext.so /usr/lib64/libglut.so -L/usr/X11R6/lib /usr/lib64/libgthread-2.0.so -lrt /usr/lib64/libgtkglext-x11-1.0.so /usr/lib64/libgdkglext-x11-1.0.so /usr/lib/libGLU.so /usr/lib64/libGL.so /usr/lib64/libXmu.so /usr/lib64/libXt.so /usr/lib64/libSM.so /usr/lib64/libICE.so /usr/lib64/libpangox-1.0.so /usr/lib64/libX11.so /usr/lib64/libglade-2.0.so /usr/lib64/libgtk-x11-2.0.so /usr/lib64/libxml2.so /usr/lib64/libgdk-x11-2.0.so /usr/lib64/libatk-1.0.so /usr/lib64/libgdk_pixbuf-2.0.so /usr/lib64/libpangocairo-1.0.so /usr/lib64/libpango-1.0.so /usr/lib64/libcairo.so /usr/lib64/libgobject-2.0.so /usr/lib64/libgmodule-2.0.so /usr/lib64/libglib-2.0.so /usr/lib64/libopenbabel.so -L/usr/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../.. /usr/lib64/libghemical.so /usr/lib64/libSCoptions.so /usr/lib64/libSCpsi.so /usr/lib64/libSCmbpt.so /usr/lib64/libSCdft.so /usr/lib64/libSCscf.so /usr/lib64/libSCwfn.so /usr/lib64/libSCsolvent.so /usr/lib64/libSCintv3.so /usr/lib64/libSCoint3.so /usr/lib64/libSCbasis.so /usr/lib64/libSCmolecule.so /usr/lib64/libSCisosurf.so /usr/lib64/libSCoptimize.so /usr/lib64/libSCsymmetry.so /usr/lib64/libSCrender.so /usr/lib64/libSCscmat.so /usr/lib64/libSCgroup.so /usr/lib64/libSCmisc.so /usr/lib64/libSCstate.so /usr/lib64/libSCkeyval.so /usr/lib64/libSCclass.so /usr/lib64/libSCcontainer.so /usr/lib64/libSCref.so -lfl -ldl -lpthread -llapack -lblas /usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/libgfortranbegin.a -lm -lgcc_s /usr/lib64/libmopac7.so /usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/libgfortran.so /usr/lib64/liboglappth.so

[Error:]
/usr/lib64/libmopac7.so: undefined reference to `i_len'
/usr/lib64/libmopac7.so: undefined reference to `d_int'
/usr/lib64/libmopac7.so: undefined reference to `d_sign'
/usr/lib64/libmopac7.so: undefined reference to `pow_ii'
/usr/lib64/libmopac7.so: undefined reference to `s_wsle'
/usr/lib64/libmopac7.so: undefined reference to `e_rsfe'
/usr/lib64/libmopac7.so: undefined reference to `do_uio'
/usr/lib64/libmopac7.so: undefined reference to `e_rdue'
/usr/lib64/libmopac7.so: undefined reference to `r_cnjg'
/usr/lib64/libmopac7.so: undefined reference to `s_copy'
/usr/lib64/libmopac7.so: undefined reference to `s_cmp'
[snip]

collect2: ld returned 1 exit status
make[3]: *** [ghemical] Error 1
make[3]: Leaving directory `/var/tmp/portage/sci-chemistry/ghemical-2.95/work/ghemical-2.95/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/sci-chemistry/ghemical-2.95/work/ghemical-2.95/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/portage/sci-chemistry/ghemical-2.95/work/ghemical-2.95/src'
make: *** [all-recursive] Error 1


Expected Results:  
Successful compilation

Making autoconf check for libf2c and adding MAIN__=main to ld_flags corrects the problem.  The (soon to be) attached ebuild fixes the problem on my machine.  The autoconf solution has the advantage that people w/o gfortran installed will NOT get errors about libf2c not being present.  -lf2c will only be added to the compile command if libf2c exists on the system.

I am new to ebuilds and didn't know the best way to handle the patch to the configure.ac file.  I included the text of the diff in the ebuild.  Not pretty, but it works.

Similar to bug 158570.  Wasn't sure if it was better to reopen that bug or open a new one.  Some of my fix was borrowed from the 2.10 ebuild, but the 2.10 ebuild always tries to link against libf2c and (I expect) will fail if libf2c is not installed on the system (and violates bug 226915).

This fix is compliant with bug 226915, which does not allow the library to be passed in LD_FLAGS.  The library is picked up with autoconf.  Although, LD_FLAGS is still used for the MAIN__=main definition.  I do not really understand this line, but the compilation does not work without it.

emerge --info:
Portage 2.1.4.4 (default/linux/amd64/2008.0/desktop, gcc-4.2.4, glibc-2.6.1-r0, 2.6.24-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.24-gentoo-r8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
Timestamp of tree: Thu, 17 Jul 2008 01:45:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r13
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
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.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -mtune=native -msse3 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/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/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -mtune=native -msse3 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://gentoo.cites.uiuc.edu/pub/gentoo/"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_US"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
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/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X Xaw3d a52 aac acpi alsa amd64 amr apm bash-completion berkdb bidi binary-drivers bluetooth branding buffysize bzip2 cairo cdaudio cdb cdda cddb cdr cdrom cdsound chroot cli clisp colordiff cpudetection cracklib crypt cups dbus dga dri dts dv dvd dvdr dvdread emacs emboss encode esd evo exif fam fat ffmpeg fftw firefox flac foomaticdb fortran ftp gd gdbm gif gimp gmedia gnome gnuplot gphoto2 gpm gs gstreamer gtk gtkspell guile gzip hal hfs iconv icu ieee1394 imagemagick ipv6 isdnlog jack java javascript jpeg jpeg2k kino kpathsea lame latex libffi libnotify libwww lm_sensors logrotate lucene lyx mad mbox mdb midi mikmod mime mmx mmxext mng mopac7 mp2 mp3 mpeg mplayer mpqc mudflap multilib musepack ncurses networking nls nntp nptl nptlonly ogg openal openbabel openexr opengl openmp openssl pam pcre pdf perl plotutils png pnm pop posix postscript ppds pppd print python qt3support quicktime raw readline realmedia reflection regex rtc scanner sdl session sharedmem smp sockets sound sox speex spell spl sqlite sqlite3 sse sse2 ssl startup-notification svg theora threads tiff toolkit-scroll-bars truetype unicode usb v4l v4l2 vorbis wma wmf wmp wxwindows x264 xine xml xorg xpm xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="nv vesa vga fbdev apm nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 maurerpe 2008-07-19 04:55:00 UTC
Created attachment 160793 [details]
Updated ebuild fixes the issue on my machine, your mileage my vary
Comment 2 Jeffrey Gardner (RETIRED) gentoo-dev 2008-07-19 15:20:50 UTC
Thanks a TON!
I'll check it out...
Comment 3 Jeffrey Gardner (RETIRED) gentoo-dev 2008-07-20 02:50:55 UTC
Rats... it's still failing here (after a remerge of libghemical with the mopac7 USE flag) like:

libtool: link: x86_64-pc-linux-gnu-g++ -march=core2 -mtune=core2 -O2 -pipe -fomit-frame-pointer -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--as-needed -Wl,-defsym -Wl,MAIN__=main -o ghemical fileio.                    o filetrans.o custom_app.o custom_camera.o custom_lights.o project.o spline.o oglview_wcl.o ac_stor_wcl.o p1dview_wcl.o p2dview_wcl.o eldview_wcl.o rcpview_wcl.o gpcview_wcl.o ogl_plane.o ogl_surface.o ogl_                    ribbon.o gtk_simple_dialogs.o gtk_glade_dialog.o gtk_file_export_dialog.o gtk_file_import_dialog.o gtk_geomopt_dialog.o gtk_moldyn_dialog.o gtk_progress_dialog.o gtk_setup_dialog.o gtk_stereo_dialog.o gtk_t                    rajview_dialog.o gtk_wnd.o gtk_oglview_wnd.o gtk_p1dview_wnd.o gtk_p2dview_wnd.o gtk_eldview_wnd.o gtk_rcpview_wnd.o gtk_gpcview_wnd.o gtk_app.o gtk_project.o gtk_main.o -pthread -Wl,--export-dynamic  -lf2c                     -L/usr/lib -L/usr/lib64 -L/usr/X11R6/lib /usr/lib64/libgthread-2.0.so -lrt /usr/lib64/libgtkglext-x11-1.0.so /usr/lib64/libgdkglext-x11-1.0.so /usr/lib64/libpangox-1.0.so /usr/lib64/libglade-2.0.so /usr/li                    b64/libgtk-x11-2.0.so /usr/lib64/libgdk-x11-2.0.so /usr/lib64/libatk-1.0.so /usr/lib64/libgdk_pixbuf-2.0.so /usr/lib64/libpangocairo-1.0.so /usr/lib64/libpangoft2-1.0.so /usr/lib64/libpango-1.0.so /usr/lib6                    4/libcairo.so /usr/lib64/libfontconfig.so /usr/lib64/libexpat.so /usr/lib64/libfreetype.so /usr/lib64/libxml2.so /usr/lib64/libdirectfb.so /usr/lib64/libfusion.so /usr/lib64/libdirect.so /usr/lib64/libpng12                    .so /usr/lib64/libXrender.so /usr/lib64/libpixman-1.so /usr/lib64/libgobject-2.0.so /usr/lib64/libgmodule-2.0.so /usr/lib64/libglib-2.0.so /usr/lib64/libopenbabel.so -lz -L/usr/lib/gcc/x86_64-pc-linux-gnu/4                    .3.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linu                    x-gnu/4.3.1/../../.. /usr/lib64/libghemical.so /usr/lib64/libSCoptions.so /usr/lib64/libSCpsi.so /usr/lib64/libSCmbpt.so /usr/lib64/libSCdft.so /usr/lib64/libSCscf.so /usr/lib64/libSCwfn.so /usr/lib64/libSC                    solvent.so /usr/lib64/libSCintv3.so /usr/lib64/libSCoint3.so /usr/lib64/libSCbasis.so /usr/lib64/libSCmolecule.so /usr/lib64/libSCisosurf.so /usr/lib64/libSCoptimize.so /usr/lib64/libSCsymmetry.so /usr/lib6                    4/libSCrender.so /usr/lib64/libSCscmat.so /usr/lib64/libSCgroup.so /usr/lib64/libSCmisc.so /usr/lib64/libSCstate.so /usr/lib64/libSCkeyval.so /usr/lib64/libSCclass.so /usr/lib64/libSCcontainer.so /usr/lib64                    /libSCref.so -lfl -llapack -lblas /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/libgfortranbegin.a -lgcc_s /usr/lib64/libmopac7.so /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.1/libgfortran.so /usr/lib64/liboglappth.so /u                    sr/lib64/libglut.so /usr/lib/libGLU.so -luuid /usr/lib64/libXmu.so /usr/lib64/libXt.so /usr/lib64/libSM.so /usr/lib64/libICE.so /usr/lib64/libXi.so -lpthread /usr/lib64/libGL.so -lm /usr/lib64/libXext.so /u                    sr/lib64/libX11.so /usr/lib64/libXau.so /usr/lib64/libXdmcp.so -ldl -pthread
/usr/lib64/libmopac7.so: undefined reference to `i_len'
/usr/lib64/libmopac7.so: undefined reference to `d_int'
/usr/lib64/libmopac7.so: undefined reference to `d_sign'
/usr/lib64/libmopac7.so: undefined reference to `pow_ii'
/usr/lib64/libmopac7.so: undefined reference to `s_wsle'
/usr/lib64/libmopac7.so: undefined reference to `e_rsfe'
/usr/lib64/libmopac7.so: undefined reference to `do_uio'
/usr/lib64/libmopac7.so: undefined reference to `e_rdue'
/usr/lib64/libmopac7.so: undefined reference to `r_cnjg'
/usr/lib64/libmopac7.so: undefined reference to `s_copy'
/usr/lib64/libmopac7.so: undefined reference to `s_cmp'
/usr/lib64/libmopac7.so: undefined reference to `s_rsfe'
/usr/lib64/libmopac7.so: undefined reference to `f_clos'
/usr/lib64/libmopac7.so: undefined reference to `s_wsfe'
/usr/lib64/libmopac7.so: undefined reference to `f_rew'
/usr/lib64/libmopac7.so: undefined reference to `i_dnnt'
/usr/lib64/libmopac7.so: undefined reference to `do_lio'
/usr/lib64/libmopac7.so: undefined reference to `getenv_'
/usr/lib64/libmopac7.so: undefined reference to `s_wdue'
/usr/lib64/libmopac7.so: undefined reference to `pow_dd'
/usr/lib64/libmopac7.so: undefined reference to `i_indx'
/usr/lib64/libmopac7.so: undefined reference to `e_wdue'
/usr/lib64/libmopac7.so: undefined reference to `s_stop'
/usr/lib64/libmopac7.so: undefined reference to `d_nint'
/usr/lib64/libmopac7.so: undefined reference to `e_rsue'
/usr/lib64/libmopac7.so: undefined reference to `s_rsue'
/usr/lib64/libmopac7.so: undefined reference to `r_sign'
/usr/lib64/libmopac7.so: undefined reference to `s_rdue'
/usr/lib64/libmopac7.so: undefined reference to `pow_di'
/usr/lib64/libmopac7.so: undefined reference to `d_lg10'
/usr/lib64/libmopac7.so: undefined reference to `e_wsle'
/usr/lib64/libmopac7.so: undefined reference to `s_rsle'
/usr/lib64/libmopac7.so: undefined reference to `s_cat'
/usr/lib64/libmopac7.so: undefined reference to `do_fio'
/usr/lib64/libmopac7.so: undefined reference to `e_wsfe'
/usr/lib64/libmopac7.so: undefined reference to `e_wsue'
/usr/lib64/libmopac7.so: undefined reference to `z_exp'
/usr/lib64/libmopac7.so: undefined reference to `f_open'
/usr/lib64/libmopac7.so: undefined reference to `c_abs'
/usr/lib64/libmopac7.so: undefined reference to `z_sqrt'
/usr/lib64/libmopac7.so: undefined reference to `flush_'
/usr/lib64/libmopac7.so: undefined reference to `e_rsle'
/usr/lib64/libmopac7.so: undefined reference to `s_wsue'
collect2: ld returned 1 exit status
Comment 4 Donnie Berkholz (RETIRED) gentoo-dev 2008-07-21 23:28:16 UTC
That looks like libmopac7 needs to directly link against libm. Might try adding that to its build, if it's not already.
Comment 5 maurerpe 2008-07-22 01:10:11 UTC
Jeffery,
    Your system is failing and mine compiles fine.  This means that my system is not really useful for further debugging.  Nevertheless, I would like to help get your system working.

First run the following command (as any user):
> grep i_len /usr/lib64/*

When I run this, I get:
grep: /usr/lib64/gcj: No such file or directory
grep: /usr/lib64/libavcall.la: No such file or directory
grep: /usr/lib64/libcallback.la: No such file or directory
Binary file /usr/lib64/libf2c.a matches
Binary file /usr/lib64/libf2c.so matches
Binary file /usr/lib64/libmopac7.a matches
Binary file /usr/lib64/libmopac7.so matches
Binary file /usr/lib64/libmopac7.so.1 matches
Binary file /usr/lib64/libmopac7.so.1.0.13 matches

The important things to note here are that libf2c and libmopac7 contain this symbol.  Next verify that libf2c provides the symbol.  Run:
> objdump -T /usr/lib64/libf2c.so | grep i_len
I get:
0000000000008310 g    DF .text  0000000000000004  Base        i_len
(.text means the symbol is in the .text section (which contains executable code))
(The value of the numbers do not matter here and could change from computer to computer)
Contrast this with with libmopac7 which requires the symbol:
> objdump -T /usr/lib64/libmopac7.so | grep i_len
0000000000000000      D  *UND*  0000000000000000              i_len
(*UND* means the symbol is undefined)

This means that any program linking against libmopac7.so also needs to link against libf2c.so

Next check what version of gcc and libtool you have:
> gcc --version
> libtool --version
I have gcc 4.2.4 and libtool 1.5.26
Perhaps you have gcc 4.1.2, which is the current stable on x86_64

I have found that order sometimes matters when linking, which means that you would want -lf2c toward the end.

To try that theory, try the following (as your normal emerge user):
> emerge ghemical
This will fail, hence the bug.
> cd /var/tmp/portage/sci-chemistry/ghemical-2.95/work/ghemical-2.95/src
This is the directory where the error occurred.
Next download the debug1.sh attachment and copy it to that directory.
This next command is the one you reported failing with -lf2c moved to after mopac7.
> /bin/sh debug1.sh
If this command succeeds, I can probably make an ebuild that will work.

If this fails, more brainstorming is needed.
Comment 6 maurerpe 2008-07-22 01:11:32 UTC
Created attachment 161064 [details]
Modified link command: libf2c near the end
Comment 7 Reinis Danne 2008-08-21 13:28:39 UTC
Hi!

I too have some problems with this ebuild.
First of all it failed already at configuration stage (pkg-config for GTK couldn't find or too old), but it seemed that rebuilding openbabel? fixed that.
Now I have the same error as others about undefined symbols:

build options:
^^^^^^^^^^^^^^
enable gtk : yes
enable threads : yes
enable OpenBabel : yes

Making all in docs
Making all in user-docs
Making all in images
Making all in examples
Making all in TSS
Making all in carbocation_rearrangement_hydride_shift
Making all in carbocation_rearrangement_methide_shift
Making all in cycloaddition_Diels-Alder
Making all in E2-reaction
Making all in sigmatropic_rearrangement_Cope
Making all in SN2-reaction
Making all in tautomeric_shift_keto_enol
Making all in src
Making all in res_gtk
mkdir .libs
x86_64-pc-linux-gnu-g++ -march=nocona -O2 -pipe -Wl,-O1 -o ghemical fileio.o filetrans.o custom_app.o custom_camera.o custom_lights.o project.o spline.o oglview_wcl.o ac_stor_wcl.o p1dview_wcl.o p2dview_wcl.o eldview_wcl.o rcpview_wcl.o gpcview_wcl.o ogl_plane.o ogl_surface.o ogl_ribbon.o gtk_simple_dialogs.o gtk_glade_dialog.o gtk_file_export_dialog.o gtk_file_import_dialog.o gtk_geomopt_dialog.o gtk_moldyn_dialog.o gtk_progress_dialog.o gtk_setup_dialog.o gtk_stereo_dialog.o gtk_trajview_dialog.o gtk_wnd.o gtk_oglview_wnd.o gtk_p1dview_wnd.o gtk_p2dview_wnd.o gtk_eldview_wnd.o gtk_rcpview_wnd.o gtk_gpcview_wnd.o gtk_app.o gtk_project.o gtk_main.o -pthread -Wl,--export-dynamic  /usr/lib64/libXi.so /usr/lib64/libXext.so /usr/lib64/libglut.so -lm -L/usr/X11R6/lib /usr/lib64/libgthread-2.0.so -lrt /usr/lib64/libgtkglext-x11-1.0.so /usr/lib64/libgdkglext-x11-1.0.so /usr/lib/libGLU.so /usr/lib64/libGL.so /usr/lib64/libXmu.so /usr/lib64/libXt.so /usr/lib64/libSM.so /usr/lib64/libICE.so /usr/lib64/libpangox-1.0.so /usr/lib64/libX11.so /usr/lib64/libglade-2.0.so /usr/lib64/libgtk-x11-2.0.so /usr/lib64/libxml2.so /usr/lib64/libgdk-x11-2.0.so /usr/lib64/libatk-1.0.so /usr/lib64/libgdk_pixbuf-2.0.so /usr/lib64/libpangocairo-1.0.so /usr/lib64/libpango-1.0.so /usr/lib64/libcairo.so /usr/lib64/libgobject-2.0.so /usr/lib64/libgmodule-2.0.so -ldl /usr/lib64/libglib-2.0.so /usr/lib64/libopenbabel.so -L/usr/lib /usr/lib64/libghemical.so /usr/lib64/libmopac7.so /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/libgfortran.so /usr/lib64/liboglappth.so
/usr/lib64/libmopac7.so: undefined reference to `c_abs'
/usr/lib64/libmopac7.so: undefined reference to `e_wsue'
/usr/lib64/libmopac7.so: undefined reference to `do_lio'
/usr/lib64/libmopac7.so: undefined reference to `flush_'
/usr/lib64/libmopac7.so: undefined reference to `z_sqrt'
/usr/lib64/libmopac7.so: undefined reference to `e_rsle'
/usr/lib64/libmopac7.so: undefined reference to `e_wsfe'
/usr/lib64/libmopac7.so: undefined reference to `i_len'
/usr/lib64/libmopac7.so: undefined reference to `getenv_'
/usr/lib64/libmopac7.so: undefined reference to `s_wsue'
/usr/lib64/libmopac7.so: undefined reference to `d_int'
/usr/lib64/libmopac7.so: undefined reference to `s_wdue'
/usr/lib64/libmopac7.so: undefined reference to `pow_dd'
/usr/lib64/libmopac7.so: undefined reference to `i_indx'
/usr/lib64/libmopac7.so: undefined reference to `d_sign'
/usr/lib64/libmopac7.so: undefined reference to `e_rsue'
/usr/lib64/libmopac7.so: undefined reference to `e_wdue'
/usr/lib64/libmopac7.so: undefined reference to `s_stop'
/usr/lib64/libmopac7.so: undefined reference to `s_rsue'
/usr/lib64/libmopac7.so: undefined reference to `pow_ii'
/usr/lib64/libmopac7.so: undefined reference to `r_sign'
/usr/lib64/libmopac7.so: undefined reference to `d_nint'
/usr/lib64/libmopac7.so: undefined reference to `e_rsfe'
/usr/lib64/libmopac7.so: undefined reference to `s_wsle'
/usr/lib64/libmopac7.so: undefined reference to `do_uio'
/usr/lib64/libmopac7.so: undefined reference to `e_rdue'
/usr/lib64/libmopac7.so: undefined reference to `s_cmp'
/usr/lib64/libmopac7.so: undefined reference to `d_lg10'
/usr/lib64/libmopac7.so: undefined reference to `s_rdue'
/usr/lib64/libmopac7.so: undefined reference to `f_rew'
/usr/lib64/libmopac7.so: undefined reference to `r_cnjg'
/usr/lib64/libmopac7.so: undefined reference to `s_copy'
/usr/lib64/libmopac7.so: undefined reference to `s_cat'
/usr/lib64/libmopac7.so: undefined reference to `s_rsfe'
/usr/lib64/libmopac7.so: undefined reference to `e_wsle'
/usr/lib64/libmopac7.so: undefined reference to `f_clos'
/usr/lib64/libmopac7.so: undefined reference to `s_rsle'
/usr/lib64/libmopac7.so: undefined reference to `do_fio'
/usr/lib64/libmopac7.so: undefined reference to `i_dnnt'
/usr/lib64/libmopac7.so: undefined reference to `s_wsfe'
/usr/lib64/libmopac7.so: undefined reference to `pow_di'
/usr/lib64/libmopac7.so: undefined reference to `z_exp'
/usr/lib64/libmopac7.so: undefined reference to `f_open'
collect2: ld returned 1 exit status
make[3]: *** [ghemical] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
 * 
 * ERROR: sci-chemistry/ghemical-2.95 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2430:  Called die
 * The specific snippet of code:
 *       emake || die "make failed"
 *  The die message:
 *   make failed
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/sci-chemistry/ghemical-2.95/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sci-chemistry/ghemical-2.95/temp/environment'.

It looks like it doesn't link against libf2c at all. Appending "-lf2c /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/libgfortran.so /usr/lib64/liboglappth.so /usr/lib64/libglut.so /usr/lib/libGLU.so" to the compiler call above, fixes this and seemingly working executable is produced.

> First run the following command (as any user):
> > grep i_len /usr/lib64/*

Binary file /usr/lib64/libf2c.a matches
Binary file /usr/lib64/libf2c.so matches
grep: /usr/lib64/libming.so: No such file or directory
Binary file /usr/lib64/libmopac7.a matches
Binary file /usr/lib64/libmopac7.so matches
Binary file /usr/lib64/libmopac7.so.1 matches
Binary file /usr/lib64/libmopac7.so.1.0.13 matches
Binary file /usr/lib64/libwireshark.so matches
Binary file /usr/lib64/libwireshark.so.0 matches
Binary file /usr/lib64/libwireshark.so.0.0.1 matches

> The important things to note here are that libf2c and libmopac7 contain this
> symbol.  Next verify that libf2c provides the symbol.  Run:
> > objdump -T /usr/lib64/libf2c.so | grep i_len

00000000000080e4 g    DF .text	0000000000000004  Base        i_len

> Contrast this with with libmopac7 which requires the symbol:
> > objdump -T /usr/lib64/libmopac7.so | grep i_len

0000000000000000      D  *UND*	0000000000000000              i_len

> Next check what version of gcc and libtool you have:
> > gcc --version

gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.1)

> > libtool --version

ltmain.sh (GNU libtool) 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)

 ~ $ eix libf2c
[I] dev-libs/libf2c
     Available versions:  20021004-r1 ~20051004 (~)20070912
     Installed versions:  20070912(17:35:59 2008.08.18.)
     Homepage:            ftp://ftp.netlib.org/f2c/index.html
     Description:         Library that converts FORTRAN to C source.


I used ebuild from portage.

Is this really an application error or an ebuild error?
Comment 8 Reinis Danne 2008-08-21 13:31:52 UTC
Created attachment 163471 [details]
emerge build.log
Comment 9 Reinis Danne 2008-08-21 13:32:32 UTC
Created attachment 163473 [details]
emerge environment
Comment 10 Reinis Danne 2008-08-21 13:37:27 UTC
Created attachment 163475 [details]
emerge info
Comment 11 Reinis Danne 2008-08-21 14:00:08 UTC
Tested attached ebuild. It is working in my case, too. Thanks.
Comment 12 Reinis Danne 2009-02-21 00:17:17 UTC
Added to science overlay
Comment 13 Justin Lecher (RETIRED) gentoo-dev 2010-06-21 14:34:23 UTC
*ghemical-2.99.2 (21 Jun 2010)

  21 Jun 2010; Justin Lecher <jlec@gentoo.org> +files/2.99.2-docs.patch,
  -ghemical-2.10.ebuild, -ghemical-2.95.ebuild, -ghemical-2.98.ebuild,
  +ghemical-2.99.2.ebuild:
  Version Bump, fixing bug 212689, 232292, 246414, thanks rei4dan for working
  on patches, Cleaned old buggy versions, Fixed wrong path for html installation