error: unused parameter 'head' [-Werror=unused-parameter]
yv5125 opened this issue · 4 comments
Hello!
I'm trying to build plcontainer on Ubuntu 18 with gpdb 6.7.1 as described in the README step by step.
I already done:
Build and install PL/Container GPDB backend client
Get the code repogit clone --recursive https://github.com/greenplum-db/plcontainer.git
Install the third-party libraries
Protobuf and gRpc
git clone --recursive --branch v1.24.3 --depth 1 https://github.com/grpc/grpc.git
cd grpc/third_party/protobuf
./autogen.sh
./configure
make -j
sudo make install
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH
cd ../..
make -j
sudo make installBuild and Install
cd plcontainer
make docker-dep
make proto
And now when I do make
I've got an error:
root@dwgpdb:~/git/plcontainer# make
Makefile:124: warning: overriding recipe for target 'installdirs'
/opt/greenplum-db-6.7.1/lib/postgresql/pgxs/src/makefiles/pgxs.mk:180: warning: ignoring old recipe for target 'installdirs'
Makefile:128: warning: overriding recipe for target 'uninstall'
/opt/greenplum-db-6.7.1/lib/postgresql/pgxs/src/makefiles/pgxs.mk:207: warning: ignoring old recipe for target 'uninstall'
Generating protobuf and grpc files.
protoc -I src --grpc_out=src/proto --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` plcontainer.proto
protoc -I src --cpp_out=src/proto plcontainer.proto
mv src/proto/plcontainer.pb.h src/include/proto/
mv src/proto/plcontainer.grpc.pb.h src/include/proto/
make -C ./src/
make[1]: Entering directory '/root/git/plcontainer/src'
g++ -std=c++11 -I/usr/include/libxml2 -Iinclude -Iinclude/proto -Wall -Wextra -g3 -O0 -ggdb -fPIC -Iinclude -Iinclude/proto -I. -I./ -I/opt/greenplum-db-6.7.1/include/postgresql/server -I/opt/greenplum-db-6.7.1/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o proto/plcontainer.pb.o proto/plcontainer.pb.cc
g++ -std=c++11 -I/usr/include/libxml2 -Iinclude -Iinclude/proto -Wall -Wextra -g3 -O0 -ggdb -fPIC -Iinclude -Iinclude/proto -I. -I./ -I/opt/greenplum-db-6.7.1/include/postgresql/server -I/opt/greenplum-db-6.7.1/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o proto/plcontainer.grpc.pb.o proto/plcontainer.grpc.pb.cc
gcc -I/usr/include/libxml2 -std=gnu99 -Iinclude -Iinclude/proto -Wall -Wextra -g3 -O0 -ggdb -fPIC -shared -o plc_coordinator.so plc_coordinator.o containers.o message_fns.o plc_configuration.o plc_docker_api.o plcontainer_udfs.o function_cache.o plc_typeio.o common/comm_connectivity.o common/comm_dummy_plc.o common/comm_messages.o proto/async_server.o proto/client.o proto/proto_utils.o proto/plcontainer.pb.o proto/plcontainer.grpc.pb.o docker/docker_client.o docker/plc_docker.o -L/opt/greenplum-db-6.7.1/lib -Wl,--as-needed -Wl,-rpath,'/opt/greenplum-db-6.7.1/lib',--enable-new-dtags -ljson-c -lxml2 -lcurl -L/usr/local/lib -lprotobuf -lgrpc++ -lgrpc -lgpr -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -ldl
make[1]: Leaving directory '/root/git/plcontainer/src'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fno-aggressive-loop-optimizations -Wno-unused-but-set-variable -Wno-address -Werror=implicit-fallthrough=3 -Wno-format-truncation -O3 -fargument-noalias-global -fno-omit-frame-pointer -g -std=gnu99 -Werror=uninitialized -Werror=implicit-function-declaration -fPIC -Werror -Wextra -Wall -Wno-sign-compare -I./src/include -I./src/include/proto -I/usr/include/libxml2 -I. -I./ -I/opt/greenplum-db-6.7.1/include/postgresql/server -I/opt/greenplum-db-6.7.1/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/plcontainer.o src/plcontainer.c
In file included from /opt/greenplum-db-6.7.1/include/postgresql/server/storage/smgr.h:20:0,
from /opt/greenplum-db-6.7.1/include/postgresql/server/storage/buf_internals.h:22,
from /opt/greenplum-db-6.7.1/include/postgresql/server/storage/bufmgr.h:20,
from /opt/greenplum-db-6.7.1/include/postgresql/server/storage/bufpage.h:25,
from /opt/greenplum-db-6.7.1/include/postgresql/server/nodes/tidbitmap.h:32,
from /opt/greenplum-db-6.7.1/include/postgresql/server/access/genam.h:19,
from /opt/greenplum-db-6.7.1/include/postgresql/server/nodes/execnodes.h:19,
from /opt/greenplum-db-6.7.1/include/postgresql/server/commands/trigger.h:16,
from src/plcontainer.c:16:
/opt/greenplum-db-6.7.1/include/postgresql/server/lib/ilist.h: In function 'dlist_next_node':
/opt/greenplum-db-6.7.1/include/postgresql/server/lib/ilist.h:448:29: error: unused parameter 'head' [-Werror=unused-parameter]
dlist_next_node(dlist_head *head, dlist_node *node)
^~~~
/opt/greenplum-db-6.7.1/include/postgresql/server/lib/ilist.h: In function 'dlist_prev_node':
/opt/greenplum-db-6.7.1/include/postgresql/server/lib/ilist.h:458:29: error: unused parameter 'head' [-Werror=unused-parameter]
dlist_prev_node(dlist_head *head, dlist_node *node)
^~~~
/opt/greenplum-db-6.7.1/include/postgresql/server/lib/ilist.h: In function 'slist_next_node':
/opt/greenplum-db-6.7.1/include/postgresql/server/lib/ilist.h:669:29: error: unused parameter 'head' [-Werror=unused-parameter]
slist_next_node(slist_head *head, slist_node *node)
^~~~
cc1: all warnings being treated as errors
<builtin>: recipe for target 'src/plcontainer.o' failed
make: *** [src/plcontainer.o] Error 1
@HaozhouWang could you please help me to solve this?
Thanks!
We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.
The labels on this github issue will be updated when the story is started.
For additional information. Because you don't describe what packages must be installed in Ubuntu I spent many time to find right packages. Here they are:
apt install -y autoconf libtool make git gawk g++ gpp libxml2-dev libjson-c-dev libssl-dev libkrb5-dev libcurl4-openssl-dev
apt install python-pip
pip install -U pip
pip install gssapi
Also I tried 6X_STABLE branch with the same error.
PL/Container will use GPDB CFLAGS/CXXCLAGS, it will happen if the gcc version is too high. Please try to override the CFLAGS/CXXCLAGS in Makefile and this issue could be resolved.
Thank you for response!
I'm using Ubuntu 18 with gcc 7.5.0 please give me more details what I should change in Makefile?
$ gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
$ cat /git/plcontainer_6x/Makefile | grep CFLAGS
override CFLAGS += -DPLC_PG
# override CFLAGS += -DPLC_PG -Wno-sign-compare
override CFLAGS += $(shell $(CURL_CONFIG) --cflags)
override CFLAGS += $(shell xml2-config --cflags)
override CFLAGS += $(shell pkg-config --cflags json-c)
override CFLAGS += -Werror -Wextra -Wall -Wno-sign-compare
override CFLAGS += -coverage
override CLIENT_CFLAGS += -coverage -O0 -g
override CLIENT_CFLAGS += -O3 -g
override CFLAGS += -DDOCKER_API_LOW
CC='$(CC)' CFLAGS='$(CLIENT_CFLAGS)' LDFLAGS='$(CLIENT_LDFLAGS)' $(MAKE) -C $(SRCDIR)/pyclient all
CC='$(CC)' CFLAGS='$(CLIENT_CFLAGS)' LDFLAGS='$(CLIENT_LDFLAGS)' $(MAKE) -C $(SRCDIR)/rclient all