Reputation: 39
I am trying to include the in-build subroutines of Intel Math Kernel Library in ABAQUS UMAT. I included 'mkl.fi' but it is showing the error as shown below (It is ABAQUS generated job file):
Abaqus JOB Job-1
Abaqus 6.13-1
Begin Compiling Abaqus/Standard User Subroutines
3/8/2017 6:14:23 PM
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on
Intel(R) 64, Version 17.0.1.143 Build 20161005
Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(29): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE CGEJSV( JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(30): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
& M, N, A, LDA, SVA, U, LDU, V, LDV, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(34): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
COMPLEX A( LDA, * ), U( LDU, * ), V( LDV, * ), &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(43): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE ZGEJSV( JOBA, JOBU, JOBV, JOBR, JOBT, JOBP, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(44): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
& M, N, A, LDA, SVA, U, LDU, V, LDV, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(48): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
DOUBLE COMPLEX A( LDA, * ), U( LDU, * ), V( LDV, * ), &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(57): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE DGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(58): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
& IL, IU, NS, S, U, LDU, VT, LDVT, WORK, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(64): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
DOUBLE PRECISION A( LDA, * ), S( * ), U( LDU, * ), &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(70): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE SGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(71): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
& IL, IU, NS, S, U, LDU, VT, LDVT, WORK, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(77): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
REAL A( LDA, * ), S( * ), U( LDU, * ), &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(83): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE CGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(84): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
& IL, IU, NS, S, U, LDU, VT, LDVT, WORK, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(91): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
COMPLEX A( LDA, * ), U( LDU, * ), VT( LDVT, * ), &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(97): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE ZGESVDX( JOBU, JOBVT, RANGE, M, N, A, LDA, VL, VU, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(98): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
& IL, IU, NS, S, U, LDU, VT, LDVT, WORK, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(105): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
COMPLEX*16 A( LDA, * ), U( LDU, * ), VT( LDVT, * ), &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(111): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE CGESVJ( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(121): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE ZGESVJ( JOBA, JOBU, JOBV, M, N, A, LDA, SVA, MV, V, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(131): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE DGGSVD3( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(132): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
& LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,&
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(135): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(138): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
DOUBLE PRECISION A( LDA, * ), ALPHA( * ), B( LDB, * ), &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(139): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
& BETA( * ), Q( LDQ, * ), U( LDU, * ), &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(145): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
SUBROUTINE SGGSVD3( JOBU, JOBV, JOBQ, M, N, P, K, L, A, LDA, B, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(146): error #5082: Syntax error, found '&' when expecting one of: * <IDENTIFIER>
& LDB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK,&
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(149): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
INTEGER INFO, K, L, LDA, LDB, LDQ, LDU, LDV, M, N, P, &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(152): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
REAL A( LDA, * ), ALPHA( * ), B( LDB, * ), &
------------------------------------------------------------------------^
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.1.143\windows\mkl\include\MKL_lapack.FI(153): error #5082: Syntax error, found '&' when expecting one of: <IDENTIFIER> %FILL
& BETA( * ), Q( LDQ, * ), U( LDU, * ), &
------------------------------------------------------------------------^
AFEM.for(170): catastrophic error: Too many errors, exiting
compilation aborted for AFEM.for (code 1)
Abaqus Error: Problem during compilation - D:\Google Drive\Friday_May_27_2016\Mtech Thesis Job\All new work\TA\AFEM.for
Abaqus/Analysis exited with errors
In case when MKL library is not included, job file shows the following errors:
----------
Abaqus JOB Job-1
Abaqus 6.13-1
Abaqus License Manager checked out the following licenses:
Begin Compiling Abaqus/Standard User Subroutines
3/8/2017 6:18:48 PM
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005
Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
End Compiling Abaqus/Standard User Subroutines
Begin Linking Abaqus/Standard User Subroutines
Creating library standardU.lib and object standardU.exp
AFEM.obj : error LNK2019: unresolved external symbol dgemm referenced in function umat.R
standardU.dll : fatal error LNK1120: 1 unresolved externals
Abaqus Error: Problem during linking - Abaqus/Standard User Subroutines.
This error may be due to a mismatch in the Abaqus user subroutine arguments.
These arguments sometimes change from release to release, so user subroutines used with a previous release of Abaqus may need to be adjusted.
Abaqus/Analysis exited with errors
The source code, when compiled outside ABAQUS, works fine with no errors. If I am not able to include this lapack library in ABAQUS UMAT subroutine, I may have to append lapack source code in my code itself. That may invite other problems.
So is there any way to compile these lapack subroutines in ABAQUS successfully. Note that ABAQUS User subroutine (UMAT) is written in '.for' format. I have included the UMAT (ABAQUS subroutine) for reference. It has 'mul_big_mat' (that stands for multiplying big matrices) subroutine that uses lapack 'dgemm' subroutine.
C================================================================
SUBROUTINE UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,
1RPL,DDSDDT,DRPLDE,DRPLDT,STRAN,DSTRAN,
2TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,MATERL,NDI,NSHR,NTENS,
3NSTATV,PROPS,NPROPS,COORDS,DROT,PNEWDT,CELENT,
4DFGRD0,DFGRD1,NOEL,NPT,KSLAY,KSPT,KSTEP,KINC)
C
INCLUDE 'ABA_PARAM.INC'
C
CHARACTER*80 MATERL
DIMENSION STRESS(NTENS),STATEV(NSTATV),
1DDSDDE(NTENS,NTENS),DDSDDT(NTENS),DRPLDE(NTENS),
2STRAN(NTENS),DSTRAN(NTENS),TIME(2),PREDEF(1),DPRED(1),
3PROPS(NPROPS),COORDS(3),DROT(3,3),
4DFGRD0(3,3),DFGRD1(3,3)
C
DIMENSION EELAS(6),EPLAS(6),FLOW(6)
PARAMETER (ONE=1.0D0,TWO=2.0D0,THREE=3.0D0,SIX=6.0D0)
DATA NEWTON,TOLER/10,1.D-6/
C
C ============================================================================
C UMAT FOR 1D BAR
C
============================================================================
C Note :- This UMAT can only be used by 1D elements
C
C Number of material properties, nprops = 1
C props(1) Young's modulus in x direction
C ---------------------------------------------------------------------
C
! --- local variables
DOUBLE PRECISION E
DOUBLE PRECISION C(ntens, ntens)
integer z
!***********************************************************************
! *** Get Elastic properties
E = props(1)
write(*,*)''
write(*,*) z
write(*,*)''
! *** Elastic stiffness Cijkl *** !
C(1,1) = E
!call hello_world3
CALL mul_big_mat
! *** calculate the stress *** !
stress(1) = C(1,1)*(stran(1) + dstran(1))
! Updating Jacobian matrix
ddsdde(1,1) = C(1,1)
return
END
subroutine hello_world3
implicit none
character*32 text
c
write(*,*)'Hello World'
c
END
subroutine mul_big_mat
c
c
integer m, n, k, i, j
parameter (m=100, k= 200, n=100)
double precision a(m,k), b(k,n), c(m,n), alpha, beta
alpha=1.0
beta=0.0
c matrix a declaration
do i=1,m
do j=1,k
a(i,j)=i+j
enddo
enddo
write(*,*) a(100,200)
c matrix b declaration
do i=1,k
do j=1,n
b(i,j)=i-j
enddo
enddo
write(*,*) b(200,100)
c matrix c declaration
do i=1,m
do j=1,n
c(i,j)=0.0
enddo
enddo
call dgemm('n','n',m,n,k,alpha,a,m,b,k,beta,c,m)
! THIS IS THE SUBROUTINE I WANT TO USE FROM INTEL MKL LIBRARY
! I COULD USE MATMUL (AND THAT WORKS FINE), BUT ITS JUST AN EXAMPLE
! I HAVE TO USE 'DGETRI' AND MANY MORE
write(*,*) c(1,1)
do i=1,m
do j=1,n
write(*,*) ' '
write(*,*) c(i,j)
enddo
enddo
END
Upvotes: 1
Views: 1297
Reputation: 60078
It looks like you are compiling a free-form (.f90) file as a fixed-form (old FORTRAN 77 style) file. You cannot use & at the and of the line in fixed form .f or .for file.
Your source file is a .for
file (AFEM.for
) sou your code should be in the fixed form. You can try whether ABAQUS supports the -free
compiler flag to force free-form. If it doesn't you must use the fixed form everywhere.
Be careful not to mix parts of fixed-form and free-form in one file. The file MKL_lapack.FI
seems not to be compatible with your original source. You unfortunately do not show how you are including this.
HOWEVER, you should not really need to include the include file at all! You should just link with the right library. Use the Intel MKL Link Line Advisor https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor to derive the correct linker flags.
Upvotes: 2