Fedora Linux Support Community & Resources Center
  #1  
Old 7th May 2012, 10:58 AM
AAGLI Offline
Registered User
 
Join Date: May 2012
Location: Cote d'azur
Posts: 2
linuxfirefox
Problem with g95

Hello everyone
recently i'v intalled the fortran compiler g95 following the steps in the manual (http://ftp.g95.org/G95Manual.pdf)
and while running it throught the helloworld example to test I get this assembler error

g95 -c hello.f90
/tmp/ccb9kyvJ.s: Assembler messages:
/tmp/ccb9kyvJ.s:11: Error: invalid instruction suffix for `push'

I also tried to call a fortran program through matlab using the mex tools but it seems to be a compatibility problem (glnxa64 VS mexa64..) since I get this errors:

~/simple_example/ssolve_m.mexa64': /usr/local/matlab2011b/bin/glnxa64/../../sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by
~/Desktop/.../hampath/simple_example/ssolve_m.mexa64)

I'm under ferdora (x86_64)
If anyone could help
thank you very much
Reply With Quote
  #2  
Old 7th May 2012, 11:57 AM
aleph Offline
Banned (for/from) behaving just like everybody else!
 
Join Date: Jul 2007
Location: Nanjing, China
Posts: 1,332
linuxfirefox
Re: Problem with g95

Did you compile the compiler from source, or did you followed any of the binary file links in the download page?
__________________
Code:
from rlyeh import cthulhu
cthulhu.fhtagn()
Reply With Quote
  #3  
Old 7th May 2012, 01:23 PM
AAGLI Offline
Registered User
 
Join Date: May 2012
Location: Cote d'azur
Posts: 2
linuxfirefox
Re: Problem with g95

I have followed the step belew:
wget -O - http://ftp.g95.org/g95-x86-linux.tgz | tar xvfz -
ln -s $PWD/g95-install/bin/i686-pc-linux-gnu-g95 /usr/bin/g95 ....
Reply With Quote
  #4  
Old 7th May 2012, 03:40 PM
aleph Offline
Banned (for/from) behaving just like everybody else!
 
Join Date: Jul 2007
Location: Nanjing, China
Posts: 1,332
linuxfirefox
Re: Problem with g95

I don't think g95 can generate 64-bit code. I looked at the generated intermediate assembly code and found it uses 32-bit instructions. The error message refers to the sequence at the entrance point, which is
Code:
MAIN_:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $24, %esp
        movl    $0, -8(%ebp)
<snip>
This is clearly 32-bit code which is rejected by the assembler ("as"), hence the error message.

It appears you have to cross-compile for 32-bit on your 64-bit system, and run the generated code with multilib support. To do this, you must install the glibc.i686 and glibc-devel.i686 packages (the architecture suffix i686 is required). To compile the hello world program, use this command
Code:
g95 -Wa,--32 -Wl,-melf_i386 helloworld.f
This tells the intermediate assembler to work with 32-bit code, and the linker to look for 32-bit shared libraries.

In any case, cross-compiling is a pain, and running the generated code under 32-bit multilib support is only pain doubly afflicted. If possible, I think you are better without g95 and use the well-supported gfortran compiler and do everything in full 64-bit. The former looks dead project to me anyway.
__________________
Code:
from rlyeh import cthulhu
cthulhu.fhtagn()
Reply With Quote
  #5  
Old 7th May 2012, 05:35 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Birmingham, UK
Age: 31
Posts: 2,771
linuxfirefox
Re: Problem with g95

Why are you trying to use g95? gfortran is the official GCC Fortran compiler, is included in the Fedora repos, and can handle Fortran 95 and some newer Fortran features too. (Anything suggesting g77 is the GCC version is several years out of date.)
Reply With Quote
Reply

Tags
g95, problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump


Current GMT-time: 20:02 (Saturday, 20-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat