MantisBT - CMake
View Issue Details
0012253CMakeCPackpublic2011-06-07 10:192011-06-10 05:04
Fabien Spindler 
Eric NOULARD 
normalmajorsometimes
closedwon't fix 
LinuxFedora15 x86_64
CMake 2.8.4 
CMake 2.8.4 
0012253: CPack RPM generator self dependency trouble
I'm able to produce an rpm package on my fedora 15 x86_64 system with cmake 2.8.4, but when I try to install the package I get the following error:

$ rpm -i libvisp-devel-2.6.1-1.fc15.x86_64.rpm
error: Failed dependencies:
        libvisp-2.so.2()(64bit) is needed by libvisp-devel-2.6.1-1.x86_64

libvisp-2 is created as a shared library by cmake:
ADD_LIBRARY(visp-2 ..)
SET_TARGET_PROPERTIES(visp-2 PROPERTIES
  VERSION "2.6.1"
  SOVERSION "2"
  )
INSTALL(TARGETS visp-2
  DESTINATION lib
  PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
  COMPONENT libraries
  )
 
In _CPack_Packages/x86_64/RPM/SPECS/libvisp-devel.spec I have:

Requires: cmake >= 2.6, libX11-devel >= 1.3, lapack-devel >= 3.2, libv4l-devel >= 0.6.2, libdc1394-devel >= 2.1.2, libxml2-devel >= 2.7.6, libpng-devel >= 2:1.2.44, libjpeg-devel >= 6b-46, Coin2-devel >= 2.5.0, SoQt-devel >= 1.5.0, opencv-devel >= 2.0

%files
%defattr(-,root,root,-)
"/usr/lib/libvisp-2.so"
"/usr/lib/libvisp-2.so.2"
"/usr/lib/libvisp-2.so.2.6.1"

Here libvisp-2.so and libvisp-2.so.2 are symlinks to libvisp-2.so.2.6.1. The symlinks are created by cmake.

Note that when I build the library visp-2 as a static library libvisp-2.a, I'm able to install properly the rpm.

Any suggestion?
Thanks

Fabien
This bug seems in relation with 0009927: CPack RPM generator does not seem to install symlinks
No tags attached.
related to 0009927closed Eric NOULARD CPack RPM generator does not seem to install symlinks 
related to 0011964closed Eric NOULARD Handle lib64 library on Linux 
? libvisp-devel.spec (9,359) 2011-06-08 09:54
https://public.kitware.com/Bug/file/3919/*
? rpmbuild.out (778) 2011-06-09 01:28
https://public.kitware.com/Bug/file/3922/rpmbuild.out
Issue History
2011-06-07 10:19Fabien SpindlerNew Issue
2011-06-08 04:04Eric NOULARDAssigned To => Eric NOULARD
2011-06-08 04:04Eric NOULARDStatusnew => assigned
2011-06-08 04:05Eric NOULARDRelationship addedrelated to 0009927
2011-06-08 04:11Eric NOULARDRelationship addedrelated to 0011964
2011-06-08 04:25Eric NOULARDNote Added: 0026748
2011-06-08 04:58Eric NOULARDNote Added: 0026752
2011-06-08 09:31Fabien SpindlerNote Added: 0026757
2011-06-08 09:43Eric NOULARDNote Added: 0026758
2011-06-08 09:46Eric NOULARDNote Added: 0026759
2011-06-08 09:54Fabien SpindlerFile Added: libvisp-devel.spec
2011-06-08 10:02Fabien SpindlerNote Added: 0026760
2011-06-08 13:10Fabien SpindlerNote Added: 0026765
2011-06-08 13:39Eric NOULARDNote Added: 0026766
2011-06-08 15:55Fabien SpindlerNote Added: 0026771
2011-06-08 16:04Fabien SpindlerNote Added: 0026773
2011-06-08 17:30Eric NOULARDNote Added: 0026777
2011-06-09 01:28Fabien SpindlerFile Added: rpmbuild.out
2011-06-09 09:35Eric NOULARDNote Added: 0026804
2011-06-09 09:35Eric NOULARDSummaryCPack RPM generator cannot handle dependencies with symlinks => CPack RPM generator self dependency trouble
2011-06-09 09:46Eric NOULARDNote Added: 0026806
2011-06-10 03:22Eric NOULARDNote Edited: 0026806bug_revision_view_page.php?bugnote_id=26806#r352
2011-06-10 03:28Eric NOULARDNote Added: 0026816
2011-06-10 03:29Eric NOULARDReproducibilityalways => sometimes
2011-06-10 03:29Eric NOULARDStatusassigned => feedback
2011-06-10 04:14Fabien SpindlerNote Added: 0026817
2011-06-10 04:14Fabien SpindlerStatusfeedback => assigned
2011-06-10 04:16Eric NOULARDNote Added: 0026818
2011-06-10 04:56Fabien SpindlerNote Added: 0026819
2011-06-10 05:04Eric NOULARDNote Added: 0026820
2011-06-10 05:04Eric NOULARDStatusassigned => closed
2011-06-10 05:04Eric NOULARDResolutionopen => won't fix
2011-06-10 05:04Eric NOULARDFixed in Version => CMake 2.8.4

