LAPACK Archives

[Lapack] failed to build 32 bit f2clib

Hello Julian,

Thank you for your response.

Also, I send another e-mail earlier regarding another problem.

On a i386 architecture / linux / 32 bit platform I was able to compile
and build the blas, f2c and lapack libraries without a single error
message.  Also I was able to compile and link the test routines.

I used the downloaded clapack package with only one
modification.  I renamed to only.

However, some of the lapack function calls never returned.
For example,  the executables that are included in the package
and are used to test the lapack library never end.

I wrote the following code (test.c)

        #include "f2c.h"
        #include "clapack.h"

        int main()
            integer m=3, n=2, nrhs=1, lda=3, ldb=3, lwork=512, info;
            double aa[]={1,1,1,2,3,4};
            double bb[]={2,3,4};
            double w[512];
            char trans='N';
            int result = dgels_( &trans, &m, &n, &nrhs, aa, &lda, bb, 
&ldb, w, &lwork, &info );

            return, 0;

I compiled and linked the code without any error message with the command
        gcc test.c lapack_LINUX.a blas_LINUX.a F2CLIBS/libf2c.a -lm -IINCLUDE
but when I ran the executable a.out it never returned.  However, 
after I changed
the initialization value of lwork to -1 and compiled and ran the 
executable, then
it returned.  The argument lwork is set to -1 when we need the lapack
function to return an optimum size for work buffer only.

I followed the same steps mentioned above exactly on a
i386 architecture / linux / 64 bit platform and all executables
ran to completion without any error or problem.

Any help from you to solve this problem will be appreciated.

Thank you,

At 9:40 AM -0600 7/15/08, julien.langou@Domain.Removed wrote:
Hello Edwin,

I am forwarding the answer of Peng Du that worked on the problem.
You probably have a problem with one of your system lib that is 32-bit.
For example glibc. Here are some relevant discussions.

Peng did a quick sample on a 64-bit debian machine, just call printf and
print something. At linking time gcc complained:

[dpo-deb4-64:/home/pdu/tryout]299 % gcc -m32 -c foo.c
[dpo-deb4-64:/home/pdu/tryout]302 % gcc foo.o -o foo
/hub/Linux/glibc-2.3.6/x86_64/apps/gcc-4.1.1/bin/ld: warning: i386
architecture of input file `foo.o' is incompatible with i386:x86-64 output
[dpo-deb4-64:/home/pdu/tryout]304 % ./foo
Segmentation fault

So you could try to make this kind of example work when looking for 
what is really missing in the process before moving on to deal with 

In any case, the problem does not seem to come from us.

(Thanks Peng.)

On Mon, 14 Jul 2008, Edwin Sarkissian wrote:


I tried to compile CLAPACK on a 64 bit architecture as a 32 bit library.
To do so, I renamed to and replaced the line
       CC        = gcc
       CC        = gcc -m32
I was able to create blas_linux.a library, but building f2clib failed.  The
following shows the error messages that I got.

[esarkiss at vostok CLAPACK-3.1.1]$ make f2clib
( cd F2CLIBS/libf2c; make )
make[1]: Entering directory
cp signal1.h0 signal1.h
cp sysdep1.h0 sysdep1.h
gcc -m32 -c f77vers.c
gcc -m32 -c i77vers.c
gcc -m32 -c -DSkip_f2c_Undefs -O3 main.c
ld -r -x -o main.o
ld: Relocatable linking with relocations from format elf32-i386
(main.o) to format elf64-x86-64 ( is not supported
make[1]: *** [main.o] Error 1
make[1]: Leaving directory
make: *** [f2clib] Error 2

Thank you in advance,
Lapack mailing list

<Prev in Thread] Current Thread [Next in Thread>

For additional information you may use the LAPACK/ScaLAPACK Forum.
Or one of the mailing lists, or