Home > Archive > Fortran > August 2005 > CVF: run-time error
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
CVF: run-time error
|
|
|
| Does anyone know of a way to change run-time error destination from its
default (console) to an arbitrary disk file?
| |
| Duane Bozarth 2005-08-12, 10:32 pm |
| bv wrote:
>
> Does anyone know of a way to change run-time error destination from its
> default (console) to an arbitrary disk file?
command line redirection?
It's been so long since I used a MS command interpreter I don't recall
what they support for redirection other than standard input/output, but
the JPSoft command interpreters use the following--
< filename To get input from a file or device instead of from
the keyboard
> filename To redirect standard output to a file or device
>& filename To redirect standard output and standard error to a
file or device
>&> filename To redirect standard error only to a file or device
HTH ...
| |
| e p chandler 2005-08-13, 4:00 am |
| bv wrote:
> Does anyone know of a way to change run-time error destination from its
> default (console) to an arbitrary disk file?
append
2>filename.ext
to your command line to redirect std-err to a file
| |
|
| Duane Bozarth wrote:
>
>
> command line redirection?
Thanks, I know about that one but my problem is deeper than that. I'd
like to find a way to poke into the rt-dll and make it talk to a
different drummer -- it's for a win app dll, which (curiously) still
wants to talk to a "deaf" console.
| |
|
| Abdul Qat wrote:
>
> 1. how to get rid of the annoying console
> 2. how to direct rt errors to a file
>
> 1 must precede 2. For this your Fortran DLL must have a DLLMain in C, as
> opposed to the default DLLMain in Fortran that CVF provides...
> 2. Here's the gist of writing rt errors to a file:
I'm OK on (1) - driver is win native in C++. On (2) it worked like a
charm but my cigar went out when I moved to dlls. Here's a mini test I
did:
program mini
data a/-2/
call erlog
y = sqrt(a)
print*, y
end
subroutine erlog
logical res
character*50 path
call getcwd (path)
res = setenvqq("for_disable_diagnostic_display=T")
res = setenvqq("for_diagnostic_log_file="//path//"\err.log")
end
- compiled w/static libs I get the msge in the log file
- compiled w/dll libs I get NaN printed and no sign of the log file
Tried & stuffed "erlog" into win app dll anyway - no chg - silently
hangs (like before) when exception is hit. Any ideas what to do next?
| |
| aardpig@hotmail.com 2005-08-15, 10:02 pm |
| bv wrote:
> Abdul Qat wrote:
>
> I'm OK on (1) - driver is win native in C++. On (2) it worked like a
> charm but my cigar went out when I moved to dlls. Here's a mini test I
> did:
>
> program mini
> data a/-2/
>
> call erlog
> y = sqrt(a)
> print*, y
> end
>
> subroutine erlog
> logical res
> character*50 path
>
> call getcwd (path)
> res = setenvqq("for_disable_diagnostic_display=T")
> res = setenvqq("for_diagnostic_log_file="//path//"\err.log")
> end
>
> - compiled w/static libs I get the msge in the log file
> - compiled w/dll libs I get NaN printed and no sign of the log file
>
> Tried & stuffed "erlog" into win app dll anyway - no chg - silently
> hangs (like before) when exception is hit. Any ideas what to do next?
Upgrade to a non-obsolete compiler. It's so straightforward that even
someone with your skillset could accomplish it.
| |
| Abdul Qat 2005-08-16, 5:06 pm |
|
"bv" <bvoh@Xsdynamix.com> wrote in message
news:43013939.CE2DF232@Xsdynamix.com...
> Abdul Qat wrote:
as[color=darkred]
>
> I'm OK on (1) - driver is win native in C++. On (2) it worked like a
> charm but my cigar went out when I moved to dlls. Here's a mini test I
> did:
>
> program mini
> data a/-2/
>
> call erlog
> y = sqrt(a)
> print*, y
> end
>
> subroutine erlog
> logical res
> character*50 path
>
> call getcwd (path)
> res = setenvqq("for_disable_diagnostic_display=T")
> res = setenvqq("for_diagnostic_log_file="//path//"\err.log")
> end
>
> - compiled w/static libs I get the msge in the log file
> - compiled w/dll libs I get NaN printed and no sign of the log file
>
> Tried & stuffed "erlog" into win app dll anyway - no chg - silently
> hangs (like before) when exception is hit. Any ideas what to do next?
>
With CVF DLLs you have to go with /libs:static. Notice, however, that you
can then supply your own matherrqq if you want to log run time math lib
infractions, something that IVF doesn't currently support.
Salaam,
Abdul Q.
| |
|
| Abdul Qat wrote:
>
> With CVF DLLs you have to go with /libs:static. Notice, however, that you
> can then supply your own matherrqq if you want to log run time math lib
> infractions, something that IVF doesn't currently support.
Thanks, but again no cigar - I tried the option (never occurred to me
that static & dynamic could mix) and got nowhere, that is, got either
NaN or "domain error" spilled into the console w/no log file in sight.
I'll give matherrqq a try when I get a chance, and will let reverse FIV
enthusiasts tinker w/resurrected VAXline cli artifacts.
| |
| Abdul Qat 2005-08-17, 4:07 am |
|
"bv" <bvoh@Xsdynamix.com> wrote in message
news:43028505.13A1B51D@Xsdynamix.com...
> Abdul Qat wrote:
you[color=darkred]
>
> Thanks, but again no cigar - I tried the option (never occurred to me
> that static & dynamic could mix) and got nowhere, that is, got either
> NaN or "domain error" spilled into the console w/no log file in sight.
> I'll give matherrqq a try when I get a chance, and will let reverse FIV
> enthusiasts tinker w/resurrected VAXline cli artifacts.
>
LOL! I'm sure Aardpig@hotmail.com, the Pork Chop Queen, has mortaged her
tent to scrape together her meagre contribution to the Intel coffers in
support of Fortran.
Perhaps it's high time for ISO Fortran 2X and Intel etc to apply for United
Way 2006 funding in pursuit of their gratitious irrelevance. Anyways, have
fun with Fortran.
This Matherrqq works with /libs:static for .DLLs:
subroutine matherrqq ( name, length, info, retcode)
!Detects runtime math lib errors
use dflib
use kernel32
implicit none
!Temp path directory
character(len=256) :: TempPath
integer :: iend
integer(2) length, retcode
character(len = length ) name
type( MTH$E_INFO )info
integer(4) i
logical(4) rest
integer(4) ResTempPath,BuffLength
INTEGER(4) RTN_STS
INCLUDE 'IOSDEF.FOR'
!Get temp path
BuffLength = len(TempPath)
ResTempPath = GetTempPath(BuffLength,TempPath)
do i = 1, len_trim(TempPath)
if(TempPath(i:i) == '') iend = i
end do
open(6,file = TempPath(1:iend)//'ERR.log',status='replace')
close(6)
rest = SETENVQQ("FOR_DISABLE_DIAGNOSTIC_DISPLAY=T")
!rest = SETENVQQ("FOR_ENABLE_VERBOSE_STACK_TRACE=T")
rest = SETENVQQ("FOR_DIAGNOSTIC_LOG_FILE="//TempPath(1:iend)//"ERR.log")
write(*,*) "Failing function is: ", name
write(*,*) "Error type is: ", info.errcode
Select Case(info.ERRCODE)
Case (MTH$E_DOMAIN)
write(*,*) "Argument domain error in: "//name
retcode = MTH$E_DOMAIN
Case (MTH$E_SINGULARITY)
write(*,*) "Argument is a singular value of: "//name
retcode = MTH$E_SINGULARITY
Case (MTH$E_OVERFLOW)
write(*,*) "Overflow range error in: "//name
retcode = MTH$E_OVERFLOW
Case (MTH$E_UNDERFLOW)
write(*,*) "Underflow range error in: "//name
retcode = MTH$E_UNDERFLOW
Case (MTH$E_TLOSS)
write(*,*) "Total loss of significance in: "//name
retcode = MTH$E_TLOSS
Case (MTH$E_PLOSS)
write(*,*) "Partial loss of significance in: "//name
retcode = MTH$E_PLOSS
Case Default
retcode = 0
End Select
Select Case (info.ftype)
Case (TY$REAL4)
write(*,*) "TY$REAL4's:"
write(*,*) info.r4arg1
write(*,*) info.r4arg2
Case (TY$REAL8)
write(*,*) "TY$REAL8's:"
write(*,*) info.r8arg1
write(*,*) info.r8arg2
Case (TY$CMPLX8)
write(*,*) "TY$CMPLX8's:"
write(*,*) info.c8arg1
write(*,*) info.c8arg2
Case (TY$CMPLX16)
write(*,*) "TY$CMPLX16's:"
write(*,*) info.c16arg1
write(*,*) info.c16arg2
End Select
if (retcode /= 0) then
write(*,*) "Accepted TRACEBACK"
close(6)
CALL TRACEBACKQQ(USER_EXIT_CODE=-1,STATUS=RTN_STS)
IF (RTN_STS .EQ. FOR$IOS_SUCCESS) THEN
PRINT *,'TRACEBACK WAS SUCCESSFUL'
END IF
write(*,*) "Accepted TRACEBACK"
call Sleep(100)
!iret = RAISEQQ(SIG$FPE)
else
write(*,*) "Declined TRACEBACK"
call Sleep(100)
endif
return
end subroutine matherrqq
| |
|
| Abdul Qat wrote:
>
> This Matherrqq works with /libs:static for .DLLs:
Thanks, that was pure TNT! I haven't tried it from the win host yet, as
I need to install VF online docs first to read up on the usage nuances.
fyi - by accident I uncovered something and have no idea why or how it
works, and you may want to check it out. Compile matherrqq into a dll,
and into an obj, then link them in turn w/erlog driver I posted - just a
mere *presence* alters the behavior, that is, w/dll makes a log file,
and w/obj writes (matherrqq info) to a console.
| |
| Abdul Qat 2005-08-24, 6:59 pm |
|
"bv" <bvoh@Xsdynamix.com> wrote in message
news:4305680E.6E5CF3A7@Xsdynamix.com...
> Abdul Qat wrote:
>
> Thanks, that was pure TNT! I haven't tried it from the win host yet, as
> I need to install VF online docs first to read up on the usage nuances.
>
Happily, it's not a WMD!
The VF online docs originated verbatim with Digital's takeover of Microsoft
FPS; additions by DVF/CVF/IVF/NEXTVF are for the most part to be taken with
a grain of salt if you write real Win apps: every claim by the current
peddler of VF has to be verified, no matter the config/.exe/.obj/.dll, and
they're unlikely to alter their high-handed distain of user's expectations
that there be compatibility and consistency from one release of the product
to the next. Sure, they'll shift responsibility to Microsoft who surely and
rightfully ignore them. The major advantage of CVF over IVF is that it's no
longer supported whereas IVF remains a product in the making that has yet
to convince the mass of CVF users to downgrade to its inferior and
deficient status .
Salaam,
Abdul Q.
--
"Visual Fortran is part of the Microsoft family of Visual Tools." DIGITAL
Visual Fortran, Getting Started, 1998.
|
|
|
|
|