Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 197801
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Science Related Packages <sci@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: David Radice <david.e.pi.3.14@gmail.com>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
build.log build.log text/plain David Radice 2007-11-02 15:59 0000 98.62 KB Details
freefem++-2.20.1.ebuild Test case: building and testing freefem++ on eigenvalues problems text/plain David Radice 2007-11-08 11:55 0000 1.40 KB Details
buildlog.tar.gz Complete Build Log text/plain David Radice 2007-11-08 21:06 0000 49.80 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 197801 depends on: Show dependency tree
Bug 197801 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-11-01 18:46 0000
If test is set in /etc/make.conf arpack-96-r1 test programs execution fails.

Reproducible: Always

Steps to Reproduce:
1.Enable the "test" function of portage
2.emerge -1 arpack
3.

Actual Results:  
After succesfully building the test programs against arpack the execution
hangs. I have waited several minutes with the CPU at 100%, but nothing happens
(no output on the stdout nor nothing). It look like that the computer has
entered a never ending loop inside one of the test routines:

>>> Source compiled.
gfortran   -c -o sssimp.o sssimp.f
gfortran   -c -o dssimp.o dssimp.f
gfortran   -c -o snsimp.o snsimp.f
gfortran   -c -o dnsimp.o dnsimp.f
gfortran   -c -o cnsimp.o cnsimp.f
gfortran   -c -o znsimp.o znsimp.f
gfortran  -L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs
-L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/LAPACK/.libs sssimp.o
-larpack -llapack_arpack -lblas -o sssimp
gfortran  -L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs
-L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/LAPACK/.libs dssimp.o
-larpack -llapack_arpack -lblas -o dssimp
gfortran  -L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs
-L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/LAPACK/.libs snsimp.o
-larpack -llapack_arpack -lblas -o snsimp
gfortran  -L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs
-L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/LAPACK/.libs dnsimp.o
-larpack -llapack_arpack -lblas -o dnsimp
gfortran  -L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs
-L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/LAPACK/.libs cnsimp.o
-larpack -llapack_arpack -lblas -o cnsimp 
gfortran  -L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs
-L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/LAPACK/.libs znsimp.o
-larpack -llapack_arpack -lblas -o znsimp  


Exiting on signal 2

(I have waited a lot of time before killing)

Expected Results:  
Test programs should be executed correctly...

If I build the test programs against LAPACK everithing works and the test phase
is carried out succesfully in a few seconds. I have modified the ebuild this
way:

I changed this:

    sed -i \
        -e '/^include/d' \
        -e "s/\$(ALIBS)/-larpack ${BLAS_LIBS}/g" \
        -e 's/$(FC)/$(F77)/g' \
        -e 's/$(FFLAGS)/$(FFLAGS) $(LDFLAGS)/g' \
        EXAMPLES/*/makefile || die "sed failed"

into this:

    sed -i \
        -e '/^include/d' \
        -e "s/\$(ALIBS)/-llapack -larpack ${BLAS_LIBS}/g" \
        -e 's/$(FC)/$(F77)/g' \
        -e 's/$(FFLAGS)/$(FFLAGS) $(LDFLAGS)/g' \
        EXAMPLES/*/makefile || die "sed failed"

(please notice that lapack is before arpack, otherwise it does not work). This
way everything works, but here I am using the lapack-atlas package which is not
a dependency of arpack. I have tried using the temporary lapack_arpack library
which is build by the package but this was useless...

As for my environment: 

