Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 18 Dec 2014, 15:39
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
gfortran for puppy 4.1
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
lluamco

Joined: 16 Mar 2007
Posts: 207
Location: Banyoles, Spain

PostPosted: Wed 08 Oct 2008, 13:55    Post subject:  gfortran for puppy 4.1
Subject description: To compile fortran programs
 

Puppy 4.x series do not include fortran in the devx_4xx.sfs official files.

I have compiled gfortran-4.2.2 and make it available in two forms.

1. devx_with_fortran_410.sfs is a replacement for the official devx_410.sfs for puppy 4.1 which includes gfortran. It can be obtained in
http://puppyisos.org/files/sfs/Puppy-4.1
The above url requires username and passwd. Please get them in
http://murga-linux.com/puppy/viewtopic.php?p=196141#196141

2. gfortran-4.2.2.pet is a pet-package for those who prefer to use the official devx_410.sfs
file and willing to add fortran as a pet install. Notice that in order to use gfortran,
the devx_410.sfs should be active! The pet is NOT to be used as standalone program.
Get it at
http://dotpups.de/puppy4/dotpups/Programming/gfortran-4.2.2.pet
or, alternatively
http://puppyfiles.ca/dotpupsde/puppy4/dotpups/Programming/gfortran-4.2.2.pet
Back to top
View user's profile Send private message 
carolus

Joined: 14 Feb 2007
Posts: 129

PostPosted: Sat 07 Mar 2009, 02:36    Post subject: Re: gfortran for puppy 4.1
Subject description: To compile fortran programs
 

lluamco wrote:

gfortran-4.2.2.pet is a pet-package for those who prefer to use the official devx_410.sfs
file and willing to add fortran as a pet install.


Is it correct to presume that the pet package can be used with all versions of Puppy 4 (now up to 4.1.2)?
Back to top
View user's profile Send private message 
JohnRoberts

Joined: 29 Nov 2006
Posts: 145
Location: Greece

PostPosted: Sat 07 Mar 2009, 07:23    Post subject:  

