[Seisunix] Seismic Unix install on Mac OS X 10.5.6

894 views
Skip to first unread message

Jaume', Steven C

unread,
Mar 10, 2009, 2:08:25 PM3/10/09
to seis...@mailman.mines.edu
I have just tried installing Seismic Unix after changing these lines
in the default Makefile.config. I am way out of practice playing with
makefiles so suggestions are very welcome!

ENDIANFLAG -DCWP_LITTLE_ENDIAN

XDRFLAG -DSUXDR -D_BSD_SOURCE

CC gcc

CPP /usr/bin/cpp

The installation as far as:

gcc -I/Users/jaumes/Documents/SeismicUnix/include -O3 -Wall -Wno-long-long -ansi -pedantic -D_POSIX_SOURCE -D_FILE_OFFSET_BITSd -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DGNU_SOURCE -DCWP_LITTLE_ENDIAN -DSUXDR -D_BSD_SOURCE fcat.c -L/Users/jaumes/Documents/SeismicUnix/lib -lcwp -o /Users/jaumes/Documents/SeismicUnix/bin/fcat

where it crashed with these error codes:

fcat.c: In function ‘main’:
fcat.c:35: error: storage size of ‘buf’ isn’t known
fcat.c:43: warning: implicit declaration of function ‘open64’
fcat.c:45: warning: implicit declaration of function ‘fstat64’
fcat.c:35: warning: unused variable ‘buf’
make[2]: *** [/Users/jaumes/Documents/SeismicUnix/bin/fcat] Error 1
make[1]: *** [INSTALL] Error 2
make: *** [cwpstuff] Error 2

I suspect I either have to change another line in Makefile.config or I have incorrectly set
one of the lines quoted above. Any suggestions?

Dr. Steven C. Jaume'
Associate Professor
Department of Geology and Environmental Geosciences
College of Charleston
66 George Street
Charleston, SC 29424
Phone: (843) 953-1802
FAX: (843) 953-5446
Email: jau...@cofc.edu

_______________________________________________
seisunix mailing list
seis...@mailman.mines.edu
https://mailman.mines.edu/mailman/listinfo/seisunix
Unsubscribe: seisunix-u...@mailman.mines.edu

Bernard Giroux

unread,
Mar 10, 2009, 2:30:12 PM3/10/09
to Jaume', Steven C, seis...@mailman.mines.edu
Hi,

With 10.5.6, I use

CPP gcc -E

However, I'm not 100% sure it will solve your issue. I have SU on my
laptop which is at home right now. I can send you my Makefile.config
later on if needed.


Le 09-03-10 à 14:08, Jaume', Steven C a écrit :

---
Bernard Giroux, ing., Ph.D.
Chercheur
http://geo.polymtl.ca/~giroux

John Stockwell

unread,
Mar 10, 2009, 3:31:46 PM3/10/09
to Jaume', Steven C, seis...@mailman.mines.edu
Dear James,

What hardware are you running: Mac Intel, Power PC, G4, G5,...?

-John


> I have just tried installing Seismic Unix after changing these lines
> in the default Makefile.config. I am way out of practice playing with
> makefiles so suggestions are very welcome!
>
> ENDIANFLAG

> XDRFLAG
> CC
> CPP

John Stockwell | jo...@dix.Mines.EDU
Center for Wave Phenomena (The Home of Seismic Un*x)
Colorado School of Mines
Golden, CO 80401 | http://www.cwp.mines.edu/cwpcodes
voice: (303) 273-3049

Our book:
Norman Bleistein, Jack K. Cohen, John W. Stockwell Jr., [2001],
Mathematics of multidimensional seismic imaging, migration, and inversion,
(Interdisciplinary Applied Mathematics, V. 13.), Springer-Verlag, New York.

Michael Fehler

