LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2012, 10:40 AM   #1
msbstar
Member
 
Registered: Jan 2010
Distribution: Ubuntu 10.4
Posts: 122

Rep: Reputation: 16
I get "'found module version 0, expected 9" Error while running a fortran 90 program.


Hi everybody.

I am trying to run a Fortran 90 code by issuing the following command:

hassan@ubuntu:~/popratio$ g95 main3.f90

But I got the following error

Fatal Error: While reading module 'precision' found module version 0, expected 9.

My "precision" module contains the following lines:

!-----------------------------------------------------------------------
!* This module defines single/double precision parameters and
!* sets the accuracy of the floating point operations.
!-----------------------------------------------------------------------
module Precision
implicit none
public
integer, parameter :: SP = kind (1.0) ! single precision definition
integer, parameter :: DP = kind (1.0D0) ! double precision definition
! the following corresponds to the old Fortran 77's double precision data type:
integer, parameter :: WP = DP ! working precision definition
end module Precision
----------------------------------------------------

I would be grateful if any one could help me in this matter.

With best regards,
Hassan
 
Old 09-16-2012, 11:07 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,520

Rep: Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106
It seems to work for me with gfortran. How are you using the module in your main code?

Code:
$ cat precision.f90
module Precision
implicit none
public
integer, parameter :: SP = kind (1.0)
integer, parameter :: DP = kind (1.0D0)
integer, parameter :: WP = DP
end module Precision


use Precision

print *,SP,DP,WP
end
$ gfortran precision.f90 
$ ./a.out 
           4           8           8
 
1 members found this post helpful.
Old 09-16-2012, 11:33 AM   #3
msbstar
Member
 
Registered: Jan 2010
Distribution: Ubuntu 10.4
Posts: 122

Original Poster
Rep: Reputation: 16
Thanks for the reply.

I uploaded the whole code to the following ftp server:

ftp://ftp.ing.iac.es/hassan/

I need to run the file "main1.f90" through "main5.f90".
But when I try to run them using following command I got
the above error:

hassan@ubuntu:~/popratio$ g95 main3.f90

Also when I type :

hassan@ubuntu:~/popratio$ gfortran Precision.f90

I got the following error:

/usr/lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
hassan@ubuntu:~/popratio$


Thanks.
hassan

Last edited by msbstar; 09-16-2012 at 11:45 AM.
 
Old 09-16-2012, 01:14 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,520

Rep: Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106Reputation: 2106
You can't compile main without also compiling its dependencies. You can't compile Precision.f90 into an executable because there is no main function to actually execute (it just contains a library of functions). You could compile Precision.f90 itself by adding the -c flag to your compiler, but it wouldn't do much good. Basically, you need to compile all of the dependencies in order to compile the main routine. After some playing around, I found the full set in the right sequence:

Code:
gfortran d*.f la_precision.f90 Precision.f90 f77_lapack.f90 la_erinfo.f90 sgemv.f slamc1.f slamc3.f slamc4.f slamc5.f slabad.f sger.f sgetrs.f sgerfs.f slamc2.f sasum.f scopy.f strsv.f saxpy.f sdot.f isamax.f sswap.f sscal.f sgemm.f slacon.f slatrs.f srscl.f ieeeck.f sgetf2.f slaswp.f strsm.f slassq.f ilaenv.f sgetrf.f slantr.f slange.f sgecon.f lsame.f xerbla.f idamax.f sgesvx.f slamch.f sgeequ.f slaqge.f slacpy.f la_auxmod.f90 la_dgesvx*.f90 PhysMath.f90 spline.f90 FieldInt.f90 f90_lapack.f90 PopRatio.f90 main3.f90 -o main3
I'm not sure who wrote the makefile, but it has a few errors, and won't run on my system.

Last edited by suicidaleggroll; 09-16-2012 at 01:18 PM.
 
1 members found this post helpful.
Old 09-16-2012, 02:44 PM   #5
msbstar
Member
 
Registered: Jan 2010
Distribution: Ubuntu 10.4
Posts: 122

Original Poster
Rep: Reputation: 16
Hi suicidaleggroll,

I would like to thank you very much for your help.
At last it worked! This code was very important for my thesis
and I really appreciate your help.

With best regards,
Hassan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"FATAL: Module not found error" using modprobe shariefbe Linux - Software 7 12-17-2008 06:51 AM
"Fatal Error; Module ndiswrapper not found" installing WUSB300N card markackerman8@gmail. Linux - Newbie 1 07-13-2008 10:52 AM
"libc.so.6: version `GLIBC_2.4' not found" when running library on different machine mventimi Linux - Newbie 1 09-27-2007 07:15 AM
executing a loaded module returns "command not found" error neelay1 Linux - Software 1 05-08-2006 02:25 PM
SuSE Linux 9.1 Personal: Error message "module usb_uhci not found" johnerskine Linux - Newbie 2 06-24-2004 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration