De : Paul Fertser <fercerpav@gmail.com>
Envoyé : 14 mars 2023 21:09:01 GMT+01:00
À : Ramon Carbonell <ramon.carbonell@csic.es>
Cc : seisunix@seismic-unix.org
Objet : Re: [Seisunix] Compilation probles wis dist CWP-44.26

Hello,

On Tue, Mar 14, 2023 at 06:16:14PM +0100, Ramon Carbonell wrote:
compiling with the xdr
I am getting messages like 
src/su/lib/fgettr.c:148: undefined reference to `xdr_float'
src/su/lib/fputtr.c:123: undefined reference to `xdr_vector'
I am running Ubuntu 22.04 and somehow, although xdr.h is installed at rpc/xdr.h
I am not sure why the compiler does not locate it.

That's because it's a linking error, the compiler found your include
but the linker doesn't know it needs to use an additional library.

This change makes it buildable on current Ubuntu LTS:

diff --git a/src/Makefile.config b/src/Makefile.config
index a1b8699c11e2..f7cdd4feab08 100644
--- a/src/Makefile.config
+++ b/src/Makefile.config
@@ -68,7 +68,7 @@ RANFLAGS =
ICHMODLINE = chmod 644 $@
MCHMODLINE = chmod 755 $@

-POSTLFLAGS =
+POSTLFLAGS = $(shell pkg-config --libs libtirpc)

#-----------------------------------------------------------------------
# use both X11 path conventions
@@ -92,8 +92,8 @@ CPP = /usr/bin/cpp
CC = /usr/bin/gcc
#OPTC = -g -c90 -m64 -Wall -ansi -Wno-long-long
#OPTC = -g -std=c90 -m64 -Wall -ansi -Wno-long-long
-OPTC = -g -std=c99 -m64 -Wall -ansi -Wno-long-long
-CFLAGS = -I$I $(OPTC) $(CWP_FLAGS)
+OPTC = -g -std=c99 -m64 -Wall -ansi -Wno-long-long -D_ISOC99_SOURCE
+CFLAGS = -I$I $(OPTC) $(CWP_FLAGS) $(shell pkg-config --cflags libtirpc)

# if gfortran is made using Homebrew
FC = gfortran

--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.