unread,
Mar 10, 2009, 4:52:04 PM3/10/09
to John Stockwell, Jaume', Steven C, seis...@mailman.mines.edu
All: While this is being answered, can anyone please include information on how to compile with the large file option on an Intel Mac (OS10.5.6)? I have SU working on my mac but have tried a number of Makefile mods to get the large option but it does not seem to have any impact.

For my initial install, I don't recall that I had to do any modification to the makefile.

Thank you,

Michael Fehler

John Stockwell

unread,
Mar 11, 2009, 9:17:57 AM3/11/09
to Michael Fehler, Jaume', Steven C, seis...@mailman.mines.edu
Dear Michael,

This is what I use on my Mac Intel system.

# uncomment if you want to install with large file support
# Mac OS X
LARGE_FILE_FLAG = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DGNU_SOURCE


If you try this and still are having problems, please email a
detailed explanation of the problem you are seeing so I can troubleshoot
it on this end.

-John

Marc Langlois

unread,
Mar 16, 2009, 5:22:00 PM3/16/09
to seis...@mailman.mines.edu
I found another file I had to modify to compile SU 41 for large files/XDR on OS X: ./src/cwp/include/cwp.h. The change skips the definition of open, lseek, etc to the 64 bit versions when compiling for large files (these settings should ALWAYS be left to the compiler to decide).
 
Output from the diff command is:

diff cwp.h cwp.h.TBI
636a637,638
> #ifndef _LARGEFILE_SOURCE
648a651,652
> #endif

Regards,
Marc Langlois.

----- Original Message -----
From: Marc Langlois <ma...@tbi.ca>
Date: Monday, March 16, 2009 3:00 pm
Subject: Re: [Seisunix] Seismic Unix install on Mac OS X 10.5.6
To: seis...@mailman.mines.edu

> We use SU release 41 with large files and XDR on OS X 10.5.6
> (Intel 
> and PowerPC). As I recall, the source did not compile with the
> large 
> file settings and XDR, so I had to modify the fgettr.c and
> fputtr.c 
> routines (in src/su/lib) to get the release to build.
>
> The relevant settings in our Makefile.config are:
>
> ENDIANFLAG = -DCWP_LITTLE_ENDIAN
> XDRFLAG = -DSUXDR
> LARGE_FILE_FLAG =  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
> OPTC = -O3 -Wall -ansi -pedantic
>
> Which result in the compile flags:
>
> cc -c -I/NFS/Software/su/include -O3 -Wall -ansi -pedantic 
> -
> D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DCWP_LITTLE_ENDIAN -DSUXDR
>
> The source code mods I made were replacing "unsigned off_t" and
> "int" 
> with "off_t" or "size_t" in the definition of the insegyinfo
> struct. 
> Note that the struct is defined twice in fgettr.c, once for XDR
> and 
> again without XDR. Using "unsigned off_t" doesn't make sense
> since 
> "off_t" is already unsigned, but for some reason it seems to
> compile 
> on Linux and not on OS X.
>
> The output from the diff command on the source files is shown
> below. 
> Let me know if you would like to have the entire files and I'll
> send 
> them to you.
>
> Regards,
> Marc Langlois.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Marc Langlois
> Thrust Belt Imaging
> Calgary, AB, Canada
>
>
> ##########
> diff fgettr.c fgettr.c.TBI
> 96c96
> <       unsigned off_t
> itr;          /*
> number of traces read    */
> ---
>  >       off_t
> itr;           /* number of traces read    */
> 99,100c99,100
> <       int
> nsegy;                   /* segy bytes from nsfirst  */
> <       unsigned off_t
> ntr;      /* traces in input,if known */
> ---
>  >       size_t
> nsegy;                /* segy bytes from nsfirst  */
>  >       off_t
> ntr;           /* traces in input,if known */
> 104c104
> <        unsigned int
> bufstart; /* "offset" of start of buf */
> ---
>  >         size_t
> bufstart;      /* "offset" of start of
> buf */
> 170d169
> <       unsigned int
> startpos;  /* xdr stream offset */
> 246c245
> <                   efseeko(fp,(off_t) 0,SEEK_END);
> ---
>  >                   efseeko(fp,(off_t) 0,SEEK_END);
> 343c342
> <       unsigned off_t
> itr;          /*
> number of traces read    */
> ---
>  >       off_t
> itr;           /* number of traces read    */
> 346,347c345,346
> <       unsigned off_t 
> nsegy;               /* segy bytes from 
> nsfirst  */
> <       unsigned off_t
> ntr;                  /* traces in input,if 
> known */
> ---
>  >       size_t
> nsegy;                /* segy bytes from nsfirst  */
>  >       off_t
> ntr;           /* traces in input,if known */
>
> ##########
> diff fputtr.c fputtr.c.TBI
> 77c77
> <       unsigned off_t
> itr;           /* number of traces 
> written       */
> ---
>  >       off_t
> itr;            /* number of traces written       */
> 239c239
> <       unsigned off_t
> itr;           /* number of traces 
> written       */
> ---
>  >       off_t
> itr;            /* number of traces written       */
>
>
> On 16-Mar-09, at 1:53 PM, Marc Langlois wrote:

