 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Mon Jul 06, 2009 6:59 pm Post subject: Release versus Debug version |
|
|
I have a program that runs fine when compiled for using the debuger but when it is compiled as "release win32", it starts but, after a short time, the classic legend "Program not responding" appears. I wonder why this can happen. Compiling with Checkmate works but only under the debuger as well. This drives me nuts! I do not find the way to discover what is wrong in the source code.
Any clue?
Agustin |
|
Back to top |
|
 |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Mon Jul 06, 2009 7:48 pm Post subject: |
|
|
More about my problem: message I get when compiling:
WARNING the following symbols are missing:
MODULE MSW32PRM C:\Documentos Agustin\Trabajos\Huergo\Fortran\Imagenes\Debug\Win32\calcular_contorno.obj
(C:\DOCUMENTOS AGUSTIN\TRABAJOS\HUERGO\FORTRAN\IMAGENES\CALCULAR_CONTORNO.F95)
MODULE CLRWIN C:\Documentos Agustin\Trabajos\Huergo\Fortran\Imagenes\Debug\Win32\calcular_contorno.obj
(C:\DOCUMENTOS AGUSTIN\TRABAJOS\HUERGO\FORTRAN\IMAGENES\CALCULAR_CONTORNO.F95)
Creating executable: Debug\Win32\imagenes_cultivos.exe
I do not understand: I put "use mswin" at the very beginning of the subroutine! Could this be the problem when compiling as "Release"?
Agustin |
|
Back to top |
|
 |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Mon Jul 06, 2009 9:17 pm Post subject: |
|
|
The problem is seemingly related to Vista! I have compiled the same program as "Release" using a PC with XP and FTN95 5.20 and worked fine! So I thought the problem was with the FTN95 installed in my notebook: I removed FTN95 5.30 and also FTN95 Express (that was also installed in the same machine) and installed FTN95 5.20 and .....crash! once again! So, some happens between FTN95 and Vista. The question is now for Paul Laidler...is there any compatibility problem with Vista, particularly when you use large arrays (just in case the problem is when arrays are not quite small)?
regards,
Agustin |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Jul 07, 2009 7:08 am Post subject: |
|
|
I don't know of any particular problems relating to Vista.
It may be that some of your modules are in the wrong folder and that you need to consider using /MOD_PATH on the command line. If so then this would imply that you have set up things differently on your Vista machine.
You can also use MOD_PATH as an environment variable. |
|
Back to top |
|
 |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Tue Jul 07, 2009 12:47 pm Post subject: |
|
|
Well, that's would be funny because: a) only one subroutine claims that those modules are missing, the other subroutines run OK and most of them use mswin module; b) why should that happen only when you compile as release and not as debug? If anything is missing, is missing.; c) if you use mswin, this module includes msw32prm, mswin32, and clrwin modules as far as I understood. d) I put the missing modules in the same folder of the project and the compiler informs the same problem!! The solution I found was to write and test the program using the debuger and run the release version only using XP machines. For your informantio the notebook runs using Vista Home Basic, Service Pack 1. If I found what could be wrong in my system, I let you know.
Best regards,
Agustin |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Jul 07, 2009 2:35 pm Post subject: |
|
|
If you can cut the offending code down to a short sample for me to test then I will take a look at it. |
|
Back to top |
|
 |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Tue Jul 07, 2009 3:34 pm Post subject: |