Notes
(0026748)
Eric NOULARD   
2011-06-08 04:25   
Hi Fabien,

I'm not sure about the issue, this may be related to bug 0011964 too.
In fact I do generate RPMs on F11..F13 for projects which includes
lib and symlinks created by CMake without trouble.

I dot not have F15 x86_64 at hand, but could try 2 things:

1) build & install the very same RPM on F15 x86 (32bits)
   and/or F14 x86_64 and see what happen.

2) on 64 bits system try to install in lib64 and not lib
   i.e.
 INSTALL(TARGETS visp-2
  DESTINATION lib64
  PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
  COMPONENT libraries
  )
   
With 2.8.5 you'll be able to use GnuInstallDirs.cmake modules
which define CMAKE_INSTALL_LIBDIR with appropriate value
(lib or lib64) depending on the system.
(0026752)
Eric NOULARD   
2011-06-08 04:58   
Some complement,
If you don't want to install current 2.8.5 rc you can pick
the GNUInstallDirs.cmake module and use it locally in your project:

http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/GNUInstallDirs.cmake;h=a114dcb2e18c5c74ae32b092849b9e45be73379a;hb=126c993d [^]
(0026757)
Fabien Spindler   
2011-06-08 09:31   
Hi Eric,

Thanks for your response.
I tried your second point without success.

In the spec file _CPack_Packages/x86_64/RPM/SPECS/libvisp-devel.spec I have now:

"/usr/lib64/libvisp-2.so"
"/usr/lib64/libvisp-2.so.2"
"/usr/lib64/libvisp-2.so.2.6.1"

but when I try to install the rpm I come to the same error:

$ rpm -i libvisp-devel-2.6.1-1.fc15.x86_64.rpm
error: Failed dependencies:
        libvisp-2.so.2()(64bit) is needed by libvisp-devel-2.6.1-1.x86_64

I will now try to install Fedora 15 32bit on my VM.

Fabien
(0026758)
Eric NOULARD   
2011-06-08 09:43   
Hi Fabien,

Could you tell me what you see when doing:

rpm -qpl libvisp-devel-2.6.1-1.fc15.x86_64.rpm
rpm -qp --requires libvisp-devel-2.6.1-1.fc15.x86_64.rpm
rpm -qp --provides libvisp-devel-2.6.1-1.fc15.x86_64.rpm

and may be attaching the corresponding spec file to the tracker.
(0026759)
Eric NOULARD   
2011-06-08 09:46   
One more question.
Do you use RPM component packaging ?
If so could you try a monolithic RPM build:
see
http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#Forcing_MONOLITHIC_installers [^]
(0026760)
Fabien Spindler   
2011-06-08 10:02   
Below are the rpm command results:

$ rpm -qpl libvisp-devel-2.6.1-1.fc15.x86_64.rpm
/usr/bin/visp-config
/usr/include/visp/vp1394Grabber.h
/usr/include/visp/vp1394TwoGrabber.h
/usr/include/visp/vpAR.h
/usr/include/visp/vpAROgre.h
/usr/include/visp/vpAdaptativeGain.h
/usr/include/visp/vpAfma4.h
/usr/include/visp/vpAfma6.h
/usr/include/visp/vpArit.h
/usr/include/visp/vpBSpline.h
/usr/include/visp/vpBasicFeature.h
/usr/include/visp/vpBasicKeyPoint.h
/usr/include/visp/vpBiclops.h
/usr/include/visp/vpBound.h
/usr/include/visp/vpCalibration.h
/usr/include/visp/vpCalibrationException.h
/usr/include/visp/vpCameraParameters.h
/usr/include/visp/vpCgiconstants.h
/usr/include/visp/vpCircle.h
/usr/include/visp/vpColVector.h
/usr/include/visp/vpColor.h
/usr/include/visp/vpConfig.h
/usr/include/visp/vpCylinder.h
/usr/include/visp/vpD3DRenderer.h
/usr/include/visp/vpDebug.h
/usr/include/visp/vpDirectShowDevice.h
/usr/include/visp/vpDirectShowGrabber.h
/usr/include/visp/vpDirectShowGrabberImpl.h
/usr/include/visp/vpDirectShowSampleGrabberI.h
/usr/include/visp/vpDiskGrabber.h
/usr/include/visp/vpDisplay.h
/usr/include/visp/vpDisplayD3D.h
/usr/include/visp/vpDisplayException.h
/usr/include/visp/vpDisplayGDI.h
/usr/include/visp/vpDisplayGTK.h
/usr/include/visp/vpDisplayOpenCV.h
/usr/include/visp/vpDisplayWin32.h
/usr/include/visp/vpDisplayX.h
/usr/include/visp/vpDot.h
/usr/include/visp/vpDot2.h
/usr/include/visp/vpException.h
/usr/include/visp/vpExponentialMap.h
/usr/include/visp/vpFFMPEG.h
/usr/include/visp/vpFeatureBuilder.h
/usr/include/visp/vpFeatureDepth.h
/usr/include/visp/vpFeatureDisplay.h
/usr/include/visp/vpFeatureEllipse.h
/usr/include/visp/vpFeatureException.h
/usr/include/visp/vpFeatureLine.h
/usr/include/visp/vpFeatureLuminance.h
/usr/include/visp/vpFeaturePoint.h
/usr/include/visp/vpFeaturePoint3D.h
/usr/include/visp/vpFeaturePointPolar.h
/usr/include/visp/vpFeatureThetaU.h
/usr/include/visp/vpFeatureTranslation.h
/usr/include/visp/vpFeatureVanishingPoint.h
/usr/include/visp/vpFernClassifier.h
/usr/include/visp/vpForceTwistMatrix.h
/usr/include/visp/vpForwardProjection.h
/usr/include/visp/vpFrameGrabber.h
/usr/include/visp/vpFrameGrabberException.h
/usr/include/visp/vpGDIRenderer.h
/usr/include/visp/vpGEMM.h
/usr/include/visp/vpGenericFeature.h
/usr/include/visp/vpHinkley.h
/usr/include/visp/vpHistogram.h
/usr/include/visp/vpHistogramPeak.h
/usr/include/visp/vpHistogramValey.h
/usr/include/visp/vpHomogeneousMatrix.h
/usr/include/visp/vpHomography.h
/usr/include/visp/vpImage.h
/usr/include/visp/vpImageConvert.h
/usr/include/visp/vpImageException.h
/usr/include/visp/vpImageFilter.h
/usr/include/visp/vpImageIo.h
/usr/include/visp/vpImageMorphology.h
/usr/include/visp/vpImagePoint.h
/usr/include/visp/vpImageSimulator.h
/usr/include/visp/vpImageTools.h
/usr/include/visp/vpImstack.h
/usr/include/visp/vpIoException.h
/usr/include/visp/vpIoTools.h
/usr/include/visp/vpKalmanFilter.h
/usr/include/visp/vpKeyPointSurf.h
/usr/include/visp/vpKeyboard.h
/usr/include/visp/vpKeyword.h
/usr/include/visp/vpKltOpencv.h
/usr/include/visp/vpLaserScan.h
/usr/include/visp/vpLaserScanner.h
/usr/include/visp/vpLevenbergMarquartd.h
/usr/include/visp/vpLex.h
/usr/include/visp/vpLine.h
/usr/include/visp/vpLinearKalmanFilterInstantiation.h
/usr/include/visp/vpList.h
/usr/include/visp/vpMath.h
/usr/include/visp/vpMatrix.h
/usr/include/visp/vpMatrixException.h
/usr/include/visp/vpMbEdgeTracker.h
/usr/include/visp/vpMbTracker.h
/usr/include/visp/vpMbtDistanceCylinder.h
/usr/include/visp/vpMbtDistanceLine.h
/usr/include/visp/vpMbtHiddenFace.h
/usr/include/visp/vpMbtMeLine.h
/usr/include/visp/vpMbtXmlParser.h
/usr/include/visp/vpMe.h
/usr/include/visp/vpMeEllipse.h
/usr/include/visp/vpMeLine.h
/usr/include/visp/vpMeNurbs.h
/usr/include/visp/vpMeSite.h
/usr/include/visp/vpMeTracker.h
/usr/include/visp/vpMeterPixelConversion.h
/usr/include/visp/vpMouseButton.h
/usr/include/visp/vpMy.h
/usr/include/visp/vpNoise.h
/usr/include/visp/vpNurbs.h
/usr/include/visp/vpOpenCVGrabber.h
/usr/include/visp/vpParallelPort.h
/usr/include/visp/vpParallelPortException.h
/usr/include/visp/vpParseArgv.h
/usr/include/visp/vpPixelMeterConversion.h
/usr/include/visp/vpPlanarObjectDetector.h
/usr/include/visp/vpPlane.h
/usr/include/visp/vpPlot.h
/usr/include/visp/vpPlotCurve.h
/usr/include/visp/vpPlotGraph.h
/usr/include/visp/vpPoint.h
/usr/include/visp/vpPolygon.h
/usr/include/visp/vpPose.h
/usr/include/visp/vpPoseException.h
/usr/include/visp/vpPoseVector.h
/usr/include/visp/vpProjectionDisplay.h
/usr/include/visp/vpPtu46.h
/usr/include/visp/vpRGBa.h
/usr/include/visp/vpRansac.h
/usr/include/visp/vpRect.h
/usr/include/visp/vpRfstack.h
/usr/include/visp/vpRingLight.h
/usr/include/visp/vpRobot.h
/usr/include/visp/vpRobotAfma4.h
/usr/include/visp/vpRobotAfma6.h
/usr/include/visp/vpRobotBiclops.h
/usr/include/visp/vpRobotBiclopsController.h
/usr/include/visp/vpRobotCamera.h
/usr/include/visp/vpRobotCycab.h
/usr/include/visp/vpRobotException.h
/usr/include/visp/vpRobotPtu46.h
/usr/include/visp/vpRobotSimulator.h
/usr/include/visp/vpRobotTemplate.h
/usr/include/visp/vpRobotViper850.h
/usr/include/visp/vpRobust.h
/usr/include/visp/vpRotationMatrix.h
/usr/include/visp/vpRotationVector.h
/usr/include/visp/vpRowVector.h
/usr/include/visp/vpRxyzVector.h
/usr/include/visp/vpRzyxVector.h
/usr/include/visp/vpRzyzVector.h
/usr/include/visp/vpScale.h
/usr/include/visp/vpScanPoint.h
/usr/include/visp/vpServo.h
/usr/include/visp/vpServoData.h
/usr/include/visp/vpServoDisplay.h
/usr/include/visp/vpServoException.h
/usr/include/visp/vpServolens.h
/usr/include/visp/vpSickLDMRS.h
/usr/include/visp/vpSimulator.h
/usr/include/visp/vpSimulatorAfma6.h
/usr/include/visp/vpSimulatorException.h
/usr/include/visp/vpSimulatorViper850.h
/usr/include/visp/vpSkipio.h
/usr/include/visp/vpSphere.h
/usr/include/visp/vpSubColVector.h
/usr/include/visp/vpSubMatrix.h
/usr/include/visp/vpSubRowVector.h
/usr/include/visp/vpThetaUVector.h
/usr/include/visp/vpTime.h
/usr/include/visp/vpTmstack.h
/usr/include/visp/vpToken.h
/usr/include/visp/vpTracker.h
/usr/include/visp/vpTrackingException.h
/usr/include/visp/vpTranslationVector.h
/usr/include/visp/vpTriangle.h
/usr/include/visp/vpTwistMatrix.h
/usr/include/visp/vpV4l2Grabber.h
/usr/include/visp/vpVelocityTwistMatrix.h
/usr/include/visp/vpVideoReader.h
/usr/include/visp/vpVideoWriter.h
/usr/include/visp/vpView.h
/usr/include/visp/vpViewer.h
/usr/include/visp/vpViper.h
/usr/include/visp/vpViper850.h
/usr/include/visp/vpVwstack.h
/usr/include/visp/vpWin32Renderer.h
/usr/include/visp/vpWin32Window.h
/usr/include/visp/vpWireFrameSimulator.h
/usr/include/visp/vpXmlParser.h
/usr/include/visp/vpXmlParserCamera.h
/usr/lib64/libvisp-2.so
/usr/lib64/libvisp-2.so.2
/usr/lib64/libvisp-2.so.2.6.1
/usr/share/visp/VISPBuildSettings.cmake
/usr/share/visp/VISPConfig.cmake
/usr/share/visp/VISPLibraryDepends.cmake
/usr/share/visp/VISPUse.cmake
/usr/share/visp/ViSP-third-party.txt

$ rpm -qp --requires libvisp-devel-2.6.1-1.fc15.x86_64.rpm
/bin/sh
/bin/sh
/bin/sh
/bin/sh
/bin/sh
cmake >= 2.6
lapack-devel >= 3.2
libX11-devel >= 1.3
libdc1394-devel >= 2.1.2
libjpeg-devel >= 6b-46
libpng-devel >= 2:1.2.44
libv4l-devel >= 0.6.2
libvisp-2.so.2()(64bit)
libxml2-devel >= 2.7.6
opencv-devel >= 2.0
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1


$ rpm -qp --provides libvisp-devel-2.6.1-1.fc15.x86_64.rpm
libvisp-devel = 2.6.1-1
libvisp-devel(x86-64) = 2.6.1-1

I see here a dash instead of an underscore in (x86-64) which seems strange to me!

Attached you will also found the spec file.

I use componant packaging. If I add set(CPACK_MONOLITHIC_INSTALL 1)
to build a monolithic rpm I get the same error.
(0026765)
Fabien Spindler   
2011-06-08 13:10   
I have the same error on a F15 32bits.
(0026766)
Eric NOULARD   
2011-06-08 13:39   
Thank you for testing Fabien.
I'll try myself on some F14 or F15 32 bits tomorrow.

Currently I have no clue why it is requesting a dependency on itself.
By the way is the visp project this one:
https://gforge.inria.fr/scm/?group_id=397 [^]

