The programs bellow fails to link against lapack library from the atlas
package:

% gfortran -L/sw/lib -llapack -lcblas -lf77blas -latlas test_dgesv.f 
/usr/bin/ld: Undefined symbols:
___powisf2 referenced from liblapack expected to be defined in libgcc
___powidf2 referenced from liblapack expected to be defined in libgcc
collect2: ld returned 1 exit status

This is with gcc43 4.3.3-1000 and atlas 3.8.2-2 on MacOS 10.4.11 PPC.
The powisf2  and powidf2 symbol are defined in 
/sw/lib/gcc4.3/lib/libgcc_s.1.dylib. Indeed the program links fine if 
one add -lgcc_s.1 to the link command:

% gfortran -L/sw/lib -llapack -lcblas -lf77blas -latlas -lgcc_s.1 test_dgesv.f 

Why does this library need to be added by hand? Is it a bug in atlas on 
10.4/PPC? The same program compiles well on 10.5 without -lgcc_s.1.


        PROGRAM TEST_DGESV
C...Resolution d'un systeme lineaire
        IMPLICIT NONE
        DOUBLE PRECISION MAT
        DOUBLE PRECISION VEC
        
        DIMENSION MAT(4,4)
        DIMENSION VEC(4)
        
        INTEGER I

        INTEGER INFO
        INTEGER IPIV
        DIMENSION IPIV(4)

C...Elements de la matrice MAT
C...Premiere ligne
        MAT(1,1)=1
        MAT(1,2)=2
        MAT(1,3)=3
        MAT(1,4)=4
C...Deuxieme ligne
        MAT(2,1)=4
        MAT(2,2)=1
        MAT(2,3)=2
        MAT(2,4)=3
C...Toisieme ligne
        MAT(3,1)=5
        MAT(3,2)=6
        MAT(3,3)=1
        MAT(3,4)=2
C...Quatrieme ligne
        MAT(4,1)=-7
        MAT(4,2)=-8
        MAT(4,3)=-9
        MAT(4,4)=1

C...Elements du vecteur VEC
        VEC(1)=-10
        VEC(2)=-4
        VEC(3)=-12
        VEC(4)=-22

C...Resolution de A*X=B
C...DGESV(N,NRHS,A,LDA,IPIV,B,LDB,INFO)
        CALL DGESV(4,1,MAT,4,IPIV,VEC,4,INFO)
C...En sortie, MAT contient sa decomposition LU
C...En sortie, la solution est dans VEC
C...En sortie, INFO=0 si tout va bien
C...En sortie, IPIV contient la liste des permutations
        WRITE(6,*)'INFO=',INFO
        WRITE(6,*)'LISTE DES PERMUTATIONS:'
        DO I=1,4
        WRITE(6,*)'IPIV(',I,')=',IPIV(I)
        ENDDO

C...Affichage du resultat (1,-2,3,-4)
        WRITE(6,*)'SOLUTION DE MAT*X=VEC:'
        DO I=1,4
        WRITE(6,*)'X(',I,')=',VEC(I)
        ENDDO

        END PROGRAM TEST_DGESV





------------------------------------------------------------------------------
_______________________________________________
Fink-devel mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.devel

Reply via email to