>
> >
> >
> > ----- Original Message -----
> > From: John Stockwell <jo...@dix.mines.edu>
> > Date: Wednesday, March 11, 2009 7:33 am
> > Subject: Re: [Seisunix] Seismic Unix install on Mac OS X 10.5.6
> > To: Michael Fehler <michael...@gmail.com>
> > Cc: "Jaume', Steven C" <Jau...@cofc.edu>,
> seis...@mailman.mines.edu>
> > > Dear Michael,
> > >
> > > This is what I use on my Mac Intel system.
> > >
> > > # uncomment if you want to install with large file support
> > > # Mac OS X
> > > LARGE_FILE_FLAG =  -D_FILE_OFFSET_BITS=64 -
> > > D_LARGEFILE_SOURCE -DGNU_SOURCE
> > >
> > >
> > > If you try this and still are having problems, please email a
> > > detailed explanation of the problem you are seeing so I can
> > > troubleshootit on this end.

Michael Fehler

unread,
Mar 17, 2009, 10:36:04 AM3/17/09
to John Stockwell, Jaume', Steven C, seis...@mailman.mines.edu
John: I am really sorry to have to ask for personal help but I still cannot get this to work. I went back and grabbed the latest version of SU (41) from your site. I modified the Makefile.config by uncommenting the appropriate lines for Mac as stated in the file. I made a new version of SU. I did all of this in a new folder after changing my CWPROOT and changing my search path the the new folder and taking out reference to the older one. To confirm, I closed Xterm and Terminal appplications and restarted them. I checked that my environment was set correctly with the new CWPROOT and new path. I did make install. The install went fine. SU works well. The problem is that I still cannot access large files. I have several large files.

Here is information on one large segy file:
-r-xr-xr-x@ 1 mfehlerlap  mfehlerlap  2159712396 Mar 17 10:26 test.sgy
so it is a segy file of a little over 2 GB

If I execute
segyread tape=test.sgy    > test.su

I get a file with the following characteristics
-rw-r--r--  1 mfehlerlap  mfehlerlap  2159708796 Mar 17 10:28 test.su

I then type
surange < test.su

and here is the response:
surange: subcalls.c : efseeko: fseeko failed

I can also try
suximage n2=100 < test.su

and I get
suximage: subcalls.c : efseeko: fseeko failed

If I limit the size of my su file by using
segyread tape=test.sgy trmin=1 trmax=100 > test1.su

then surange and suximage work fine on test1.su.

I would greatly appreciate any help you might offer me in solving this problem.

I should note that I get similar response when I try these tests on other large segy files that I have on my Mac.

I am running OS10.5.6 on a 2 X 2.8 GHz Quad-Core Intel Xeon machine with 4 GB RAM.

Any help would be greatly appreciated. Again, I feel bad having to ask for help on this.

Michael Fehler

Jan Willem Thorbecke - CITG

unread,
Mar 17, 2009, 11:32:42 AM3/17/09
to Michael Fehler, John Stockwell, Jaume', Steven C, seis...@mailman.mines.edu

Dear Michael,

On my Mac (10.5.6) I also have CWP 41 running without any problems. I just made a diff of the latest version (downloaded from the web) and my local installed version. Besides the Makefile.config there are no changes to the code.  I tested my version for a 2+GB file:

JansMac:~ jan$ suplane nt=16000 ntr=38000 > plane.su
JansMac:~ jan$ du -sh plane.su
2.3G    plane.su
JansMac:~ jan$ surange < plane.su
38000 traces:
tracl    1 38000 (1 - 38000)
tracr    1 38000 (1 - 38000)
offset   400
ns       16000
dt       4000

and do not see problems. My Makefile.config is attached below. Note that I used the 64-bit Intel compilers to compile the code. Hopefully this helps you a bit further.

kind regards,

Jan




-----Original Message-----
From: seisunix...@mailman.mines.edu on behalf of Michael Fehler
Sent: Tue 3/17/2009 3:36 PM
To: John Stockwell
Cc: Jaume', Steven C; seis...@mailman.mines.edu
Subject: Re: [Seisunix] Seismic Unix install on Mac OS X 10.5.6

Makefile.config

John Stockwell

unread,
Mar 17, 2009, 11:41:49 AM3/17/09
to Michael Fehler, Jaume', Steven C, seis...@mailman.mines.edu
Please add:

-m64

to the OPTC line in Makefile.config and do

make remake
make xtremake

Michael Fehler

unread,
Mar 17, 2009, 11:56:05 AM3/17/09
to John Stockwell, Jaume', Steven C, seis...@mailman.mines.edu
Thank you. I got it to work with Marc's instructions.

Michael

John Stockwell

unread,
Mar 25, 2009, 5:09:04 PM3/25/09
to huub douma, Jaume', Steven C, seis...@mailman.mines.edu
Hi Huub,

What platform are you working on? (Please specify Intel vs Power PC
if Mac, and operating system level).

In addition to other comments, don't use any optimization in your
OPTC = line

-John


> Michael, I have the exact same problem that you had. I edited fgettr.c,
> fputtr.c and cwp.h per Marc's suggestions, did a remake with the same
> options that Marc suggested , but I still get the same old
>
> subcalls.c : efseeko: fseeko failed
>
> when I for example run a simple surange. Can you be a bit more specific on
> what you exactly did? Many thanks in advance.
>
> I also tried the -m64 compile option: that read the data succesfully, but
> when I viewed it, it looked like garbage: very large values and no hint of
> any nice wiggly lines.
>
> Any other suggestions?
>
> On Tue, Mar 17, 2009 at 11:56 AM, Michael Fehler
> <michael...@gmail.com>wrote:

John Stockwell

unread,
Mar 25, 2009, 8:05:45 PM3/25/09
to huub douma, Jaume', Steven C, seis...@mailman.mines.edu
Is it a Mac Intel or a Mac Power PC or G4 or G5 or other hardware specification?
Did you compile it with XDR?

Please email me your Makefile.config file.

> Hi John and Michael,
>
> I am using Mac OS X Version 10.5.6. Reading the data with SU made without
> the OPTC optimization but with the edited files per Marc's suggestion gives
> me the same data display ('looks like garbage') as when using the unedited
> fgettr.c fputtr.c and cwp.h, but compiling with the -m64 option.
>
> Michael just sent an email with the edited files. I remade SU with his
> edited files, and the data indeed also reads successfully but still looks
> like garbage (although it is consistently the same looking garbage...). I
> guess that it means that I am unlucky and that something is likely wrong
> with this particular dataset. It thus looks that the large file problem is
> indeed solved by either the -m64 option, or the editing of the fgettr.c,
> fputtr.c and cwp.h.
>
> Huub

Reply all
Reply to author
Forward
0 new messages