Hey Jan,
Thanks for your feedback and interest in this issue. Unfortunately I believe that checking the pointer size is not a reasonable way to determine which directory to use for the library install locations. I will outline my reasons below.
First, we initially ran into this problem when working with newer versions of ubuntu:
https://wiki.ubuntu.com/MultiarchSpec
You will notice that they have an intricate set of rules for how library directories get named. The current implementation supports this process well.
Second, just because a linux system is a 64 bit architecture does not mean that the package manager deposits 64 bit libraries in a lib64 directory. We work with SLES and openSUSE quite a bit and I know that 64 bit libraries get stored in a lib directory. This method appropriately detects when to use a lib64 directory for a given kernel.
Third, on macs the lib directory is used by default for 64 bit libraries. This implementation handles this case as well.
Fourth, while "Windows is totally stupid" might be true the standard that the broader development community has taken on this issue is that there is no lib64 directory. I think making osgBullet and osgWorks be philosophically correct is not something we want to do. In general it makes it more difficult for others to work with our projects.
Fifth, Paul and I are currently working with a couple of libraries that enforce a library install location based on the test that your are proposing and it ends up being somewhat of a hassle to deal with on the packaging, deployment, and integration front because it is different than the majority of libraries that we deal with.
Hopefully those reasons help you understand where we are coming from on this issue.
Doug
On Jun 19, 2013, at 10:29 AM, Paul Martz <
skewm...@gmail.com> wrote:
> I'm content to let you and Doug bash this out. Though I would suggest we take the discussion to osgworks-users where the reasoning and conclusions will be archived.
>
>
> On Wed, Jun 19, 2013 at 9:27 AM, Paul Martz <
skewm...@gmail.com> wrote:
> If I understand Doug's change correctly, you should be able to set CMAKE_INSTALL_LIBDIR to "lib64" and get the behavior you need. Is that not correct?
>
>
> On Wed, Jun 19, 2013 at 9:17 AM, Jan Ciger <
jan....@gmail.com> wrote:
> Hello again,
>
> On Wed, Jun 19, 2013 at 4:59 PM, Paul Martz <
skewm...@gmail.com> wrote:
> > Hey Doug -- Thanks for your recent commit. This works fine for me on 64-bit
> > Windows.
> >
> > Jan -- Doug submitted a follow-up change that uses more conventional CMake
> > rules for determining the names of the bin and lib directories. Can you
> > please give this a try and let us know how it works? Thanks.
>
> I have checked what the OSG build defines on Windows and unfortunately
> the fix is not correct.
>
> The code below which was introduced by Dough ignores Linux completely.
> I believe the CMAKE_INSTALL_LIBDIR is set to "lib" by default. It must
> be set explicitly to "lib64" on 64bit Linux if compiling for the 64bit
> ABI - that's why the pointer size test, because Linux supports both
> ABIs.
>
> I have tried to use the CMAKE_INSTALL_LIBDIR before, thinking that the
> correct directory will be selected based on the ABI, but it isn't the
> case. Not sure whether that is a gcc or CMake feature or bug. Also in
> Windows, when I am building for 64bits, the CMAKE_INSTALL_LIBDIR is
> not defined, just checked my OSG build for it. It should be probably
> "x64" to not mix 32bit and 64bit DLLs - Windows is totally stupid and
> will happily attempt to load a 32bit DLL into a 64bit binary, causing
> a crash, but that is another issue.
>
> if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
> if(WIN32)
> set(CMAKE_INSTALL_LIBDIR bin)
> else(WIN32)
> set(CMAKE_INSTALL_LIBDIR lib)
> endif(WIN32)
> endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
>
> Regards,
>
> Jan
>
>
>
> --
> Paul Martz
> Skew Matrix Software LLC
>
>
>
> --
> Paul Martz
> Skew Matrix Software LLC