HI Fabien,

I tried to get things compile with a static build of NVTT but in the
end it required me to statically linking in OpenEXP and libsquish as
well at which point, like you I gave up.  It should be possible to get
it all to work though given enough patience.

With a dynamic build, the use of -fPIC and enabling of the Release
build of NVTT finally got me a lib that worked with VPB and working as
efficiently as the old GL based compression code.  Horahh!!

To test out the build of VPB against NVTT and GL I added a CMake
option BUILD_USE_NVTT_WHEN_AVAILABLE that defaults to TRUE, this
allows me to toggle between the two types of build.  With this
addition and few extras for opening the door for the static build I
have checked your changes in into VPB svn/trunk.

Cheers,
Robert.

On Fri, Sep 10, 2010 at 1:13 PM, Fabien Lavignotte
<[email protected]> wrote:
> Hi Robert,
> By default, nvtt builds the static version of the lib, but as you see
> its buggy on linux.
> You can set NVTT_SHARED=TRUE to produce shared libs. Sorry, I totally
> forget to tell you to compile NVTT as a shared library.
> In fact, i did try to link with static lib, and i did the same
> modification (add -fPIC), then it was needed to add all the library
> (nvcore, nvimage, nvmath).
> I didn't remember well, but i think there is still something not
> working, so i give up and use the shared lib.
> On windows, it works ok without modification.
>
> Fabien
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> Robert Osfield
> Sent: vendredi 10 septembre 2010 13:50
> To: OpenSceneGraph Submissions
> Subject: Re: [osg-submissions] [vpb] Using NVTT to work without
> graphicscontext
>
> Hi Fabien,
>
> I'm currently integrating your changes.  First thumbs up from me, you've
> made the integration of NVTT very clean and maintainable :-)
>
> Now.. the tricky bits.. I've download
> nvidia-texture-tools-2.0.8-1.tar.gz and compiled it.  It uses CMake
> which is great, I built and installed and then attempted to configure
> VPB to pick on the libs, but it didn't fine the libs.  For my build NTT
> placed static libs in /usr/local/lib/static so I then added lib/static
> and lib64/static to the FindNVTT script and it found them.
>  Then on buildingt VPB I got an error about needing to build NVTT with
> -fPIC:
>
> /usr/bin/ld: /usr/local/lib/static/libnvtt.a(Compressor.cpp.o):
> relocation R_X86_64_32S against `vtable for nv::BoxFilter' can not be
> used when making a shared object; recompile with -fPIC
> /usr/local/lib/static/libnvtt.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
>
> So I went into CMake and added -fPIC, rebuilt NVTT and then installed.
>  This got me a bit further, but then got the error:
>
> Linking CXX shared library ../../lib/libvpb.so [ 88%] Built target vpb [
> 91%] Building CXX object
> applications/osgdem/CMakeFiles/application_osgdem.dir/osgdem.o
> Linking CXX executable ../../bin/osgdem
> ../../lib/libvpb.so.0.9.11: undefined reference to `nv::Image::pixels()'
> ../../lib/libvpb.so.0.9.11: undefined reference to `nv::Image::Image()'
> ../../lib/libvpb.so.0.9.11: undefined reference to
> `nv::AlphaBlockDXT5::index(unsigned int) const'
> ../../lib/libvpb.so.0.9.11: undefined reference to
> `nv::FloatImage::createImage(unsigned int, unsigned int) const'
>
>
> Which suggests to me that I need to added NVTT to library list of
> osgdem, vpbmaster, or possible just the vpb lib.   I have to go out
> right now so can't tinker further.
>
> What platform did you build and test with?
>
> Cheers,
> Robert.
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegr
> aph.org
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to