View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011910CMakeModulespublic2011-03-01 03:582012-07-09 06:52
ReporterRaymond Wan 
Assigned ToRolf Eike Beer 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformAMD64OSDebianOS Version6.0
Product VersionCMake-2-8 
Target VersionCMake 2.8.8Fixed in VersionCMake 2.8.8 
Summary0011910: FindOpenMP.cmake requires both C and CXX
DescriptionIf only CXX is enabled and not C, then many errors are produced that look like this (path shortened):

-- Performing Test OpenMP_FLAG_DETECTED
CMake Error: Unknown extension ".c" for file ".../build/CMakeFiles/CMakeTmp/src.c". TRY_COMPILE only works for enabled languages.
Currently enabled languages are: CXX
See PROJECT command for help enabling other languages.

Looking at the module, it seems that (1) it performs both the C and CXX tests unconditionally. So if C is not enabled, then the C tests will generate the above error. (2) Also, at the end of the module, the use of find_package_handle_standard_args() seems to require that both C and CXX flags have to be set.

Also, (3) there is a minor problem with the check_c_source_compiles () using the CXX source, and vice-versa. (As the two sources are identical, the effect is trivial.)

-----

Notes:
1) Debian 6.0 is using cmake 2.8.2 . However, looking at 2.8.4, it seems that the problem still persists.
2) A similar problem for an entirely different module appears to be described here: http://www.mail-archive.com/cmake@cmake.org/msg06043.html [^]]

Steps To ReproduceHave a PROJECT () line with just CXX and no C enabled.
Additional InformationAttached is a diff file with changes that hopefully addresses the 3 problems above by performing the test only if either the C or CXX compiler is defined. The diff file is generated against the newer 2.8.4 and not the 2.8.2 that I'm using.

As I'm not experienced with cmake, hopefully it is correct and of some help.

TagsNo tags attached.
Attached Filespatch file icon FindOpenMP.2-8-4.patch [^] (3,209 bytes) 2011-03-01 03:58 [Show Content]

 Relationships

  Notes
(0028515)
Justin (reporter)
2012-02-06 07:42

Patch works fine, please apply.
(0028525)
Rolf Eike Beer (developer)
2012-02-08 13:04

Pushed fix to next:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=81228e9d1d94cb55fa0a75b474c5a3283b39551a [^]

It's not your one, but does the same.
(0029964)
David Cole (manager)
2012-07-09 06:52

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-03-01 03:58 Raymond Wan New Issue
2011-03-01 03:58 Raymond Wan File Added: FindOpenMP.2-8-4.patch
2012-02-06 07:42 Justin Note Added: 0028515
2012-02-08 13:04 Rolf Eike Beer Note Added: 0028525
2012-02-08 13:04 Rolf Eike Beer Assigned To => Rolf Eike Beer
2012-02-08 13:04 Rolf Eike Beer Status new => resolved
2012-02-08 13:04 Rolf Eike Beer Resolution open => fixed
2012-02-08 13:04 Rolf Eike Beer Fixed in Version => CMake 2.8.8
2012-02-08 13:04 Rolf Eike Beer Target Version => CMake 2.8.8
2012-07-09 06:52 David Cole Note Added: 0029964
2012-07-09 06:52 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team