My laptop has a AMD Athlon 64 Processor 3700+, Architecture is x86_64. My problem is that I have to compile a code that will then be linked to pre-compile binaries produced on 32-bit machines. In short, everything must be compiled to generate 32-bit code for the sake of compatibility. There should be an option in the gcc compiler that forces it to generate 32-bit code.. But assuming I've got an executable for 32-bit machines, then can I run such an exectable on MY OWN laptop which is 64-bit ? If the answer is "yes" (I hope so) then I'd be grateful to know how I can do that . Thank you in advance for your help. Maura
On Saturday 15 April 2006 23:12, Maura Edeweiss Monville wrote:
My laptop has a AMD Athlon 64 Processor 3700+, Architecture is x86_64. My problem is that I have to compile a code that will then be linked to pre-compile binaries produced on 32-bit machines. In short, everything must be compiled to generate 32-bit code for the sake of compatibility. There should be an option in the gcc compiler that forces it to generate 32-bit code.. But assuming I've got an executable for 32-bit machines, then can I run such an exectable on MY OWN laptop which is 64-bit ? If the answer is "yes" (I hope so) then I'd be grateful to know how I can do that .
Providing you have any 32bit libraries you need installed then you can just prefix your program name with linux32 for instance you can run bash in 32 bit by typing linux32 bash David -- David Bottrill david@bottrill.org www.bottrill.org Registered Linux user number 330730 Internet Free World Dialup: 683864
On Saturday 15 April 2006 18:38, David Bottrill wrote:
Providing you have any 32bit libraries you need installed then you can just prefix your program name with linux32
for instance you can run bash in 32 bit by typing
linux32 bash
As an aside to your reply to Maura; Could you elaborate some on compiling in 32 bit mode? eg: I would just do a ./configure linux32 abcd-1.2, or a makeinstall linux32, Or are you saying but "bash" in a 32 bit mode, then continue with your compiling? Please excuse my ignorance. I would like very much to compile some of my programs to 32 bit on my 64 bit system. Bob S.
David
-- David Bottrill
david@bottrill.org www.bottrill.org Registered Linux user number 330730 Internet Free World Dialup: 683864
Thank you. I've tried and played around with the command you suggest. Here are the results: mauede@linux:~> uname -m x86_64 mauede@linux:~> linux32 bash mauede@linux:~> uname -m i686 mauede@linux:~> source ~/bin/gcc-4.1 mauede@linux:~> uname -m i686 I have recently succeeded at installing the CERN library. The 1st step of the provided installation procedure un-gzips and un-tars all the source files, then creates the lib structure, generates all the necessary Makefiles, and finally execs the Makefiles at each structure level, therefore creating the library functions. The problem I'm facing is that if I run such procedure "as is" on my 64-bit laptop, then by default the invoked compilers (gcc, g++, f77), no matter their version, will generate code for my system, that is for a 64-bit processor. But I need to generate 32-bit code. I wonder if I run the CERLIB installation procedure AFTER launching the linux32 bash then all the invoked compiler will see the processor being emulated, that is i686 rather than the true processor x86_64, therefore they automatically will, hopefully, geneate 32-bit code WITHOUT setting any flag and/or option ... ???? .... I might be insane ..... If this is not the case then I will have to split the native CERNLIB installation procedure e manually force the proper options/flags in order to generate code for a 32-bit machine . Thank you very much for your help, Maura On Sat, 15 Apr 2006, David Bottrill wrote:
On Saturday 15 April 2006 23:12, Maura Edeweiss Monville wrote:
My laptop has a AMD Athlon 64 Processor 3700+, Architecture is x86_64. My problem is that I have to compile a code that will then be linked to pre-compile binaries produced on 32-bit machines. In short, everything must be compiled to generate 32-bit code for the sake of compatibility. There should be an option in the gcc compiler that forces it to generate 32-bit code.. But assuming I've got an executable for 32-bit machines, then can I run such an exectable on MY OWN laptop which is 64-bit ? If the answer is "yes" (I hope so) then I'd be grateful to know how I can do that .
Providing you have any 32bit libraries you need installed then you can just prefix your program name with linux32
for instance you can run bash in 32 bit by typing
linux32 bash
David
-- David Bottrill
david@bottrill.org www.bottrill.org Registered Linux user number 330730 Internet Free World Dialup: 683864
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Sun, 16 Apr 2006 02:01:56 -0500 (CDT) Maura Edeweiss Monville <memonvil@artsci.wustl.edu> wrote:
I have recently succeeded at installing the CERN library. The 1st step of the provided installation procedure un-gzips and un-tars all the source files, then creates the lib structure, generates all the necessary Makefiles, and finally execs the Makefiles at each structure level, therefore creating the library functions. The problem I'm facing is that if I run such procedure "as is" on my 64-bit laptop, then by default the invoked compilers (gcc, g++, f77), no matter their version, will generate code for my system, that is for a 64-bit processor. But I need to generate 32-bit code. I wonder if I run the CERLIB installation procedure AFTER launching the linux32 bash then all the invoked compiler will see the processor being emulated, that is i686 rather than the true processor x86_64, therefore they automatically will, hopefully, geneate 32-bit code WITHOUT setting any flag and/or option ... ???? .... I might be insane .....
If this is not the case then I will have to split the native CERNLIB installation procedure e manually force the proper options/flags in order to generate code for a 32-bit machine . I don't know specifically how CERN has set up the configure script. The best way is to tell the configure script to force 32-bits. if that is possible. gcc has a number of options you can use to control compilation for 32-bit, such as -m32. Look at "i386 and x86-64 Options" on the gcc man page. You might also want to set this in the CFLAGS and CXXFLAGS environment variables.
That said, you may not be able to easily configure CERN to structure it the way you want, but there are a couple of possible solutions. Assuming that the CERN libraries use a sequence such as ./configure, make, make install... Build CERN on another computer, but do not issue "make install" Then copy the directory tree to your laptop. Make sure you preserve the permissions. Then, you should be able to run "make install" to install the 32-bit CERN. A really ugly way is to install SuSE on your laptop as a 32-bit OS. -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
On Sunday 16 April 2006 00:12, Maura Edeweiss Monville wrote:
My laptop has a AMD Athlon 64 Processor 3700+, Architecture is x86_64. My problem is that I have to compile a code that will then be linked to pre-compile binaries produced on 32-bit machines. In short, everything must be compiled to generate 32-bit code for the sake of compatibility. There should be an option in the gcc compiler that forces it to generate 32-bit code..
I have no experience with 64-bit, but as I'm experimenting with a mips-router that involves cross-compiling (ADM5120P cpu), I thought i'd have a look at the 10.0 package repository. There is a directory named 'x86_64'. In there I found not only a gcc-4.0.2, but also gcc-32bit-4.0.2 package. Something for cross-compiling and worth to have a closer look?
But assuming I've got an executable for 32-bit machines, then can I run such an exectable on MY OWN laptop which is 64-bit ? If the answer is "yes" (I hope so) then I'd be grateful to know how I can do that .
:} Hmm, I noticed two other mailinglists that might interest you: - suse-programming-e (http://lists.suse.com/archive/suse-programming-e/) - suse-amd64 (http://lists.suse.com/archive/suse-amd64/) Cheers, Leen
Just one more generic comment about the x86_64 architecture. This architecture supports the identical 32-bit architecture expected by 32-bit code. Programs built as 32-bit will think they are on a 32-bit x86 architecture. gaf@gaflap:~/src> gcc hello.c -o hello64 gaf@gaflap:~/src> file hello64 hello64: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), not stripped gaf@gaflap:~/src> gcc -m32 hello.c -o hello32 gaf@gaflap:~/src> file hello32 hello32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped Another issue is the OS. You can run either a 32-bit or a 64-bit OS. he 32-bit OS will not give you any of the additional features of the 64-bit architecture. A 64-bit OS runs in full 64-bit mode, but does allow both 64-bit and 32-bit binaries to run. -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
On Sunday 16 April 2006 16:22, Jerry Feldman wrote:
A 64-bit OS runs in full 64-bit mode, but does allow both 64-bit and 32-bit binaries to run.
with two caveats: The kernel is still 64 bit, and while there are a number of 32 bit compatibility calls in there, some syscalls will fail Not all supporting libraries are included in 32 bit form, they may have to be installed separately
Shall I deduce that: 1. It is possible to generate 32-bit code on a 64-bit machine 2. Not all 32-bit code, no matter where it was generated, will run on a 64-bit machine I do not give up. From your answers I infer that running the CERNLIB installation procedure in a shell where linux32 has been invoked, like: # linux32 bash # ./start_cern will NOT automatically produce 32-bit code. Am I right ? The workaround consists in splitting the provided installation procedure and manually change the compiler options. Still, this is not the whole story .. sigh .. In fact the next step in the CERNLIB creation consist of generating the math functions tha rely on "blas" and "lapack". Here I'm quoting the CERNLIB installation guidelines at http://cernlib.web.cern.ch/cernlib/install/lapack3.html: "... If successful, the libraries will be in $CERN_ROOT/lib. Failure is usually indicated in the end of the log files in $CERN_ROOT/build/log. Pawlib and some parts of mathlib depend on Lapack3, which can now be built as described here... " Where "here" is a link to http://cernlib.web.cern.ch/cernlib/install/lapack3.html This latter site contains instructions for downloading and installing the linear algebra LAPACK. Here is my point: I ALREADY have on my system both the native "blas" and "lapack" installed from SuSE DVD. But they are for x86_64 architecture. For the sake of consistency I need the equivalent two packages for 32-bit machines. No matter if I install the ones provided by CERN or from the rpm files that can be downloaded from http://rpmfind.net//linux/RPM/PLD/dists/ac/ready/i686/blas-3.0-30.i686.html I am VERY CONCERNED that the new blas and lapack will overwrite the existing one therefore messing up my system .... HELP ... PLEASE ! Is there a way tomake both 64- and 32-versions of blas and lapack coexist in the same system and then liknk the appropriate version ? Thank you so much, Maura On Sun, 16 Apr 2006, Anders Johansson wrote:
On Sunday 16 April 2006 16:22, Jerry Feldman wrote:
A 64-bit OS runs in full 64-bit mode, but does allow both 64-bit and 32-bit binaries to run.
with two caveats:
The kernel is still 64 bit, and while there are a number of 32 bit compatibility calls in there, some syscalls will fail
Not all supporting libraries are included in 32 bit form, they may have to be installed separately
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Shall I deduce that:
1. It is possible to generate 32-bit code on a 64-bit machine
2. Not all 32-bit code, no matter where it was generated, will run on a 64-bit machine
I do not give up. From your answers I infer that running the CERNLIB installation procedure in a shell where linux32 has been invoked, like: # linux32 bash # ./start_cern
will NOT automatically produce 32-bit code. Am I right ? The workaround consists in splitting the provided installation procedure and manually change the compiler options.
Still, this is not the whole story .. sigh .. In fact the next step in the CERNLIB creation consist of generating the math functions tha rely on "blas" and "lapack". Here I'm quoting the CERNLIB installation guidelines at http://cernlib.web.cern.ch/cernlib/install/lapack3.html:
"... If successful, the libraries will be in $CERN_ROOT/lib. Failure is usually indicated in the end of the log files in $CERN_ROOT/build/log. Pawlib and some parts of mathlib depend on Lapack3, which can now be built as described here... "
Where "here" is a link to http://cernlib.web.cern.ch/cernlib/install/lapack3.html This latter site contains instructions for downloading and installing the linear algebra LAPACK.
Here is my point: I ALREADY have on my system both the native "blas" and "lapack" installed from SuSE DVD. But they are for x86_64 architecture. For the sake of consistency I need the equivalent two packages for 32-bit machines. No matter if I install the ones provided by CERN or from the rpm files that can be downloaded from http://rpmfind.net//linux/RPM/PLD/dists/ac/ready/i686/blas-3.0-30.i686.html I am VERY CONCERNED that the new blas and lapack will overwrite the existing one therefore messing up my system .... HELP ... PLEASE ! Is there a way tomake both 64- and 32-versions of blas and lapack coexist in the same system and then liknk the appropriate version ? IMHO, you should be able to run 32-bit code. The problem is with
On Sun, 16 Apr 2006 11:00:24 -0500 (CDT) Maura Edeweiss Monville <memonvil@artsci.wustl.edu> wrote: libraries. You can create 2 copies of the blas and lapack libraries. I happen to have a very large (over 1,000,000 lines of code) that I have ported to the 64-bit IA64 that happens to use both blas and lapack. This same code runs on an x86_64 box that currently has RHEL 3.0 with a 64-bit kernel. You should have on your system /lib - 32-bit lib /lib64 /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 You should find that the blas and lapack 32-bit and 64-bit will coexist nicely. -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
On Sun, 16 Apr 2006, Jerry Feldman wrote:
IMHO, you should be able to run 32-bit code. The problem is with libraries. You can create 2 copies of the blas and lapack libraries. I happen to have a very large (over 1,000,000 lines of code) that I have ported to the 64-bit IA64 that happens to use both blas and lapack. This same code runs on an x86_64 box that currently has RHEL 3.0 with a 64-bit kernel.
You should have on your system /lib - 32-bit lib /lib64 /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
You should find that the blas and lapack 32-bit and 64-bit will coexist nicely.
CERN provides a link to a LAPACK source code described at http://www.netlib.org/lapack/ It can be downloaded from http://cernlib.web.cern.ch/cernlib/install/lapack3.html by clicking on "lapack.tgz" I've been adviced to use the equivalent package meant for SuSE downloadable from http://rpm.pbone.net/index.php3/stat/4/idpl/1805848/com/blas-3.0-923.i586.rp... But CERLIB expects the ".a" lapack library as specified at http://cernlib.web.cern.ch/cernlib/install/lapack3.html whereas the rpm file for SuSE provides the ".so" Installing the CERN library on a 64-bit machine is a nightmare that I'm suggested to give up. In the following I'm copying my supervisor's suggestion based on a previous experience they had at trying to install MARS (A Mongte Carlo code that uses the CERLIB) on SuSE. As you all will read it's not encouraging .. sigh .. **++************************************** * PASTED MESSAGE FROM MY SUPERVISOR * ****************************************** Nikolai Mokhov to me Hide options 6:59 am (6 hours ago) From: Nikolai Mokhov <mokhov@fnal.gov> Mailed-By: fnal.gov To: Maura Monville <maura.monville@gmail.com> Date: Apr 16, 2006 6:59 AM Subject: Re: CERNLIB Reply | Reply to all | Forward | Print | Add sender to Contacts list | Delete this message | Report phishing | Show original | Message text garbled? Maura, A month ago, we had a problem with a MARS user who had 64-bit SuSE on her computer. Mike Kriss spent a half a day trying to help her resolve the problems you are facing. Then they gave up, Elaine switched to a 32-bit Red Hat with the appropriate CERNLIB, and after that in 30 minutes she was able to run the MARS system. You can check with Mike and Elaine Marshall <emarshall@hbartech.com>. Because of such cases, I don't like to deal with laptops for MARS, not to mention that you won't be able to get the full version there with MCNP, LAQGSM, DPMJET etc. The natural way is to do most of the work on the clusters - cartoon and heimdall for you - as all of us do. There is a chance that I will be absent on some days of the coming week because of a jury duty: I will be checking their voice messages every night starting today (Sunday) to find out if I need to show up in the court next day. If I will need to be there, I will try to stop in my office after that in evenings. I am in my office now dealing with some unavoidable things... Cheers, Nikolai
-- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
Maura Edeweiss Monville wrote:
Installing the CERN library on a 64-bit machine is a nightmare that I'm suggested to give up. In the following I'm copying my supervisor's suggestion based on a previous experience they had at trying to install MARS (A Mongte Carlo code that uses the CERLIB) on SuSE.
But it appears you mistakenly attribute your MARS problem with SuSE (thus went to RH) instead of a 32 bit versus 64 bit problem. Simply put, 32 bit programs WILL work on 64 bit IF all their prerequisites are met (not anything new, just a slightly new twist). Since they link to 32 bit libraries, they need those libraries available in a 64 bit machine. The 64 bit libs install to their lib64 directories, whereas 32 bit to theirs (lib). It isn't that it is hard, it is just new. To say it was easy on a 32 bit RH would only be a valid comparison if it was easier than on a 32 bit SuSE. SuSE has provided many -32bit versions of many packages that coexist fine with the 64 bit versions. Building those packages obviously take some work (more than the normal) to ensure there aren't duplicate files/filenames. To need to run a lot of 32 bit stuff on a 64 bit SuSE (or any other flavor) will be much more work than just running a 32 bit OS. As has been shared, -m32 will compile 32 bit on a 64 bit computer, and linux32 will simulate an x86 machine for those programs that need more. That is only part of the problem as you have seemingly found (i.e. duplicate file names and files, such as docs). Once though these have been overcome and an rpm built, it is simple to get 32 bit programs working in x86_64 (i.e rpm -ivh xxxx.rpm). HTH to put things in a proper perspective. -- Joe Morris Registered Linux user 231871
Maura Edeweiss Monville wrote:
CERN provides a link to a LAPACK source code described at http://www.netlib.org/lapack/ It can be downloaded from http://cernlib.web.cern.ch/cernlib/install/lapack3.html by clicking on "lapack.tgz" I've been adviced to use the equivalent package meant for SuSE downloadable from http://rpm.pbone.net/index.php3/stat/4/idpl/1805848/com/blas-3.0-923.i586.rp... But CERLIB expects the ".a" lapack library as specified at http://cernlib.web.cern.ch/cernlib/install/lapack3.html whereas the rpm file for SuSE provides the ".so"
I don't understand your problem. The pbone package provides both the static (.a) as the dynamic libraries. (.so) vankan@pavilion:~> ls /usr/lib/libblas* /usr/lib/libblas.a /usr/lib/libblas.so /usr/lib/libblas.so.3 /usr/lib/libblas.so.3.0.0 In fact they're only two files (.a and .so.3.0.0) and two symlinks. These are NOT the lapack subroutines btw but only the blas (basic linear algebra subroutines). The lapack rpm for Suse can be found at http://rpmfind.net/linux/rpm2html/search.php?query=lapack Regards, -- Jos van Kan registered Linux user #152704
Please, have a look at the following website: http://fr.rpmfind.net/linux/RPM/Development_Libraries.html You'll find CERNLIB versions appearently for x86_64 but also for i386 (which to my understanding should be the 32-bit procesor ?) Is it going to worn on SuSE 9.3 ? It's still source code though .. Thanks, Maura
Maura, I think you solution is clear..... What I would suggest you do, is install a dual boot SuSE. If you install only 32-bit SuSE on one partition, and the combination of 64-32 on another, you will get the added benifit for problem solving of knowing your in an exclusively 32-bit environment. Once you get that working, you can be up and running without too much loss of productivity. You probably won't notice too much difference between the two anyway unless you do some really heavy computing. Then, you can work out the 64-bit side of things on a no pressure basis. It can be done. I have been using 64 bit SuSE on all my machines (including laptop) and have had no problems eventually getting everything I use to work. But when I had to get something done, I just switched to a 32-bit machine to pass up the pressure of the deadline, and would eventually get to make it work 64-bit. Heck, you may find it easier to build all your support libs while booted 32bit. And then setup the environment on you 64-bit side to actually use the other partitions libs. Clean seperation can certainly help, especially if your new to the 64/32 bit thing. Hope this helps. B-) On Sunday 16 April 2006 8:55 pm, Maura Edeweiss Monville wrote:
Please, have a look at the following website: http://fr.rpmfind.net/linux/RPM/Development_Libraries.html
You'll find CERNLIB versions appearently for x86_64 but also for i386 (which to my understanding should be the 32-bit procesor ?) Is it going to worn on SuSE 9.3 ? It's still source code though ..
Thanks, Maura
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
participants (9)
-
Anders Johansson
-
Bob S
-
Brad Bourn
-
David Bottrill
-
Jerry Feldman
-
Joe Morris (NTM)
-
Jos van Kan
-
Leendert Meyer
-
Maura Edeweiss Monville