Menu

#1 make fails with ld error: "cannot find -lkeccak"

2.0
closed
None
2019-04-09
2019-04-06
Russtopia
No

I am trying to build the C ref implementation and am unsure where to obtain/build the proper libkeccak.

Where may I obtain a compatible libkeccak? I am on Funtoo Linux x64 and unsure what, if any, package might provide a compatible implementation, so would prefer to build from source. Thank you.

$ cd src/ref
$ make clean all
...
cc -I. -Ibuild -Os -march=native -Wall -Wextra -Wpedantic -DNDEBUG -fomit-frame-pointer -std=c11  -c -o build/shake.o shake.c
cc  -o build/threebears build/BabyBearEphem/threebears.o build/BabyBear/threebears.o build/MamaBearEphem/threebears.o build/MamaBear/threebears.o build/PapaBearEphem/threebears.o build/PapaBear/threebears.o build/BabyBearEphem/ring.o build/BabyBear/ring.o build/MamaBearEphem/ring.o build/MamaBear/ring.o build/PapaBearEphem/ring.o build/PapaBear/ring.o build/test_threebears.o build/melas_fec.o build/shake.o -lkeccak
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lkeccak
collect2: error: ld returned 1 exit status
make: *** [Makefile:17: build/threebears] Error 1

Discussion

  • Russtopia

    Russtopia - 2019-04-06

    Hmm. Seems this -lkeccak isn't actually required. I can build with the following patch:

    diff --git a/src/ref/Makefile b/src/ref/Makefile
    index 9bc3238..90d43e9 100644
    --- a/src/ref/Makefile
    +++ b/src/ref/Makefile
    @@ -14,7 +14,7 @@ BEARS_H = $(addprefix build/,$(addsuffix /threebears.h,$(BEARS)))
    all: build/threebears build/test_fec

    build/threebears: $(BEARS_O) $(BEARS_R) build/test_threebears.o build/melas_fec.o build/shake.o
    - $(CC) $(LDFLAGS) -o $@ $^ -lkeccak
    + $(CC) $(LDFLAGS) -o $@ $^ #-lkeccak

    size: $(BEARS_O) $(BEARS_R) build/melas_fec.o build/shake.o
    size $^
    @@ -75,4 +75,4 @@ test: build/test_fec
    build/test_fec

    clean:
    - rm -fr build/
    \ No newline at end of file
    + rm -fr build/

     
  • Mike Hamburg

    Mike Hamburg - 2019-04-09

    Thanks for the report, should be fixed in 0cbf5e.

     
  • Mike Hamburg

    Mike Hamburg - 2019-04-09
    • status: open --> closed
    • assigned_to: Mike Hamburg
    • Milestone: 1.0 --> 2.0
     

Log in to post a comment.