Ticket #544 (closed task: fixed)

Opened 3 years ago

Last modified 10 months ago

Porting earthworm to 64bit linux

Reported by: dthies Owned by: et
Priority: major Milestone: Linux 64bit
Component: ALL modules Version: 7.9
Keywords: Cc:

Description (last modified by et) (diff)

update libqlib2 to the latest version

create flag in Makefile for bitness

fix fortrans compile targets FFLAGS

fix c and c++ compile targets CFLAGS CPPFLAGS

in libraries requiring qlib2 make the linker link to the appropriate library.

in qlib2 making only the correct version as 32bit systems cannot build the 32 bit

Change History

comment:1 Changed 3 years ago by et

  • Owner changed from somebody to et
  • Status changed from new to assigned
  • Version set to 7.9
  • Description modified (diff)
  • Milestone set to Linux 64bit

Modifications to support building for 64-bit targets (Linux and Windows) are in the 'ew64mods' branch: svn checkout svn://svn.isti.com/earthworm/branches/ew64mods

The 'ew64mods' branch supersedes the 'win64mods' branch, and it will soon be merged into the trunk.

See the updated 'environment/ew_linux.bash' file for the settings to target a 64-bit platform. Basically, it's just setting EWBITS to 32 or 64. A basic set of complier-warning flags have been added, and a more comprehensive set (for use during development) are noted in the comments.

As far as I can tell at the time of this writing, all the modules build and run successfully as 64-bit-Linux binaries. (Of course, more testing should be done.) One caveat is that tank files built by the 'wave_serverV' module (in the 'tnk' directory) are not compatible between 32-bit and 64-bit versions.

As an FYI, the biggest issue for 64-bit Linux is that the size of the 'long' type changes from 4 bytes to 8 bytes. Places in the code that depended on the size of the 'long' type (like structures with defined sizes) needed to be modifed. The 'int32_t' and similar types are now defined for all platforms, and are now used in many places in favor of 'long' types. The 'SwapLong()' function (in "libsrc/util/swap.c") has been changed to 'SwapInt32()'.

The other thing to watch out for are format strings for 'printf'-type statements assuming that 'int' and 'long' variables are interchangable. The default compiler warning flags now include "-Wextra -Werror=format" so that the build fails if any mismatches are found between the 'printf'-type format strings and their associated parameters.

The Makefile for 'libsrc' now sets up a "qlib2/lib_ew" directory with 32/64-bit specific libraries for modules to reference.

The 'qlib2' library has been updated to the "1.53 2013.260" version (found in the "qlib2.2016.011.tar.gz" at http://quake.geo.berkeley.edu/qug/software/ucb ). The Makefile was modified to use global 'CC' and GLOBALFLAGS and to not specify the '-Wall' parameter (caused error on Solaris build with 'cc').

The module 'data_sources/nmxptool' was updated to version 2.1.2 (2015/06/26) from http://mednet.rm.ingv.it/nmxptool.php .


comment:2 Changed 3 years ago by et

The 'ew64mods' branch was merged into the SVN 'trunk' on 2016-09-09: http://earthworm.isti.com/trac/earthworm/changeset/6803/trunk

The 'trunk' should build without errors on the various platforms.

Also, these modules now all have 'makefile.nt' files and build OK under Windows:

  • seismic_processing/Mm
  • seismic_processing/Ms
  • seismic_processing/Theta

(So far I haven't run any of them under Windows).

At this point the 'ew64mods' branch should be considered obsolete.


comment:3 Changed 10 months ago by stefan

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.