Bug report #5620

libqgis_core in the build directory is not used when running crssync during build

Added by Alister Hood almost 12 years ago. Updated over 11 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Build/Install
Affected QGIS version:master Regression?:No
Operating System:linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:worksforme
Crashes QGIS or corrupts data:No Copied to github as #:15190

Description

Building on Arch Linux fails like this:

Scanning dependencies of target synccrsdb
../../output/bin/crssync: error while loading shared libraries: libqgis_core.so.1.8.0: cannot open shared object file: No such file or directory
make[2]: *** [src/crssync/CMakeFiles/synccrsdb] Error 127
make[1]: *** [src/crssync/CMakeFiles/synccrsdb.dir/all] Error 2
make: *** [all] Error 2

It looks like it is not looking for libs in the build directory, because if I copy libqgis_core.so.1.8.0 to /usr/lib, then try building again, it is successful.

History

#1 Updated by Radim Blazek almost 12 years ago

I have the same problem. It fails during the first installation. Developers do not notice that, because they have already the libs installed. I have used export LD_LIBRARY_PATH=`pwd`/src/core/:$LD_LIBRARY_PATH in build dir to get over, but that is not a solution.

#2 Updated by Radim Blazek almost 12 years ago

May be it only happens with CMAKE_SKIP_RPATH ON.

#3 Updated by Radim Blazek almost 12 years ago

I am not able to reproduce the problem anymore.

#4 Updated by Leyan Ouyang almost 12 years ago

I confirm the same problem, also on ArchLinux, now with libqgis_core.so.1.9.0, but all the rest is similar.

It is due to the line 15 in src/crssync/CMakeLists.txt :
ADD_CUSTOM_TARGET(synccrsdb COMMAND crssync)

cmake then tries to execute crssync but doesn't find libqgis_core. The LD_LIBRARY_PATH should be changed to include ${QGIS_OUTPUT_DIRECTORY}/lib but I do not know the preferred way to do this in Cmake.

#5 Updated by Jürgen Fischer over 11 years ago

Leyan Ouyang wrote:

I confirm the same problem, also on ArchLinux, now with libqgis_core.so.1.9.0, but all the rest is similar.

Is QGIS on ArchLinux built with other cmake rpath settings?

#6 Updated by Alister Hood over 11 years ago

In both https://aur.archlinux.org/packages/qg/qgis-git/PKGBUILD and https://aur.archlinux.org/packages/qg/qgis/PKGBUILD there is this:
-DCMAKE_SKIP_RPATH=ON \\
Is that what you mean?

#7 Updated by Jürgen Fischer over 11 years ago

  • Resolution set to worksforme
  • Status changed from Open to Closed

Alister Hood wrote:

In both https://aur.archlinux.org/packages/qg/qgis-git/PKGBUILD and https://aur.archlinux.org/packages/qg/qgis/PKGBUILD there is this:
-DCMAKE_SKIP_RPATH=ON \\
Is that what you mean?

Yes, that's causing the problem.

Also available in: Atom PDF