Is the current problem occuring on svn trunk or in some
uncommited changes?

I may have a look at the set of CMakeLists.txt you use
may I'll find something unsual.
(0026771)
Fabien Spindler   
2011-06-08 15:55   
Yes, you point out the right project. The problem appears in the trunk

svn checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP [^] ViSP-code

The CPack config is handled in
CMakeModules/CPackConfig.cmake and
CMakeModules/CPackConfigRpm.cmake

Thanks
(0026773)
Fabien Spindler   
2011-06-08 16:04   
If I remove all the material to handle components I get the same error.
(0026777)
Eric NOULARD   
2011-06-08 17:30   
I saw nothing special inside CMakeLists.txt

I'll try tomorrow on Fedora but could attach the rpmbuild output
_CPack_Packages/x86_64/RPM/rpmbuild.out
to the tracker.
(0026804)
Eric NOULARD   
2011-06-09 09:35   
Renaming because the title is misleading
(0026806)
Eric NOULARD   
2011-06-09 09:46   
(edited on: 2011-06-10 03:22)
Hi Fabien,
Thanks you for the rpmbuild.out.

I did try to produce your RPM in a FC15-64 VM and I can reproduce the issue.

Now I know the precise symptom but I am not able to track down the cause...

In the process of building an RPM, rpmbuild scans the packaged files
in order to discover dependencies:
 http://www.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html [^]

