Hide internal modified libsvm
Mantis Issue 446, reported by jmalik, assigned to mgrizonnet, created: 2011-12-09
In the frame of what is already done for ossim and curl, we should :
- remangle the libsvm symbol to avoid runtime conflicts
- provide a wrapper in Code/UtilitiesWrapper to avoid requiring installation of libsvm headers when installing OTB
1324477338 - grizonnetmHi, I understand the point 2 (provide wrapper in ThirdPartUtilities) but I am not sure to understand what should be done for the point 1 (remangling).
1324478658 - julienmThe idea for point 1 is that the library otbsvm.so does not export any of the original libsvm symbols.
As the internal version of otb is heavily modified, all those functions should be renamed : svm_train -> otb_svm_train for example.
One good implementation example is in ITK/Utilities/itktiff. This is exactly what is done. Usually a bunch of well-placed #define is sufficient, ans avoids modifications in the code itself.
To extract the symbols list, you can use "nm" on a static version of the lib (or remove _init and _fini symbols from the shared lib), though I've been told it may not be enough (all global symbols should be renamed too, not only function names). For this, gdal libtiff remangling is a good example.
1324478710 - julienmLook here : http://svn.osgeo.org/gdal/trunk/gdal/frmts/gtiff/