|
|
Well, I cut most of the code and left just a part that can run fine under Debug and not under Release. The point is that you will need a bmp file containing a black figure on a white background. If you need one of my figures, just let me know and I send you by e-mail. Hope this helps.
Best regards,
Agustin
module datos
character(len=128) :: archivo = ''
character*128 :: file =''
character(len=128) output,output2
integer long_archivo,place
character a(3,1024,1024)
integer hres,vres,nb_colours,ier,i,k,control,red,white,black,j,green,c2,blue
integer colour1,colour2,colour3,colour4,colour5,ans
type coordenate
real x
real y
end type coordenate
type(coordenate),dimension( ,allocatable :: matrix,contorno
integer,dimension(:, ,allocatable :: b_matrix
integer col,num_pixels,pixels_contorno,pp
real*8 x_ref,y_ref,sum_x,sum_y
real*8 :: h_mean = 0.0, width=0.0,slope=0.0
character(len=24) :: str = 'desea salir realmente?'
end module datos
program imagine
use mswin
use datos
implicit none
integer select_file,calcular_circular,calcular_lineal,check_file,ctrl,dimension_fractal
external select_file,calcular_circular,calcular_lineal,check_file,dimension_fractal
ans=winio@('%ca[Determinaci�n de Contornos en Colonias Circulares]&')
ans=winio@('%nl RUGOSIDAD........ %`5rf&',width)
ans=winio@('%nl RADIO MEDIO...... %`5rf&',h_mean)
ans=winio@('%nl Dimension Fractal.. %`5rf&',slope)
ans=winio@('%`gr[rgb_colours]&',800l,600l,1)
ans=winio@('%bg[grey]%ww%lw&',ctrl)
ans=winio@('%mn[&Archivo]&', select_file)
ans=winio@('%mn[&Calcular contorno[Circular,Lineal]]&',calcular_circular,calcular_lineal)
ans=winio@('%mn[C&hequear archivo]&',check_file)
ans=winio@('%mn[&Dimension Fractal]&',dimension_fractal)
ans=winio@('%mn[E&xit]','confirm_exit',str)
end program imagine
integer function select_file()
use mswin
use datos
implicit none
integer :: number_of_filters
logical :: must_exist
character(len=128),dimension (10) :: filter_names, filters
character(len=128) :: file_name,path
character (len=20) :: title
title = 'seleccionar archivo';path = 'c:\';file_name = ' '
filter_names(1) = 'imagenes';filters(1) = '*.bmp';filter_names(2) = 'all files';filters(2) = '*.*'
number_of_filters = 2;must_exist = .true.
call get_filtered_file@(title, file_name, path, &
& filter_names, filters, number_of_filters,must_exist)
if(file_name /= '') then
ans = winio@('%ca[ARCHIVO]&')
ans = winio@('%bg[btnface]&')
ans = winio@('El archivo seleccionado es:"%ws"%2nl&', file_name)
ans = winio@('%cn%bt[OK]')
if (ans == 1) then
archivo=file_name
long_archivo=len(archivo)
else
ans=winio@('no se ha seleccionado ning�n archivo')
endif
endif
call clear_screen@
select_file=1
end function select_file
integer function check_file()
check_file=1
end function check_file
integer function calcular_lineal()
calcular_lineal=1
end function calcular_lineal
integer function calcular_circular()
use mswin
use datos
file=archivo
if(file=='') then ! si no seleccion� primero un archivo el programa no sigue
ans=winio@('%bg&',RGB@(0,255,255))
ans=winio@('%si!�NO SELECCION� EL ARCHIVO!&')
ans=winio@('%2nl%cn%bt[OK]')
else
call clear_screen@
call set_rgb_colours_default@(1)
call get_dib_size@(file,hres,vres,nb_colours,ier)
call create_graphics_region@(2,hres,vres)
call use_rgb_colours@(2,1)
call select_graphics_object@(2)
ihfile = import_bmp@(file,ierr)
call dib_paint@(0l,0l,ihfile,0l,0l)
call select_graphics_object@(1)
call copy_graphics_region@(1,0,0,600,600,2,0,0,hres,vres,srccopy)
call perform_graphics_update@
allocate(b_matrix(hres,vres))
allocate(matrix(hres*vres))
b_matrix=0
matrix%x=0
matrix%y=0
k=1
red= rgb@(255,0,0)
black=rgb@(0,0,0)
white=rgb@(255,255,255)
do i=1,hres-1
do j=1,vres-1
call get_rgb_value@(i,j,colour1)
call get_rgb_value@(i,j-1,colour2)
call get_rgb_va |
|
Back to top |
|
 |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Tue Jul 07, 2009 3:37 pm Post subject: |
|
|
Ooops! the code was seeminlgy too long! Here is the part from
integer function calcular_circular()
use mswin
use datos
file=archivo
if(file=='') then ! si no seleccion� primero un archivo el programa no sigue
ans=winio@('%bg&',RGB@(0,255,255))
ans=winio@('%si!�NO SELECCION� EL ARCHIVO!&')
ans=winio@('%2nl%cn%bt[OK]')
else
call clear_screen@
call set_rgb_colours_default@(1)
call get_dib_size@(file,hres,vres,nb_colours,ier)
call create_graphics_region@(2,hres,vres)
call use_rgb_colours@(2,1)
call select_graphics_object@(2)
ihfile = import_bmp@(file,ierr)
call dib_paint@(0l,0l,ihfile,0l,0l)
call select_graphics_object@(1)
call copy_graphics_region@(1,0,0,600,600,2,0,0,hres,vres,srccopy)
call perform_graphics_update@
allocate(b_matrix(hres,vres))
allocate(matrix(hres*vres))
b_matrix=0
matrix%x=0
matrix%y=0
k=1
red= rgb@(255,0,0)
black=rgb@(0,0,0)
white=rgb@(255,255,255)
do i=1,hres-1
do j=1,vres-1
call get_rgb_value@(i,j,colour1)
call get_rgb_value@(i,j-1,colour2)
call get_rgb_value@(i,j+1,colour3)
if(colour1 /= white.and.colour2 == white.and.colour3 /=white) then
b_matrix(i,j) = 2
matrix(k)%x=i; matrix(k)%y=j
k=k+1
call draw_point@(i,j,red)
elseif(colour1 /= white.and.colour2 /= white.and.colour3 == white) then
b_matrix(i,j) = 2
matrix(k)%x=i; matrix(k)%y=j
k=k+1
call draw_point@(i,j,red)
else
cycle
endif
end do
end do
do j=1,vres-1
do i=1,hres-1
call get_rgb_value@(i,j,colour1)
call get_rgb_value@(i,j-1,colour2)
call get_rgb_value@(i,j+1,colour3)
if(colour1 /= white.and.colour2 == white.and.colour3 /=white) then
if(b_matrix(i,j) /= 2) then
matrix(k)%x=i; matrix(k)%y=j
k=k+1
call draw_point@(i,j,red)
endif
elseif(colour1 /= white.and.colour2 /= white.and.colour3 == white) then
if(b_matrix(i,j) /= 2) then
matrix(k)%x=i; matrix(k)%y=j
k=k+1
call draw_point@(i,j,red)
endif
else
cycle
endif
end do
end do
pixels_contorno=k
call create_graphics_region@(3,hres,vres)
call select_graphics_object@(3)
do i=1,hres-1
do j=1,vres-1
if(b_matrix(i,j) == 2) then
call draw_point@(i,j,red)
else
call draw_point@(i,j,white)
endif
end do
end do
call copy_graphics_region@(1,0,0,600,600,3,0,0,hres,vres,srccopy)
call perform_graphics_update@
deallocate(b_matrix)
endif
calcular_circular=1
end function calcular_circular
Integer function dimension_fractal()
dimension_fractal=1
end function dimension_fractal |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Jul 07, 2009 6:24 pm Post subject: |
|
|
My guess is that it is necessary to set the environment variable
MOD_PATH=C:\Program Files\Silverfrost\FTN95\include
If this is not the right folder then use the one where the mod files are kept.
I do not know if this should be set by the installer and, if so, why it has not be set for you.
You should create the environment variable via the Control Panel under System then Advanced System Settings. |
|
Back to top |
|
 |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Tue Jul 07, 2009 9:51 pm Post subject: |
|
|
I have just checked it: this environmental variable was already set by the installer, so this seems not to be the problem.
Agustin |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Jul 08, 2009 5:28 am Post subject: |
|
|
Can you see mswin.mod in C:\Program Files\Silverfrost\FTN95\Include or the equivalent folder on your machine?
By the way, your earlier post refered to msw32prm and clrwin rather than mswin. These two modules are included in mswin so you will need all of them in your "Include" folder. mswin32 is also included in mswin. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Jul 08, 2009 7:09 am Post subject: |
|
|
I have now checked the FTN95 code and it should not be necessary to set the mod_path environment variable. The compiler will look in its INCLUDE folder if it does not find the module anywhere else. If you have used MSWIN etc. as a name for one your own modules then you will have problems. |
|
Back to top |
|
 |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Wed Jul 08, 2009 2:42 pm Post subject: |
|
|
Well, I am using the mswin module of FTN95 (not a personal mswin module), so that it is quite strange that the compiler sets those two warnings because those modules are included in mswin, as you point out. Have you compiled my code under Vista and Release? If it works for you, the problem is in my notebook and likely not related neither to FTN95 nor Vista. The only question I would still have is what is the difference in Debug and Release (apart from the inclusion of debug code in the former and the optimisation of the code in the latter) that makes my code run or not in my notebook.
Agustin
P.D. although mswin is included in several subroutines, the only warning appears for calcular_contorno subroutine (?) and is apparently that when the release version enters into this subroutine, the program enters into "not responding". Very, very strange.... |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Wed Jul 08, 2009 6:05 pm Post subject: |
|
|
Yes I have tested your program under Vista and it builds and runs OK for all modes (release etc). |
|
Back to top |
|
 |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Wed Jul 08, 2009 6:17 pm Post subject: |
|
|
OK! Thanks, I will look for another PC running Vista and test it. The problem is evidently with the notebook and its Vista. By the way, which version of Vista did you use? ah! and the switches you set?
best wishes,
Agustin |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|