Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fail undefined reference to PMAP #21

Open
jrgruher opened this issue Nov 22, 2022 · 3 comments
Open

build fail undefined reference to PMAP #21

jrgruher opened this issue Nov 22, 2022 · 3 comments

Comments

@jrgruher
Copy link

Testing on Ubuntu 22.04 with GCC12. Cloned git, cd src, make (or 'make results').

First I hit this issue, followed these steps to work around:
#16

Now I get this failure:

root@ce-2-jrgruher:~/lmbench/src# make results LDFLAGS=-ltirpc
gmake[1]: Entering directory '/root/lmbench/src'
cc -O -DRUSAGE -DHAVE_uint=1 -DHAVE_int64_t=1 -DHAVE_DRAND48 -DHAVE_SCHED_SETAFFINITY=1  -ltirpc -o ../bin/x86_64-linux-gnu/bw_tcp bw_tcp.c ../bin/x86_64-linux-gnu/lmbench.a -lm
bw_tcp.c: In function ‘main’:
bw_tcp.c:74:44: warning: implicit declaration of function ‘lmbench_usage’ [-Wimplicit-function-declaration]
   74 |                         if (parallel <= 0) lmbench_usage(ac, av, usage);
      |                                            ^~~~~~~~~~~~~
bw_tcp.c: In function ‘initialize’:
bw_tcp.c:142:25: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘int’ [-Wformat=]
  142 |         sprintf(buf, "%lu", state->msize);
      |                       ~~^   ~~~~~~~~~~~~
      |                         |        |
      |                         |        int
      |                         long unsigned int
      |                       %u
bw_tcp.c: In function ‘main’:
bw_tcp.c:63:25: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   63 |                         write(conn, "0", 1);
      |                         ^~~~~~~~~~~~~~~~~~~
/usr/bin/ld: ../bin/x86_64-linux-gnu/lmbench.a(lib_tcp.o): in function `tcp_done':
lib_tcp.c:(.text+0x1b): undefined reference to `pmap_unset'
/usr/bin/ld: ../bin/x86_64-linux-gnu/lmbench.a(lib_tcp.o): in function `tcp_connect':
lib_tcp.c:(.text+0x3bd): undefined reference to `pmap_getport'
/usr/bin/ld: ../bin/x86_64-linux-gnu/lmbench.a(lib_tcp.o): in function `tcp_server':
lib_tcp.c:(.text+0x5cd): undefined reference to `pmap_unset'
/usr/bin/ld: lib_tcp.c:(.text+0x5e9): undefined reference to `pmap_set'
collect2: error: ld returned 1 exit status
gmake[1]: *** [Makefile:311: ../bin/x86_64-linux-gnu/bw_tcp] Error 1
gmake[1]: Leaving directory '/root/lmbench/src'
make: *** [Makefile:114: lmbench] Error 2
root@ce-2-jrgruher:~/lmbench/src# 
@gipi
Copy link

gipi commented Mar 3, 2023

Probably is sufficient to indicate such library in the build script

diff --git a/scripts/build b/scripts/build
index 16a6600..561cdb3 100755
--- a/scripts/build
+++ b/scripts/build
@@ -18,7 +18,7 @@ done
 
 trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BASE}$$.o ${BASE}$$; exit 1' 1 2 15
 
-LDLIBS=-lm
+LDLIBS="-lm -ltirpc"
 
 # check for HP-UX's ANSI compiler
 echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c

AndrewFasano added a commit to AndrewFasano/lmbench that referenced this issue Apr 3, 2023
@rajesh-s
Copy link

rajesh-s commented Sep 4, 2024

@jrgruher were you able to get around thsi?

@jrgruher
Copy link
Author

jrgruher commented Sep 9, 2024

@rajesh-s No, not as far as I can recall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants