Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 518910 - dev-util/cmake-3.0.0 - CMake Error at /usr/share/cmake/Modules/FindLAPACK.cmake:374 (endif): endif An ENDIF command was found outside of a proper IF ENDIF structure.
Summary: dev-util/cmake-3.0.0 - CMake Error at /usr/share/cmake/Modules/FindLAPACK.cma...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-03 08:44 UTC by Matthias Maier
Modified: 2014-09-15 22:44 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
updated FindLAPACK patch (cmake-3.0.0-FindLAPACK.patch,1.41 KB, patch)
2014-09-15 22:00 UTC, Eugene Shalygin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Maier gentoo-dev 2014-08-03 08:44:57 UTC
The cmake-3.0.0 ebuild installs a broken FindLAPACK.cmake package:

Reproducible: Always

Steps to Reproduce:
1. Emerge cmake-3.0.0
2. Have no blas/lapack installed (other case not tested)
3. configure with the following minimal CMakeLists.txt:
  cmake_minimum_required(VERSION 3.0)
  project(test C)
  find_package(LAPACK)
Actual Results:  
Configuration bails out with:

-- A library with LAPACK API not found. Please specify library location.
CMake Error at /usr/share/cmake/Modules/FindLAPACK.cmake:374 (endif):
  endif An ENDIF command was found outside of a proper IF ENDIF structure.
  Or its arguments did not match the opening IF command.
Call Stack (most recent call first):
  CMakeLists.txt:3 (find_package)
-- Configuring incomplete, errors occurred!
...

Expected Results:  
Configuration should succeed with no internal error:

-- A library with LAPACK API not found. Please specify library location.
-- Configuring done
...

Current stable cmake-2.8.12.2-r1 works fine.

Note that FindLAPACK.cmake has 20 opening if()-statements and 22 closing endif()-statements. Given the fact that cmake-3.0.0-FindLAPACK.patch injects a matching amount of if() and endif()-statements, this might be an upstream error that badly interacts with the patch. But I haven't investigated any further.
Comment 1 Matthias Maier gentoo-dev 2014-08-03 08:56:40 UTC
Update: This also happens with installed blas/lapack.
Comment 2 Michael Palimaka (kensington) gentoo-dev 2014-08-08 17:08:19 UTC
In the patch, we do if(PC_LAPACK_FOUND) inside macro(Check_Lapack_Libraries ... ), then endif(PC_LAPACK_FOUND) *outside* the macro.

It appears that this awful behaviour is now illegal, so the patch needs refactoring.
Comment 3 Eugene Shalygin 2014-09-15 22:00:54 UTC
Created attachment 384812 [details, diff]
updated FindLAPACK patch

Allowed me to compile media-gfx/hugin
Comment 4 Johannes Huber (RETIRED) gentoo-dev 2014-09-15 22:44:27 UTC
Thanks you all. This is fixed in cvs now. Please sync in some hours to get the changes.

+
+  15 Sep 2014; Johannes Huber <johu@gentoo.org> +cmake-3.0.2.ebuild,
+  +files/cmake-3.0.2-FindLAPACK.patch, -cmake-3.0.0.ebuild,
+  -files/cmake-3.0.0-FindLAPACK.patch:
+  Version bump, adds updated patch for FindLAPACK module by Eugene Shalygin
+  <eugene.shalygin@gmail.com>, bug #518910. Remove old.
+