Bug 1175

Summary: the shared libraries is not versioned (With patch)
Product: ns-3 Reporter: YunQiang Su <wzssyqa>
Component: build systemAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, vedran
Priority: P5    
Version: pre-release   
Hardware: All   
OS: All   
Attachments: make shared libraries be versioned

Description YunQiang Su 2011-05-31 08:43:49 UTC
Created attachment 1152 [details]
make shared libraries be versioned

The shared libraries in Linux system or some else are typical with a shared tail, just like:

liba.so.1.2.3
liba.so.1
liba.so

The liba.so.1 and liba.so are symbol links to liba.so.1.2.3.

ns-3 didn't work like this.

The attachment is my patch.
Comment 1 Gustavo J. A. M. Carneiro 2011-05-31 09:42:07 UTC
+1 on the idea in general, though there's probably a more efficient way (than reading a file) to retrieve VERSION.  We should store it in conf.env and retrieve it later in bld.env.
Comment 2 Gustavo J. A. M. Carneiro 2011-06-26 08:41:23 UTC
changeset:   7319:175c382cfab0
tag:         tip
user:        Gustavo J. A. M. Carneiro  <gjc@inescporto.pt>
date:        Sun Jun 26 13:40:27 2011 +0100
summary:     Bug 1175 - the shared libraries is not versioned, based on patch by YunQiang Su
Comment 3 Vedran Miletić 2011-06-26 15:33:10 UTC
This works now, but the other way round, i.e.

$ ls -l build/debug/
total 130112
drwxrwxr-x.  3 vedranm vedranm      4096 Jun 21 14:31 bindings
-rw-rw-r--.  1 vedranm vedranm       408 Jun 26 21:14 build-status.py
-rwxrwxr-x.  1 vedranm vedranm   2739180 Jun 26 21:13 libns3-aodv.so
lrwxrwxrwx.  1 vedranm vedranm        14 Jun 26 21:14 libns3-aodv.so.3-dev -> libns3-aodv.so

libns3-aodv.so should be a symlink to libns3-aodv.so.3-dev.
Comment 4 YunQiang Su 2011-06-26 16:14:51 UTC
Yes, the waf do it like this, but when install, it will change it, ie

when after build 
   libsss.so.1.1.1 -> libsss.so

but after install
   libsss.so -> libsss.so.1.1.1

So, it is not a problem.
Comment 5 Vedran Miletić 2011-06-26 16:20:22 UTC
Wow, interesting. Thanks for pointing it out.
Comment 6 Gustavo J. A. M. Carneiro 2011-06-27 09:55:58 UTC
Actually, I didn't test this very well, there is a problem:


gjc@gjc-laptop:ns-3-dev$ ls /tmp/ns3/lib/ -l
total 57864
[...]
lrwxrwxrwx 1 gjc gjc      20 2011-06-27 14:26 libns3-aodv.so -> libns3-aodv.so.3-dev
lrwxrwxrwx 1 gjc gjc      20 2011-06-27 14:26 libns3-aodv.so.3-dev -> libns3-aodv.so.3-dev

Either WAF is just plain buggy or it doesn't like the '3-dev' version "number" which is not a usual version number...

OK, after testing it is the latter problem.  I changed vnum to 1.2.3 and:


lrwxrwxrwx 1 gjc gjc       20 2011-06-27 14:44 libns3-aodv.so -> libns3-aodv.so.1.2.3
lrwxrwxrwx 1 gjc gjc       20 2011-06-27 14:44 libns3-aodv.so.1 -> libns3-aodv.so.1.2.3
-rw-r--r-- 1 gjc gjc  3107878 2011-06-27 14:43 libns3-aodv.so.1.2.3

I fixed it by only enabling vnum if VERSION is normal X.Y.Z or X.Y number:

changeset:   7320:7334aa839e46
tag:         tip
user:        Gustavo J. A. M. Carneiro  <gjc@inescporto.pt>
date:        Mon Jun 27 14:55:11 2011 +0100
summary:     Bug 1175 postfix: only enable vnum if the VERSION matches x.y(.z) dotted number format