Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 296518 - sys-cluster/openmpi does not link with mpi_cxx
Summary: sys-cluster/openmpi does not link with mpi_cxx
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL:
Whiteboard:
Keywords:
: 298506 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-11 13:15 UTC by Juergen Rose
Modified: 2010-02-14 20:48 UTC (History)
3 users (show)

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


Attachments
octave-3.2.3-r1 build log (build.log,364.26 KB, text/plain)
2010-01-06 00:58 UTC, Sébastien Fabbro (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2009-12-11 13:15:03 UTC
'emerge octave' fails with:
...
x86_64-pc-linux-gnu-g++  -I. -I.. -I../liboctave -I../src -I../libcruft/misc  -DHAVE_CONFIG_H -I/usr/include/freetype2 -Wall -W -Wshadow -Wold-style-cast -Wformat -O2 -pipe -rdynamic \
        -L..  -fPIC -Wl,-O1 -o octave \
        main.o  \
        -L../liboctave -L../libcruft -L../src -Wl,-rpath -Wl,/usr/lib64/octave-3.2.3 \
        -loctinterp -loctave  -lcruft   \
             \
           -llapack -lblas   -lblas   \
        -lfftw3 -lfftw3f -lqrupdate  -lftgl -lfreetype -lz -L/usr/X11R6/lib -lGL -lGLU \
        -L/usr/lib64 -lX11  -lreadline  -lncurses -ldl -lhdf5 -lz -lm  -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/../../.. -lhdf5 -lz -lgfortranbegin -lgfortran -lm
../src/liboctinterp.so: undefined reference to `ompi_mpi_cxx_op_intercept'
../src/liboctinterp.so: undefined reference to `MPI::Datatype::Free()'
../src/liboctinterp.so: undefined reference to `MPI::Comm::Comm()'
../src/liboctinterp.so: undefined reference to `MPI::Win::Free()'
collect2: ld returned 1 exit status
...
 * ERROR: sci-mathematics/octave-3.2.3 failed:


Reproducible: Always




root@moose:/root(8)# emerge --info
Portage 2.1.7.13 (default/linux/amd64/10.0/desktop, gcc-4.4.2, glibc-2.11-r1, 2.6.32-gentoo x86_64)
=================================================================
System uname: Linux-2.6.32-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9650_@_3.00GHz-with-gentoo-2.0.1
Timestamp of tree: Fri, 11 Dec 2009 11:00:01 +0000
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4, 3.1.1-r1
dev-python/pycrypto: 2.1.0_beta1
dev-util/cmake:      2.8.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.3
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.64
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA PUEL dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
FFLAGS="-march=nocona -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="de fr"
MAKEOPTS="-j5"
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/local/portage/layman/zugaina /usr/local/portage/layman/java-overlay /usr/local/portage/layman/science /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d a52 aac acl acpi administrator afs alsa amd64 amrr ao aotuv apache2 asf aspell audacious audiofile automount bash-completion beagle berkdb bjam blas bluetooth boo boost branding bzip2 c++ cairo cardbus cdda cddb cdf cdio cdparanoia cdr cgi chm cli consolekit corba cracklib crypt cups curl cxx daap dbus device-mapper dga dia djvu doc dri ds2490 dts dv dvb dvd dvdr dvi dxr3 eds elf emacs emboss encode epiphany evo examples exif expat extra extras fam fame ffmpeg fftw firefox fits flac fltk foomaticdb fortran fpx fuse galago garmin gd gdal gdbm geolocation geos gif gimp ginac git glade glib glitz gml gmp gnokii gnome gnome-keyring gnuplot gnutls gphoto2 gpm graphics graphviz gs gsl gsm gstreamer gtk guile hal hardened harness hddtemp hdf hdf5 hlapi http httpd hvm iconv icq icu id3 ide imagemagick imap innodb ipod ipv6 irda ithreads jabber jadetex java java5 java6 jbig john jpeg jpeg2k kde kerberos kexi kpathsea kvm ladspa lame lapack laptop latex lcms ldap libffi libgda libnotify libsamplerate lirc lm_sensors lua lzo mad mail maildir mailwrapper math matroska matrox mikmod mmx mmxext mng modules mono motif mozdevelop mozilla mp3 mp4 mpeg mpi mplayer mtp mudflap multilib musicbrainz mysql mysqli nautilus ncurses neXt netcdf netpbm network networking networkmanager nfs nls nntp nptl nptlonly nsplugin ntfs ntp numarray numeric nvidia obex objc ocaml octave odbc ogdi ogg ole openexr opengl openmp pae pam pcre pda pdf perl plotutils plugins png podcast policykit posix postgres postscript ppds pppd preview-latex proj projectx pstricks pulseaudio pymol python qhull qt3support qt4 quicktime readline reflection reiserfs rle romio rpc rrdcgi rrdtool samba sasl science sdl server session slang slp smbclient smp sndfile snmp soup sox speex spell spl sql sqlite sse sse2 ssl startup-notification stlport subtitles subversion suexec svg swig sysfs szip t1lib tcl tcpd tex tex4ht texmacs theora thinkpad threads thunar thunderbird tidy tiff tk tntc tools truetype udev unicode usb userlocales utempter v4l2 virtualbox vorbis wav webdav webdav-serf webkit wifi wmf wxwidgets x264 xattr xcb xemacs xext xine xml xmlreader xmlrpc xorg xpm xulrunner xv xvid xvmc zlib zvbi" ALSA_CARDS="intel8x0" 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 auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse                evdev               " KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de fr" NETBEANS_MODULES="ide websvccommon nb harness apisupport groovy gsf j2ee java xml" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Juergen Rose 2009-12-14 12:25:26 UTC
A similar bug seems to be Bug# 296790.
Comment 2 Juergen Rose 2009-12-17 13:08:48 UTC
Even "emerge -vDe system" did not solve the issue.
Comment 3 Juergen Rose 2009-12-25 21:16:13 UTC
'USE=-hdf5 emerge -vDN octave' works.
Comment 4 Honza Macháček 2009-12-27 14:58:50 UTC
(In reply to comment #3)
> 'USE=-hdf5 emerge -vDN octave' works.

So does `export LIBS="-lmpi_cxx"; emerge octave`

Apparently hdf5 libraries compiled with mpi support somehow get libmpi_cxx symbols into the octave object files. The octave ebuild is not mpi-aware and neither seems to be the octave package itself, so no mpi libraries are linked in unless forced to. I am not sure what the proper solution should be.
Comment 5 Juergen Rose 2009-12-28 10:10:41 UTC
It seems, that I found the reason for my problems with mpi references.
On some computers, were I installed mpich2 several month (or years) ago, I had no problems. On the other computers, where I set the mpi USE flag some weeks ago, openmpi was installed automatically. And on those computers with openmpi I had the undefined references to ompi_mpi_cxx_op_intercept, MPI::Datatype::Free etc.

So switching to mpich2 solved my problem.
Comment 6 Juergen Rose 2010-01-05 10:13:01 UTC
With 'export LIBS="-lmpi_cxx"; emerge octave' the installationn of octave works also in the case that only openmpi (and not mpich2) is installed.

Comment 7 Sébastien Fabbro (RETIRED) gentoo-dev 2010-01-05 23:36:42 UTC
*** Bug 296790 has been marked as a duplicate of this bug. ***
Comment 8 Sébastien Fabbro (RETIRED) gentoo-dev 2010-01-05 23:40:52 UTC
I can reproduce it, and it looks like an openmpi issue.
Comment 9 Justin Bronder (RETIRED) gentoo-dev 2010-01-05 23:59:30 UTC
(In reply to comment #0)
> 'emerge octave' fails with:
> ...
> x86_64-pc-linux-gnu-g++  -I. -I.. -I../liboctave -I../src -I../libcruft/misc 
...
(In reply to comment #8)
> I can reproduce it, and it looks like an openmpi issue.
> 

From the looks of this, octave/hdf5 are not using the OpenMPI compiler wrappers and instead trying to guess which libraries to link in.  Both OpenMPI and Mpich2 upstream developers will not support/guarantee anything aside from using the wrappers provided in their packages.

To be sure, would you attach the full build log?  
Comment 10 Sébastien Fabbro (RETIRED) gentoo-dev 2010-01-06 00:58:32 UTC
Created attachment 215355 [details]
octave-3.2.3-r1 build log

Here is octave-3.2.3-r1 build log. octave does not directly depend on mpi, only via hdf5. hdf5-1.8.4-r1 was built with mpi, and uses the mpicc wrapper as shown in the ebuild. The mpi interface of hdf5 does not support c++, so I don't see why we should link to mpi_cxx or use mpicxx.
It could be a as-needed problem on libmpi from openmpi.
Comment 11 Sébastien Fabbro (RETIRED) gentoo-dev 2010-01-07 03:55:33 UTC
*** Bug 298506 has been marked as a duplicate of this bug. ***
Comment 12 Justin Bronder (RETIRED) gentoo-dev 2010-01-22 03:56:50 UTC
I cannot reproduce this with openmpi-1.4.1, can anyone else confirm that?

I did not try with --as-needed though, as that was not in LDFLAGS of the reporter.
Comment 13 Sébastien Fabbro (RETIRED) gentoo-dev 2010-01-23 16:53:03 UTC
It seems to be gone too with openmpi-1.4.1 and also with as-needed. I tested on a few applications.
Re-open if it's not the case.
Thanks.

Comment 14 Juergen Rose 2010-02-14 20:48:22 UTC
Emerging octave-3.2.4 with installed openmpi-1.4.1 works now for me.