From: Tobias Burnus on 1 Oct 2008 12:52 On Oct 1, 3:20 pm, "Jinsong.Z...(a)gmail.com" <Jinsong.Z...(a)gmail.com> wrote: > I have to modify the source code by changing USE funcon_C, only : ... > to USE funcon_C, and compile it successfully. However, after running > it using a example input, I get segmentation fault. I have try to > trace the error, find it come from setup_mopac_arrays.f90 line 47. > However, I don't know how to fix it. Maybe it's a fault of gfortran? I sincerely doubt this. (Not that compiler bugs don't exist, but programming errors are much more likely.) Looking at the valgrind output (using gfortran) and at ifort -check all, I would claim that if (mode == 1) then ... else allocate(c(norbs, norbs), wj(1), wk(1), eigs(norbs), dxyz(3*numat), grad(nvar)) ... end if grad = 0.d0 ! <<< Line 47 is wrong if grad is not allocated (as valgrind & ifort -check all indicate). Moving up "grad" one line or allocating it for mode == 1 helps. (No, I'm not reading the whole program to check what is the algorithmically correct solution.) Tobias
From: user1 on 1 Oct 2008 16:39 Jinsong.Zhao(a)gmail.com wrote: [snip] > > I am trying to build it with f90 under solaris, as you mentioned, it > give improper continuation lines. After correct it, the compile could > give correct results. > Yes, I also seem to have it working using the Sun Studio Express compilers (f90/f95) under Linux. It worked after I fixed continuation lines and lowercased all filenames. I still have had no success with either gfortran or g95.
From: Steven G. Kargl on 1 Oct 2008 20:35 In article <c0703811-4e20-4f4e-9416-b7842d95979b(a)v15g2000hsa.googlegroups.com>, "Jinsong.Zhao(a)gmail.com" <Jinsong.Zhao(a)gmail.com> writes: > I have to modify the source code by changing USE funcon_C, only : ... > to USE funcon_C, and compile it successfully. However, after running > it using a example input, I get segmentation fault. I have try to > trace the error, find it come from setup_mopac_arrays.f90 line 47. > However, I don't know how to fix it. Maybe it's a fault of gfortran? I > also try to compile it on solaris using f90, however, there are many > errors about "missing '". But I test setup_mopac_arrays.F90, it dose > not give any error. Can you identify which version of gfortran you have? It may also be prudent to compile with "-Wall -Werror -std=f95 -pedantic -fbounds-check" and fix all warnings and errors. -- steve
From: Jinsong.Zhao on 1 Oct 2008 22:23 On Oct 2, 8:35 am, ka...(a)REMOVE.apl.washington.edu (Steven G. Kargl) wrote: > > Can you identify which version of gfortran you have? > The version of gfortran I used is: GNU Fortran (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33) Copyright (C) 2007 Free Software Foundation, Inc. > It may also be prudent to compile with "-Wall -Werror -std=f95 > -pedantic -fbounds-check" and fix all warnings and errors. > the warnings is come from continuation lines, it's a huge work to fix all warnings. I don't think the warnings will give segmentation fault. Thanks again for your suggestions. Regards, Jinsong
From: Steven G. Kargl on 1 Oct 2008 22:34
In article <0365b49b-b3ed-473b-b0b6-6cca26d10eb4(a)y71g2000hsa.googlegroups.com>, "Jinsong.Zhao(a)gmail.com" <Jinsong.Zhao(a)gmail.com> writes: > On Oct 2, 8:35�am, ka...(a)REMOVE.apl.washington.edu (Steven G. Kargl) > wrote: >> >> Can you identify which version of gfortran you have? >> > The version of gfortran I used is: > GNU Fortran (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33) You want to update to a newer version. You have 4.2.4 and 4.3.2 as released versions, and from the gfortran wiki you can get a bleeding edge pre-release of 4.4.0. >> It may also be prudent to compile with "-Wall -Werror -std=f95 >> -pedantic -fbounds-check" and fix all warnings and errors. >> > the warnings is come from continuation lines, it's a huge work to fix > all warnings. I don't think the warnings will give segmentation fault. > Thanks again for your suggestions. Read the documentation. -Wall will give many more warns on things like variables used but uninitialized. -- steve |