Project

General

Profile

Feature #976

Include Run-Time Search Path for Cmake Builds in exiv2 binary

Added by Nehal J Wani over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
build
Target version:
Start date:
02 Aug 2014
Due date:
% Done:

0%

Estimated time:

Description

When exiv2 is built using: make config; ./configure; sudo make install:
➜ build objdump -x $(which exiv2) | grep RPATH
RPATH /usr/local/lib
When exiv2 is built using: mkdir build; cd build; cmake ../; sudo make install:
➜ build objdump -x $(which exiv2) | grep RPATH
➜ build

On operating systems like Fedora, the default search path for libraries doesn't include /usr/local/lib and hence, on executing the binary compiled using cmake, once gets:
➜ build exiv2
exiv2: error while loading shared libraries: libexiv2.so.13: cannot open shared object file: No such file or directory
➜ build ldd $(which exiv2)
linux-vdso.so.1 => (0x00007fff0ffdf000)
libexiv2.so.13 => not found
libdl.so.2 => /lib64/libdl.so.2 (0x0000003b51800000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x0000003b56c00000)
libz.so.1 => /lib64/libz.so.1 (0x0000003b51c00000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x0000003672200000)
libm.so.6 => /lib64/libm.so.6 (0x0000003b51000000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003671a00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003b50c00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003b50400000)

Associated revisions

Revision 3287 (diff)
Added by Robin Mills over 7 years ago

#976 http://dev.exiv2.org/issues/976 Thank You, Nehal for both finding and fixing this.

History

#1

Updated by Robin Mills over 7 years ago

  • Category set to build
  • Status changed from New to Assigned
  • Assignee set to Nehal J Wani
  • Target version set to 0.25

Good find, Nehal. If you could submit a fix, I will test your fix on Mac/Cygwin/Ubuntu.

#2

Updated by Gilles Caulier over 7 years ago

==> make config

This is not cmake config rule, but standard automake.

To configure Exiv2 with cmake, take a look to READM-CMAKE file for details...

Gilles Caulier

#3

Updated by Gilles Caulier over 7 years ago

  • Subject changed from Include Run-Time Search Path for CMake Builds in exiv2 binary to Include Run-Time Search Path for Automake Builds in exiv2 binary
#4

Updated by Nehal J Wani over 7 years ago

@Gilles
I think you misunderstood my problem description. I was saying that standard make config included RPATH in the binary. We need to do the same for CMake builds.

The simple solution for this is to add:

SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

to the file

trunk/CMakeLists.txt
#5

Updated by Robin Mills over 7 years ago

Thanks for speaking about this, Gilles. I believe Nehal is saying that the automake process is fine ( $ make config ; ./configure ; make etc).

However CMake on Fedora isn't linking correctly and requires some RPATH magic to be added. I think this is a Fedora/CMake issue. I've never seen this on the Mac or Ubuntu.

So, I think Nehal's original title is correct by associating this issue to CMake and not automate. As always, I could be wrong!

#6

Updated by Gilles Caulier over 7 years ago

  • Subject changed from Include Run-Time Search Path for Automake Builds in exiv2 binary to Include Run-Time Search Path for Cmake Builds in exiv2 binary
#7

Updated by Gilles Caulier over 7 years ago

Right i read too fast...

But i never seen this kind of error under Linux, OSX and Windows using CMake (i always use CMake everywhere)

Gilles Caulier

#8

Updated by Gilles Caulier over 7 years ago

Sound like the solution is given here :

http://www.cmake.org/pipermail/cmake/2010-February/035157.html

Gilles Caulier

#9

Updated by Robin Mills over 7 years ago

  • Status changed from Assigned to Resolved

Fix submitted r3285. Thank You, Nehal for finding and fixing this.

#10

Updated by Andreas Huggel over 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF