How to install Earthworm on Freebsd os

386 views
Skip to first unread message

budi satriyo

unread,
Feb 19, 2019, 7:19:04 PM2/19/19
to earthwo...@googlegroups.com
Dear All, 

Greetings, i am facing difficulties to install a Earthworm on Freebsd os, I already search literature/guidence to install earthworm on freebsd, but until now i have difficulties to found it on google, as far i know freebsd is unix-like operating system(not linux), i have some question about this: 

1. It does possible to install earthworm on freebsd os?

2. Does anyone had been install this before?

3. if possible and someone already install it, whould someone help me to get this manual? 

Thank you very much,

Budi

Stefan Lisowski

unread,
Feb 19, 2019, 7:21:23 PM2/19/19
to earthwo...@googlegroups.com
I haven't heard of anyone doing it in a while, but I bet you can get it
working.

What modules do you need to have running when you are done?

If you set the environment for, say, Linux by first editing and then
sourcing the environment file in the environment directory, and then in
the src directory you try to 'make unix', what kind of errors do you get?
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Earthworm Community Forum" group.
>
> To post to this group, send an email to earthwo...@googlegroups.com
>
> To unsubscribe from this group, send an email to
> earthworm_for...@googlegroups.com
>
> For more options, visit this group at
> http://groups.google.com/group/earthworm_forum?hl=en
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Earthworm Community Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to earthworm_for...@googlegroups.com
> <mailto:earthworm_for...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Larry Baker

unread,
Feb 19, 2019, 7:24:31 PM2/19/19
to earthwo...@googlegroups.com, Larry Baker
I would think if you start with the Mac OS X environment file, environment/ew_macosx_intel.sh, it might just work.  Mac OS X uses BSD libraries and kernel headers.

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



To unsubscribe from this group and stop receiving emails from it, send an email to earthworm_for...@googlegroups.com.

budi satriyo

unread,
Feb 21, 2019, 8:37:26 AM2/21/19
to earthwo...@googlegroups.com
Dear  Mr. Stefan,

Since on daily work i use freebsd as my os, i have some curios how to install it on this os,
I have done install in centos  7.5.1804 and also in ubuntu 14.04 LTS,
this is was a challenge for me .. cause freebsd is robust for me ( from my perspective ) and of course earthworm too, 
it is because it modular which is easy to know what is the first we need, like input module, then process module, also output module, after this success i only want to slink2ew and wave_serverV module .. just for testing purpose.   

I did try to install it from scratch, from this binary file "earthworm_7.9-src.tar.gz", I extract the zip file
as your suggestion i try from centos installation with file ew_linux.bash as source for katalog/decription where all the paths will be store,

on /opt/earthworm/earthworm_7.9/src/ folder i do commend "make unix" and this is the error .. 
Selection_NNN(030).png
Does there is something that i left behind .. please give me some clue Sir,

Many thanks before,
Regards,

Budi




To unsubscribe from this group and stop receiving emails from it, send an email to earthworm_for...@googlegroups.com.

Paul Friberg

unread,
Feb 21, 2019, 9:08:16 AM2/21/19
to Earthworm Community Forum
Hi Budi,

THanks for the screenshot. It looks like your CC environment variable is not being set to the gcc C compiler. Is GCC installed on the FREE BSD OS you have? If not, please install that  and gfortran as well, and also set the CC to gcc and FC to gfortran paths.

Cheers,

Paul
--
===================================
Paul Friberg   p.fr...@isti.com
CEO/Seismologist
ISTI==Instrumental Software Technologies, Inc.
Phone 845.256.9290  FAX 845.256.9299   Mobile +1.914.489.4888

Stefan Lisowski

unread,
Feb 21, 2019, 10:01:22 AM2/21/19
to earthwo...@googlegroups.com
Not sure if you saw Larry's comment, but he's right, start from the osx
intel environment file, and not the linux environment file.

And then yes, follow Paul's instructions to install gcc and gfortran if
you don't have them already.

On 2/20/2019 11:25 PM, budi satriyo wrote:
> Dear  Mr. Stefan,
>
> Since on daily work i use freebsd as my os, i have some curios how to
> install it on this os,
> I have done install in centos  7.5.1804 and also in ubuntu 14.04 LTS,
> this is was a challenge for me .. cause freebsd is robust for me ( from
> my perspective ) and of course earthworm too,
> it is because it modular which is easy to know what is the first we
> need, like input module, then process module, also output module, after
> this success i only want to slink2ew and wave_serverV module .. just for
> testing purpose.
>
> I did try to install it from scratch, from this binary file
> "earthworm_7.9-src.tar.gz", I extract the zip file
> as your suggestion i try from centos installation with file
> ew_linux.bash as source for katalog/decription where all the paths will
> be store,
>
> on /opt/earthworm/earthworm_7.9/src/ folder i do commend "make unix" and
> this is the error ..
> <mailto:earthwo...@googlegroups.com>
> >
> > To unsubscribe from this group, send an email to
> > earthworm_for...@googlegroups.com
> <mailto:earthworm_forum%2Bunsu...@googlegroups.com>
> >
> > For more options, visit this group at
> > http://groups.google.com/group/earthworm_forum?hl=en
> >
> > ---
> > You received this message because you are subscribed to the Google
> > Groups "Earthworm Community Forum" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to earthworm_for...@googlegroups.com
> <mailto:earthworm_forum%2Bunsu...@googlegroups.com>
> > <mailto:earthworm_for...@googlegroups.com
> <mailto:earthworm_forum%2Bunsu...@googlegroups.com>>.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Earthworm Community Forum" group.
>
> To post to this group, send an email to
> earthwo...@googlegroups.com
> <mailto:earthwo...@googlegroups.com>
>
> To unsubscribe from this group, send an email to
> earthworm_for...@googlegroups.com
> <mailto:earthworm_forum%2Bunsu...@googlegroups.com>
>
> For more options, visit this group at
> http://groups.google.com/group/earthworm_forum?hl=en
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Earthworm Community Forum" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to earthworm_for...@googlegroups.com
> <mailto:earthworm_forum%2Bunsu...@googlegroups.com>.

emum...@gmail.com

unread,
Mar 13, 2019, 8:58:18 AM3/13/19
to Earthworm Community Forum
Has anyone made any progress on this? I'm looking at the Mac OS environment script and while it looks simple to modify, I'm not sure of the environment variables. 

Jonathan

Stefan Lisowski

unread,
Mar 13, 2019, 7:39:15 PM3/13/19
to earthwo...@googlegroups.com
Try modifying it, source it, and then try to 'make unix' in src, and
send us output if you have issues.
> > <stefanl...@isti.com <javascript:> <mailto:stefanl...@isti.com
> > earthwo...@googlegroups.com <javascript:>
> >     <mailto:earthwo...@googlegroups.com <javascript:>>
> >      >
> >      > To unsubscribe from this group, send an email to
> >      > earthworm_for...@googlegroups.com <javascript:>
> >     <mailto:earthworm_forum%2Bunsu...@googlegroups.com
> <javascript:>>
> >      >
> >      > For more options, visit this group at
> >      > http://groups.google.com/group/earthworm_forum?hl=en
> <http://groups.google.com/group/earthworm_forum?hl=en>
> >      >
> >      > ---
> >      > You received this message because you are subscribed to
> the Google
> >      > Groups "Earthworm Community Forum" group.
> >      > To unsubscribe from this group and stop receiving emails
> from it,
> >     send
> >      > an email to earthworm_for...@googlegroups.com <javascript:>
> >     <mailto:earthworm_forum%2Bunsu...@googlegroups.com
> <javascript:>>
> >      > <mailto:earthworm_for...@googlegroups.com
> <javascript:>
> >     <mailto:earthworm_forum%2Bunsu...@googlegroups.com
> <javascript:>>>.
> >      > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
> >
> >     --
> >     --
> >     You received this message because you are subscribed to the
> Google
> >     Groups "Earthworm Community Forum" group.
> >
> >     To post to this group, send an email to
> > earthwo...@googlegroups.com <javascript:>
> >     <mailto:earthwo...@googlegroups.com <javascript:>>
> >
> >     To unsubscribe from this group, send an email to
> > earthworm_for...@googlegroups.com <javascript:>
> >     <mailto:earthworm_forum%2Bunsu...@googlegroups.com
> <javascript:>>
> >
> >     For more options, visit this group at
> > http://groups.google.com/group/earthworm_forum?hl=en
> <http://groups.google.com/group/earthworm_forum?hl=en>
> >
> >     ---
> >     You received this message because you are subscribed to the
> Google
> >     Groups "Earthworm Community Forum" group.
> >     To unsubscribe from this group and stop receiving emails from
> it,
> >     send an email to earthworm_for...@googlegroups.com <javascript:>
> >     <mailto:earthworm_forum%2Bunsu...@googlegroups.com
> <javascript:>>.
> >     For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
> >
> > --
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Earthworm Community Forum" group.
> >
> > To post to this group, send an email to
> earthwo...@googlegroups.com <javascript:>
> >
> > To unsubscribe from this group, send an email to
> > earthworm_for...@googlegroups.com <javascript:>
> >
> > For more options, visit this group at
> > http://groups.google.com/group/earthworm_forum?hl=en
> <http://groups.google.com/group/earthworm_forum?hl=en>
> >
> > ---
> > You received this message because you are subscribed to the Google
> > Groups "Earthworm Community Forum" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to earthworm_for...@googlegroups.com <javascript:>
> > <mailto:earthworm_for...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Earthworm Community Forum" group.
>
> To post to this group, send an email to earthwo...@googlegroups.com
>
> To unsubscribe from this group, send an email to
> earthworm_for...@googlegroups.com
>
> For more options, visit this group at
> http://groups.google.com/group/earthworm_forum?hl=en
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Earthworm Community Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to earthworm_for...@googlegroups.com
> <mailto:earthworm_for...@googlegroups.com>.

Larry Baker

unread,
Mar 13, 2019, 7:49:58 PM3/13/19
to emum...@gmail.com, earthwo...@googlegroups.com
Try these commands (they are the same commands I use on MacOS):

$ mkdir -p /opt/earthworm
$ cd /opt/earthworm
$ rm -f -r earthworm-svn
$ svn checkout svn://svn.isti.com/earthworm/trunk earthworm-svn
$ export EW_REV=rev <=== rev is the revision number of the svn checkout
$ rm -f -r earthworm-7.10-${EW_REV}
$ svn export -r ${EW_REV} earthworm-svn earthworm-7.10-${EW_REV}
$ ARCH=`uname -m`
$ EW_INSTALL_HOME="`pwd`" \
  EW_INSTALL_VERSION=earthworm-7.10-${EW_REV} \
  EW_INSTALL_BITS=32 \
  source earthworm-7.10-${EW_REV}/environment/ew_macosx_intel.sh
$ cd earthworm-7.10-${EW_REV}/src
$ make clean_unix 2>&1 | grep '[*][*][*]'
$ make clean_bin_unix 2>&1 | grep '[*][*][*]'
$ make unix &>../../make-freebsd-${ARCH}-${EW_BITS}.log
$ tail ../../make-freebsd-${ARCH}-${EW_BITS}.log
$ grep -i ': err' ../../make-freebsd-${ARCH}-${EW_BITS}.log
$ grep '[*][*][*]' ../../make-freebsd-${ARCH}-${EW_BITS}.log

Send the screen output.

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



To unsubscribe from this group and stop receiving emails from it, send an email to earthworm_for...@googlegroups.com.

emum...@gmail.com

unread,
Mar 15, 2019, 9:41:06 AM3/15/19
to Earthworm Community Forum
Hi Larry and Stefan,

Thank you for the assistance. I'm using gcc8, g++8, and gfortran8. Using Larry's commands, here is the output:

gmake unix
gmake: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src'
-*-*-*-*-*-*-*-*-*-*
Earthworm build info
-*-*-*-*-*-*-*-*-*-*
cd diagnostic_tools/buildinfo && \
        gmake -f makefile.unix clean ; \
        gmake -f makefile.unix clean_bin ; \
        gmake -f makefile.unix
gmake[1]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
rm -f a.out core *.o *.obj *% *~
gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
gmake[1]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
rm -f /home/closet/earthworm/earthworm-7.10-7917/bin/buildinfo /home/closet/earthworm/earthworm-7.10-7917/bin/buildinfo.exe
gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
gmake[1]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
gcc8 -m64 -g -pthread -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-pragmas -Wformat -Wdeclaration-after-statement -D_MACOSX -D_DARWIN_C_SOURCE -D_INTEL -D_USE_SCHED -pthread -D_USE_PTHREADS -D_DARWIN_USE_64_BIT_INODE -I/home/closet/earthworm/earthworm-7.10-7917/include -D_MACOSX -D_DARWIN_C_SOURCE -D_INTEL -D_USE_SCHED -pthread -D_USE_PTHREADS -D_DARWIN_USE_64_BIT_INODE -I/home/closet/earthworm/earthworm-7.10-7917/include  -c -o unixbuildinfo.o unixbuildinfo.c
gcc8 -o /home/closet/earthworm/earthworm-7.10-7917/bin/buildinfo -m64 -g -pthread -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-pragmas -Wformat -Wdeclaration-after-statement -D_MACOSX -D_DARWIN_C_SOURCE -D_INTEL -D_USE_SCHED -pthread -D_USE_PTHREADS -D_DARWIN_USE_64_BIT_INODE -I/home/closet/earthworm/earthworm-7.10-7917/include unixbuildinfo.o -lpthread
gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
buildinfo

buildinfo: MacOS EARTHWORM-64 build of Mar 13 2019 21:21:08

-*-*-*-*-*-*-*-*-*
Making C libraries
-*-*-*-*-*-*-*-*-*
gmake[1]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc'
----------
Making earlybird in: /home/closet/earthworm/earthworm-7.10-7917/src/libsrc/earlybird
gmake[2]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/earlybird'
gcc8 -m64 -g -pthread -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-pragmas -Wformat -Wdeclaration-after-statement -D_MACOSX -D_DARWIN_C_SOURCE -D_INTEL -D_USE_SCHED -pthread -D_USE_PTHREADS -D_DARWIN_USE_64_BIT_INODE -I/home/closet/earthworm/earthworm-7.10-7917/include -D_ADD_TRACE2_HEADER_ -D_MACOSX -D_DARWIN_C_SOURCE -D_INTEL -D_USE_SCHED -pthread -D_USE_PTHREADS -D_DARWIN_USE_64_BIT_INODE -I/home/closet/earthworm/earthworm-7.10-7917/include  -c -o filters.o filters.c
In file included from /home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:23,
                 from /home/closet/earthworm/earthworm-7.10-7917/include/earthworm.h:28,
                 from filters.c:19:
/home/closet/earthworm/earthworm-7.10-7917/include/platform.h:163:14: error: conflicting types for 'timer_t'
 typedef long timer_t;
              ^~~~~~~
In file included from /home/closet/earthworm/earthworm-7.10-7917/include/platform.h:130,
                 from /home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:23,
                 from /home/closet/earthworm/earthworm-7.10-7917/include/earthworm.h:28,
                 from filters.c:19:
/usr/include/sys/types.h:221:19: note: previous declaration of 'timer_t' was here
 typedef __timer_t timer_t;
                   ^~~~~~~
gmake[2]: *** [<builtin>: filters.o] Error 1
gmake[2]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/earlybird'
gmake[1]: *** [makefile.unix:53: earlybird] Error 2
gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc'
gmake: *** [Makefile:120: unix_libs] Error 2
gmake: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src'

What is wrong with that function?

Thank you.

Jonathan

    > For more options, visit https://groups.google.com/d/optout
   <https://groups.google.com/d/optout>.
--
--
You received this message because you are subscribed to the Google
Groups "Earthworm Community Forum" group.
To post to this group, send an email to earthwo...@googlegroups.com
To unsubscribe from this group, send an email to
earthworm_for...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/earthworm_forum?hl=en
---
You received this message because you are subscribed to the Google Groups "Earthworm Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to earthworm_for...@googlegroups.com <mailto:earthworm_forum+unsub...@googlegroups.com>.

For more options, visit https://groups.google.com/d/optout.

Larry Baker

unread,
Mar 16, 2019, 7:16:31 PM3/16/19
to emum...@gmail.com, earthwo...@googlegroups.com
This is caused by the OS-specific code in Earthworm include/platform.h.  Someone went through each of the operating systems Earthworm is built for and set up all the includes and other defines and typedefs needed by Earthworm.  It must be that Mac OS does not support timer_t, so a surrogate is typedef'd.  For your OS, timer_t apparently is supported, and there is a conflict with masquerading as Mac OS in that case.  You might try the Linux environment script, ew_linux.bash, in the same way  you tried the ew_macosx_intel.sh script to see if you get any farther.  Include the transcript of any errors, as you did here.


Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



emum...@gmail.com

unread,
Mar 17, 2019, 11:43:52 PM3/17/19
to Earthworm Community Forum
Hi Larry,

Thanks for the reply. Now I seem to have even more errors related to platform:

gmake unix

-*-*-*-*-*-*-*-*-*-*
Earthworm build info
-*-*-*-*-*-*-*-*-*-*
cd diagnostic_tools/buildinfo && \
        gmake -f makefile.unix clean ; \
        gmake -f makefile.unix clean_bin ; \
        gmake -f makefile.unix
gmake[1]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
rm -f a.out core *.o *.obj *% *~
gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
gmake[1]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
rm -f /usr/home/closet/earthworm/earthworm-7.10-7917/bin/buildinfo /usr/home/closet/earthworm/earthworm-7.10-7917/bin/buildinfo.exe

gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
gmake[1]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
gcc8    -c -o unixbuildinfo.o unixbuildinfo.c
gcc8 -o /usr/home/closet/earthworm/earthworm-7.10-7917/bin/buildinfo  unixbuildinfo.o -lpthread

gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/diagnostic_tools/buildinfo'
buildinfo

buildinfo: Unix EARTHWORM-64 build of Mar 17 2019 23:40:01


-*-*-*-*-*-*-*-*-*
Making C libraries
-*-*-*-*-*-*-*-*-*
gmake[1]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc'
----------
Making earlybird in: /usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/earlybird

gmake[2]: Entering directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/earlybird'
gcc8  -D_ADD_TRACE2_HEADER_   -c -o filters.o filters.c
In file included from /home/closet/earthworm/earthworm-7.10-7917/include/earthworm.h:28,
                 from filters.c:19:
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:75:1: error: unknown type name 'sema_t'; did you mean 'size_t'?
 sema_t *CreateSpecificSemaphore_ew( unsigned int count ); /* sema_ew.c    system-dependent */
 ^~~~~~
 size_t
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:79:34: error: unknown type name 'sema_t'; did you mean 'size_t'?
 void PostSpecificSemaphore_ew  ( sema_t * );              /* sema_ew.c    system-dependent */
                                  ^~~~~~
                                  size_t
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:80:34: error: unknown type name 'sema_t'; did you mean 'size_t'?
 void WaitSpecificSemaphore_ew  ( sema_t * );              /* sema_ew.c    system-dependent */
                                  ^~~~~~
                                  size_t
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:85:37: error: unknown type name 'sema_t'; did you mean 'size_t'?
 void DestroySpecificSemaphore_ew  ( sema_t * );           /* sema_ew.c    system-dependent */
                                     ^~~~~~
                                     size_t
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:94:27: error: unknown type name 'mutex_t'; did you mean 'rune_t'?
 void CreateSpecificMutex( mutex_t * );
                           ^~~~~~~
                           rune_t
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:95:26: error: unknown type name 'mutex_t'; did you mean 'rune_t'?
 void CloseSpecificMutex( mutex_t * );
                          ^~~~~~~
                          rune_t
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:96:28: error: unknown type name 'mutex_t'; did you mean 'rune_t'?
 void RequestSpecificMutex( mutex_t * );
                            ^~~~~~~
                            rune_t
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:97:28: error: unknown type name 'mutex_t'; did you mean 'rune_t'?
 void ReleaseSpecificMutex( mutex_t * );
                            ^~~~~~~
                            rune_t
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:101:1: warning: parameter names (without types) in function declaration
 void SocketClose  ( SOCKET    );            /* socket_ew.c  system-dependent */
 ^~~~
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:103:21: error: expected ')' before 'const'
 int sendall( SOCKET, const char *, long, int ); /* socket_ew.c  system-dependent */
                     ^~~~~~
                     )
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:113:17: error: unknown type name 'ew_thread_t'
 int WaitThread( ew_thread_t * );
                 ^~~~~~~~~~~
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:114:1: warning: parameter names (without types) in function declaration
 int KillThread( ew_thread_t );
 ^~~
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:116:18: error: unknown type name 'thr_ret'
 int StartThread( thr_ret (*fun)( void * ), unsigned int, ew_thread_t * );
                  ^~~~~~~
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:116:58: error: unknown type name 'ew_thread_t'
 int StartThread( thr_ret (*fun)( void * ), unsigned int, ew_thread_t * );
                                                          ^~~~~~~~~~~
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:117:25: error: unknown type name 'thr_ret'
 int StartThreadWithArg( thr_ret (*fun)( void * ), void *, unsigned int, ew_thread_t * );
                         ^~~~~~~
/home/closet/earthworm/earthworm-7.10-7917/include/earthworm_complex_funcs.h:117:73: error: unknown type name 'ew_thread_t'
 int StartThreadWithArg( thr_ret (*fun)( void * ), void *, unsigned int, ew_thread_t * );
                                                                         ^~~~~~~~~~~

gmake[2]: *** [<builtin>: filters.o] Error 1
gmake[2]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/earlybird'
gmake[1]: *** [makefile.unix:53: earlybird] Error 2
gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc'
gmake: *** [Makefile:120: unix_libs] Error 2

Is there something else I can change?

Thanks.

Jonathan

Larry Baker

unread,
Mar 18, 2019, 2:33:05 AM3/18/19
to emum...@gmail.com, earthwo...@googlegroups.com
Jonathan,

You did not source the ew_linux.bash environment script before running gmake unix.  Notice that the gcc8 command has very few arguments compared to your previous attempt.  Also, the output from buildinfo: says Unix; it should say Linux.

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



emum...@gmail.com

unread,
Mar 18, 2019, 7:07:50 AM3/18/19
to Earthworm Community Forum
Hi Larry,

Here is my terminal output:
EW_INSTALL_HOME="`pwd`" \
> EW_INSTALL_VERSION=earthworm-7.10-${EW_REV} \
> EW_INSTALL_BITS=32 \
> source earthworm-7.10-${EW_REV}/environment/ew_linux.bash
CC must be gcc
FC must be either gfortran or ifort

I am editing the file so gcc, g++, and gfortran are gcc8, g++8, and gfortran8. Should I set those variables myself instead?

Thanks.

Jonathan

emum...@gmail.com

unread,
Mar 18, 2019, 8:03:39 AM3/18/19
to Earthworm Community Forum
Hi Larry,

In the environment file, I have to set CC=gcc8, CXX=g++8, and FC=gfortran8. It must not be sourcing correctly after I edit those. Is there a way to fix that?

Thanks.

Jonathan

Larry Baker

unread,
Mar 18, 2019, 5:51:49 PM3/18/19
to earthwo...@googlegroups.com, Larry Baker
Jonathan,

Those compilers are not recognized by the ew_linux.bash script.  That is why you received the error messages.  Does your system not have a gcc, g++, and gfortran?  If not, I recommend you create soft links or use a tool like alternatives to set up aliases for gcc, g++, and gfortran to point to whatever compiler you use that is compatible.  (For example, on MacOS, gcc is not really GNU gcc, but Apple's clang/llvm.)  Otherwise, you'll have to edit ew_linux.bash to recognize gcc8, g++8, and gfortran8 and set up the environment variables to be the same as for gcc, g++, and gfortran.  Then your Earthworm make unix should have the complete commands it needs.

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



emum...@gmail.com

unread,
Mar 18, 2019, 10:37:55 PM3/18/19
to Earthworm Community Forum
Hi Larry,

Thanks for the tip. I symlinked gcc8, g++8, and gfortran8 and got a lot farther. There are a few errors that stopped the build. I highlighted the "error" text red:

gcc -m64 -g -pthread -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unknown-pragmas -Wno-pragmas -Wformat -Wdeclaration-after-statement -D_LINUX -Dlinux -D_INTEL -D_USE_SCHED -D_USE_PTHREADS -D_USE_TERMIOS -D_FILE_OFFSET_BITS=64 -I/usr/home/closet/earthworm/earthworm-7.10-7917/include -D_LINUX -Dlinux -D_INTEL -D_USE_SCHED -D_USE_PTHREADS -D_USE_TERMIOS -D_FILE_OFFSET_BITS=64 -I/usr/home/closet/earthworm/earthworm-7.10-7917/include  -c -o libnetserv.o libnetserv.c
libnetserv.c: In function 'open_socket':
libnetserv.c:200:48: error: 'IPPROTO_TCP' undeclared (first use in this function); did you mean 'IPT_TCP'?
   nsstr->npath = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP) ;
                                                ^~~~~~~~~~~
                                                IPT_TCP
libnetserv.c:200:48: note: each undeclared identifier is reported only once for each function it appears in
In file included from libtypes.h:43,
                 from libnetserv.h:34,
                 from libnetserv.c:48:
pascal.h:47:14: warning: passing argument 4 of 'lib_msg_add' from incompatible pointer type [-Wincompatible-pointer-types]
 #define addr &
libnetserv.c:211:64: note: in expansion of macro 'addr'
         lib_msg_add(nsstr->ns_par.stnctx, AUXMSG_SOCKETERR, 0, addr(s)) ;
                                                                ^~~~
In file included from libstrucs.h:57,
                 from libmsgs.h:44,
                 from libnetserv.c:52:
libclient.h:446:76: note: expected 'char (*)[96]' but argument is of type 'char (*)[64]'
 extern void lib_msg_add (tcontext ct, word msgcode, longword dt, string95 *msgsuf) ;
                                                                  ~~~~~~~~~~^~~~~~
libnetserv.c:221:8: error: dereferencing pointer to incomplete type 'struct sockaddr_in'
   psock->sin_family = AF_INET ;
        ^~
libnetserv.c:226:25: warning: implicit declaration of function 'htons' [-Wimplicit-function-declaration]
       psock->sin_port = htons(nsstr->ns_par.ns_port) ;
                         ^~~~~
libnetserv.c:227:28: error: 'INADDR_ANY' undeclared (first use in this function); did you mean 'INADDR_NONE'?
   psock->sin_addr.s_addr = INADDR_ANY ;
                            ^~~~~~~~~~
                            INADDR_NONE
In file included from libtypes.h:43,
                 from libnetserv.h:34,
                 from libnetserv.c:48:
pascal.h:47:14: warning: passing argument 4 of 'lib_msg_add' from incompatible pointer type [-Wincompatible-pointer-types]
 #define addr &
libnetserv.c:259:62: note: in expansion of macro 'addr'
         lib_msg_add(nsstr->ns_par.stnctx, AUXMSG_BINDERR, 0, addr(s)) ;
                                                              ^~~~
In file included from libstrucs.h:57,
                 from libmsgs.h:44,
                 from libnetserv.c:52:
libclient.h:446:76: note: expected 'char (*)[96]' but argument is of type 'char (*)[64]'
 extern void lib_msg_add (tcontext ct, word msgcode, longword dt, string95 *msgsuf) ;
                                                                  ~~~~~~~~~~^~~~~~
In file included from libtypes.h:43,
                 from libnetserv.h:34,
                 from libnetserv.c:48:
pascal.h:47:14: warning: passing argument 4 of 'lib_msg_add' from incompatible pointer type [-Wincompatible-pointer-types]
 #define addr &
libnetserv.c:284:64: note: in expansion of macro 'addr'
         lib_msg_add(nsstr->ns_par.stnctx, AUXMSG_LISTENERR, 0, addr(s)) ;
                                                                ^~~~
In file included from libstrucs.h:57,
                 from libmsgs.h:44,
                 from libnetserv.c:52:
libclient.h:446:76: note: expected 'char (*)[96]' but argument is of type 'char (*)[64]'
 extern void lib_msg_add (tcontext ct, word msgcode, longword dt, string95 *msgsuf) ;
                                                                  ~~~~~~~~~~^~~~~~
libnetserv.c:290:15: warning: implicit declaration of function 'ntohs' [-Wimplicit-function-declaration]
   host_port = ntohs(psock->sin_port) ;
               ^~~~~
In file included from libtypes.h:43,
                 from libnetserv.h:34,
                 from libnetserv.c:48:
pascal.h:47:14: warning: passing argument 4 of 'lib_msg_add' from incompatible pointer type [-Wincompatible-pointer-types]
 #define addr &
libnetserv.c:292:59: note: in expansion of macro 'addr'
   lib_msg_add(nsstr->ns_par.stnctx, AUXMSG_SOCKETOPEN, 0, addr(s)) ;
                                                           ^~~~
In file included from libstrucs.h:57,
                 from libmsgs.h:44,
                 from libnetserv.c:52:
libclient.h:446:76: note: expected 'char (*)[96]' but argument is of type 'char (*)[64]'
 extern void lib_msg_add (tcontext ct, word msgcode, longword dt, string95 *msgsuf) ;
                                                                  ~~~~~~~~~~^~~~~~
In file included from libtypes.h:43,
                 from libnetserv.h:34,
                 from libnetserv.c:48:
libnetserv.c: In function 'accept_ns_socket':
pascal.h:47:14: warning: passing argument 4 of 'lib_msg_add' from incompatible pointer type [-Wincompatible-pointer-types]
 #define addr &
libnetserv.c:338:67: note: in expansion of macro 'addr'
               lib_msg_add(nsstr->ns_par.stnctx, AUXMSG_ACCERR, 0, addr(s)) ;
                                                                   ^~~~
In file included from libstrucs.h:57,
                 from libmsgs.h:44,
                 from libnetserv.c:52:
libclient.h:446:76: note: expected 'char (*)[96]' but argument is of type 'char (*)[64]'
 extern void lib_msg_add (tcontext ct, word msgcode, longword dt, string95 *msgsuf) ;
                                                                  ~~~~~~~~~~^~~~~~
libnetserv.c:354:18: warning: implicit declaration of function 'ntohl'; did you mean 'atoll'? [-Wimplicit-function-declaration]
         showdot (ntohl(psock->sin_addr.s_addr), addr(hostname)) ;
                  ^~~~~
                  atoll
libnetserv.c:354:29: error: dereferencing pointer to incomplete type 'struct sockaddr_in'
         showdot (ntohl(psock->sin_addr.s_addr), addr(hostname)) ;
                             ^~
In file included from libtypes.h:43,
                 from libnetserv.h:34,
                 from libnetserv.c:48:
pascal.h:47:14: warning: passing argument 4 of 'lib_msg_add' from incompatible pointer type [-Wincompatible-pointer-types]
 #define addr &
libnetserv.c:384:60: note: in expansion of macro 'addr'
         lib_msg_add (nsstr->ns_par.stnctx, AUXMSG_CONN, 0, addr(s)) ;
                                                            ^~~~
In file included from libstrucs.h:57,
                 from libmsgs.h:44,
                 from libnetserv.c:52:
libclient.h:446:76: note: expected 'char (*)[96]' but argument is of type 'char (*)[64]'
 extern void lib_msg_add (tcontext ct, word msgcode, longword dt, string95 *msgsuf) ;
                                                                  ~~~~~~~~~~^~~~~~
In file included from libtypes.h:43,
                 from libnetserv.h:34,
                 from libnetserv.c:48:
libnetserv.c: In function 'read_from_client':
pascal.h:47:14: warning: passing argument 4 of 'lib_msg_add' from incompatible pointer type [-Wincompatible-pointer-types]
 #define addr &
libnetserv.c:438:69: note: in expansion of macro 'addr'
                 lib_msg_add(nsstr->ns_par.stnctx, AUXMSG_DISCON, 0, addr(s)) ;
                                                                     ^~~~
In file included from libstrucs.h:57,
                 from libmsgs.h:44,
                 from libnetserv.c:52:
libclient.h:446:76: note: expected 'char (*)[96]' but argument is of type 'char (*)[64]'
 extern void lib_msg_add (tcontext ct, word msgcode, longword dt, string95 *msgsuf) ;
                                                                  ~~~~~~~~~~^~~~~~
In file included from libtypes.h:43,
                 from libnetserv.h:34,
                 from libnetserv.c:48:
libnetserv.c: In function 'send_netserv_packet':
pascal.h:47:14: warning: passing argument 4 of 'lib_msg_add' from incompatible pointer type [-Wincompatible-pointer-types]
 #define addr &
libnetserv.c:500:67: note: in expansion of macro 'addr'
               lib_msg_add(nsstr->ns_par.stnctx, AUXMSG_DISCON, 0, addr(s)) ;
                                                                   ^~~~
In file included from libstrucs.h:57,
                 from libmsgs.h:44,
                 from libnetserv.c:52:
libclient.h:446:76: note: expected 'char (*)[96]' but argument is of type 'char (*)[64]'
 extern void lib_msg_add (tcontext ct, word msgcode, longword dt, string95 *msgsuf) ;
                                                                  ~~~~~~~~~~^~~~~~
libnetserv.c: In function 'lib_ns_start':
libnetserv.c:726:5: warning: assignment to 'char *' from incompatible pointer type 'uint8_t (*)[512]' {aka 'unsigned char (*)[512]'} [-Wincompatible-pointer-types]
   p = addr(nsstr->sync_record) ;
     ^
gmake[2]: *** [<builtin>: libnetserv.o] Error 1
rm libcvrt.o libarchive.o
gmake[2]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/lib330'
gmake[1]: *** [makefile.unix:53: lib330] Error 2

gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc'
gmake: *** [Makefile:120: unix_libs] Error 2

Thanks again!

Jonathan

Larry Baker

unread,
Mar 18, 2019, 11:01:21 PM3/18/19
to emum...@gmail.com, earthwo...@googlegroups.com
You probably do not need the lib330 library that is causing the problems.  That is only used for Q330 instruments.  Can you try running gmake with the option to ignore errors?  -k, I think.  You might end up with enough modules that work to at least run the Memphis test suite.

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



emum...@gmail.com

unread,
Mar 18, 2019, 11:32:10 PM3/18/19
to Earthworm Community Forum
Thanks Larry! I only need the PSNAdSend module for data acquisition. I have attached the log file of the whole compile. Many files were missing. Do I need freebsd includes?

Jonathan
make-freebsd-amd64-64.log

Larry Baker

unread,
Mar 19, 2019, 12:14:57 AM3/19/19
to emum...@gmail.com, earthwo...@googlegroups.com
Well, yes, you will need what other packagers call -devel or -dev add-ons.  I don't think that is it, though.  The errors I see in your log file look like you are either missing the correct IP networking development headers, or the "Linux" choices are not quite right for FreeBSD, so the definitions you need for FreeBSD are not being made.

I recently did an Earthworm build from a virgin VirtualBox Ubuntu disk image.  I had to install these packages:

$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
$ sudo apt-get install gfortran
$ sudo apt-get install g++-multilib
$ sudo apt-get install libc6-dev:i386
$ sudo apt-get install subversion

My old notes for setting up CentOS includes installing these add-on packages:

If necessary, install the 64- and 32-bit development tools.

# yum groupinstall "Development tools"
# yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686

Install the subversion tool (svn).

# yum install subversion

Forget lib330.  That is a mess.  But, for the other places where there are errors (like parse_ip_address), look at what gcc complains is missing or incomplete, and see if you can tell where FreeBSD would define those missing typedefs or function prototypes, and why they are not being included in the "Linux" compile.  See what man ip6 says on your system.  On my Mac, it shows a struct ip6_addr, which your compile says is missing.

Another idea is to try the Intel Solaris environment file, ew_sol_intel.bash.  Maybe that will bring in the correct headers for a BSD OS.

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



<make-freebsd-amd64-64.log>

emum...@gmail.com

unread,
Mar 19, 2019, 12:42:43 PM3/19/19
to Earthworm Community Forum
Hi Larry,

I do have all of the gcc libraries. I used EW_INSTALL_BITS=64 since this version builds all modules in 64 bit. Your suggestion to look at ipv6 led me to someone who suggested to look for #include <netdb.h> and add #include <netinet/in.h> and #include <arpa/inet.h> to those files. grep reported these files had #include <netdb.h>:

