lianlab / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

[PATCH] CMake project doesn't install libraries in correct destination directory #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Building bullet on a GNU/Linux 64 bit architecture through CMake
2. Installing bullet through 'make install' 

What is the expected output? What do you see instead?
On a 64 bit GNU/Linux, libraries are supposed to be installed in
/usr/lib64/ but CMake try to install them in /usr/lib/.

What version of the product are you using? On what operating system?
Bullet-2.73-sp1 (but it seems to still be there  in the trunk)
I am using GNU/Linux Fedora (my personal machine and Fedora's build farm)

Please provide any additional information below.
I am trying to make a rpm package of bullet as shared libraries.
The issue comes from CMake configuration files. They use 'lib' as the
destination directory for libraries. A simple way for fixing that is to use
${LIB_SUFFIX} which will be set to 64 for 64 bit architectures.

Please find attached a patch which will replace 'lib' by lib${LIB_SUFFIX}.

This has successfully been tested on my 32 bit personal machine and
Fedora's build farm (ppc64, x64, 32bit)

Original issue reported on code.google.com by brum...@gmail.com on 18 Jan 2009 at 5:11

Attachments:

GoogleCodeExporter commented 9 years ago

Thanks for the patch. Where is this LIB_SUFFIX initialized?

Some projects set it manually in their CMakeList.txt like this, is this 
necessary?

IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
    SET(LIB_SUFFIX "")
  ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
    SET(LIB_SUFFIX 64)

Thanks,
Erwin

Original comment by erwin.coumans on 19 Jan 2009 at 7:25

GoogleCodeExporter commented 9 years ago
In my case this is initialized through rpmbuild which will call cmake when 
generating
a rpm.
See /etc/rpm/macros.cmake :

#
# Macros for cmake
#
%_cmake_lib_suffix64 -DLIB_SUFFIX=64
%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON
%__cmake %{_bindir}/cmake

%cmake \
  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
  %__cmake \\\
        -DCMAKE_VERBOSE_MAKEFILE=ON \\\
        -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
        -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\
        -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\
        -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\
        -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
        -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\
%if "%{?_lib}" == "lib64" \
        %{?_cmake_lib_suffix64} \\\
%endif \
        %{?_cmake_skip_rpath} \\\
        -DBUILD_SHARED_LIBS:BOOL=ON

I am no expert in CMake, but from what I have seen on my machine (in 32 bit): 
when
running it, it would get replaced by "" if LIB_SUFFIX is not defined, which 
would not
break the build.
It is also used by most of the GNU/Linux distributions.
So manually setting this variable doesn't seem necessary. Or at least we should
provide a way for the user to override this (for instance manually setting the 
value,
only if it hasn't been defined yet)

Here are some links to similar issues with some other projects:
http://bugs.scribus.net/view.php?id=6010
http://www.licq.org/ticket/1649

Original comment by brum...@gmail.com on 19 Jan 2009 at 8:57

GoogleCodeExporter commented 9 years ago
Hello i'm the fedora package maintainer of this lib and i see that this problem 
is
open in 2.75. Have you any plans abot adding the patch?

Original comment by linuxdon...@gmail.com on 24 Sep 2009 at 11:12

GoogleCodeExporter commented 9 years ago
Sorry for the delay. The patch has been applied in latest trunk.

Can you check if all compiles/links/installs fine?

Original comment by erwin.coumans on 3 Nov 2009 at 6:01

GoogleCodeExporter commented 9 years ago
i use this patch on the fedora 12 package. And it works.

Original comment by linuxdon...@gmail.com on 21 Jan 2010 at 11:48

GoogleCodeExporter commented 9 years ago
Patch for bullet 2.77 for the new libs in bullet.

Original comment by linuxdon...@gmail.com on 28 Sep 2010 at 11:06

Attachments:

GoogleCodeExporter commented 9 years ago
fixed the patch

Original comment by linuxdon...@gmail.com on 28 Sep 2010 at 11:32

Attachments: