Re: [cmake-developers] BlueGene/Q Platform files

2015-03-23 Thread Mark Abraham
Hi,

Looks good. We have bundled similar content in GROMACS for a while. Can I
add one for bgclang?

Mark
On 23/03/2015 6:21 am, "Todd Gamblin"  wrote:

> Done!  Thanks.
>
> On 3/20/15, 7:19 AM, "Brad King"  wrote:
>
> >On 03/19/2015 02:53 AM, Todd Gamblin wrote:
> >> Let me know if I can merge this topic to next.
> >
> >Yes, please.
> >
> >Thanks,
> >-Brad
> >
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

[cmake-developers] [PATCH] fix use of CMAKE_REQUIRED_DEFINITIONS

2015-02-24 Thread Mark Abraham
Hi,

Some modules shoud use CMAKE_REQUIRED_FLAGS, not
CMAKE_REQUIRED_DEFINITIONS, I think.

Mark
From ed93849e9635a67f6d8ae4256f9a8d8f13c1b8bb Mon Sep 17 00:00:00 2001
From: Mark Abraham 
Date: Tue, 24 Feb 2015 14:20:16 +0100
Subject: [PATCH] Fix incorrect use of CMAKE_REQUIRED_DEFINITIONS

Variable CMAKE_REQUIRED_FLAGS should be used by
Check*CompilerFlag.cmake modules to check for valid flags,
per documentation of the Check*SourceCompiles.cmake
modules that they call.
---
 Modules/CheckCCompilerFlag.cmake   | 6 +++---
 Modules/CheckCXXCompilerFlag.cmake | 8 
 Modules/CheckFortranCompilerFlag.cmake | 8 
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 53f3454..4335641 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -38,8 +38,8 @@ include(CheckCSourceCompiles)
 include(CMakeCheckCompilerFlagCommonPatterns)
 
 macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
-   set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-   set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+   set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+   set(CMAKE_REQUIRED_FLAGS "${_FLAG}")
 
# Normalize locale during test compilation.
set(_CheckCCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG)
@@ -60,5 +60,5 @@ macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
unset(_CheckCCompilerFlag_LOCALE_VARS)
unset(_CheckCCompilerFlag_COMMON_PATTERNS)
 
