Hello fellow FORTRAN users,
I am having issues with EXP function with gcc FORTRAN compiler (version 4.7). This error manifests only when I create a dll out of the code. When I create an executable there is no issue.
Below is a sample code I have. In this if the argument to EXP function is declared REAL (single precision), then the EXP returns a correct value. However when I change it to Double Precision, then all "hell breaks loose". The EXP function returns garbage.
I read that there is some problem with run time libraries in gcc FORTRAN which is causing issues with EXP function. Is there any way to overcome this issue? Did the new compiler version (4.9, I think) that recently came out fix the issue?
Any help is greatly appreciated.
Regards
snkp
I am having issues with EXP function with gcc FORTRAN compiler (version 4.7). This error manifests only when I create a dll out of the code. When I create an executable there is no issue.
Below is a sample code I have. In this if the argument to EXP function is declared REAL (single precision), then the EXP returns a correct value. However when I change it to Double Precision, then all "hell breaks loose". The EXP function returns garbage.
I read that there is some problem with run time libraries in gcc FORTRAN which is causing issues with EXP function. Is there any way to overcome this issue? Did the new compiler version (4.9, I think) that recently came out fix the issue?
Code:
SUBROUTINE TryDll(Var1,Var2,Var3,Var4)
!DEC$ ATTRIBUTES DLLEXPORT :: TryDLL
REAL, INTENT(IN) :: Var1
REAL, INTENT(IN) :: Var2
REAL :: ReturnResult
REAL, INTENT(OUT) :: Var3
REAL, INTENT(OUT) :: Var4
Var3 = Add(Var1,Var2)
ReturnResult = Subtract(Var1,Var2)
Var4 = EXP(ReturnResult)
END SUBROUTINE
Any help is greatly appreciated.
Regards
snkp