Ununtu 21.04 compilation issue

53 views
Skip to first unread message

Andrey Stepnov

unread,
Sep 3, 2021, 5:02:00 AM9/3/21
to earthworm_forum
Hi Community!

The issue arises during compilation on latest ubuntu server.

It looks like this on `system_control` source:

```
Making unix_modules in: /opt/ew/earthworm_7.10/src/system_control
make[1]: Entering directory '/opt/ew/earthworm_7.10/src/system_control'
----------
Making unix_modules in: /opt/ew/earthworm_7.10/src/system_control/pau
make[2]: Entering directory '/opt/ew/earthworm_7.10/src/system_control/pau'
gcc -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 -ltirpc -I/opt/ew/earthworm_7.10/include -I/usr/include -D_LINUX -Dlinux -D_INTEL -D_USE_SCHED -D_USE_PTHREADS -D_USE_TERMIOS -D_FILE_OFFSET_BITS=64 -ltirpc -I/opt/ew/earthworm_7.10/include -I/usr/include -c -o pau.o pau.c
gcc -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 -ltirpc -I/opt/ew/earthworm_7.10/include -I/usr/include -D_LINUX -Dlinux -D_INTEL -D_USE_SCHED -D_USE_PTHREADS -D_USE_TERMIOS -D_FILE_OFFSET_BITS=64 -ltirpc -I/opt/ew/earthworm_7.10/include -I/usr/include -c -o setflags.o setflags.c
gcc -o /opt/ew/earthworm_7.10/bin/pau -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 -ltirpc -I/opt/ew/earthworm_7.10/include -I/usr/include pau.o setflags.o /opt/ew/earthworm_7.10/lib/dirops_ew.o -L/opt/ew/earthworm_7.10/lib -lew_mt -lpthread
/usr/bin/ld: /opt/ew/earthworm_7.10/lib/libew_mt.a(getutil.o):/opt/ew/earthworm_7.10/include/startstop_lib.h:248: multiple definition of `oldNChild'; pau.o:/opt/ew/earthworm_7.10/include/startstop_lib.h:248: first defined here
/usr/bin/ld: /opt/ew/earthworm_7.10/lib/libew_mt.a(getutil.o):/opt/ew/earthworm_7.10/include/startstop_lib.h:249: multiple definition of `newNRing'; pau.o:/opt/ew/earthworm_7.10/include/startstop_lib.h:249: first defined here
/usr/bin/ld: /opt/ew/earthworm_7.10/lib/libew_mt.a(getutil.o):/opt/ew/earthworm_7.10/include/startstop_lib.h:253: multiple definition of `badProcessID'; pau.o:/opt/ew/earthworm_7.10/include/startstop_lib.h:253: first defined here
/usr/bin/ld: /opt/ew/earthworm_7.10/lib/libew_mt.a(getutil.o):/opt/ew/earthworm_7.10/include/startstop_lib.h:255: multiple definition of `lockfile'; pau.o:/opt/ew/earthworm_7.10/include/startstop_lib.h:255: first defined here
/usr/bin/ld: /opt/ew/earthworm_7.10/lib/libew_mt.a(getutil.o):/opt/ew/earthworm_7.10/include/startstop_lib.h:256: multiple definition of `lockfile_fd'; pau.o:/opt/ew/earthworm_7.10/include/startstop_lib.h:256: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [makefile.unix:23: /opt/ew/earthworm_7.10/bin/pau] Error 1
make[2]: Leaving directory '/opt/ew/earthworm_7.10/src/system_control/pau'
```

And for every next module, the ld error the same.

After a little investigation, I found that the default compiler is too new: `gcc-10` (installed by default). So the fix is to use gcc-8:

```
apt install build-essential gfortran gcc-8 g++-8
```

And fix `ew_linux.bash` env's:

```
...
export CC=gcc-8
export CXX=g++-8
if [ "${CC}" = "gcc-8" ] ; then
...
```

Maybe it will save some time for someone.

Have a nice day!

Andrey Stepnov

Paul Friberg

unread,
Sep 3, 2021, 4:32:31 PM9/3/21
to Earthworm Community Forum
Thanks Andrey!!! That will help.

Paul

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/earthworm_forum/YTHkgmNbLKIzisT1%40MacBook-Pro-Andrey.local.


--
===================================
Paul Friberg   p.fr...@isti.com
CEO/Seismologist
ISTI==Instrumental Software Technologies, Inc.
Phone +1.518.602.0001  

Kevin Frechette

unread,
Sep 4, 2021, 6:15:55 AM9/4/21
to earthwo...@googlegroups.com
Note: When using a fresh checkout of the latest Earthworm (git clone https://gitlab.com/seismic-software/earthworm.git) it compiles fine with the default gcc (version 10.3.0) compiler.

On Fri, Sep 3, 2021 at 5:02 AM Andrey Stepnov <myj...@gmail.com> wrote:

Andrey Stepnov

unread,
Sep 6, 2021, 8:17:55 AM9/6/21
to earthwo...@googlegroups.com
Hi Kevin!

I have the same error with earthworm-working and gcc 10.0.3.

I also report that trig2disk was not compiled with either gcc-8 or gcc-10 (for both working and 7.10.1).

Andrey
> To view this discussion on the web visit https://groups.google.com/d/msgid/earthworm_forum/CAKjjztqqqvkE-o%3DLYJ%2BpjhD3dk%2BcfezTN%3DZHpoWpSoWxOMixEw%40mail.gmail.com.

Jean-Marie SAUREL

unread,
Sep 21, 2021, 6:55:21 AM9/21/21
to earthwo...@googlegroups.com
Hello,

Same error for me today with a fresh Debian 11 install (gcc 10.2.1-6)
and two EarthWorm versions :
- v7.10-1 from http://folkworm.ceri.memphis.edu/ew-dist/;
- today's git clone.

Regards.

Jean-Marie.
--
--------------------------------------
Institut de Physique du Globe de Paris
Observatoires Volcanologiques et Sismologiques
Responsable technique
+33 1 83 95 74 37
+33 6 20 35 28 04 (portable)
1 rue Jussieu
75238 Paris cédex 5

Jean-Marie SAUREL

unread,
Sep 21, 2021, 10:23:27 AM9/21/21
to earthwo...@googlegroups.com
Hello,

Some more news : these seems related to gcc-10 compiler only.

I had the same error with the v7.10 old sources.
Choosing the older gcc-9 on Debian 11 solved the issue and the
compilation ended successfully.

The following modules were impacted the same way at link stage when
using gcc-10 :
- stropmodule;
- status;
- startstop;
- restart;
- reconfigure;
- pau.

Regards.

Jean-Marie.

Paul Friberg

unread,
Sep 21, 2021, 1:59:52 PM9/21/21
to Earthworm Community Forum
Thanks Jean-Marie,

Yes, we haven't played much with Debian or the new gcc v10 edition yet. We will make sure to test that and get it all going for EW v7.11 release.

Cheers,

Paul

Reply all
Reply to author
Forward
0 new messages