[Seisunix] Trouble compiling seg2segy

Juan Lorenzo gllore at lsu.edu
Tue Apr 10 14:13:02 MDT 2018


Hi Seth,

I had a similar problem some time ago  and I solved it by converting 
SEG2 file directly to the SU format.  Once in .su format you can convert 
to segy easily.

I downloaded,  compiled sioseis (gfortran) and ran its conversion options.

The following code is taken from inside a "for-loop" that works over 
many files, where each file name is an indexed element ($i) of an array 
of file names.

For example, $file_name[$i] represents the "ith" element of the array of 
file names ( strictly @file_name).
So if you are not familiar with the perl syntax, just replace 
$file_name[$i] with a single file name.

The only catch is that sioseis expects SEG2 file names to have a suffix 
= ".DAT".  My seismograph outputs ".dat" files that have to first be 
converted.

A second "gotcha" is that I usually have to run 'segyclean' on the output.

In any case, it you need a quick conversion, just send me the files and 
I can send them back converted.  I work on 64-bit machines under CentOS7.

sioseis << eof
procs seg2in diskoa end
seg2in
ffilen $file_name[$i] lfilen $file_name[$i]end
end
diskoa
opath $file_name[$i].su
ofmt 1
format su end
end
end
eof

Cheers,

Juan


On 4/9/2018 4:48 PM, Haines, Seth wrote:
> Hi all,
>    This isn't exactly an SU question, but seg2segy is among the 
> ThirdParty codes, and I'm hoping that someone here may be able to 
> provide some suggestions.
>
>     I'm setting up some codes in the bash/Ubuntu/Xming environment on 
> a Windows machine (a new Dell laptop, 64 bit). One item in particular 
> that I'd like very much to get running is seg2segy, as I'm not aware 
> of too many other options for converting SEG2 to SEGY.  I'm definitely 
> not very proficient at compiling, but I've been stuck on this for 
> several days and would be glad for suggestions.  I've installed a 
> number of libraries to get this to compile, via apt-get, and do get it 
> to (seemingly) compile.  But the executable doesn't actually work.  
> I've got two main options at this point:
>
>
>    If I compile with "gcc -m32 seg2segy.c  -Bstatic    -o seg2segy", 
> and then attempt to run the executable, I get this message " -bash: 
> ./seg2segy: cannot execute binary file: Exec format error".  My 
> understanding is that this indicates that the executable was compiled 
> for an incorrect type of system.  But I don't entirely understand what 
> that means in this case. I'm not too sure whether I ought to be using 
> the -m32 flag, but that's what's indicated by the note in the 
> Makefile.  If I use that flag, in order to avoid a compile error 
> regarding "fatal error: sys/cdefs.h: No such file or directory", I 
> need to install either/both of g++-multilib or libc6-dev-i386.
>
>
>    If I compile with "gcc seg2segy.c  -Bstatic    -o seg2segy" (same 
> as above, just without the -m32 flag) then I get an executable that 
> runs, but that rejects the SEG2 files I've tested it on, giving this 
> message (I'm including my command):
>  > ./seg2segy 329.dat 1
> Using default header word mappings.
> File 329.dat, Data Format Revision: 1, Number of traces: 3
> Not a SEG-2 trace header.  Can not process 3a55 (line 740)
>
>    I've tested on a few SEG2 files, including the one that comes with 
> SU in the ThirdParty directory, with the same result.
>
> Thank you very much for any suggestions on this.
>
> Seth
>
>
>
> _______________________________________________
> seisunix mailing list
> seisunix at mailman.mines.edu
> https://mailman.mines.edu/mailman/listinfo/seisunix
> Unsubscribe: seisunix-unsubscribe at mailman.mines.edu

-- 
--LSU--
Juan M. Lorenzo
Associate Professor
Ernest & Alice Neal Professorship in Geology & Geophysics
Adjunct Faculty in Dept. Petroleum Engineering
Howe-Russell-Kniffen Building Room 215
Corner South Campus/Tower Drives
Louisiana State University
Baton Rouge, LA 70803-4101
Tel.:                     (225) 578-4249
Fax:                      (225) 578-2302
Seismic Shop:             (225) 578-3424
Harrison Subsurface Lab:  (225) 578-4816
e-mail: gllore at lsu.edu
URL: http://www.geol.lsu.edu/jlorenzo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.mines.edu/pipermail/seisunix/attachments/20180410/1a4cb96a/attachment-0001.html>


More information about the seisunix mailing list