Compilation fails on Ubuntu 16.04.1 LTS

Issue #25 resolved
Dennis Golomazov
created an issue

This is what I see when I execute the sudo pip install monary command on Ubuntu 16.04.1 LTS.

Collecting monary
  Downloading Monary-0.5.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pymongo in ./.local/lib/python2.7/site-packages (from monary)
Requirement already satisfied (use --upgrade to upgrade): numpy in ./.local/lib/python2.7/site-packages (from monary)
Installing collected packages: monary
  Running setup.py install for monary ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pZlWE3/monary/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BbUPlM-record/install-record.txt --single-version-externally-managed --compile:
    /tmp/pip-build-pZlWE3/monary/setup.py:90: UserWarning: WARNING: the python package pkgconfig is not installed. If you have pkg-config installed on your system, please install the python's pkgconfig, e.g. "pip install pkgconfig". Will use libmongoc=/usr/local and libbson=/usr/local instead.
      % (mongoc_src, bson_src)))
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/monary
    copying monary/__init__.py -> build/lib.linux-x86_64-2.7/monary
    copying monary/ordereddict.py -> build/lib.linux-x86_64-2.7/monary
    copying monary/monary.py -> build/lib.linux-x86_64-2.7/monary
    copying monary/datehelper.py -> build/lib.linux-x86_64-2.7/monary
    copying monary/monary_param.py -> build/lib.linux-x86_64-2.7/monary
    copying monary/write_concern.py -> build/lib.linux-x86_64-2.7/monary
    running build_ext
    building 'monary.libcmonary' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/monary
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0 -I/usr/include/python2.7 -c monary/cmonary.c -o build/temp.linux-x86_64-2.7/monary/cmonary.o -fPIC -O2 -DNDEBUG
    monary/cmonary.c: In function ‘monary_connect’:
    monary/cmonary.c:130:9: error: unknown type name ‘mongoc_ssl_opt_t’
             mongoc_ssl_opt_t opts = { pem_file, pem_pwd, ca_file, ca_dir, crl_file,
             ^
    monary/cmonary.c:130:35: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
             mongoc_ssl_opt_t opts = { pem_file, pem_pwd, ca_file, ca_dir, crl_file,
                                       ^
    monary/cmonary.c:130:35: note: (near initialization for ‘opts’)
    monary/cmonary.c:130:45: warning: excess elements in scalar initializer
             mongoc_ssl_opt_t opts = { pem_file, pem_pwd, ca_file, ca_dir, crl_file,
                                                 ^
    monary/cmonary.c:130:45: note: (near initialization for ‘opts’)
    monary/cmonary.c:130:54: warning: excess elements in scalar initializer
             mongoc_ssl_opt_t opts = { pem_file, pem_pwd, ca_file, ca_dir, crl_file,
                                                          ^
    monary/cmonary.c:130:54: note: (near initialization for ‘opts’)
    monary/cmonary.c:130:63: warning: excess elements in scalar initializer
             mongoc_ssl_opt_t opts = { pem_file, pem_pwd, ca_file, ca_dir, crl_file,
                                                                   ^
    monary/cmonary.c:130:63: note: (near initialization for ‘opts’)
    monary/cmonary.c:130:71: warning: excess elements in scalar initializer
             mongoc_ssl_opt_t opts = { pem_file, pem_pwd, ca_file, ca_dir, crl_file,
                                                                           ^
    monary/cmonary.c:130:71: note: (near initialization for ‘opts’)
    monary/cmonary.c:131:13: warning: excess elements in scalar initializer
                 weak_cert_validation
                 ^
    monary/cmonary.c:131:13: note: (near initialization for ‘opts’)
    monary/cmonary.c:133:9: warning: implicit declaration of function ‘mongoc_client_set_ssl_opts’ [-Wimplicit-function-declaration]
             mongoc_client_set_ssl_opts(client, &opts);
             ^
    monary/cmonary.c: In function ‘monary_load_query’:
    monary/cmonary.c:1018:9: warning: variable ‘total_values’ set but not used [-Wunused-but-set-variable]
         int total_values;
             ^
    monary/cmonary.c: In function ‘monary_insert’:
    monary/cmonary.c:1406:5: warning: ‘mongoc_client_get_max_message_size’ is deprecated [-Wdeprecated-declarations]
         max_message_size = mongoc_client_get_max_message_size(client);
         ^
    In file included from /usr/local/include/libmongoc-1.0/mongoc.h:26:0,
                     from monary/cmonary.c:8:
    /usr/local/include/libmongoc-1.0/mongoc-client.h:139:32: note: declared here
     int32_t                        mongoc_client_get_max_message_size (mongoc_client_t              *client) BSON_GNUC_DEPRECATED;
                                    ^
    monary/cmonary.c:1374:11: warning: unused variable ‘str’ [-Wunused-variable]
         char *str;
               ^
    monary/cmonary.c:1368:25: warning: unused variable ‘citem’ [-Wunused-variable]
         monary_column_item *citem;
                             ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pZlWE3/monary/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BbUPlM-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-pZlWE3/monary/
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Comments (5)

  1. Dennis Golomazov reporter

    Unfortunately, I couldn't rebuild MongoDB C Driver with SSL support, though it's out of Monary scope. I tried installing all necessary SSL packages and then reinstalling mongoc-driver, but it didn't help, kept getting the same compilation error. Ended up using regular pymongo for data loading for now.

  2. Log in to comment