/home/closet/earthworm/earthworm-7.10-7917/include/platform.h
/home/closet/earthworm/earthworm-7.10-7917/src/display/webswave/mongoose.c
/home/closet/earthworm/earthworm-7.10-7917/src/seismic_processing/localmag/lm_ws.c
/home/closet/earthworm/earthworm-7.10-7917/src/seismic_processing/gmew/gm_ws.c
/home/closet/earthworm/earthworm-7.10-7917/src/reporting/ewhttpd/mongoose.c
/home/closet/earthworm/earthworm-7.10-7917/src/reporting/moleserv/mongoose.c
/home/closet/earthworm/earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_pthread.c
/home/closet/earthworm/earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_gethostbyname.c
/home/closet/earthworm/earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_net.c
/home/closet/earthworm/earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/extlib/yassl/src/socket_wrapper.cpp
/home/closet/earthworm/earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/libmysql/client.c
/home/closet/earthworm/earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/libmysql/libmysql.c
/home/closet/earthworm/earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/vio/vio_priv.h
/home/closet/earthworm/earthworm-7.10-7917/src/archiving/archman/libbgs/network.c
/home/closet/earthworm/earthworm-7.10-7917/src/data_exchange/slink2ew/libslink/slplatform.h
/home/closet/earthworm/earthworm-7.10-7917/src/data_exchange/ewexport2ringserver/src/network.c
/home/closet/earthworm/earthworm-7.10-7917/src/data_sources/psnadsend/PsnAdBoard/PSNADBoard.h
/home/closet/earthworm/earthworm-7.10-7917/src/data_sources/naqs2ew/nmxsrv_socket.c
/home/closet/earthworm/earthworm-7.10-7917/src/data_sources/nmxptool/lib/nmxp_win.c
/home/closet/earthworm/earthworm-7.10-7917/src/data_sources/nmxptool/lib/nmxp_base.c
/home/closet/earthworm/earthworm-7.10-7917/src/data_sources/palert_svr/eew.h
/home/closet/earthworm/earthworm-7.10-7917/src/data_sources/winsdr2ew/mseed/platform.h
/home/closet/earthworm/earthworm-7.10-7917/src/data_sources/tideweb2ew/http_fetcher.c
/home/closet/earthworm/earthworm-7.10-7917/src/data_sources/reboot_mss/rb_sol.c
/home/closet/earthworm/earthworm-7.10-7917/src/data_sources/reboot_mss/rb_lin.c
/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/libdali/parse_ip_address.c
/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/libdali/portable.h
/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/unix/tcpaccept_ew.c
/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/unix/setuptcpclient_ew.c
/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/unix/setuptcpserver_ew.c
/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/lib330/platform.h

I added those two includes to the files that did not have them. This seemed to fix the ip6 errors. Now, it stops on one single error:
qtime.c: In function 'unix_time_from_ext_time':
qtime.c:1790:25: error: invalid operands to binary - (have 'time_t' {aka 'long int'} and 'char * (*)(int,  int)')
     gtime = mktime(&tm) - timezone;
             ~~~~~~~~~~~ ^
gmake[2]: *** [Makefile:157: lib64/libqlib2.a] Error 1
gmake[2]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc/qlib2'
mkdir -p lib_ew
cp lib64/*.a lib_ew/
cp: lib64/*.a: No such file or directory
gmake[1]: *** [makefile.unix:90: qlib264] Error 1

gmake[1]: Leaving directory '/usr/home/closet/earthworm/earthworm-7.10-7917/src/libsrc'
gmake: *** [Makefile:120: unix_libs] Error 2

What do you think of that function?

Thank you.

Jonathan
...

emum...@gmail.com

unread,
Mar 19, 2019, 1:15:06 PM3/19/19
to Earthworm Community Forum
Hi Larry,

I think I fixed that issue. I'd like to document these steps so everyone can benefit. In earthworm-7.10-7917/src/libsrc/qlib2/qtime.c, I added || defined (___FreeBSD___) to line 1784 and gcc compiled it. It looks like:
 /* Map into units required by unix time routines.           */
    /*  NOTE - Posix time does not deal with leapseconds.       */
    /*  Therefore, if this is a leapsecond, set it to be the    */
    /*  the previous second.                                    */

    tm.tm_sec = (et.second < 60) ? et.second : 59;
    tm.tm_min = et.minute;
    tm.tm_hour = et.hour;
    tm.tm_mday = et.day;                        /* 1-31         */
    tm.tm_mon = et.month - 1;                   /* 0-11         */
    tm.tm_year = et.year - 1900;                /* year - 1900  */
    tm.tm_wday = 0;
    tm.tm_yday = et.doy - 1;                    /* 0-365        */
    tm.tm_isdst =0;
#if defined(SUNOS) || defined (MACOSX) || defined(__MACH__) || defined(__FreeBSD__)
    tm.tm_zone = "GMT";
    tm.tm_gmtoff = 0;
    gtime = timegm (&tm);
#else
    tzset();

    gtime = mktime(&tm) - timezone;
#endif

It stopped on another error that I'm investigating

Thanks again.

Jonathan
...

Larry Baker

unread,
Mar 19, 2019, 3:00:57 PM3/19/19
to emum...@gmail.com, earthwo...@googlegroups.com, Alex Schnackenberg
Jonathan,

Good progress.  Please find out if there is a *BSD macro that will let your fix work with any of the Open/Free/BSD variants, assuming they all use the same code base.

Also, please send us the patches you made to add the missing #include files.  IPv6 support is new in Earthworm, officially supported for the first time in the upcoming 7.10 release.  It would be nice to have your fixes make it into the 7.10 release.  I have CC'd Alex Schnackenberg at ISTI so he knows that there may be some missing IPv6 #includes.

FYI.  When I am working on the code and I want to know what has changed from the SVN checkout, I run this command from my Desktop/Software/Earthworm top-level folder that contains both the SVN checkout and the EW_REV export I am editing:

( cd earthworm-svn ; find * -type f -exec diff -q {} ../earthworm-7.10-${EW_REV}/{} ';' )

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



To unsubscribe from this group and stop receiving emails from it, send an email to earthworm_for...@googlegroups.com.

emum...@gmail.com

unread,
Mar 19, 2019, 8:35:36 PM3/19/19
to Earthworm Community Forum
Hi Larry and Alex,

I was actually able to get everything to compile without errors! It compiled 64-bit too. On FreeBSD, you get linker errors looking for the 32-bit libraries if you try to compile in 32-bit. I don't know if you can install the 32-bit libraries separately or not. Here is a summary of what I did:
 
1. Symlink gcc8, g++8, and gfortran8 to gcc, g++, and gfortran.
2. Used bash instead of FreeBSD's /bin/sh to stay compatible with ew_linux.bash
3. Edited ew_linux.bash to change the earthworm install directory and added -Wl,-rpath=/usr/local/lib/gcc8 to the gfortran options so fortran programs are linked correctly. See here for my issue I had with another program.
4. Used Larry's commands after downloading the latest svn version:
export EW_REV=7917
ARCH=`uname -m`
EW_INSTALL_HOME="`pwd`" \
EW_INSTALL_VERSION=earthworm-7.10-${EW_REV} \
EW_INSTALL_BITS=64 \
source earthworm-7.10-${EW_REV}/environment/ew_linux.bash

5. after gmake clean_unix and gmake clean_bin_unix, I ran gmake unix. Here is a summary of the changes I made to files that produced errors:
A. Added #include <netinet/in.h> and #include <arpa/inet.h> to the following files containing #include <netdb.h>:
earthworm-7.10-7917/include/platform.h
earthworm-7.10-7917/src/display/webswave/mongoose.c
earthworm-7.10-7917/src/seismic_processing/localmag/lm_ws.c
earthworm-7.10-7917/src/seismic_processing/gmew/gm_ws.c
earthworm-7.10-7917/src/reporting/ewhttpd/mongoose.c
earthworm-7.10-7917/src/reporting/moleserv/mongoose.c
earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_pthread.c
earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_gethostbyname.c
earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_net.c
earthworm-7.10-7917/src/libsrc/libdali/parse_ip_address.c
earthworm-7.10-7917/src/libsrc/libdali/portable.h
earthworm-7.10-7917/src/libsrc/unix/tcpaccept_ew.c
earthworm-7.10-7917/src/libsrc/unix/setuptcpclient_ew.c
earthworm-7.10-7917/src/libsrc/unix/setuptcpserver_ew.c
earthworm-7.10-7917/src/libsrc/lib330/platform.h
I just used grep to locate which files containing #include <netdb.h>. I think the ones that affected the build were in libsrc and include/platform.h
B. Made the following modifications to the files:
earthworm-7.10-7917/src/libsrc/unix/transport.c
comment out line 984 and 1898