Just from curiosity, can you layout (if it's not too complicated)
some instructions on how to compile gfortran?

_________________
Help M$ become a Linux distro maintainer...
Force-feed them with Open-Source faster than they can produce patents
Back to top
View user's profile Send private message 
lluamco

Joined: 16 Mar 2007
Posts: 207
Location: Banyoles, Spain

PostPosted: Sat 07 Mar 2009, 16:08    Post subject: Re: gfortran for puppy 4.1
Subject description: To compile fortran programs
 

carolus wrote:

Is it correct to presume that the pet package can be used with all versions of Puppy 4 (now up to 4.1.2)?

Yes. At least it works for Puppy 4.1.1. Please confirm it if you try for Puppy 4.1.2.
Back to top
View user's profile Send private message 
lluamco

Joined: 16 Mar 2007
Posts: 207
Location: Banyoles, Spain

PostPosted: Sat 07 Mar 2009, 16:40    Post subject:  

JohnRoberts wrote:
Just from curiosity, can you layout (if it's not too complicated)
some instructions on how to compile gfortran?

I do not remember exactly all steps. If my memory does not fail, I needed to install first
gmp-4.1.4 and mpfr-2.2.1. Then I compiled gcc, with these
configure options (given by executing gfortran -v):
Code:
Configured with: ./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libdir=/usr/lib --datadir=/usr/share --includedir=/usr/include --infodir=/usr/info --mandir=/usr/man --sysconfdir=/etc --localstatedir=/var --disable-debug --without-libpam --without-pam --disable-libpam --disable-pam --host=i486-t2-linux-gnu --enable-__cxa_atexit --disable-checking --disable-bootstrap --disable-libstdcxx-pch --disable-multilib --enable-languages=c,c++,fortran --disable-libmudflap

Finally, I searched for the fortran specific files and/or libraries and build the pet from those.
I hope that helps.
Lluis
Back to top
View user's profile Send private message 
carolus

Joined: 14 Feb 2007
Posts: 129

PostPosted: Sun 08 Mar 2009, 15:40    Post subject: Re: gfortran for puppy 4.1
Subject description: To compile fortran programs
 

lluamco wrote:

At least it works for Puppy 4.1.1. Please confirm it if you try for Puppy 4.1.2.


Not so easy to check, since I'm still using Puppy 2.16 on the principle "if it ain't broke, don't upgrade". I'm running fortran in a linux programming environment by means of the Cygwin linux emulator, which also ain't broke. So the most checking I could do in Puppy is "hello fortran-user". I'm still using g77, but have tried a few makefiles with gfortran and found them to work simply by changing the name of the compiler. My benchmarks (all debugging tools enabled) run faster with gfortran.

Many thanks for providing the gfortran pet package, which I'll add to my toolkit as a potentially useful option.
Back to top
View user's profile Send private message 
JohnRoberts

Joined: 29 Nov 2006
Posts: 145
Location: Greece

PostPosted: Mon 09 Mar 2009, 09:59    Post subject:  

Not so easy to check indeed!!! I have been baffled the entire weekend
trying to port a piece of code (~600 lines) - originally written in D.E.C. F77
to gcc. Running the same program in XP gives normal results, running
in Linux with gcc gives really strange results... Rolling Eyes

_________________
Help M$ become a Linux distro maintainer...
Force-feed them with Open-Source faster than they can produce patents
Back to top
View user's profile Send private message 
carolus

Joined: 14 Feb 2007
Posts: 129

PostPosted: Mon 09 Mar 2009, 20:26    Post subject:  

JohnRoberts wrote:
Not so easy to check indeed!!! I have been baffled the entire weekend
trying to port a piece of code (~600 lines) - originally written in D.E.C. F77
to gcc. Running the same program in XP gives normal results, running
in Linux with gcc gives really strange results... Rolling Eyes


The folks at newsgroup comp.lang.fortran are very helpful with this sort of problem, but they will want you to be quite explicit about which compilers you are using and what the "strange results" are, and would prefer that you illustrate your problem with a code snippet smaller than the whole 600 lines.

DEC f77 for VMS was the best-ever compiler for scrounging other people's code because it would compile almost any dialect of fortran that had ever been created, as well as its own nonstandard extensions. It would not surprise me if you have some nonstandard features in your code. It could be that the Windows compiler you are using happens to support them.

If the "gcc" compiler you are using happens to be lluamco's gfortran package, then I suppose it would not be too far off-topic for you to describe the "strange results" in this forum. Anyway, I'm curious.
Back to top
View user's profile Send private message 
elraven

Joined: 03 Apr 2007
Posts: 82
Location: wnc-usa

PostPosted: Mon 09 Mar 2009, 22:11    Post subject:  gfortran  

just drop'n a line to let you know its working on my 4.2 rc2 puppy.

elraven
Back to top
View user's profile Send private message 
JohnRoberts

Joined: 29 Nov 2006
Posts: 145
Location: Greece

PostPosted: Tue 10 Mar 2009, 06:19    Post subject:  

carolus wrote:

The folks at newsgroup comp.lang.fortran are very helpful with this sort of problem, but they will want you to be quite explicit about which compilers you are using and what the "strange results" are, and would prefer that you illustrate your problem with a code snippet smaller than the whole 600 lines.

DEC f77 for VMS was the best-ever compiler for scrounging other people's code because it would compile almost any dialect of fortran that had ever been created, as well as its own nonstandard extensions. It would not surprise me if you have some nonstandard features in your code. It could be that the Windows compiler you are using happens to support them.

If the "gcc" compiler you are using happens to be lluamco's gfortran package, then I suppose it would not be too far off-topic for you to describe the "strange results" in this forum. Anyway, I'm curious.


Yep everything you mentioned makes sense.
Code has two major sections. First section produces an interpolating cubic spline from a set of data and outputs the spline's coefficients and
the underlying integral per section. Second part calculates vs. X-ordinate the underlying integral and the spline's curvature on a specified number of equi-spaced points along the spline.
Strange thing is that trying the code on gcc x86-64 (opensuse) both
parts work and the whole program executes normally but the integral numbers of section A and all the results of section B do not make sense.
If I try the code on gcc x86 (Puppy, Xandros/Debian on an Eee, etc.)
I get correct numbers for the entire section A, but the program fails on
section B with an arithmetic exception.
No, I haven't tried lluamco's PET, yet. The main powerline cable under the street pavement shorted, and while repairs last, we have extended power-outs. I just managed to try the first possibility and installed Fortran on Dingo using GSlapt. It seems to work Ok, otherwise. Just to list here the steps, I installed:

- gcc
- gcc-gfortran
- mpfr
- gmp

I will definitely get to the bottom of this, even if I have to reinspect the entire code, variable per variable.

_________________
Help M$ become a Linux distro maintainer...
Force-feed them with Open-Source faster than they can produce patents
Back to top
View user's profile Send private message 
lluamco

Joined: 16 Mar 2007
Posts: 207
Location: Banyoles, Spain

PostPosted: Tue 10 Mar 2009, 06:34    Post subject: May this help?  

One thing I had to change in my g77 programs: every appearence of the type
Code:
   write(20,*)
which should read
Code:
   write(20,'(a)')
in order to get sensible outputs using gfortran.
Back to top
View user's profile Send private message 
JohnRoberts

Joined: 29 Nov 2006
Posts: 145
Location: Greece

PostPosted: Tue 10 Mar 2009, 07:00    Post subject:  

Shocked really?
I suspected the culprit would be me using dynamically allocatable
arrays...Would have never guessed write Shocked Shocked

_________________
Help M$ become a Linux distro maintainer...
Force-feed them with Open-Source faster than they can produce patents
Back to top
View user's profile Send private message 
carolus

Joined: 14 Feb 2007
Posts: 129

PostPosted: Tue 10 Mar 2009, 12:47    Post subject:  

Sounds to me like lluamco's gfortran package is working fine. If anyone wants to pursue the fortran issues, I suggest comp.lang.fortran, where help is generous.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0803s ][ Queries: 11 (0.0033s) ][ GZIP on ]