[SAC-HELP] SAC on 64-bit Linux

Chad Trabant chad at iris.washington.edu
Sun May 17 14:02:22 PDT 2009


Hi Carl,

The gfortran compiler should be able to build both 32 and 64-bit  
binaries.  I'm guessing your compiler is defaulting to 64-bit and  
that's why it's skipping the 32-bit libsacio.a.  Try adding the '-m32'  
option to the compiler arguments to build a 32-bit binary.  Unless you  
need the benefits of 64-bit (possible but unlikely), a 32-bit binary  
will probably work just fine.

It is not generally possible to compile programs with a mix of 32 and  
64-bit libraries; for a given application the constituent binary  
objects (libraries, .o files, etc.) must all be one or the other,  
otherwise the linker will complain as it did in your case.  On most  
modern 64-bit operating systems their are parallel sets of system  
libraries, one 32-bit and one 64-bit.  In some cases you need to  
install the 32-bit system libraries.

regards,
Chad

On May 17, 2009, at 1:35 PM, Carl Tape wrote:

> 17-May-2009
>
> Dear SAC Help:
>
> I am having trouble using SAC libraries for a particular Fortran  
> code.  The
> problem may be related to 64-bit vs 32-bit processing.  Here are the  
> details of
> my situation.
>
> uname -a
> Linux denali #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/ 
> Linux
>
> Computer Dell Inspiron 530
> Platform Ubuntu 9.0.4
>
> sac
> SEISMIC ANALYSIS CODE [09/04/2008 (Version 101.2)]
>
> gfortran --version
> GNU Fortran (Ubuntu 4.3.3-5ubuntu4) 4.3.3
>
> gcc --version
> gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3
>
> I see from this file
> http://www.iris.edu/software/sac/SAC_History.txt
> that SAC should be possible with 64 bit Linux.
>
> And I can at least run sac and look at sac files, so something is  
> working.
>
> The particular Fortran code is the FLEXWIN package from CIG (I am  
> one of the
> main developers of this code):
> http://www.geodynamics.org/cig/software/packages/seismo/flexwin
>
> I used this code throughout my thesis at Caltech.  Now, at Harvard  
> on my new
> setup, when I compile the code, the pertinent error message is as  
> follows:
>
> gfortran -O2 -Wall flexwin.f90 -o flexwin copy_float.o libmeasure2.a
> -Lttimes_mod -L/opt/sac/lib -lsacio -lsac -ltau -lm
> /usr/bin/ld: skipping incompatible /opt/sac/lib/libsacio.a when  
> searching for
> -lsacio
> /usr/bin/ld: cannot find -lsacio
> collect2: ld returned 1 exit status
> make: *** [flexwin] Error 1
>
> Qinya Liu (U. Toronto) is able to successfully compile the program  
> with Ubuntu
> but using a slightly older (32 bit?) computer and a slightly older  
> Ubuntu
> version:
>
> Linux river #1 SMP Wed Apr 1 21:47:28 UTC 2009 i686 GNU/Linux
>
> This led us to believe that the problem was 32-bit vs 64-bit.  Is  
> anyone aware
> of this problem?  Do I need to try to compile SAC from the source  
> code on my
> 64-bit computer?
>
> I would appreciate any help on this matter.
>
> Thanks,
> Carl Tape
> Harvard U.
> -----------
>
> _______________________________________________
> sac-help mailing list
> sac-help at iris.washington.edu
> http://www.iris.washington.edu/mailman/listinfo/sac-help
>




More information about the sac-help mailing list