In your case
/usr/lib/rpm/find-requires does find the required dependencies
but
/usr/lib/rpm/find-provides does NOT!!!

(this is NOT shown in rpmbuild.our after the line
  "Processing files: libvisp-devel-2.6.1-1.x86_64"
  Provides should appear here and there is none)

I tried with another project (https://savannah.nongnu.org/projects/certi/ [^])
which builds shared libs and its works as expected.

There must be something odd I did not catch in your case.

May be you can try yourself with a stupid project build 1 shared lib and 1 exe
depending on it and you'll see (I hope) that the rpm building just works...

I suspect rpmbuild is not scanning the appropriate directory but
I cannot understand why it would work for requires and not for provides...

(0026816)
Eric NOULARD   
2011-06-10 03:28   
Hi Fabien,

I did some more investigation this morning and I must admit I did not
find anything uselfull. I wasn't able to find what in your CMake configuration
could cause this...
Launching rpmbuild by hand with extra verbose mode -vv did not bring more infos.

The fact that F15 32 bits show the same issue makes me think that
the culprit should be in the generated spec files somehow.

Do you have some other project for which you build RPMs with CPack ?
If yes do they exhibit the same kind of problem?
(0026817)
Fabien Spindler   
2011-06-10 04:13   
I will create a new basic project to see if I can reproduce the error on it.
(0026818)
Eric NOULARD   
2011-06-10 04:16   
Argh!!!

I found the culprit:
INSTALL(TARGETS visp-2
  DESTINATION lib
  PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
  COMPONENT libraries
  )

you install the lib without execute permission which seems to break
the automatic provides machinery of rpmbuild.

could you try with:
INSTALL(TARGETS visp-2
  DESTINATION lib
  PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
  COMPONENT libraries
  )

and tell me if the generated rpm becames installable after that.
You can check the rpm using:

rpm -qp --provides libvisp-devel-2.6.1-1.fc15.x86_64.rpm
(0026819)
Fabien Spindler   
2011-06-10 04:56   
Wonderful it works.

$ rpm -qp --provides libvisp-devel-2.6.1-1.fc15.x86_64.rpm
libvisp-2.so.2()(64bit)
libvisp-devel = 2.6.1-1
libvisp-devel(x86-64) = 2.6.1-1

Merci beaucoup.

Fabien
(0026820)
Eric NOULARD   
2011-06-10 05:04   
This wasn't really a CPackRPM issue but a previously unknown rpmbuild behavior which does not handle library dependency discovery properly if they are not executable.