Configuring distcc for makefiles - makefile

I am testing distcc and I found this tutorial very easy to follow, I should say that I am able to compile llvm using CMake + Ninja and CMake + Makefiles using distcc and docker with no problems. Since I am particularly interested in Makefiles, I looked at the files produced by CMake + Ninja and all I saw was that distcc is added as a prefix to the compiler (e.g. distcc /usr/bin/gcc). So I thought that if I create a small project using only Makefiles I could possibly add distcc and things will magically work. Well, looks like I am missing something because all I get is:
$ ./mk.sh image
make[1]: Entering directory '/home/user/sandbox/distcc-makefiles'
Compiling Lib/Print.c
Compiling Boot/Main.c
distcc[16644] ERROR: compile Boot/Main.c on 172.17.0.2/1 failed
distcc[16644] (dcc_build_somewhere) Warning: remote compilation of 'Boot/Main.c' failed, retrying locally
distcc[16644] Warning: failed to distribute Boot/Main.c to 172.17.0.2/1, running locally instead
distcc[16644] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'Boot/Main.c' failed, retried locally and got a different result.
distcc[16643] ERROR: compile Lib/Print.c on 172.17.0.2/1 failed
distcc[16643] (dcc_build_somewhere) Warning: remote compilation of 'Lib/Print.c' failed, retrying locally
distcc[16643] Warning: failed to distribute Lib/Print.c to 172.17.0.2/1, running locally instead
distcc[16643] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'Lib/Print.c' failed, retried locally and got a different result.
make[1]: Leaving directory '/home/user/sandbox/distcc-makefiles'
By running the llvm example I discarded all docker connection and distcc configuration issues, I tried to search for any ideas/examples on the internet but most of the people use CMake which is not my case. Suggestions are welcome, I based my demo project on a real project I am working on, so that's how basically the Makefile look like.
I don't know what I am missing...
Versions:
Just for reference:
$ distcc --version
distcc 3.1 x86_64-pc-linux-gnu
(protocols 1, 2 and 3) (default port 3632)
built Oct 19 2017 11:05:18
Copyright (C) 2002, 2003, 2004 by Martin Pool.
Includes miniLZO (C) 1996-2002 by Markus Franz Xaver Johannes Oberhumer.
Portions Copyright (C) 2007-2008 Google.
$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
$ make --version
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.

After enabling debug messages (with $ export DISTCC_VERBOSE=1), I found that distcc actually compiles in the server but the compilation fails and that's why it retries locally.
It fails because I am using external files to keep additional options (see gcc #file) and distcc doesnt interpret that as a file but rather as a string basically. That's why the compilation fails and distcc fallsback.
Log inspection
For reference, the distcc log looks like the following (divided into sections for further explanation):
... {{ SECTION A }}
distcc[13039] (dcc_spawn_child) forking to execute: gcc -std=c99 -Wall #_out/Release/Boot/Main.o.via -E /home/user/sandbox/distcc-makefiles/Boot/Main.c
distcc[13040] (dcc_get_hostlist) read hosts from environment
distcc[13040] (dcc_parse_hosts) found tcp token "172.17.0.2/1"
distcc[13039] (dcc_spawn_child) child started as pid13041
... {{ SECTION B }}
distcc[13039] (dcc_strip_local_args) result: gcc -std=c99 -Wall #_out/Release/Boot/Main.o.via -c /home/user/sandbox/distcc-makefiles/Boot/Main.c -o _out/Release/Boot/Main.o
distcc[13039] exec on 172.17.0.2/1: gcc -std=c99 -Wall #_out/Release/Boot/Main.o.via -c /home/user/sandbox/distcc-makefiles/Boot/Main.c -o _out/Release/Boot/Main.o
distcc[13039] (dcc_note_state) note state 2, file "Main.c", host "172.17.0.2"
distcc[13039] (dcc_connect_by_name) connecting to 172.17.0.2 port 3632
distcc[13041] (dcc_new_pgrp) entered process group
distcc[13041] (dcc_increment_safeguard) setting safeguard: _DISTCC_SAFEGUARD=1
distcc[13039] (dcc_connect_by_addr) started connecting to 172.17.0.2:3632
... {{ SECTION C }}
distcc[13039] (dcc_select_for_write) select for write on fd6
distcc[13039] (dcc_note_state) note state 4, file "(NULL)", host "(NULL)"
distcc[13039] (dcc_x_token_int) send DIST00000001
distcc[13039] (dcc_x_token_int) send ARGC00000008
distcc[13039] (dcc_x_token_int) send ARGV00000003
distcc[13039] (dcc_x_token_string) send string 'gcc'
distcc[13039] (dcc_x_token_int) send ARGV00000008
distcc[13039] (dcc_x_token_string) send string '-std=c99'
distcc[13039] (dcc_x_token_int) send ARGV00000005
distcc[13039] (dcc_x_token_string) send string '-Wall'
distcc[13039] (dcc_x_token_int) send ARGV0000001d
distcc[13039] (dcc_x_token_string) send string '#_out/Release/Boot/Main.o.via'
distcc[13039] (dcc_x_token_int) send ARGV00000002
distcc[13039] (dcc_x_token_string) send string '-c'
distcc[13039] (dcc_x_token_int) send ARGV0000002f
distcc[13039] (dcc_x_token_string) send string '/home/user/sandbox/distcc-makefiles/Boot/Main.c'
distcc[13039] (dcc_x_token_int) send ARGV00000002
distcc[13039] (dcc_x_token_string) send string '-o'
distcc[13039] (dcc_x_token_int) send ARGV00000018
distcc[13039] (dcc_x_token_string) send string '_out/Release/Boot/Main.o'
distcc[13039] (dcc_note_state) note state 3, file "(NULL)", host "(NULL)"
distcc[13039] (dcc_collect_child) cpp child 13041 terminated with status 0
distcc[13039] (dcc_collect_child) cpp times: user 0.000000s, system 0.000000s, 0 minflt, 0 majflt
distcc[13039] cpp /home/user/sandbox/distcc-makefiles/Boot/Main.c on localhost completed ok
... {{ SECTION D }}
distcc[13039] (dcc_unlock) release lock fd4
distcc[13039] (dcc_x_file) send 14682 byte file /tmp/distcc_cd4d9216.i with token DOTI and compression 69
distcc[13039] (dcc_x_token_int) send DOTI0000395a
distcc[13039] (dcc_compile_remote) client finished sending request to server
distcc[13039] (dcc_note_state) note state 5, file "(NULL)", host "172.17.0.2"
distcc[13039] (dcc_select_for_read) select for read on fd6 for 300s
distcc[13039] (dcc_r_token_int) got DONE00000001
distcc[13039] (dcc_note_state) note state 6, file "(NULL)", host "(NULL)"
distcc[13039] (dcc_r_token_int) got STAT00000100
distcc[13039] (dcc_r_token_int) got SERR00000044
distcc[13039] (dcc_r_file) received 68 bytes to file /tmp/distcc_server_stderr_cd009216.txt
distcc[13039] (dcc_r_token_int) got SOUT00000000
distcc[13039] (dcc_r_token_int) got DOTO00000000
... {{ SECTION E }}
distcc[13039] 14682 bytes from /home/user/sandbox/distcc-makefiles/Boot/Main.c compiled on 172.17.0.2 in 0.0063s, rate 2274kB/s
distcc[13039] (dcc_unlock) release lock fd3
distcc[13039] ERROR: compile /home/user/sandbox/distcc-makefiles/Boot/Main.c on 172.17.0.2/1 failed
distcc[13039] (dcc_build_somewhere) Warning: remote compilation of '/home/user/sandbox/distcc-makefiles/Boot/Main.c' failed, retrying locally
distcc[13039] (dcc_mark_timefile) mark /home/user/.distcc/lock/backoff_tcp_172.17.0.2_3632_0
distcc[13039] Warning: failed to distribute /home/user/sandbox/distcc-makefiles/Boot/Main.c to 172.17.0.2/1, running locally instead
where, to my understanding, SECTION A finds the remote server, SECTION B opens a connection to the server, SECTION C send the command to run in the server (includes the compile options and the file to compile), SECTION D fetches the result, and SECTION E analizes the result and decides what to do next. As you might see, this is the error:
distcc[13039] (dcc_x_token_string) send string '#_out/Release/Boot/Main.o.via'
distcc[13039] (dcc_x_token_int) send ARGV00000002

To see output of compile error, define these environment above:
export DISTCC_VERBOSE=1
export DISTCC_SAVE_TEMPS=1
export DISTCC_FALLBACK=0
see also man distcc or https://linux.die.net/man/1/distcc

current distcc maintainer,
I highly recommend using MASQUERADE as documented in the distcc man page.

Related

How to Run Systemd with Asan(Address Sanitizer)

When I use asan to compile the rpm package of systemd:
Add the following information to the systemd.spec file:
export CFLAGS="$RPM_OPT_FLAGS"
export LDFLAGS=$RPM_LD_FLAGS
CFLAGS="$CFLAGS -fsanitize=address
-fno-omit-frame-pointer-fsanitize-recover=address"
LDFLAGS="$LDFLAGS -fsanitize=address
-fno-omit-frame-pointer-fsanitize-recover=address"
Run the rpmbuild -ba command to generate RPM packages.
Then use the rpm to upgrade the system:rpm -Uvh systemd*.rpm
However, the system fails to be started:
Failed to start Load/Save Random Seed.
Some failed services will prompt such as:
systemd[1]: Starting Load/Save Random Seed...
systemd-random-seed[2939]: ==2939==Can't open /proc/2457614/task for
reading. systemd-random-seed[2939]: ==2939==LeakSanitizer has
encountered a fatal error. systemd-random-seed[2939]: ==2939==HINT:
For debugging, try setting environment variable
LSAN_OPTIONS=verbosity=1:log_threads=1 systemd-random-seed[2939]:
==2939==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc) systemd[1]: Failed to start Load/Save Random Seed.
By the way, when I enter emergency mode and execute __lsan_do_recoverable_leak_check in systemd, systemd exits.
How to Run Systemd with Asan (Address Sanitizer)?

error: linking with `ld` failed: exit status: 1

I'm trying to follow this guide as my entry into Solana blockchain development. I'm running into an error when I run the command $anchor build
For context, I'm running wsl. I'm not concerned about the warning, but any help would be much appreciated!
Here are the contents of the error:
error: linking with `ld` failed: exit status: 1
|
= note: "ld" "--version-script=/tmp/rustc7rlvlq/list" "--Bdynamic" "--entry=entrypoint" "--threads=1" "-z" "notext" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.0.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.1.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.10.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.11.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.12.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.13.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.14.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.15.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.2.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.3.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.4.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.5.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.6.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.7.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.8.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.9.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.23ok8bvhjt9fifog.rcgu.o" "--as-needed" "-L" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps" "-L" "/home/tai8910/Code/solana-twitter/target/release/deps" "-L" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib" "-Bstatic" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libanchor_lang-369f9fcce7f9778b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbase64-ee92f11b5395c52e.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsolana_program-9fe9cc99ff752644.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libserde_bytes-5207c42260a7c267.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libhex-6cd04f1b9c696e32.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsolana_frozen_abi-f9c2f8b8a627f8aa.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbs58-fe01222278a2eda8.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbv-c7c0e796134886cb.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/liblazy_static-809b40aac429888e.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libitertools-c458dae8c4611cd8.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libeither-6eeb62e68a9b8e57.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsha3-24b5c86da1eb0453.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libkeccak-ac25e9c6d97c1dff.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libthiserror-90c773aba6f68987.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsha2-48f21f103c901542.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libopaque_debug-7a932b68d3299c7b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libdigest-6389a1260a04b96b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libblock_buffer-a630a7b4c9084931.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libblock_padding-1a56ee8f16ee908c.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libgeneric_array-d7158a87da87264b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libtypenum-ef879e2476d2db6d.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/liblog-cc2d231fbaac5454.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libcfg_if-1643e4a2c6efb510.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libnum_traits-67afc00ec41f572f.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbincode-daf7bb0fce4a700c.rlib"
"/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libserde-e445d83f85708c13.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libborsh-701da45de74b9763.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbytemuck-eaed85aa73d5dfbc.rlib" "--start-group" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libstd-b9e47931bb048ddd.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libpanic_abort-cee38af281743742.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libstd_detect-4bf956fa4dfc36ef.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libhashbrown-419e08fa951207df.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/librustc_std_workspace_alloc-f389bcb5a4dc00c1.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libunwind-9d2b664eda1e59bf.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcfg_if-0df5cdc1ad3f0480.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/liblibc-1d523315f98b1675.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/liballoc-38dcdcf486775e23.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/librustc_std_workspace_core-8201043866f2d4dd.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcore-a4fd67b7f3cf9226.rlib" "--end-group" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcompiler_builtins-fcfbbdc9d2a94cb9.rlib" "-Bdynamic" "--script" "/tmp/rustc7rlvlq/rustc-bpfel-linkfile.ld" "-znoexecstack" "-L" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib" "-o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.so" "--gc-sections" "-shared" "-O1"
= note: ld: unrecognized option '--threads=1'
ld: use the --help option for usage information
warning: `solana-twitter` (lib) generated 1 warning
error: could not compile `solana-twitter` due to previous error; 1 warning emitted
It looks like the build is not using the correct linker that's part of the BPF tool suite, probably using the default ld instead.
Can you make sure that ~/.local/share/solana/install/active_release/bin is part of your PATH? After that, try simply running cargo build-bpf to make sure that the program can build without Anchor. If it's still failing, you may need to reinstall the Solana tools.

How to build dpdk examples on windows

I am able to follow the directions on the dpdk docs for windows.
http://doc.dpdk.org/guides/windows_gsg/build_dpdk.html
I am able to run meson build and ninja -C build and everything seems to work. The problem is whenever I run with the flag -Dexamples=helloworld, or any example for that matter, I get the following failure after running ninja -C build
FAILED: examples/dpdk-helloworld.exe
"clang" -Wl,/MACHINE:X64 -Wl,/OUT:examples/dpdk-helloworld.exe examples/dpdk-helloworld.exe.p/helloworld_main.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/OPT:REF" "-Wl,/WHOLEARCHIVE:lib\librte_hash.a" "-Wl,/WHOLEARCHIVE:lib\librte_cmdline.a" "-Wl,/WHOLEARCHIVE:lib\librte_pci.a" "-Wl,/WHOLEARCHIVE:lib\librte_ethdev.a" "-Wl,/WHOLEARCHIVE:lib\librte_meter.a" "-Wl,/WHOLEARCHIVE:lib\librte_net.a" "-Wl,/WHOLEARCHIVE:lib\librte_mbuf.a" "-Wl,/WHOLEARCHIVE:lib\librte_mempool.a" "-Wl,/WHOLEARCHIVE:lib\librte_rcu.a" "-Wl,/WHOLEARCHIVE:lib\librte_ring.a" "-Wl,/WHOLEARCHIVE:lib\librte_eal.a" "-Wl,/WHOLEARCHIVE:lib\librte_telemetry.a" "-Wl,/WHOLEARCHIVE:lib\librte_kvargs.a" "-Wl,/WHOLEARCHIVE:drivers\librte_bus_pci.a" "-Wl,/WHOLEARCHIVE:drivers\librte_bus_vdev.a" "-Wl,/WHOLEARCHIVE:drivers\librte_mempool_ring.a" "-lws2_32" "-lmincore" "-ladvapi32" "-lsetupapi" "-ldbghelp" "lib\librte_hash.a" "lib\librte_cmdline.a" "lib\librte_pci.a" "lib\librte_ethdev.a" "lib\librte_meter.a" "lib\librte_net.a" "lib\librte_mbuf.a" "lib\librte_mempool.a" "lib\librte_rcu.a" "lib\librte_ring.a" "lib\librte_eal.a" "lib\librte_telemetry.a" "lib\librte_kvargs.a" "drivers\librte_bus_pci.a" "drivers\librte_bus_vdev.a" "drivers\librte_mempool_ring.a" "-Wl,--subsystem,console" "-lkernel32" "-luser32" "-lgdi32" "-lwinspool" "-lshell32" "-lole32" "-loleaut32" "-luuid" "-lcomdlg32"
LINK : warning LNK4044: unrecognized option '/-subsystem'; ignored
LINK : fatal error LNK1181: cannot open input file 'console.obj'
clang: error: linker command failed with exit code 1181 (use -v to see invocation)
[179/181] Linking target lib/rte_hash-21.dll
Creating library lib\rte_hash.lib and object lib\rte_hash.exp
ninja: build stopped: subcommand failed.

protocol buffer build.sh error and show "protobuf test program failed to link"

I am setting up protocal buffer in my mac(10.14.4)
I step by step according to the readme
When I input ./scripts/build.sh in the terminal and it tells me:
ERROR:
protobuf test program failed to link:
perhaps you need to add -Llibdir to your LDFLAGS.
what should I do?
what is mean add -Llibdir to your LDFLAGS and how to fix it?

net-snmp TUT:Writing a MIB Module doesn't work

I just follow the net-snmp tutorial step by step, I really can't get the right result.
here is the link
HERE
I'm facing the same problem, I even didn't pass the tutorial.
here are my details:
my configure command:
./configure --with-default-snmp-version="3" --with-sys-contact="##no.where" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" --with-mib-modules="nstAgentModuleObject"
after configuration:
part of the ./configure output
checking for and configuring mib modules to use... nstAgentModuleObject default_modules.
nstAgentModuleObject default_modules snmpv3mibs mibII ucd_snmp notification notification-log-mib target agent_mibs agentx dism
and after all:
---------------------------------------------------------
Net-SNMP configuration summary:
---------------------------------------------------------
SNMP Versions Supported: 1 2c 3
Building for: linux
Net-SNMP Version: 5.7.2.1
Network transport support: Callback Unix Alias TCP UDP IPv4Base SocketBase TCPBase UDPIPv4Base UDPBase
SNMPv3 Security Modules: usm
Agent MIB code: nstAgentModuleObject default_modules => snmpv3mibs mibII ucd_snmp notification notification-log-mib target agent_mibs agentx disman/event disman/schedule utilities host
MYSQL Trap Logging: unavailable
Embedded Perl support: enabled
SNMP Perl modules: building -- embeddable
SNMP Python modules: disabled
Crypto support from: internal
Authentication support: MD5 SHA1
Encryption support: DES AES
Local DNSSEC validation: disabled
I used nm to check whether the function has been compiled into the library.
akamai#JNdev:~/Workspace/net-snmp-5.7.2.1/net-snmp-5.7.2.1/agent/.libs$ nm libnetsnmpmibs.so | grep init_nst
00000000000331c0 T init_nstAgentModuleObject

Resources