earthworm-7.10-7917/src/libsrc/unix/remote_copy.c
line 40 wait.h to sys/wait.h

earthworm-7.10-7917/src/libsrc/unix/copyfile.c
line 42 wait.h to sys/wait.h

earthworm-7.10-7917/src/libsrc/util/startstop_unix_generic.c
replace O_NDELAY with O_NOCTTY on two lines and __WALL with P_ALL on multiple lines

earthworm-7.10-7917/src/libsrc/qlib2/qtime.c
line 1784 add || defined(__FreeBSD__) to end of line

earthworm-7.10-7917/src/data_exchange/getfile_ew/getfile_socket.c
comment out lines 55, 56, 57

earthworm-7.10-7917/src/reporting/ewhttpd/mongoose.c
line 1587 and 3340 replace PF_INET with AF_INET

earthworm-7.10-7917/src/seismic_processing/evanstrig/mutils.c and mutils.h
rewrite time functions to use gettimeofday instead of the old ftime

6. gmake unix and everything compiled without any errors.

Attached is my log. I'll need to create the diff file and also test earthworm now that everything is compiled.

More to come.

Thanks Larry.

Jonathan
...
make-freebsd-amd64-64.log

emum...@gmail.com

unread,
Mar 19, 2019, 8:52:10 PM3/19/19
to Earthworm Community Forum
For the last file I changed with evanstrig, apparently I could pass -lcompat to gcc so it would link properly and could use ftime. Attached are my file rewrites. I'm not an expert, so it might be bad or wrong code. Let me know what you think. I believe I can add -lcompat to the end of the first line of the evanstrig makefile, right?

Jonathan
...
mutils.c
mutils.h

Larry Baker

unread,
Mar 19, 2019, 9:06:41 PM3/19/19
to earthwo...@googlegroups.com, Larry Baker
Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



On 19 Mar 2019, at 5:35:36 PM, <emum...@gmail.com> <emum...@gmail.com> wrote:

Hi Larry and Alex,

I was actually able to get everything to compile without errors! It compiled 64-bit too. On FreeBSD, you get linker errors looking for the 32-bit libraries if you try to compile in 32-bit. I don't know if you can install the 32-bit libraries separately or not.

As I showed you for Ubuntu and CentOS (both x86_64 installations), I had to install the i686 or multilib packages for 32-bit development to work.  That is optional, of course, unless you have trouble and want to compare a 64-bit build to a 32-bit build.  personally, I do not trust the 64-bit code yet; I run 32-bit Earthworm on my CentOS x86_64 boxes.

Here is a summary of what I did:
 
1. Symlink gcc8, g++8, and gfortran8 to gcc, g++, and gfortran.

I think I may edit the Linux script to accept gcc* and gfortran*, on the assumption that they are gcc and gfortran of some flavor.

2. Used bash instead of FreeBSD's /bin/sh to stay compatible with ew_linux.bash

Yes, I have to do the same when I log in to the Ubuntu box I borrow.  The account I use is a C shell account.  I have to be sure to run /bin/bash, not /bin/sh.

3. Edited ew_linux.bash to change the earthworm install directory and added -Wl,-rpath=/usr/local/lib/gcc8 to the gfortran options so fortran programs are linked correctly. See here for my issue I had with another program.

You can save yourself the step to "Edited ew_linux.bash to change the earthworm install directory".  The "EW_INSTALL_HOME="`pwd`"" before the source command does that for you.

I am puzzled by the need to add the lib path for gfortran8.  It has been my impression that the gcc and gfortran compilers know to look in the same path as the executable.  perhaps the soft link confuses gfortran.

4. Used Larry's commands after downloading the latest svn version:
export EW_REV=7917
ARCH=`uname -m`
EW_INSTALL_HOME="`pwd`" \
EW_INSTALL_VERSION=earthworm-7.10-${EW_REV} \
EW_INSTALL_BITS=64 \
source earthworm-7.10-${EW_REV}/environment/ew_linux.bash

5. after gmake clean_unix and gmake clean_bin_unix, I ran gmake unix. Here is a summary of the changes I made to files that produced errors:

Gold mine.  Especially the missing #include <netinet/in.h> and #include <arpa/inet.h> for IPv6 support.  They indicate that, at least for some systems, the code is relying on them being implicitly included, rather than being explicit about what it needs.  Those edits should really be made before the Earthworm 7.10 release.  And changing<wait.h> to <sys/wait.h>.  When I did a man wait, it said to include sys/wait.h.  I have no idea why the code uses wait.h, or why that works at all.

To unsubscribe from this group and stop receiving emails from it, send an email to earthworm_for...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<make-freebsd-amd64-64.log>

emum...@gmail.com

unread,
Mar 19, 2019, 11:00:36 PM3/19/19
to Earthworm Community Forum
Hi Larry,

Unfortunately, gcc8 on FreeBSD does not support multilib yet, however the gcc8-devel port did just add support today. If this version of the Earthworm code did not support 64-bit compilation on all modules, I would have never been able to compile it. Once gcc8 is updated, I can compile the 32-bit version.

The issue with gfortran is apparently an issue with FreeBSD's linker, not gfortan itself. I'm not sure if there is an official solution.

Thanks for reminding me about "EW_INSTALL_HOME="`pwd`"".

I'll get a diff file and look into testing it next.

Thanks.

Jonathan
                           &nb

Larry Baker

unread,
Mar 20, 2019, 5:29:03 AM3/20/19
to earthwo...@googlegroups.com
I think on CentOS (older ones, at least), there is no multilib either; you have to install the i686 packages.  Then, -m32 compiles and links pick the lib libraries instead of the lib64 libraries.

Actually, you may have noticed that there is an option for the Linux ew_linux.bash to leave EW_INSTALL_BITS unspecified.  In that case, no -m32 or -m64 is used; you get the default for your system.  EW_BITS is still required for qlib2.  ew_linux.bash looks at the gcc output and deduces what EW_BITS is on your system.  If all you want is a "native" Earthworm build, you can leave out EW_INSTALL_BITS altogether.

I think you've done yeoman's work already.  I'd like to see a lot of what you did in the 7.10 release.  But, that is up to ISTI.

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



Paul Friberg

unread,
Mar 20, 2019, 1:57:11 PM3/20/19
to Earthworm Community Forum

Thanks Jonathan and Larry.

I made the include changes for sys/wait.h and the socket  includes, but put the latter in socket_ew.h for now to cover a lot of territory. The other changes will have to wait for after 7.10 is released.

Paul

Larry Baker

unread,
Mar 20, 2019, 2:52:42 PM3/20/19
to earthwo...@googlegroups.com, Larry Baker
but put the latter in socket_ew.h for now to cover a lot of territory

I think that is okay for now, but not a good idea in the long run.  Each C source module that makes use of a function or data type should explicitly include the correct .h file, as documented in the man pages.  It is poor practice to rely on hidden side effects of other .h files.  After the 7.10 release, I will go through the files Jonathan mentioned and fix them.

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



emum...@gmail.com

unread,
Mar 20, 2019, 10:58:41 PM3/20/19
to Earthworm Community Forum
Thanks Larry! I appreciate all of your help! I read that on FreeBSD, even with 32-bit libs, the linker won't link properly. I had this issue when I tried to build Earthworm 7.3. It will using FreeBSD's clang, but I'm not even sure if it or modules would compile. The good thing is that there will be a new version of gcc8 with multilib support.

I'm not sure if there is a *BSD macro that will allow all BSD variants to work. I only had to use || defined(__FreeBSD__) once. Have any of you guys looked at my mutils.c and mutils.h? The first two functions used ftime to get time of day for Evanstrig, but I rewrote it to use gettimeofday. The difference between the two is that ftime had a precision time value in ms and gettimeofday has a precision time value in us. I changed the divisor and believe the function should report a more accurate value. Did I make a mistake?

Also, here is a list of files I edited. Should I create a patch file to better document everything?

 find * -type f -exec diff -q {} ../earthworm-7.10-${EW_REV}/{} ';'
diff: ../earthworm-7.10-7917/debian/.DS_Store: No such file or directory
Files environment/ew_linux.bash and ../earthworm-7.10-7917/environment/ew_linux.bash differ
Files environment/ew_macosx_intel.sh and ../earthworm-7.10-7917/environment/ew_macosx_intel.sh differ
Files include/transport.h and ../earthworm-7.10-7917/include/transport.h differ
Files include/startstop_unix_generic.h and ../earthworm-7.10-7917/include/startstop_unix_generic.h differ
Files include/earlybirdlib.h and ../earthworm-7.10-7917/include/earlybirdlib.h differ
Files include/socket_ew.h and ../earthworm-7.10-7917/include/socket_ew.h differ
Files src/seismic_processing/evanstrig/mutils.h and ../earthworm-7.10-7917/src/seismic_processing/evanstrig/mutils.h differ
Files src/seismic_processing/evanstrig/mutils.c and ../earthworm-7.10-7917/src/seismic_processing/evanstrig/mutils.c differ
Files src/reporting/ewhttpd/mongoose.c and ../earthworm-7.10-7917/src/reporting/ewhttpd/mongoose.c differ
Files src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_pthread.c and ../earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_pthread.c differ
Files src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_gethostbyname.c and ../earthworm-7.10-7917/src/archiving/mole/mysql-connector-c-6.0.2/mysys/my_gethostbyname.c differ
Files src/data_exchange/ewexport2ringserver/src/network.c and ../earthworm-7.10-7917/src/data_exchange/ewexport2ringserver/src/network.c differ
Files src/data_exchange/getfile_ew/getfile_socket.c and ../earthworm-7.10-7917/src/data_exchange/getfile_ew/getfile_socket.c differ
Files src/data_sources/naqs2ew/nmxsrv_socket.c and ../earthworm-7.10-7917/src/data_sources/naqs2ew/nmxsrv_socket.c differ
Files src/libsrc/libdali/parse_ip_address.c and ../earthworm-7.10-7917/src/libsrc/libdali/parse_ip_address.c differ
Files src/libsrc/unix/tcpaccept_ew.c and ../earthworm-7.10-7917/src/libsrc/unix/tcpaccept_ew.c differ
Files src/libsrc/unix/setuptcpclient_ew.c and ../earthworm-7.10-7917/src/libsrc/unix/setuptcpclient_ew.c differ
Files src/libsrc/unix/copyfile.c and ../earthworm-7.10-7917/src/libsrc/unix/copyfile.c differ
Files src/libsrc/unix/socket_ew.c and ../earthworm-7.10-7917/src/libsrc/unix/socket_ew.c differ
Files src/libsrc/unix/remote_copy.c and ../earthworm-7.10-7917/src/libsrc/unix/remote_copy.c differ
Files src/libsrc/unix/setuptcpserver_ew.c and ../earthworm-7.10-7917/src/libsrc/unix/setuptcpserver_ew.c differ
Files src/libsrc/unix/transport.c and ../earthworm-7.10-7917/src/libsrc/unix/transport.c differ
Files src/libsrc/qlib2/qtime.c and ../earthworm-7.10-7917/src/libsrc/qlib2/qtime.c differ
Files src/libsrc/lib330/platform.h and ../earthworm-7.10-7917/src/libsrc/lib330/platform.h differ
Files src/libsrc/earlybird/filters.c and ../earthworm-7.10-7917/src/libsrc/earlybird/filters.c differ
Files src/libsrc/util/startstop_unix_generic.c and ../earthworm-7.10-7917/src/libsrc/util/startstop_unix_generic.c differ

Thanks.

Jonathan
                                                      &

Larry Baker

unread,
Mar 21, 2019, 5:44:23 AM3/21/19
to earthwo...@googlegroups.com

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov




On Mar 20, 2019, at 7:58 PM, <emum...@gmail.com> <emum...@gmail.com> wrote:

Thanks Larry! I appreciate all of your help! I read that on FreeBSD, even with 32-bit libs, the linker won't link properly. I had this issue when I tried to build Earthworm 7.3. It will using FreeBSD's clang, but I'm not even sure if it or modules would compile. The good thing is that there will be a new version of gcc8 with multilib support.

I'm not sure if there is a *BSD macro that will allow all BSD variants to work. I only had to use || defined(__FreeBSD__) once.

I can do some Internet searching to find that out.

Have any of you guys looked at my mutils.c and mutils.h? The first two functions used ftime to get time of day for Evanstrig, but I rewrote it to use gettimeofday. The difference between the two is that ftime had a precision time value in ms and gettimeofday has a precision time value in us. I changed the divisor and believe the function should report a more accurate value. Did I make a mistake?

I am not a principal Earthworm developer.  I can't answer questions like you raised above.  I am an Earthworm user with almost four decades of real-time data acquisition systems development experience, mainly on systems I developed many years ago that have been retired.

After 7.10 is out, I would not mind working with you to find the places where *BSD support is missing so you can have a clean build.  I have to get back to my real job for a bit and then I plan to get back to cleaning up Earthworm some more.  I use Earthworm for structural health monitoring.  My instrumentation is multi-channel spread throughout a structure, e.g., a high-rise building.  I insist on ultra-reliable code.  My reading of the code is that it is still not trustworthy when compiled for 64 bits.  But, we have to face the fact that most everything will only be 64 bits before too long, except maybe for ARM SoCs.  I happen to like ARM SoCs, where I am perfectly happy to run 32 bit Earthworm.

Also, here is a list of files I edited. Should I create a patch file to better document everything?

diff will do that for you.  In place of "diff -q", I use "diff -U 1".  (diff -U 1 is the same as diff -u, but with fewer lines of context.  Makes patches easier to read.)

find * -type f -not -name .DS_Store -exec diff -U 1 {} ../earthworm-7.10-${EW_REV}/{} ';' >earthworm-bsd.patch

Larry Baker

unread,
Mar 23, 2019, 2:29:24 AM3/23/19
to emum...@gmail.com, earthwo...@googlegroups.com
I'm not sure if there is a *BSD macro that will allow all BSD variants to work. I only had to use || defined(__FreeBSD__) once. 

I can do some Internet searching to find that out.

Looks like there may be a BSD pre-defined macro we can use.  See Operating Environments in:

http://beefchunk.com/documentation/lang/c/pre-defined-c/preos.html

Larry Baker
US Geological Survey
650-329-5608
ba...@usgs.gov



Jonathan CCFL_Man

unread,
Dec 23, 2019, 12:04:31 AM12/23/19
to Earthworm Community Forum
Hi All,

I was able to have good success getting 7.10 to build in FreeBSD. I'm currently down to two errors. The work I've done on 7.10 rev 7917 was wrong and almost all of the problems in compiling were missing includes. I will prepare a list of changes to share once I'm done hashing out the errors. In 7917, I replaced a lot of functions with incorrect ones to get it to build and that is obviously wrong. In the final version of 7.10, I have not replaced anything and kept all code intact. I will keep you updated.

Jonathan
Reply all
Reply to author
Forward
0 new messages