-   set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+   set (CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
 endmacro ()
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index fab3a05..71b3fd2 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -12,7 +12,7 @@
 # - variable to store the result
 #
 # This internally calls the check_cxx_source_compiles macro and sets
-# CMAKE_REQUIRED_DEFINITIONS to .  See help for
+# CMAKE_REQUIRED_FLAGS to .  See help for
 # CheckCXXSourceCompiles for a listing of variables that can otherwise
 # modify the build.  The result only tells that the compiler does not
 # give an error message when it encounters the flag.  If the flag has
@@ -37,8 +37,8 @@ include(CheckCXXSourceCompiles)
 include(CMakeCheckCompilerFlagCommonPatterns)
 
 macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
-   set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-   set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+   set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+   set(CMAKE_REQUIRED_FLAGS "${_FLAG}")
 
# Normalize locale during test compilation.
set(_CheckCXXCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG)
@@ -59,6 +59,6 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
unset(_CheckCXXCompilerFlag_LOCALE_VARS)
unset(_CheckCXXCompilerFlag_COMMON_PATTERNS)
 
-   set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+   set (CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
 endmacro ()
 
diff --git a/Modules/CheckFortranCompilerFlag.cmake b/Modules/CheckFortranCompilerFlag.cmake
index 53fd8d6..c476661 100644
--- a/Modules/CheckFortranCompilerFlag.cmake
+++ b/Modules/CheckFortranCompilerFlag.cmake
@@ -13,7 +13,7 @@
 #Will be created as an internal cache variable.
 #
 # This internally calls the check_fortran_source_compiles macro and
-# sets CMAKE_REQUIRED_DEFINITIONS to .  See help for
+# sets CMAKE_REQUIRED_FLAGS to .  See help for
 # CheckFortranSourceCompiles for a listing of variables that can
 # otherwise modify the build.  The result only tells that the compiler
 # does not give an error message when it encounters the flag.  If the
@@ -40,8 +40,8 @@ include(CheckFortranSourceCompiles)
 include(CMakeCheckCompilerFlagCommonPatterns)
 
 macro (CHECK_Fortran_COMPILER_FLAG _FLAG _RESULT)
-  set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-  set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+  set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+  set(CMAKE_REQUIRED_FLAGS "${_FLAG}")
 
   # Normalize locale during test compilation.
   set(_CheckFortranCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG)
@@ -62,5 +62,5 @@ macro (CHECK_Fortran_COMPILER_FLAG _FLAG _RESULT)
   unset(_CheckFortranCompilerFlag_LOCALE_VARS)
   unset(_CheckFortranCompilerFlag_COMMON_PATTERNS)
 
-  set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+  set (CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
 endmacro ()
-- 
1.9.1

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering,

[cmake-developers] make more CUDA cache variables advanced

2015-01-22 Thread Mark Abraham
Hi,

FindCUDA.cmake creates a number of option variables that are not set to be
advanced cache variables. I think that those that do not seem to relate to
normal usage of CUDA should be made advanced. That way, non-developer end
users of ccmake get to see among the non-advanced options for their project
the ones that really make sense for them to change. Developers and power
users can switch to the advanced display, of course, just like they do now
for a range of other CUDA variables.

Patch on cmake master attached.

Mark
From 8fbbc4d3cbcaf28a8a6939137d8c6b3be638ae02 Mon Sep 17 00:00:00 2001
From: Mark Abraham 
Date: Thu, 22 Jan 2015 16:29:22 +0100
Subject: [PATCH] Mark more CUDA variables as advanced

These variables all pertain to specific situations relevant to CUDA
compilation. If all find_package modules would make all their cache
variables non-advanced, then (e.g.) ccmake becomes rather unusable for
non-developer end users of complex software that uses multiple such
modules. Making these variables advanced seems to be a compromise that
is in the spirit of other work on this module (e.g. in commit
d468145f).
---
 Modules/FindCUDA.cmake | 4 
 1 file changed, 4 insertions(+)

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index cae9214..81e1cad 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -483,6 +483,10 @@ mark_as_advanced(
   CUDA_HOST_COMPILATION_CPP
   CUDA_NVCC_FLAGS
   CUDA_PROPAGATE_HOST_FLAGS
+  CUDA_BUILD_CUBIN
+  CUDA_BUILD_EMULATION
+  CUDA_VERBOSE_BUILD
+  CUDA_SEPARABLE_COMPILATION
   )
 
 # Makefile and similar generators don't define CMAKE_CONFIGURATION_TYPES, so we
-- 
1.9.1

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] patch for FindCUDA.cmake

2015-01-04 Thread Mark Abraham
On Sun, Jan 4, 2015 at 3:02 PM, Rolf Eike Beer  wrote:

> Mark Abraham wrote:
> > Hi,
> >
> > The FindCUDA.cmake module since v3.0 has had a bug because it assumes
> that
> > when cross compiling that CMAKE_SYSTEM_PROCESSOR will be defined. That
> > definition is documented as optional at
> > http://www.vtk.org/Wiki/CMake_Cross_Compiling, and the module can't
> work if
> > it happens to be undefined. Attached patch
> > wraps the uses of CMAKE_SYSTEM_PROCESSOR in quotes so that interpolation
> > will lead to the intended behaviour in all cases.
>
> The easier and better fix would be to just remove the dereference, i.e.
>
> if (… CMAKE_SYSTEM_PROCESSOR MATCHES arm …)


Hi,

True, once you look at the minutae of if(... MATCHES ...) :-)

Updated patch attached.

Mark


>
> Eike
> --
From cc313f608775d4c3f68c0a106a3054aa3f7a7075 Mon Sep 17 00:00:00 2001
From: Mark Abraham 
Date: Sun, 4 Jan 2015 14:37:51 +0100
Subject: [PATCH] Fix FindCUDA.cmake assumption about cross-compiling

CMAKE_SYSTEM_PROCESSOR is not guaranteed to be defined (per
http://www.vtk.org/Wiki/CMake_Cross_Compiling), and when cross
compiling where it happens to be undefined, this module was broken.
---
 Modules/FindCUDA.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 29bb875..ecfc781 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -613,7 +613,7 @@ endif()
 set(CUDA_VERSION_STRING "${CUDA_VERSION}")
 
 # Support for arm cross compilation with CUDA 5.5
-if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
+if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
   set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.")
 else()
   set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.")
@@ -621,7 +621,7 @@ endif()
 mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR)
 
 # Target CPU architecture
-if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
+if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
   set(_cuda_target_cpu_arch_initial "ARM")
 else()
   set(_cuda_target_cpu_arch_initial "")
-- 
2.2.1

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

[cmake-developers] patch for FindCUDA.cmake

2015-01-04 Thread Mark Abraham
Hi,

The FindCUDA.cmake module since v3.0 has had a bug because it assumes that
when cross compiling that CMAKE_SYSTEM_PROCESSOR will be defined. That
definition is documented as optional at
http://www.vtk.org/Wiki/CMake_Cross_Compiling, and the module can't work if
it happens to be undefined. Attached patch
wraps the uses of CMAKE_SYSTEM_PROCESSOR in quotes so that interpolation
will lead to the intended behaviour in all cases.

I haven't filed a bug report, per
http://www.cmake.org/Wiki/CMake_FAQ#I_found_a_Bug.21_What_should_I_do.3F

Thanks,

Mark
From ff32fca999767e57b48ec68c30b093207c560a2f Mon Sep 17 00:00:00 2001
From: Mark Abraham 
Date: Sun, 4 Jan 2015 14:37:51 +0100
Subject: [PATCH] Fix FindCUDA.cmake assumption about cross-compiling

CMAKE_SYSTEM_PROCESSOR is not guaranteed to be defined (per
http://www.vtk.org/Wiki/CMake_Cross_Compiling), and when cross
compiling where it happens to be undefined, this module was broken.
---
 Modules/FindCUDA.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 29bb875..55b868e 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -613,7 +613,7 @@ endif()
 set(CUDA_VERSION_STRING "${CUDA_VERSION}")
 
 # Support for arm cross compilation with CUDA 5.5
-if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
+if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf")
   set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.")
 else()
   set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.")
@@ -621,7 +621,7 @@ endif()
 mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR)
 
 # Target CPU architecture
-if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
+if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
   set(_cuda_target_cpu_arch_initial "ARM")
 else()
   set(_cuda_target_cpu_arch_initial "")
-- 
2.2.1

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers