Ubuntu / usr / bin / ld:安装monary时找不到-lsasl2

时间:2018-04-20 11:31:30

标签: linux gcc monary

我正在尝试安装monary,并收到以下错误:

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/monary/cmonary.o -L/usr/local/lib -L/usr/local/lib -lbson-1.0 -lcrypto -lssl -lsasl2 -lmongoc-1.0 -o build/lib.linux-x86_64-2.7/monary/libcmonary.so
/usr/bin/ld: cannot find -lsasl2
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

我看了usr-bin-ld-cannot-find-lz,但仍然不知道哪个包是lsasl2的一部分? (所以我可以sudo apt-get it)

同样ld不是/usr/bin/作为目录的一部分。这是linux x86 executable。我该如何解决这个问题?

我使用16.04.4 LTS xenial Ubuntu。 完整的错误和执行如下所示:

  Collecting monary
  Downloading https://files.pythonhosted.org/packages/35/b6/230a3ec114337e324f372106b83a88efe2043f9adda551292ff57cc1262d/Monary-0.5.0.tar.gz
Requirement already satisfied: pymongo in /usr/local/lib/python2.7/dist-packages (from monary) (3.6.1)
Requirement already satisfied: numpy in /usr/local/lib/python2.7/dist-packages (from monary) (1.14.1)
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-install-nyaKSj/monary/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-7Lj0Ng/install-record.txt --single-version-externally-managed --compile:
    /tmp/pip-install-nyaKSj/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/monary.py -> build/lib.linux-x86_64-2.7/monary
    copying monary/ordereddict.py -> build/lib.linux-x86_64-2.7/monary
    copying monary/write_concern.py -> build/lib.linux-x86_64-2.7/monary
    copying monary/__init__.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
    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_init_query’:
    monary/cmonary.c:910:5: warning: ‘mongoc_collection_find’ is deprecated: Use mongoc_collection_find_with_opts instead [-Wdeprecated-declarations]
         mcursor = mongoc_collection_find(collection,
         ^
    In file included from /usr/local/include/libmongoc-1.0/mongoc-client.h:28:0,
                     from /usr/local/include/libmongoc-1.0/mongoc.h:29,
                     from monary/cmonary.c:8:
    /usr/local/include/libmongoc-1.0/mongoc-collection.h:155:1: note: declared here
     mongoc_collection_find (mongoc_collection_t *collection,
     ^
    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_create_write_concern’:
    monary/cmonary.c:1100:5: warning: ‘mongoc_write_concern_set_fsync’ is deprecated [-Wdeprecated-declarations]
         mongoc_write_concern_set_fsync(write_concern, write_concern_fsync);
         ^
    In file included from /usr/local/include/libmongoc-1.0/mongoc-bulk-operation.h:25:0,
                     from /usr/local/include/libmongoc-1.0/mongoc.h:27,
                     from monary/cmonary.c:8:
    /usr/local/include/libmongoc-1.0/mongoc-write-concern.h:51:1: note: declared here
     mongoc_write_concern_set_fsync (mongoc_write_concern_t *write_concern,
     ^
    monary/cmonary.c: In function ‘monary_insert’:
    monary/cmonary.c:1398:5: warning: ‘mongoc_collection_create_bulk_operation’ is deprecated: Use mongoc_collection_create_bulk_operation_with_opts instead [-Wdeprecated-declarations]
         bulk_op = mongoc_collection_create_bulk_operation(collection, false,
         ^
    In file included from /usr/local/include/libmongoc-1.0/mongoc-client.h:28:0,
                     from /usr/local/include/libmongoc-1.0/mongoc.h:29,
                     from monary/cmonary.c:8:
    /usr/local/include/libmongoc-1.0/mongoc-collection.h:296:1: note: declared here
     mongoc_collection_create_bulk_operation (
     ^
    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:29:0,
                     from monary/cmonary.c:8:
    /usr/local/include/libmongoc-1.0/mongoc-client.h:212:1: note: declared here
     mongoc_client_get_max_message_size (mongoc_client_t *client)
     ^
    monary/cmonary.c:1489:13: warning: ‘mongoc_collection_create_bulk_operation’ is deprecated: Use mongoc_collection_create_bulk_operation_with_opts instead [-Wdeprecated-declarations]
                 bulk_op = mongoc_collection_create_bulk_operation(collection,
                 ^
    In file included from /usr/local/include/libmongoc-1.0/mongoc-client.h:28:0,
                     from /usr/local/include/libmongoc-1.0/mongoc.h:29,
                     from monary/cmonary.c:8:
    /usr/local/include/libmongoc-1.0/mongoc-collection.h:296:1: note: declared here
     mongoc_collection_create_bulk_operation (
     ^
    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;
                             ^
    monary/cmonary.c:1430:13: warning: ‘storage’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                 bson_oid_init_from_data(&oid,
                 ^
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/monary/cmonary.o -L/usr/local/lib -L/usr/local/lib -lbson-1.0 -lcrypto -lssl -lsasl2 -lmongoc-1.0 -o build/lib.linux-x86_64-2.7/monary/libcmonary.so
    /usr/bin/ld: cannot find -lsasl2
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

我想安装monary,这样我就不必使用pd.DataFrame(list()),这对于30万个属性来说非常慢。

1 个答案:

答案 0 :(得分:2)

使用:

解决了这个问题

$foo 85 12 h=12 0.02867449 85 12 h=12 0.02013402 85 12 h=55 0.04254915

我从linked question推断 如果sudo apt-get install libsasl2-dev-lz相对应,则libz-dev应与-lsasl2对应。