Error:bad register name

I have a linux amd64 system. When I try to compile the hello program I get the folowing error message:

pc210:/opt/pgi# pgf77 -V x.f

pgf77 8.0-3 64-bit target on x86-64 Linux -tp k8-64e
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2008, STMicroelectronics, Inc.  All Rights Reserved.
NOTE: your trial license will expire in 11 days, 15.6 hours.
PGFTN/x86-64 Linux 8.0-3
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2008, STMicroelectronics, Inc.  All Rights Reserved.
PGFTN-F-0002-Unable to open source input file: x.f
pc210:/opt/pgi# pgf77 hello.f
NOTE: your trial license will expire in 11 days, 15.6 hours.
/tmp/pgf778Jgf0vw_92ly.s: Assembler messages:
/tmp/pgf778Jgf0vw_92ly.s:65: Error: bad register name `%rbp'
/tmp/pgf778Jgf0vw_92ly.s:67: Error: bad register name `%rsp'
/tmp/pgf778Jgf0vw_92ly.s:84: Error: bad register name `%r8d'
/tmp/pgf778Jgf0vw_92ly.s:89: Error: bad register name `%rbp'
/tmp/pgf778Jgf0vw_92ly.s:244: Error: bad register name `%rdi'
pc210:/opt/pgi#

With the f77 order the program is compiled correctly. Maybe you can help me

Hi Grilla,

It appears that you might be using a 32-bit assembler. What is the output of ‘which as’ and ‘as --version’?

Thanks,
Mat

This is the output of ‘which as’ and ‘as --version’

astegmeir@pc210:~$ which as
/usr/bin/as
astegmeir@pc210:~$ as --version
GNU assembler 2.17 Debian GNU/Linux
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `i486-linux-gnu'.
astegmeir@pc210:~$

Thankyou very much
GRILLA

Hi Grilla,

You’ll need to install the 64-bit binutils, including a 64-bit assembler, in order to compile in 64-bits.

  • Mat

I will try this. Thank you

Hello
now I think I have the problem, that I can´t find the right package. I have a debian linux and found the following package, which I think include a 64 bit assembler. But it doesn´t work on my system.

pc210:/home/astegmeir/packages# ls
a.out                      binutils-2.19         binutils-dev_2.17-3_amd64.deb
binutils_2.17-3_amd64.deb  binutils-2.19.tar.gz
pc210:/home/astegmeir/packages# dpkg -i binutils_2.17-3_amd64.deb
dpkg: Fehler beim Bearbeiten von binutils_2.17-3_amd64.deb (--install):
 Paket-Architektur (amd64) passt nicht zum System (i386)
Fehler traten auf beim Bearbeiten von:
 binutils_2.17-3_amd64.deb
pc210:/home/astegmeir/packages# uname -r
2.6.18-6-amd64
pc210:/home/astegmeir/packages#

The error message says that the package architecture(amd64) doesn´t fit to the system(i386).
But the Kernel is an amd64 (uname -r)

The 64 bit-binutils package, you told me to install, I can´t find. Maybe you can send me a link to the right package.

Thank you very much
Grilla

Hi Grilla,

I don’t know Debian, but I think you might have a 32-bit OS installed? What is the output of “uname -a”?

  • Mat

Hello again,
I think I managed now to install the 64 bit assembler. But there is still an error message. I think I miss a gcc bib but I do not know which one:

astegmeir@pc210:~/ucn_d2/test$ as -version
GNU assembler (GNU Binutils) 2.19
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-unknown-linux-gnu'.
astegmeir@pc210:~/ucn_d2/test$ uname -a
Linux pc210 2.6.18-6-amd64 #1 SMP Fri Dec 12 18:20:54 UTC 2008 x86_64 GNU/Linux
astegmeir@pc210:~/ucn_d2/test$  gcc -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)
astegmeir@pc210:~/ucn_d2/test$ pgf77 hello.f
NOTE: your trial license will expire in 3 days, 12.4 hours.
/usr/local/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.1.2/libgcc.a when searching for -lgcc
/usr/local/bin/ld: cannot find -lgcc
astegmeir@pc210:~/ucn_d2/test$

Thank you very much for your efforts, I`m some kind of a newbie with linux, so I appreciate your help very much.

Thanks Grilla

Hi Grilla,

It appears that you’ve got a 32-bit gcc installed as well. Unfortunately, I don’t know debian but see if you can install all 64-bit development packages from your media.

Note that you can use PGI in 32-bits by either setting your path to point to the PGI 32-bit compiler directory (something like “export PATH=/opt/pgi/linux86/8.0-3/bin:$PATH”) or using a 32-bit target processor flag (like “-tp k8-32”).

  • Mat

Hello,

now it works. I had a 32bit debian distribution with a 64 bit kernel.
I installed a new suse 64bit distribution and now I have a 64bit assembler and a 64 bit gcc compiler and it works

Thank you very much for your efforts

Grilla

I get the similar problem when I install pgi5.1-64 in Fedora 7(X86_64)

#pgf90 test.f
/tmp/pgf90baaaaahgap.s: Assembler messages:
/tmp/pgf90baaaaahgap.s:22: Error: bad register name `%rbp'
/tmp/pgf90baaaaahgap.s:24: Error: bad register name `%rsp'
/tmp/pgf90baaaaahgap.s:26: Error: bad register name `%rsp'
/tmp/pgf90baaaaahgap.s:27: Error: bad register name `%rbx'
/tmp/pgf90baaaaahgap.s:51: Error: bad register name `%r8d'
/tmp/pgf90baaaaahgap.s:60: Error: bad register name `%rbp)'

here is some information of my system

which as
/usr/bin/as
#as --version
GNU assembler 2.17.50.0.12-4 20070128
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-redhat-linux'.

and I add these in /root/.bashrc

export PGI=/usr/local/pgi5.1
  export PATH=$PGI/linux86-64/5.1/bin:$PATH

Thanks!
any suggestion is appreciated!

I have fixed it!
it’s because I put a bad localrc in /usr/local.pgi5.1/linux86-64/5.1/bin

the pgi install code always failed to recognize my gcc lib (you can see from the information Error:unknown glibc version during the installation),and there is no localrc in pgi5.1/linux86-64/5.1/bin
I make localrc file maunally.


the right localrc for pgi5.1 in FC-64 should be

set LFC=-lg2c;
set LDSO=/lib64/ld-linux-x86-64.so.2;
set GCCDIR=/usr/lib/gcc/x86_64-redhat-linux/4.1.2;
set GCCINC=/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include;
#set G77DIR=;
set THROW=__THROW=;

you should edit the path according to you gcc lib version before you use it

Hi Blucas,

The 5.1 release is over 5 years old so it’s installer wouldn’t recognize Fedora7. The compilers should be ok but we don’t officially support Fedora7 until the 7.1 release.

For a complete list of supported Linux distributions, please refer to http://www.pgroup.com/support/install.htm#release_info

  • Mat