MantisBT - CMake
View Issue Details
0014941CMakeCCMakepublic2014-05-28 13:132016-06-10 14:31
Chad Balen 
Kitware Robot 
normalmajoralways
closedmoved 
x86_64OpenSUSE12.3
CMake 2.8.8 
 
0014941: Can't install Metis with ExternalPackage_Add module
The typical terminal commands to install Metis are:
$ make config shared=1 prefix=/path/to/installation
$ make # Alternatively you can skip make and just do: make install
$ make install

**If you go to line 7 of my CMake script (in steps to reproduce text box) you can copy the URL to download a copy of Metis.

When I run the equivalent commands in the ExternalPackage_Add module (See steps to reproduce text box) I get the following error at the end of the build process (or if you skip the make command and just do make install in the BUILD_COMMAND then CMake gives the same error but now after installing):

[100%] Built target ndmetis
make[4]: *** No rule to make target `s'. Stop.
gmake[3]: *** [all] Error 2
make[2]: *** [Metis-prefix/src/Metis-stamp/Metis-build] Error 2
make[1]: *** [CMakeFiles/Metis.dir/all] Error 2
make: *** [all] Error 2
In one directory above the source folder (where source folder is named: src) run commands in terminal:
$ mkdir Build
$ mkdir Install
$ cd Build
$ cmake ../src -DCMAKE_INSTALL_PREFIX=../Install
$ make

Where you use the following CMake script in src folder:

cmake_minimum_required(VERSION 2.8.8)
project(MetisBuild)
include(ExternalProject)

#SET(CMAKE_VERBOSE_MAKEFILE ON) #line 5
ExternalProject_Add(Metis
  URL http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz [^] #line 7
  URL_MD5 0
  DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/Metis
  SOURCE_DIR ${CMAKE_SOURCE_DIR}/Metis/src
  BUILD_IN_SOURCE 1
  UPDATE_COMMAND ""
  CONFIGURE_COMMAND ${CMAKE_BUILD_TOOL} config shared=1 prefix=${CMAKE_INSTALL_PREFIX}/Metis
  BUILD_COMMAND ${CMAKE_BUILD_TOOL} #line 14
  #BUILD_COMMAND ${CMAKE_BUILD_TOOL} install #line 15
  INSTALL_COMMAND ${CMAKE_BUILD_TOOL} install #line 16
)


***At end of build process you get the error shown in the description text box. If you remove the comment from line 15 and instead comment out lines 14 and 16 the same error occurs but now after it installs Metis.
I mentioned this issue initially in the mailing list (https://www.mail-archive.com/cmake@cmake.org/msg49029.html [^]) Norman K Williams responded and was able to reproduce the error on his machine as well. He noticed that if he set CMAKE_VERBOSE_MAKEFILE to ON then the build succeeded but I was unable to reproduce that result on my machine. Instead if I removed the comment from line 5 to set VERBOSE to ON then the error I received was:

[100%] Built target ndmetis
make[5]: Leaving directory `/home/cbalen/ConvertCmake/CMakeTutorial/Mine/12a_Metis2/src/Metis/src/build/Linux-x86_64'
/usr/bin/cmake -E cmake_progress_start /home/cbalen/ConvertCmake/CMakeTutorial/Mine/12a_Metis2/src/Metis/src/build/Linux-x86_64/CMakeFiles 0
make[4]: *** No rule to make target `w'. Stop.
make[4]: Leaving directory `/home/cbalen/ConvertCmake/CMakeTutorial/Mine/12a_Metis2/src/Metis/src/build/Linux-x86_64'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/home/cbalen/ConvertCmake/CMakeTutorial/Mine/12a_Metis2/src/Metis/src'
make[2]: *** [Metis-prefix/src/Metis-stamp/Metis-build] Error 2
make[2]: Leaving directory `/home/cbalen/ConvertCmake/CMakeTutorial/Mine/12a_Metis2/Build'
make[1]: *** [CMakeFiles/Metis.dir/all] Error 2
make[1]: Leaving directory `/home/cbalen/ConvertCmake/CMakeTutorial/Mine/12a_Metis2/Build'
make: *** [all] Error 2
make: *** No rule to make target `install'. Stop.

So same thing but the target changed from 's' to 'w'
No tags attached.
txt Metis_ConfigAndMake_Report.txt (13,349) 2014-05-28 13:13
https://public.kitware.com/Bug/file/5156/Metis_ConfigAndMake_Report.txt
? metis-nested-make.sh (255) 2014-05-28 14:53
https://public.kitware.com/Bug/file/5157/metis-nested-make.sh
Issue History
2014-05-28 13:13Chad BalenNew Issue
2014-05-28 13:13Chad BalenFile Added: Metis_ConfigAndMake_Report.txt
2014-05-28 14:53Brad KingFile Added: metis-nested-make.sh
2014-05-28 14:55Brad KingNote Added: 0035955
2016-06-10 14:29Kitware RobotNote Added: 0042553
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035955)
Brad King   
2014-05-28 14:55   
I can reproduce this without CMake using the attached "metis-nested-make.sh" script. The problem is in the Metis Makefile on this line:

               make -C $(BUILDDIR) $@ $(MAKEFLAGS); \

The direct reference to $(MAKEFLAGS) should be dropped. The make tool should automatically honor that from the environment. Currently the outer make sets the MAKEFLAGS to something that looks like a target name when referenced on the command line like that.
(0042553)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.