aerospike/act

ACT does not build on Debian 9 (GCE)

rbotzer opened this issue · 3 comments

On Debian 9 (on a GCE vm-instance) I've installed the dependencies and tried make ; make -f Makesalt. I get the following error:

echo "Building act.o"
Building act.o
gcc -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MMD  -o act.o -c -I. -I/usr/include act.c
echo "Building histogram.o"
Building histogram.o
gcc -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MMD  -o histogram.o -c -I. -I/usr/include histogram.c
histogram.c: In function ‘histogram_create’:
histogram.c:101:9: warning: passing argument 1 of ‘memset’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]
  memset(&h->counts, 0, sizeof(h->counts));
         ^
In file included from histogram.c:37:0:
/usr/include/string.h:62:14: note: expected ‘void *’ but argument is of type ‘volatile cf_atomic64 (*)[65] {aka volatile long unsigned int (*)[65]}’
 extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
              ^~~~~~
echo "Building queue.o"
Building queue.o
gcc -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MMD  -o queue.o -c -I. -I/usr/include queue.c
echo "Building random.o"
Building random.o
gcc -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MMD  -o random.o -c -I. -I/usr/include random.c
echo "Linking act"
Linking act
gcc -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MMD -o act  ./act.o ./histogram.o ./queue.o ./random.o -lpthread -lrt -lcrypto -lssl -lz
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:29: recipe for target 'act' failed
make: *** [act] Error 1
echo "Building salt.o"
Building salt.o
gcc -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MMD  -o salt.o -c -I. -I/usr/include salt.c
echo "Linking actprep"
Linking actprep
gcc -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MMD -o actprep  ./salt.o ./random.o -lpthread -lrt -lcrypto -lssl -lz
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makesalt:29: recipe for target 'actprep' failed
make: *** [actprep] Error 1

By comparison it builds on Ubuntu 16.04 with a warning:

$ cd act && make && make -f Makesalt
echo "Building act.o"
Building act.o
gcc -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MMD  -o act.o -c -I. -I/usr/include act.c
echo "Building histogram.o"
Building histogram.o
gcc -g -fno-common -std=gnu99 -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -MMD  -o histogram.o -c -I. -I/usr/include histogram.c
histogram.c: In function ‘histogram_create’:
histogram.c:101:9: warning: passing argument 1 of ‘memset’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]
  memset(&h->counts, 0, sizeof(h->counts));
         ^
In file included from histogram.c:37:0:
/usr/include/string.h:62:14: note: expected ‘void *’ but argument is of type ‘volatile cf_atomic64 (*)[65] {aka volatile long unsigned int (*)[65]}’
 extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
              ^

As a temporary workaround, edit the Makefile and replace '-Wall' with '-w'.

After that I ran into:

/usr/bin/ld: cannot find -lz

To fix that, install zlib1g-dev

sudo apt install zlib1g-dev

Hope this fixes it...