cstore_fdw icon indicating copy to clipboard operation
cstore_fdw copied to clipboard

Update dependency section in documentation

Open luiscape opened this issue 8 years ago • 3 comments

When installing the protobuf dependencies on a Debian machine, I ran into the following error:

$ make
protoc-c --c_out=. cstore.proto
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -fno-omit-frame-pointer -fpic --std=c99 -I. -I./ -I/usr/include/postgresql/9.6/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/tcl8.6  -c -o cstore.pb-c.o cstore.pb-c.c
In file included from cstore.pb-c.h:7:0,
                 from cstore.pb-c.c:9:
/usr/include/protobuf-c/protobuf-c.h:183:20: fatal error: assert.h: No such file or directory
 #include <assert.h>
                    ^
compilation terminated.
<builtin>: recipe for target 'cstore.pb-c.o' failed
make: *** [cstore.pb-c.o] Error 1

That is, the make command was throwing an error when attempting to compile cstore_fdw.

That was solved by adding the dependency libprotoc-dev to the list. I suggest updating the README.md file to reflect that change. If that makes sense, I've submitted a pull request that updates the documentation.

luiscape avatar Dec 12 '16 23:12 luiscape

Hello @luiscape

I can't reproduce the problem locally. We never had a problem with Debian (or Ubuntu) regarding this before. Tested with fresh install of Debian 8.6 (Jessie) on EC2 it looked good.

mtuncer avatar Dec 13 '16 17:12 mtuncer

Interesting. The issue constantly happens on a Docker deployment (locally and via CI) of Postgres 9.6 on debian:jessie. I am using this Docker postgres base image: https://github.com/docker-library/postgres/blob/5e7d985129d82e8757ac21c4c15cf51703d3477f/9.6/Dockerfile

And here is the Dockerfile that caused the error:

FROM postgres:9.6

#
#  PostGIS versioning comes from referencing the
#  Docker image developed by @mdillon.
#  See reference here:
#
#    https://hub.docker.com/r/mdillon/postgis/~/dockerfile/
#
ENV POSTGIS_MAJOR=2.3
ENV POSTGIS_VERSION=2.3.1+dfsg-1.pgdg80+1
ENV CSTORE_VERSION=1.5.0

#
#  INSTALLING DEPENDENCIES
#  -----------------------
#
#  In this section we install the dependencies
#  that the database will use when analyzing
#  data.
#

#
#  Install both PostGIS. PG_MAJOR is defined
#  automatically by the base image.
#
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        unzip ca-certificates curl git make gcc wget libprotobuf-c0-dev protobuf-c-compiler \
            postgresql-9.6-python3-multicorn python3-setuptools \
        postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
        postgresql-server-dev-$PG_MAJOR \
        postgis \
        postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
        postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \
    && apt purge -y --auto-remove ca-certificates curl \
    && rm -rf /var/lib/apt/lists/*

#
#  Install Citus `cstore_fdw` for using
#  columnar data store.
#
#    https://github.com/citusdata/cstore_fdw
#
RUN wget --no-check-certificate https://github.com/citusdata/cstore_fdw/archive/v$CSTORE_VERSION.zip \
    && unzip v$CSTORE_VERSION.zip \
    && cd cstore_fdw-$CSTORE_VERSION \
    && make && make install \
    && cd .. \
    && rm v$CSTORE_VERSION.zip \
    && rm -rf cstore_fdw-$CSTORE_VERSION/

#
#  CONFIGURATION
#  -------------
#
#  In this section packages installed in previous
#  steps are properly configured. That happens by
#  either modifying configuration files (*.config)
#  or by loading *.sh scripts that will gradually
#  do that.
#
RUN mkdir -p /docker-entrypoint-initdb.d

#
#  Adding the `cstore_fdw` extension to the start-up config
#  file.
#
RUN echo "\nshared_preload_libraries = 'cstore_fdw'" >> /tmp/postgresql.local.conf

RUN chown postgres:postgres /tmp/postgresql.local.conf

Maybe I'm missing something?

luiscape avatar Dec 13 '16 17:12 luiscape

Can you try running this without the --no-install-recommends? I've looked into the relevant packages, and in Ubuntu, some appear to be set up with recommended packages rather than hard dependencies. You're on Debian, so I wouldn't expect that to affect you, but just trying to get a handle on what's going on here.

jasonmp85 avatar Dec 15 '16 00:12 jasonmp85