problem compiling with gfortran in two different debian releases


 
Thread Tools Search this Thread
Top Forums Programming problem compiling with gfortran in two different debian releases
# 1  
Old 10-19-2011
problem compiling with gfortran in two different debian releases

Hello,

I hope this is the correct forum for this post. I have the following
problem:

A Fortran 77 program that has to deal with several large
matrices (each approx. 5000 x 5000) and uses lapack and blas
subroutines has been correctly compiled and executed using Debian
Etch. When I tried to compile the same program in another computer
with the more recent release Debian Squeeze, to my great surprise
I find out that the compilation time has hugely increased, mostly due to
an intensive use of memory. In fact I can't compile the program in the
same laptop I used to do it because it ran out of memory, so I have to
do it in a different computer. Apart from this, once the program is compiled
in the etch and the squeeze computers the output obtained in both cases
are (very) different.

I enclose here some info about the two pc's where I am testing the
program: uname, gfortran version, the time required to compile the
program, and the size of the resulting executable in both cases.

The executable sizes are almost equal. All in all, this is a quite
puzzling situation for me. I guess this has to do with compiler versions,
but I do not understand where does this huge increment in compiling time
come from and why the memory resources needed in one case and the
other are so different. I would appreciate if somebody can give me a
hint of what is going on.

Regards,

Currix

Output ETCH system:

etch$ uname -a
Linux etch 2.6.18-6-686-bigmem #1 SMP Sat Feb 20 00:15:53 UTC 2010 i686 GNU/Linux
etch$ gfortran -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)


squeeze$ uname -a
Linux squeeze 2.6.32-5-686-bigmem #1 SMP Mon Jun 13 05:03:09 UTC 2011 i686 GNU/Linux
$ gfortran -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8)


Compiling:

etch$ time make -f Makefile_test fitgen
gfortran -c u3xu3_minuit_gen_ch2_DMlc.f
gfortran -c basis_u3xu3.f
gfortran -c hamilt_u3xu3_gen_min_DM.f
gfortran -c check_conv_min_DM.f
gfortran -c compare_energ.f
gfortran -c read_expdata_u3xu3.f
gfortran -c read_harmass_u3xu3.f
gfortran -c build_exp_ass_pointer.f
gfortran -c algha_overlap.f
gfortran -c dis_res_u3xu3_sim.f
gfortran -c save_res_u3xu3_sim.f
gfortran -c fcn_gen_sub_DM.f

gfortran -o ./tmp/u3xu3_SABDMLC_etch u3xu3_minuit_gen_ch2_DMlc.o basis_u3xu3.o hamilt_u3xu3_gen_min_DM.o check_conv_min_DM.o compare_energ.o read_expdata_u3xu3.o read_harmass_u3xu3.o build_exp_ass_pointer.o algha_overlap.o dis_res_u3xu3_sim.o save_res_u3xu3_sim.o fcn_gen_sub_DM.o minuit_u3xu3.o intrac.o minuit-cern.o -lblas -llapack

real 0m1.985s
user 0m1.512s
sys 0m0.196s


etch$ ls -lth tmp/
total 252K
-rwxr-xr-x 1 user rsrchrs 245K 2011-10-17 17:56 u3xu3_SABDMLC_minuit*


squeeze$ time make -f Makefile_test fitgen
gfortran -c u3xu3_minuit_gen_ch2_DMlc.f
gfortran -c basis_u3xu3.f
gfortran -c hamilt_u3xu3_gen_min_DM.f
gfortran -c check_conv_min_DM.f
gfortran -c compare_energ.f
gfortran -c read_expdata_u3xu3.f
gfortran -c read_harmass_u3xu3.f
gfortran -c build_exp_ass_pointer.f
gfortran -c algha_overlap.f
gfortran -c dis_res_u3xu3_sim.f
gfortran -c save_res_u3xu3_sim.f
gfortran -c fcn_gen_sub_DM.f
gfortran -c minuit_u3xu3.f
gfortran -c intrac.f
gfortran -c minuit-cern.f
gfortran -o ./tmp/u3xu3_SABDMLC_squeeze u3xu3_minuit_gen_ch2_DMlc.o basis_u3xu3.o hamilt_u3xu3_gen_min_DM.o check_conv_min_DM.o compare_energ.o read_expdata_u3xu3.o read_harmass_u3xu3.o build_exp_ass_pointer.o algha_overlap.o dis_res_u3xu3_sim.o save_res_u3xu3_sim.o fcn_gen_sub_DM.o minuit_u3xu3.o intrac.o minuit-cern.o -lblas -llapack

real 0m22.898s
user 0m20.717s
sys 0m2.168s

squeeze$ lls tmp/
total 500K
-rwxr-xr-x 1 user rsrchrs 244K Oct 17 17:59 u3xu3_SABDMLC_squeeze*
-rwxr-xr-x 1 user rsrchrs 245K Oct 17 17:56 u3xu3_SABDMLC_etch*
# 2  
Old 10-25-2011
Hi to everybody,

I am still quite puzzled by my problems with the compilation of my
programs in different Debian releases, thus I have made a simple test
program to check what is really happening.

The program, that is enclosed below, is quite short. It defines a
reasonably large matrix (mat, dimensions 15000x15000), a vector
(eigval, dimension 15000) and a scratch vector (work, dimension
1600000). Then the program defines a random seed and a working
dimension dim (dim = 5000 in the example) and fills the lower half of
a dim x dim matrix with random numbers between zero and one. Finally the
matrix is diagonalized using lapack subroutine dsyev assuming that it
is symmetric.

program test_comp
c
implicit none
c
integer lda
parameter(lda = 15000)
c
integer scrtch
parameter(scrtch = 1600000)
c
double precision mat(lda,lda)
double precision work(scrtch)
double precision eigval(lda)
c
integer dim, i, j
integer info, lwork
c
c read*, dim
dim = 5000
c
call srand(299934)
c
do i = 1, dim
do j = i, dim
mat(j,i) = rand()
enddo
enddo
c
lwork = -1
c
call dsyev('N', 'L', dim, mat, lda, eigval, work, -1, info)
c
print*, '# info = ', info, ' work dim = ', work(1)
lwork = work(1)
if (lwork.gt.scrtch) stop 'too large scratch required'
c
call dsyev('N', 'L', dim, mat, lda, eigval, work, lwork, info)
c
print*, '# info = ', info
c
do i = 1, dim
write(*,*) i, eigval(i)
enddo
c
end



I enclose the program so that if someone is interested can chek my
results compiling it. The compilation is quite simple if lapack is
installed and should be as follows

gfortran test_compiler.f -llapack.

My point is the following:

If I compile and run this simple program in a server where Squeeze has
been installed (same machine and compiler than in the previous
message)

squeeze$ time gfortran -o test_compiler_squeeze test_compiler.f -llapack
real 0m19.773s
user 0m17.909s
sys 0m1.864s


squeeze$ time ./test_compiler_squeeze > out_squeeze
real 2m23.260s
user 2m34.230s
sys 0m5.484s


The results for the server with etch are the following:

etch$ time gfortran -o test_compiler_etch test_compiler.f -llapack
real 0m1.399s
user 0m0.048s
sys 0m0.004s

etch$ time ./test_compiler_etch > out_etch
real 2m58.818s
user 2m55.507s
sys 0m1.328s


The output in both cases seems to be equal (good), and the execution
time of the programs are more or less comparable (though I do not
understand how can it be in the squeeze case that the user time is
greater than the real time).

What I find really surprising is the compilation time differences,
that can be approx. a factor of 20 greater in squeeze than in etch
(20s vs 1.4s) . The final program sizes are of the same order

-rwxr-xr-x 1 user rsrchrs 8.0K Oct 25 20:29 test_compiler_squeeze*
-rwxr-xr-x 1 user rsrchrs 11K Oct 25 20:29 test_compiler_etch*


If I try to compile the program in my desktop (also squeeze in it) the
program takes a long time to compile, soaks most of my memory (2 GB)
and the mouse and keyboard react very slowly in the meantime.

I find this behavior amazing and I would like to understand what's the
reason for this.

From htop, the process where the squeeze computer spends most of the
time is while linking the program:

/usr/bin/ld --build-id --eh-frame-hdr -m elf_i386 --hash-style=both -dynamic-linker /lib/ld-linux.so.2 -o test_compiler_squeeze /usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/crt1.o /usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/cr
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

GFORTRAN library problem: libgFORTRAN.so.1 cannot open....

I've received some executable script for test, but executing this script continuously give me following message ./example: error while loading shared libraries: libgfortran.so.1: cannot open shared object file: No such file or directory Google search told me to do as following $... (1 Reply)
Discussion started by: exsonic
1 Replies

2. Programming

Compilation problem with gfortran

Hello everyone, I'm trying since a few days to compile a f90 program with gfortran (on Ubuntu) with a makefile. The fortran program calls 2 routines written in C. Here is my makefile: FC = gfortran SFC = gfortran FFLAGS = -ffree-form -O... (21 Replies)
Discussion started by: leroygr
21 Replies

3. Programming

gfortran compiling error: Expected a right parenthesis in expression at (1)

Hello, I am compiling a code with gfortran and get one error. I have not been successful in re-writing the line so that it will compile. Any suggestions for a re-written line? WRITE (IUNITITERV, 104) ((V(1,I),V(2,I)), I=1, NUMNOD) 1 Error:... (2 Replies)
Discussion started by: jm4smtddd
2 Replies

4. Programming

gfortran compiling problem,calling too many arguments

Hello, My problem is with compiling a program modelling shallow water. In it there is a subroutine called stat with 9 parameters. In the main program it is called with 9 parameters also I'm running Ubuntu 11.04 with gfortran version 4.5. Thanks. ---------- Post updated at 11:57 PM... (0 Replies)
Discussion started by: b_franz
0 Replies

5. UNIX for Dummies Questions & Answers

Compiling samba problem

People i download the lastest version of samba i`am tryng to compile it in a solaris 9 i'm reading the how to of samba, i am in the first step making the autogen.sh but show me this when i do ./autogen.sh ./autogen.sh: running script/mkversion.sh ./script/mkversion.sh: 'include/version.h'... (0 Replies)
Discussion started by: enkei17
0 Replies

6. HP-UX

Problem in HP-UX compiling

Hi When im trying to do make --version and make --help in HP-UX it throws error Make: Unknown flag argument -. Stop. a soft link is present in this directory /usr/bin/make and hard link is in /usr/ccs/bin/make what could be the reason can any1 ..please tell me how to solve this... (1 Reply)
Discussion started by: vasanthan
1 Replies

7. Solaris

Problem in PowerDNS compiling

PowerDNS is true Power of Internet Name Management. http://www.powerdns.com Now, I compile it on my SunOS system (SunOS 5.8 Generic_117350-05 sun4u sparc SUNW,Ultra-5_10). ./configure -- no error make --> it has error: <i> make: Fatal error: Command failed for target... (0 Replies)
Discussion started by: secret4all
0 Replies

8. Solaris

Compiling problem

I'm trying to install the jed text editor on a SunOS 5.10 box. It depends on the s-lang library, which I installed to ~/lib. I'm trying to install jed to ~/jed (it's a box @ my university, so I don't have rights to install globally), but when I run make I get this error: It looks like it... (1 Reply)
Discussion started by: iandunn
1 Replies
Login or Register to Ask a Question