[CDRIVER-139] default install doesn't create mongo.so Created: 18/May/12  Updated: 11/Sep/19  Resolved: 21/May/12

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 0.5.2
Fix Version/s: 0.6

Type: Task Priority: Minor - P4
Reporter: Pawel Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Oracle Linux 6, standard packages only


Attachments: File m.diff    

 Description   

Hi.

Is there a reason the installation script doesn't link libmongoc.so.0 to libmongoc.so?
So far I didn't find a way to properly link a binary against a shared library that's not named ?.so, so without linking the names, I can't seem to link my binary against that library...

Thank you,
Pawel.



 Comments   
Comment by auto [ 01/Jun/12 ]

Author:

{u'login': u'banker', u'name': u'Kyle Banker', u'email': u'kylebanker@gmail.com'}

Message: CDRIVER-139 shared install fixes
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/bc9ec4a77f1d3b17807135ab2ee8e9dad6933863

Comment by Pawel [ 29/May/12 ]

Hi.

I've attached the diff that should resolve the remaining building and installation issues.
Here is the list of changes:

1) Makefile build: wasn't including env_* for shared lib build
2) Makefile build: standardized .so building and installation
3) SCons: installation didn't install headers
4) SCons: installation didn't create target libs
5) SCons: standardized .so building and installation

Note about .so standardization:

a) Three version components must be defined - major, minor and patch (patch should be 0 if no patch version)
b) soname will be set to 'lib.so.major.minor'. soname generally specifies binary compatibility. Tagged releases should follow this, and not changing any API signatures between patch releases
c) library installed as lib.so.major.minor.patch, lib.so.major is linked to lib.so.major.minor.patch, and lib.so linked to lib.so.major

I've tested it so that I can compile, and install, from scratch, and then link against libmongo.so, using both scons and Makefile

Thanks,
Pawel.

Comment by Pawel [ 29/May/12 ]

diff to address building/installing issues

Comment by Pawel [ 21/May/12 ]

I'm sorry but there is still something wrong. I do see that the .so is now created, but the dynamic linking fails:

[vps@druid]~/ws/EF/Listener/src$ gcc  -std=c99 -isystem/usr/local/mongo-0.6/include -L/usr/local/mongo-0.6/lib -Wl,-R/usr/local/mongo-0.6/lib -lefence -g -ggdb -o /tmp/listener -Wall -lrt -lmongoc -pthread /tmp/listener.c 
[vps@druid]~/ws/EF/Listener/src$ ldd /tmp/listener
        linux-vdso.so.1 =>  (0x00007fff811ff000)
        libefence.so.0 => /usr/lib64/libefence.so.0 (0x00007f0ddc8f0000)
        librt.so.1 => /lib64/librt.so.1 (0x0000003e59800000)
        libmongoc.so.0.5.2 => not found
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003e59000000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003e58800000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003e58400000)
[vps@druid]~/ws/EF/Listener/src$ ll /usr/local/mongo-0.6/lib
total 940
drwxr-xr-x 2 root   4096 May 21 13:44 ./
drwxr-xr-x 4 root   4096 May 21 13:44 ../
-rw-rw-r-- 1 vps  220510 May 21 13:41 libbson.a
lrwxrwxrwx 1 root     14 May 21 13:44 libbson.so -> libbson.so.0.5*
lrwxrwxrwx 1 root     14 May 21 13:44 libbson.so.0 -> libbson.so.0.5*
-rwxrwxr-x 1 vps   87916 May 21 13:41 libbson.so.0.5*
-rw-rw-r-- 1 vps  435178 May 21 13:41 libmongoc.a
lrwxrwxrwx 1 root     16 May 21 13:44 libmongoc.so -> libmongoc.so.0.5*
lrwxrwxrwx 1 root     16 May 21 13:44 libmongoc.so.0 -> libmongoc.so.0.5*
-rwxrwxr-x 1 vps  203867 May 21 13:41 libmongoc.so.0.5*

I changed VERSION from "0.5.2" to "0.5" in SConstruct, that helped.

Comment by Kyle Banker [ 21/May/12 ]

Ok. Great. Thanks.

Comment by Kyle Banker [ 21/May/12 ]

Verified that it's fixed?

Comment by Pawel [ 21/May/12 ]

Verified in master.

Comment by Kyle Banker [ 21/May/12 ]

Should be fixed in this latest commit.

Comment by auto [ 21/May/12 ]

Author:

{u'login': u'banker', u'name': u'Kyle Banker', u'email': u'kylebanker@gmail.com'}

Message: CDRIVER-139 link .so to minor name
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/c905c517ce113e8938229b12040a89586c570b1e

Comment by Kyle Banker [ 21/May/12 ]

Are you using the SCons install target or the Makefile target?

Generated at Wed Feb 07 21:08:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.