davide@gentoo ~ $ emerge --info
Portage 2.1.3.9 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.6.1-r0,
2.6.22-gentoo-r8 i686)
=================================================================
System uname: 2.6.22-gentoo-r8 i686 Genuine Intel(R) CPU T2400 @ 1.83GHz
Timestamp of tree: Fri, 26 Oct 2007 19:04:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=prescott -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/init.d/ipw3945d /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/init.d /etc/revdep-rebuild
/etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=prescott -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms
strict test unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://mirror.muntinternet.net/pub/gentoo/
ftp://mirror.switch.ch/mirror/gentoo
http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/
ftp://ftp.unina.it/pub/linux/distributions/gentoo
http://mirror.ing.unibo.it/gentoo/ ftp://mirror.ing.unibo.it/gentoo/ "
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
--force --whole-file --delete --delete-after --stats --timeout=180
--exclude=/distfiles --exclude=/local --exclude=/packages
--filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa berkdb bitmap-fonts blas cairo cdr cli cracklib crypt cups
dbus dri dvd dvdr dvdread eds emboss encode esd evo fam ffmpeg firefox fortran
ftp gb gdbm gif glitz gphoto2 gpm gstreamer gtk hal iconv imagemagick ipv6
isdnlog jabber javascript jpeg kerberos lapack ldap mad midi mikmod mime mmx
mozilla mp3 mpeg msn mudflap mysql ncurses nls nptl nptlonly ogg opengl openmp
oss pam pcre pdf perl png pppd python quicktime readline reflection samba sdl
session spell spl sse sse2 ssl svg tcpd test tetex theora tiff truetype
truetype-fonts type1-fonts unicode usb vim-syntax vorbis win32codecs x86
xcomposite xml xorg xscreensaver xv xvid zlib" ALSA_CARDS="ali5451 als4000
atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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" ELIBC="glibc" INPUT_DEVICES="keyboard
mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk
hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nvidia
nv"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS,
LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

------- Comment #1 From Sébastien Fabbro 2007-11-02 13:15:48 0000 -------
I can't reproduce it on my x86 and amd64. Also, some users have reported bugs
using external lapack, which is what changed in the -r1.
It could be that you are using blas-atlas which needs atlas. I commited a small
fix that allows arpack to use any blas. Please resync later on and try again.

------- Comment #2 From David Radice 2007-11-02 15:59:04 0000 -------
Created an attachment (id=135013) [details]
build.log

Thanks you for the quick help.

It does not build the examples any more. I get an error when emerge is running
the autotools:

 * You need one of these Fortran Compilers: gfortran ifc g77
 * Installed are:  gfortran
>>> Unpacking source...
>>> Unpacking arpack96.tar.gz to /var/tmp/portage/sci-libs/arpack-96-r2/work
>>> Unpacking patch.tar.gz to /var/tmp/portage/sci-libs/arpack-96-r2/work
>>> Unpacking parpack96.tar.gz to /var/tmp/portage/sci-libs/arpack-96-r2/work
>>> Unpacking ppatch.tar.gz to /var/tmp/portage/sci-libs/arpack-96-r2/work
 * Applying arpack-autotools.patch ...                                    [ ok
]
 * Applying arpack-arscnd.patch ...                                       [ ok
]
Package blas was not found in the pkg-config search path.
Perhaps you should add the directory containing `blas.pc'
to the PKG_CONFIG_PATH environment variable
No package 'blas' found
 * Running eautoreconf in '/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK'
...
 * Running aclocal ...                                                    [ ok
]
 * Running libtoolize --copy --force --automake ...                       [ ok
]
 * Running aclocal ...                                                    [ ok
]
 * Running autoconf ...                                                   [ ok
]
 * Running automake --add-missing --copy --foreign ...                    [ ok
]
 * Running elibtoolize in: ARPACK
 *   Applying sed-1.5.6.patch ...
>>> Source unpacked.

And then while building the tests: (it seems that BLAS symbols are missing)

>>> Source compiled.
gfortran   -c -o sssimp.o sssimp.f
gfortran   -c -o dssimp.o dssimp.f
gfortran   -c -o snsimp.o snsimp.f
gfortran   -c -o dnsimp.o dnsimp.f
gfortran   -c -o cnsimp.o cnsimp.f
gfortran   -c -o znsimp.o znsimp.f
gfortran  -L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs sssimp.o
-larpack  -o sssimp
gfortran  -L/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs dssimp.o
-larpack  -o dssimp
dssimp.o: In function `MAIN__':
dssimp.f:(.text+0x833): undefined reference to `daxpy_'
dssimp.f:(.text+0x856): undefined reference to `dnrm2_'
dssimp.o: In function `av_':
dssimp.f:(.text+0x11f8): undefined reference to `daxpy_'
dssimp.f:(.text+0x1290): undefined reference to `daxpy_'
dssimp.f:(.text+0x12d4): undefined reference to `daxpy_'
dssimp.f:(.text+0x136c): undefined reference to `daxpy_'
dssimp.f:(.text+0x13c5): undefined reference to `dscal_'
/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs/libarpack.so:
undefined reference to `cgemv_'
/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs/libarpack.so:
undefined reference to `cscal_'

[Many many more of them]

/var/tmp/portage/sci-libs/arpack-96-r2/work/ARPACK/.libs/libarpack.so:
undefined reference to `drot_'
collect2: ld returned 1 exit status
make: *** [sssimp] Error 1
make: *** [snsimp] Error 1
/usr/portage/sci-libs/arpack/arpack-96-r2.ebuild: line 71: ./sssimp: No such
file or directory

This is happening while using BLAS-ATLAS. (pkg-config seems to be unable to
find it).

If I use the reference BLAS implementation I get the same problem as before...
the computer hangs while running the first test program and I have to kill the
process...

I am attaching the build log.

------- Comment #3 From Sébastien Fabbro 2007-11-02 19:01:29 0000 -------
If you want to use blas-atlas, you need to bump to the tobe stable 3.8.0.
Otherwise, stick to blas-reference.

------- Comment #4 From David Radice 2007-11-03 11:37:28 0000 -------
Ok, with reference-BLAS it does build, but it hangs while running the tests. It
does work if I link with -llapack -larpack (lapack before arpack). I think that
this way the LAPACK subroutines from within Arpack are not used, and instead
the one from lapack-atlas are used. So it must be that some Lapack subroutine
within Arpack Lib is broken in my system... This is not really a big issue as I
can always link this way against the working lapack...  

------- Comment #5 From Sébastien Fabbro 2007-11-06 11:43:00 0000 -------
David,

Could you provide the result of "eselect blas show" and "eselect lapack show"?

You should not need to link with the external lapack. Altough the documentation
is old, check http://www.caam.rice.edu/software/ARPACK/UG/node13.html

Sébastien

------- Comment #6 From David Radice 2007-11-06 20:18:36 0000 -------
Thank you very much for the help. 

Here is the eselect output for blas:
davide@gentoo ~ $ eselect blas show
lib: reference

I don't have the lapack eselect module installed... I have:

davide@gentoo ~ $ lapack-config -p

Current profile:
F77 LAPACK: /usr/lib/lapack/f77-ATLAS



davide@gentoo ~ $ eix -Ic blas
[I] app-admin/eselect-blas (0.1@08/05/07): BLAS module for eselect
[I] app-admin/eselect-cblas (0.1@08/05/07): C-language BLAS module for eselect
[I] sci-libs/blas-atlas (3.7.11-r1@08/05/07): Automatically Tuned Linear
Algebra Software BLAS implementation
[I] sci-libs/blas-reference (20070226@11/01/07): Basic Linear Algebra
Subprograms F77 reference implementations
[I] sci-libs/cblas-reference (20030223-r4@10/26/07): C wrapper interface to the
F77 reference BLAS implementation
[I] virtual/blas (1.0@10/26/07): Virtual for FORTRAN 77 BLAS implementation
[I] virtual/cblas (1.0@10/26/07): Virtual for BLAS C implementation
Found 7 matches.
davide@gentoo ~ $ eix -Ic lapack
[I] sci-libs/lapack-atlas (3.7.11@08/05/07): F77 and C LAPACK implementations
using available ATLAS routines
[I] sci-libs/lapack-config (1.0.1@08/05/07): Utility to change the default
LAPACK library
Found 2 matches.

AFAIK I should be in sync with the stable release...

I have read the documentation and I knew that -lapack shouldn't be needed
before opening this bug, but this is the only way to make the examples work.
Actually I was trying to build freefem++ with arpack and found that the only
way to make it work was patching the arpack with the "rename second patch" and
linking against lapack in a way such that the lapack subset inside arpack is
overwritten. If I use the default lapack routines inside arpack nothing works
and every program goes in a never-ending loop as the first routine of arpack is
called...  

------- Comment #7 From Sébastien Fabbro 2007-11-07 17:19:07 0000 -------
> [I] sci-libs/lapack-atlas (3.7.11@08/05/07): F77 and C LAPACK implementations
> using available ATLAS routines
> [I] sci-libs/lapack-config (1.0.1@08/05/07): Utility to change the default
> LAPACK library
> Found 2 matches.
> 
> AFAIK I should be in sync with the stable release...

Yes you are, but we are a bit behind with stabilization. You probably want
lapack-reference-3.1.1-r1. Check our updated guide at
http://www.gentoo.org/proj/en/science/blas-lapack.xml for more on lapack.

Anyway it should not matter which lapack you have installed if it's using the
arpack internal one.

> I have read the documentation and I knew that -lapack shouldn't be needed
> before opening this bug, but this is the only way to make the examples work.
> Actually I was trying to build freefem++ with arpack and found that the only
> way to make it work was patching the arpack with the "rename second patch" and
> linking against lapack in a way such that the lapack subset inside arpack is
> overwritten. If I use the default lapack routines inside arpack nothing works
> and every program goes in a never-ending loop as the first routine of arpack is
> called...  

This would be annoying if it's confirmed. Some users confirm the opposite: they
need the internal lapack, that's the main reason for the -r1 bump. I can't
reproduce it on my boxes, everything builds and tests fine. Anyone could? 
I will try freefem++ when I have more time.

------- Comment #8 From David Radice 2007-11-08 11:55:31 0000 -------
Created an attachment (id=135483) [details]
Test case: building and testing freefem++ on eigenvalues problems

I have updated to atlas-3.8.0, but nothing changes (it builds also with atlas
now, but it goes to the neverending loop too).

The issue with freefem++ should be the same of the testing libs, so you should
not need to test it, but, if you want to test, it I am attaching an ebuild I
have been writing for freefem++ for the sunrise project (it's my first ebuild),
maybe it could save you some time... (I will not "release" this until I
understand how to fix this issue...)

------- Comment #9 From Sébastien Fabbro 2007-11-08 13:54:23 0000 -------
Thanks to your build log, I think I spotted the problem. It seems it needs the
-pipe flags added to fortran flags FFLAGS. By the way, you probably want to set
your fortran flags in your /etc/make.conf, such as FFLAGS="${CFLAGS}".
Now I would like to know if there is any other issue with the internal lapack
libs. Could you set your flags as said and test your freefem++ lib?

------- Comment #10 From David Radice 2007-11-08 21:06:35 0000 -------
Created an attachment (id=135515) [details]
Complete Build Log

I have modified my make.conf and added the "FFLAGS" variable, but nothing
really changed: it is still hanging. I have tried playing with the eselect blas
and lapack values, but it was useless... I am attaching the full build log. 

------- Comment #11 From David Radice 2007-11-08 21:43:03 0000 -------
I found that building with -pipe only does it: everything works this way. But
if I build with -O (or -O{2,3}) the lapack "sublib" is not built well, but
appears to be broken. For example:

-O -pipe 

does not work while:

-march=prescott -pipe 

works, but I don't know what -march does without any optimization (almost
nothing I think).

I can't say that this really fixes the problem as building this library without
any optimization is not really good: eigenvalues problems can require a lot of
calculations... 

------- Comment #12 From Sébastien Fabbro 2007-12-04 15:45:34 0000 -------
David,

I made a new autotools patch that doesn't optimize a few internal lapack
routines, just as we do with our lapack-reference. It worked on my x86 with any
FFLAGS I set. Please let me know if it works for you after a re-sync.

------- Comment #13 From David Radice 2007-12-04 20:50:45 0000 -------
It works perfectly here now, even with -O3 FFLAGS, the test routine seems to be
executed correctly now.

------- Comment #14 From Sébastien Fabbro 2007-12-05 11:02:35 0000 -------
> It works perfectly here now, even with -O3 FFLAGS, the test routine seems to be
> executed correctly now.


Thanks! Closing, then.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug