Sponsored Content
Top Forums Programming problem compiling with gfortran in two different debian releases Post 302567944 by currix on Tuesday 25th of October 2011 03:14:09 PM
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
 

8 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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
gmk_hy(1)						       Scotch user's manual							 gmk_hy(1)

NAME
gmk_hy, gmk_m2, gmk_m3, gmk_ub2 - create source graphs SYNOPSIS
gmk_hy [options] dim [ofile] gmk_m2 [options] [-gcfile] dimX dimY [ofile] gmk_m3 [options] [-gcfile] dimX dimY dimZ [ofile] gmk_ub2 [options] dim DESCRIPTION
The gmk_* programs create source graph files for some common, regular topologies. gmk_hy creates a hypercube of dimension dim. gmk_m2 creates a 2D regular grid of dimensions dimX and dimY. gmk_m3 creates a 3D regular grid of dimensions dimX, dimY and dimZ. gmk_ub2 creates an unoriented de Bruijn graph of dimension dim. OPTIONS
-b base For gmk_m2 and gmk_m3 only. Output graphs with base value set to base. Default value is 0. -e For gmk_m2 only. Build a 8-neighbor grid rather than a 4-neighbor grid. -gcfile For gmk_m2 and gmk_m3 only. Output graph vertex coordinates (that is, geometry data to be used by gout(1)) in file cfile. -h Display some help. -t For gmk_m2 and gmk_m3 only. Create torus graphs, that is, graphs such that there exist loop edges between vertices of rank 0 and (dim-1) in every dimension. -V Display program version and copyright. EXAMPLE
Create a 5x7 grid along with its geometry: $ gmk_m2 5 7 -g/tmp/m5x7.xyz /tmp/m5x7.grf SEE ALSO
gbase(1), gmk_msh(1), gtst(1), gmap(1), gord(1), gout(1), amk_grf(1). Scotch user's manual. AUTHOR
Francois Pellegrini <francois.pellegrini@labri.fr> February 14, 2011 gmk_hy(1)
All times are GMT -4. The time now is 02:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy