[Seisunix] Trouble compiling seg2segy

Haines, Seth shaines at usgs.gov
Mon Apr 9 16:48:55 MDT 2018

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

    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

   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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.mines.edu/pipermail/seisunix/attachments/20180409/ce951a0b/attachment.html>

More information about the seisunix mailing list