主题:ifort和MKL的问题
新手,刚刚尝试使用intel的MKL,首先安装了intel编译器11.1,编译一般程序已经没有问题。
然后使用了安装好的MKL文件夹中的/mkl/tools/environment/mklvarsem64t.sh改了环境变量(不知道这样对否?)
然后进入了mkl/examples/lapack/source文件夹,找了一个相对简单的例子:ssptrdx.f, 源代码如下:
* SSPTRD (F08GEE) Example Program Text
* Mark 16 Release. NAG Copyright 1992.
* .. Parameters ..
INTEGER NIN, NOUT
PARAMETER (NIN=5,NOUT=6)
INTEGER NMAX
PARAMETER (NMAX=8)
* .. Local Scalars ..
INTEGER I, INFO, J, N
CHARACTER UPLO
* .. Local Arrays ..
REAL AP(NMAX*(NMAX+1)/2), D(NMAX), E(NMAX-1),
+ TAU(NMAX-1)
* .. External Subroutines ..
EXTERNAL SSPTRD
* .. Executable Statements ..
WRITE (NOUT,*) 'SSPTRD Example Program Results'
* Skip heading in data file
READ (NIN,*)
READ (NIN,*) N
IF (N.LE.NMAX) THEN
*
* Read A from data file
*
READ (NIN,*) UPLO
IF (UPLO.EQ.'U') THEN
READ (NIN,*) ((AP(I+J*(J-1)/2),J=I,N),I=1,N)
ELSE IF (UPLO.EQ.'L') THEN
READ (NIN,*) ((AP(I+(2*N-J)*(J-1)/2),J=1,I),I=1,N)
END IF
*
* Reduce A to tridiagonal form
*
CALL SSPTRD(UPLO,N,AP,D,E,TAU,INFO)
*
* Print tridiagonal form
*
WRITE (NOUT,*)
WRITE (NOUT,*) 'Diagonal'
WRITE (NOUT,99999) (D(I),I=1,N)
WRITE (NOUT,*) 'Off-diagonal'
WRITE (NOUT,99999) (E(I),I=1,N-1)
END IF
STOP
*
99999 FORMAT (1X,8F9.4)
END
-------------------------------------------------------
使用的编译的shell script compile.sh如下(options是在intel自己的link line advisor上面找的):
#!/bin/bash
SRC=$1
MKL=/home/liang/intel/Compiler/11.1/073/mkl/lib/em64t
ifort $1 -Wl,--start-group ${MKL}/libmkl_intel_ilp64.a ${MKL}/libmkl_sequential.a ${MKL}/libmkl_core.a -Wl,-end-group -lpthread
-------------------------------------------------------
编译命令如下(编译通过了,没有报错):
./compile.sh ssptrdx.f
-------------------------------------------------------
执行a.out:
./a.out
SSPTRD Example Program Results
try
3
U
1 2 3 4 5 6
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
a.out 0000000000413819 Unknown Unknown Unknown
a.out 0000000000408305 Unknown Unknown Unknown
a.out 0000000000406D9C Unknown Unknown Unknown
a.out 0000000000405CAE Unknown Unknown Unknown
a.out 00000000004058F4 Unknown Unknown Unknown
a.out 0000000000405755 Unknown Unknown Unknown
a.out 0000000000405526 Unknown Unknown Unknown
a.out 00000000004050AC Unknown Unknown Unknown
libc.so.6 000000366061D8A4 Unknown Unknown Unknown
a.out 0000000000404FB9 Unknown Unknown Unknown
-------------------------------------------------------------------------------
出现了上述错误,试了很久,基本上还是上面这样的错误。。网上也没有找到解答。
求专家指出可能的错误原因,谢谢。
然后使用了安装好的MKL文件夹中的/mkl/tools/environment/mklvarsem64t.sh改了环境变量(不知道这样对否?)
然后进入了mkl/examples/lapack/source文件夹,找了一个相对简单的例子:ssptrdx.f, 源代码如下:
* SSPTRD (F08GEE) Example Program Text
* Mark 16 Release. NAG Copyright 1992.
* .. Parameters ..
INTEGER NIN, NOUT
PARAMETER (NIN=5,NOUT=6)
INTEGER NMAX
PARAMETER (NMAX=8)
* .. Local Scalars ..
INTEGER I, INFO, J, N
CHARACTER UPLO
* .. Local Arrays ..
REAL AP(NMAX*(NMAX+1)/2), D(NMAX), E(NMAX-1),
+ TAU(NMAX-1)
* .. External Subroutines ..
EXTERNAL SSPTRD
* .. Executable Statements ..
WRITE (NOUT,*) 'SSPTRD Example Program Results'
* Skip heading in data file
READ (NIN,*)
READ (NIN,*) N
IF (N.LE.NMAX) THEN
*
* Read A from data file
*
READ (NIN,*) UPLO
IF (UPLO.EQ.'U') THEN
READ (NIN,*) ((AP(I+J*(J-1)/2),J=I,N),I=1,N)
ELSE IF (UPLO.EQ.'L') THEN
READ (NIN,*) ((AP(I+(2*N-J)*(J-1)/2),J=1,I),I=1,N)
END IF
*
* Reduce A to tridiagonal form
*
CALL SSPTRD(UPLO,N,AP,D,E,TAU,INFO)
*
* Print tridiagonal form
*
WRITE (NOUT,*)
WRITE (NOUT,*) 'Diagonal'
WRITE (NOUT,99999) (D(I),I=1,N)
WRITE (NOUT,*) 'Off-diagonal'
WRITE (NOUT,99999) (E(I),I=1,N-1)
END IF
STOP
*
99999 FORMAT (1X,8F9.4)
END
-------------------------------------------------------
使用的编译的shell script compile.sh如下(options是在intel自己的link line advisor上面找的):
#!/bin/bash
SRC=$1
MKL=/home/liang/intel/Compiler/11.1/073/mkl/lib/em64t
ifort $1 -Wl,--start-group ${MKL}/libmkl_intel_ilp64.a ${MKL}/libmkl_sequential.a ${MKL}/libmkl_core.a -Wl,-end-group -lpthread
-------------------------------------------------------
编译命令如下(编译通过了,没有报错):
./compile.sh ssptrdx.f
-------------------------------------------------------
执行a.out:
./a.out
SSPTRD Example Program Results
try
3
U
1 2 3 4 5 6
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
a.out 0000000000413819 Unknown Unknown Unknown
a.out 0000000000408305 Unknown Unknown Unknown
a.out 0000000000406D9C Unknown Unknown Unknown
a.out 0000000000405CAE Unknown Unknown Unknown
a.out 00000000004058F4 Unknown Unknown Unknown
a.out 0000000000405755 Unknown Unknown Unknown
a.out 0000000000405526 Unknown Unknown Unknown
a.out 00000000004050AC Unknown Unknown Unknown
libc.so.6 000000366061D8A4 Unknown Unknown Unknown
a.out 0000000000404FB9 Unknown Unknown Unknown
-------------------------------------------------------------------------------
出现了上述错误,试了很久,基本上还是上面这样的错误。。网上也没有找到解答。
求专家指出可能的错误原因,谢谢。