Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
934 views
in Technique[技术] by (71.8m points)

cmake - Building massif-visualizer: include could not find load file CMakeFindDependencyMacro

I am attempting to build massif-visualizer on CentOS 7. Unfortunately I'm having to try to guess at dependencies as they are not all listed in the INSTALL file. So far:

yum install git
yum install kdelibs-devel extra-cmake-modules 
            qt5-qtsvg-devel qt5-qtxmlpatterns-devel 
            kf5-kparts-devel kf5-karchive-devel
git clone https://github.com/KDE/massif-visualizer
cd massif-visualizer
mkdir build
(cd build && cmake .. && make && make install)

Those Qt5 and KF5 packages were added to the yum command largely by trial and error, and some pattern-matching from CMake error messages … but I cannot seem to figure out how to resolve these last errors:

-- Could not set up the appstream test. appstreamcli is missing.
CMake Error at /usr/lib64/cmake/KF5Archive/KF5ArchiveConfig.cmake:37 (include):
  include could not find load file:

    CMakeFindDependencyMacro
Call Stack (most recent call first):
  /usr/share/ECM/find-modules/FindKF5.cmake:74 (find_package)
  CMakeLists.txt:34 (find_package)


CMake Error at /usr/lib64/cmake/KF5Archive/KF5ArchiveConfig.cmake:38 (find_dependency):
  Unknown CMake command "find_dependency".
Call Stack (most recent call first):
  /usr/share/ECM/find-modules/FindKF5.cmake:74 (find_package)
  CMakeLists.txt:34 (find_package)

Is this because, on CentOS 7, CMake (2.8.12.2) is too old? Or something else?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Yes, CMake 2.8.12.2 is too old. Use CMake 3 instead:

yum install epel-release
yum install cmake3

(cd build && cmake3 .. && make && make install)
#                 ^

Now the installation complains about KChart but that's a separate issue.


In the end, here are my complete steps:

yum install epel-release
yum install subversion git cmake3 tar wget
yum install boost boost-devel
yum install kdelibs-devel extra-cmake-modules 
   graphviz-devel kdepim-devel 
   qt5-qtsvg-devel qt5-qtxmlpatterns-devel 
   kf5-kparts-devel kf5-karchive-devel 
   kf5-kiconthemes-devel kf5-kdoctools-devel
git clone https://github.com/KDE/massif-visualizer
wget https://download.kde.org/stable/kgraphviewer/2.4.0/kgraphviewer-2.4.0.tar.xz
wget https://download.kde.org/stable/kdiagram/2.6.0/src/kdiagram-2.6.0.tar.xz
tar xf kgraphviewer-2.4.0.tar.xz
tar xf kdiagram-2.6.0.tar.xz

for DIR in kgraphviewer-2.4.0 kdiagram-2.6.0 massif-visualizer
do
   cd $DIR
   mkdir build
   (cd build && cmake3 .. && make && make install)
   cd -
done

Then valgrind --tool=massif myApp and finally massif-visualiser massif.out.<PID> from a terminal inside a KDE session.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...