OpenNetworkLinux icon indicating copy to clipboard operation
OpenNetworkLinux copied to clipboard

Failed to build onlp-snmpd package on "ONLPv2" latest code base

Open david-xk opened this issue 5 years ago • 4 comments

Branch: ONLPv2

  • commit bb20e13157b9984b4183c2bc0c56768ca8ae2aeb (HEAD -> ONLPv2, origin/ONLPv2)
  • Merge: 7bc71e64 d5e38e20
  • Author: Jeffrey Townsend [email protected]
  • Date: Thu Jan 9 12:53:35 2020 -0800
  • Merge pull request #640 from CynthiaINV/ONLPv2
  • Add 2 new platforms (Inventec D10056 /D10064) and upgrade kernel platform Inventec-D7032Q28B/D10056 to 4.14

Build command: docker/tools/onlbuilder --isolate --pull --autobuild --non-interactive

Build Log: BUILD/jessie/x86_64-linux-gnu/lib/cjson.a(cJSON.o): In function parse_number': /home/david/workspace/github/opencomputeproject/OpenNetworkLinux_ONLPv2/sm/bigcode/modules/cjson/module/src/cJSON.c:113: undefined reference to pow' BUILD/jessie/x86_64-linux-gnu/lib/cjson.a(cJSON.o): In function print_number': /home/david/workspace/github/opencomputeproject/OpenNetworkLinux_ONLPv2/sm/bigcode/modules/cjson/module/src/cJSON.c:136: undefined reference to floor' BUILD/jessie/x86_64-linux-gnu/lib/cjson_util.a(cjson_util.o): In function cjson_util_vlookup_svalue': /home/david/workspace/github/opencomputeproject/OpenNetworkLinux_ONLPv2/sm/bigcode/modules/cjson_util/module/src/cjson_util.c:454: undefined reference to `floor' collect2: error: ld returned 1 exit status /home/david/workspace/github/opencomputeproject/OpenNetworkLinux_ONLPv2/sm/infra/builder/unix/toolchains/gcc-local/bin.mk:47: recipe for target 'BUILD/jessie/x86_64-linux-gnu/bin/onlp-snmpd' failed make[4]: *** [BUILD/jessie/x86_64-linux-gnu/bin/onlp-snmpd] Error 1

Patch to fix the issue: `diff --git a/packages/base/any/onlp-snmpd/builds/Makefile b/packages/base/any/onlp-snmpd/builds/Makefile index 6a5f08da..9f47b387 100644 --- a/packages/base/any/onlp-snmpd/builds/Makefile +++ b/packages/base/any/onlp-snmpd/builds/Makefile @@ -26,7 +26,7 @@ GLOBAL_CFLAGS += -g

LIBONLP := $(shell $(ONLPM) --find-file onlp:$(ARCH) libonlp.so)

-GLOBAL_LINK_LIBS += -lpthread $(LIBONLP) +GLOBAL_LINK_LIBS += -lm -lpthread $(LIBONLP) GLOBAL_LINK_LIBS += -Wl,--unresolved-symbols=ignore-in-shared-libs

.DEFAULT_GOAL := onlp-snmpd`

Attachements: build.log onlp-snmpd.Makefile.diff.txt

david-xk avatar Jan 22 '20 17:01 david-xk

I'm having this issue as well. A workaround I found is to add -lm to OpenNetworkLinux/packages/base/any/onlp-snmpd/builds/Makefile:29:

https://github.com/opencomputeproject/OpenNetworkLinux/blob/54a01701bda0418babe402fcaf02d6f84ece0743/packages/base/any/onlp-snmpd/builds/Makefile#L29

CommitThis avatar Feb 17 '20 12:02 CommitThis

@CommitThis Hi Paul, yes I have same workaround attached in my comment. Just wondering if community has a plan to fix it. Thanks, David

david-xk avatar Feb 17 '20 18:02 david-xk

@david-xk Sorry David, I missed the diff. I'll raise a PR and see what happens.

CommitThis avatar Feb 17 '20 19:02 CommitThis

@CommitThis Hi Paul, thanks a lot. Keep in touch. Best, David

david-xk avatar Feb 17 '20 20:02 david-xk