Re: [CMake] CMake + MPI

2015-09-09 Thread Tim Gallagher
That's good to know -- it looks like that capability was added 3 months after 
we wrote our CMakeLists.txt and we had to skip the find_package if we used a 
cray. That was 2011 and we never looked back at it because it worked. 

I guess I can go ahead and update that! 

Tim 

- Original Message -

From: "Chuck Atkins"  
To: "tim gallagher"  
Cc: "Andreas Naumann" , cmake@cmake.org 
Sent: Wednesday, September 9, 2015 11:11:27 AM 
Subject: Re: [CMake] CMake + MPI 






The only exception to that (which I am aware of) is if you are on a CRAY system 
where the MPI (and BLAS and LAPACK) are baked into the compiler wrappers (cc, 
ftn, etc). In those situations, you actually do not want to run 
find_package(MPI) or it will throw errors. 




Not true. The FindMPI.cmake module performs the appropriate introspection to 
check if your primary compiler wraps accordingly. For example, on a Cray XC30, 
with the PrgEnv-pgi and cray-mpich modules loaded: 

p02064@swan:~/Code/tmp/build> cat ../source/CMakeLists.txt 
cmake_minimum_required(VERSION 3.3) 
project(TestMPI C CXX) 

find_package(MPI REQUIRED) 

add_executable(test-mpi-c test-mpi.c) 
target_include_directories(test-mpi-c PRIVATE ${MPI_C_INCLUDE_PATH}) 
target_link_libraries(test-mpi-c ${MPI_C_LIBRARIES}) 

add_executable(test-mpi-cxx test-mpi.cxx) 
target_include_directories(test-mpi-cxx PRIVATE ${MPI_CXX_INCLUDE_PATH}) 
target_link_libraries(test-mpi-cxx ${MPI_CXX_LIBRARIES}) 
p02064@swan:~/Code/tmp/build> 

p02064@swan:~/Code/tmp/build> cmake ../source 
-- The C compiler identification is PGI 15.7.0 
-- The CXX compiler identification is PGI 15.7.0 
-- Check for working C compiler: /opt/cray/craype/2.4.1/bin/cc 
-- Check for working C compiler: /opt/cray/craype/2.4.1/bin/cc -- works 
-- Detecting C compiler ABI info 
-- Detecting C compiler ABI info - done 
-- Check for working CXX compiler: /opt/cray/craype/2.4.1/bin/CC 
-- Check for working CXX compiler: /opt/cray/craype/2.4.1/bin/CC -- works 
-- Detecting CXX compiler ABI info 
-- Detecting CXX compiler ABI info - done 
-- Found MPI_C: /opt/cray/craype/2.4.1/bin/cc 
-- Found MPI_CXX: /opt/cray/craype/2.4.1/bin/CC 
-- Configuring done 
-- Generating done 
-- Build files have been written to: /home/users/p02064/Code/tmp/build 
p02064@swan:~/Code/tmp/build> 

p02064@swan:~/Code/tmp/build> grep '^MPI_.*' CMakeCache.txt | grep -v INTERNAL 
MPI_CXX_COMPILER:STRING=/opt/cray/craype/2.4.1/bin/CC 
MPI_CXX_COMPILE_FLAGS:STRING= 
MPI_CXX_INCLUDE_PATH:STRING= 
MPI_CXX_LIBRARIES:STRING= 
MPI_CXX_LINK_FLAGS:STRING= 
MPI_CXX_NO_INTERROGATE:STRING=/opt/cray/craype/2.4.1/bin/CC 
MPI_C_COMPILER:STRING=/opt/cray/craype/2.4.1/bin/cc 
MPI_C_COMPILE_FLAGS:STRING= 
MPI_C_INCLUDE_PATH:STRING= 
MPI_C_LIBRARIES:STRING= 
MPI_C_LINK_FLAGS:STRING= 
MPI_C_NO_INTERROGATE:STRING=/opt/cray/craype/2.4.1/bin/cc 
MPI_EXTRA_LIBRARY:STRING=MPI_EXTRA_LIBRARY-NOTFOUND 
MPI_LIBRARY:FILEPATH=MPI_LIBRARY-NOTFOUND 
p02064@swan:~/Code/tmp/build> 

p02064@swan:~/Code/tmp/build> make 
[ 25%] Building C object CMakeFiles/test-mpi-c.dir/test-mpi.c.o 
[ 50%] Linking C executable test-mpi-c 
[ 50%] Built target test-mpi-c 
[ 75%] Building CXX object CMakeFiles/test-mpi-cxx.dir/test-mpi.cxx.o 
[100%] Linking CXX executable test-mpi-cxx 
[100%] Built target test-mpi-cxx 
p02064@swan:~/Code/tmp/build> 


As you can see from the resulting cache, the FindMPI module knows how to act 
accordingly even when mpi libraries are folded into the regular compiler. 

-- 

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

Re: [CMake] CMake + MPI

2015-09-08 Thread Tim Gallagher
The only exception to that (which I am aware of) is if you are on a CRAY system 
where the MPI (and BLAS and LAPACK) are baked into the compiler wrappers (cc, 
ftn, etc). In those situations, you actually do not want to run 
find_package(MPI) or it will throw errors.

Tim

- Original Message -
From: "Andreas Naumann" 
To: cmake@cmake.org
Sent: Tuesday, September 8, 2015 8:07:38 AM
Subject: Re: [CMake] CMake + MPI

Hi Nico,

I just use find_package(MPI REQUIRED) and use the given 
MPI_CXX_LIBRARIES and MPI_CXX_INCLUDE_PATH.
Recent mpi wrappers should support support interspection.

Regards,
Andreas

Am 08.09.2015 um 13:01 schrieb Nico Schlömer:
> Hi everyone,
>
> When it comes to compiling and linking, the MPI world is quite a mess. 
> Sometimes, vendors make you link and include certain 
> libraries/directories, sometimes you are supposed to simply use a 
> compiler wrapper, often both.
>
> What's the recommended way of dealing with MPI in CMake? Do you 
> `find_package(MPI REQUIRED)` and set LINK_LIBRARIES and INCLUDE_DIRS? 
> Do you select a compiler wrapper from within the CMake file? From outside?
>
> Cheers,
> Nico
>
>

-- 

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
-- 

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

Re: [CMake] Cray wrappers and Intel compilers

2015-05-05 Thread Tim Gallagher
We use a toolchain file to do the same thing: 

# the name of the target operating system 
SET(CMAKE_SYSTEM_NAME Catamount) 

# set the compiler 
set(CMAKE_C_COMPILER cc) 
set(CMAKE_CXX_COMPILER CC) 
set(CMAKE_Fortran_COMPILER ftn) 

There is more info on it if you search around: 

http://www.cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html 
http://www.vtk.org/Wiki/CMake_Cross_Compiling 

Tim 

- Original Message -

From: "KT Thompson"  
To: "Lucas Pettey" , "cmake ‎[cmake@cmake.org]‎" 
 
Sent: Tuesday, May 5, 2015 12:42:30 PM 
Subject: Re: [CMake] Cray wrappers and Intel compilers 



Lucas, 

When using CMake on our Cray environments (XE6, Intel compilers under the Cray 
wrappers), I do the following: 

1. Create CMakeCache.txt in the build directory with these contents: 

CMAKE_SYSTEM_NAME:STRING=Catamount 
CMAKE_C_COMPILER:FILEPATH=cc 
CMAKE_CXX_COMPILER:FILEPATH=CC 
CMAKE_Fortran_COMPILER:FILEPATH=ftn 


2. cmake /path/to/source 

Maybe the CMake experts on the list can tell us a better way. 

-kt 



From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of 
lucas.pet...@engilitycorp.com 
Sent: Tuesday, May 05, 2015 10:14 AM 
To: cmake ‎[cmake@cmake.org]‎ 
Subject: [CMake] Cray wrappers and Intel compilers 


Hello, 

I have been trying to use Cmake 3.2.2 on a Cray XC30 with the Intel compilers 
loaded. I encounter the following error: 


/opt/cray/craype/2.2.0/bin/cc -o 
CMakeFiles/cmTryCompileExec2303156381.dir/testCCompiler.c.o -c 
/p/home/lpettey/adh/parmetis-4.0.3/build/Linux-x86_64/CMakeFiles/CMakeTmp/testCCompiler.c
 


Linking C executable cmTryCompileExec2303156381 

/p/home/lpettey/cmake-3.2.2/install/bin/cmake -E cmake_link_script 
CMakeFiles/cmTryCompileExec2303156381.dir/link.txt --verbose=1 

/opt/cray/craype/2.2.0/bin/cc 
CMakeFiles/cmTryCompileExec2303156381.dir/testCCompiler.c.o -o 
cmTryCompileExec2303156381 -rdynamic 

ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in 
`/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/libc.a(strcmp.o)' 
can not be used when making an executable; recompile with -fPIE and relink 
with -pie 

Is there any way to ask Cmake not to add the -rdynamic to the link line? I 
believe this is what is causing the error. 

Thanks, 

Lucas Pettey, PhD 

HPCMP PETTT EQM CTA Lead 

ERDC-DSRC OnSite 

Vicksburg, MS 

512-297-9833 Mobile (preferred) 

601-634-2980 Office 

lucas.pet...@engilitycorp.com 
-- 

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 
-- 

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

Re: [CMake] Prevent ExternalProject from updating git submodules

2015-03-13 Thread Tim Gallagher
Okay, well, I hacked it so it would work for me: 

Our code requires a step between cloning and the submodule initalization. All 
of our code is hosted on a server behind a firewall, so when we are on our 
network the URL's for the submodules work great. But outside our network, git 
hardcodes the server names in the submodule URLs so we have a script to see 
what URL the clone came from and then changes all of the submodule URL's to use 
that same server. Outside our network, we build an SSH tunnel in and clone 
through a port forward to our server, so the .gitmodules file needs modified to 
set that up. 

Anyway, to make the ExternalProject work for me, I had to delete the submodule 
init section of the clone script. 

Then I could add an extra step between "download" and "update" to run our 
name-mangling script. 

I also modified the update step in ExternalProject so instead of running "git 
submodule update --recursive" it now runs "git submodule update --init 
--recursive" 

I don't know if anybody else has a similar use case as I do so maybe upstream 
changes are not needed. However, I will say that all of our codes have 
submodules in them that are not needed for the code to compile -- they are 
things like documentation or developer scripts/tools -- and so checking them 
out should be completely optional. It would be good if there was a way to not 
run the submodule init/update at all during the download or update steps, my 
odd use case notwithstanding. 

Tim 
- Original Message -

From: "Tim Gallagher"  
To: "cmake"  
Sent: Friday, March 13, 2015 1:05:42 PM 
Subject: Re: [CMake] Prevent ExternalProject from updating git submodules 


Hi Nicholas, 

I tried that and no luck. I've done both: 

ExternalProject_Add(... GIT_SUBMODULES "") 

and 

set(empty_list "") 
ExternalProject_Add(... GIT_SUBMODULES "${empty_list}") 

and it still tries to update the submodules. I know it's seeing the option -- 
if I pass in a name of a submodule that doesn't exist, it will crash when it 
tries to check out that made up one. But I can't seem to get it to not update 
any of them. 

Tim 

- Original Message -

From: "Nicholas Yue"  
To: "tim gallagher"  
Sent: Friday, March 13, 2015 12:52:41 PM 
Subject: Re: [CMake] Prevent ExternalProject from updating git submodules 


Hi Tim, 


I use external project but not the GIT_SUBMODULES but maybe the following might 
work 


(1) Create an empty list 
(2) set GIT_SUBMODULES to that empty list 


Cheers 


On 13 March 2015 at 09:43, Tim Gallagher < tim.gallag...@gatech.edu > wrote: 


Hi everybody, 

I'm plugging away at using the ExternalProject features to package up our code. 
Looking at the documentation for ExternalProject_Add, it says: 

... 
[GIT_SUBMODULES modules...] # Git submodules that shall be updated, all if 
empty 
... 

which is cool, but what do I do if I don't want any submodules updated at all? 
It seems my only choices are: 

1. Update them all (leaving GIT_SUBMODULES empty) 
2. Update some of them (set GIT_SUBMODULES to a list to update) 

but there's no 3rd option of not updating them at all. 

Any advice on how to keep it from updating any submodules? 

Thanks, 

Tim 
-- 

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 






-- 


Nicholas Yue 
Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5 
Custom Dev - C++ porting, OSX, Linux, Windows 
http://au.linkedin.com/in/nicholasyue 
https://vimeo.com/channels/naiadtools 


-- 

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 
-- 

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

Re: [CMake] Prevent ExternalProject from updating git submodules

2015-03-13 Thread Tim Gallagher
Hi Nicholas, 

I tried that and no luck. I've done both: 

ExternalProject_Add(... GIT_SUBMODULES "") 

and 

set(empty_list "") 
ExternalProject_Add(... GIT_SUBMODULES "${empty_list}") 

and it still tries to update the submodules. I know it's seeing the option -- 
if I pass in a name of a submodule that doesn't exist, it will crash when it 
tries to check out that made up one. But I can't seem to get it to not update 
any of them. 

Tim 

- Original Message -

From: "Nicholas Yue"  
To: "tim gallagher"  
Sent: Friday, March 13, 2015 12:52:41 PM 
Subject: Re: [CMake] Prevent ExternalProject from updating git submodules 


Hi Tim, 


I use external project but not the GIT_SUBMODULES but maybe the following might 
work 


(1) Create an empty list 
(2) set GIT_SUBMODULES to that empty list 


Cheers 


On 13 March 2015 at 09:43, Tim Gallagher < tim.gallag...@gatech.edu > wrote: 


Hi everybody, 

I'm plugging away at using the ExternalProject features to package up our code. 
Looking at the documentation for ExternalProject_Add, it says: 

... 
[GIT_SUBMODULES modules...] # Git submodules that shall be updated, all if 
empty 
... 

which is cool, but what do I do if I don't want any submodules updated at all? 
It seems my only choices are: 

1. Update them all (leaving GIT_SUBMODULES empty) 
2. Update some of them (set GIT_SUBMODULES to a list to update) 

but there's no 3rd option of not updating them at all. 

Any advice on how to keep it from updating any submodules? 

Thanks, 

Tim 
-- 

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 






-- 


Nicholas Yue 
Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5 
Custom Dev - C++ porting, OSX, Linux, Windows 
http://au.linkedin.com/in/nicholasyue 
https://vimeo.com/channels/naiadtools 

-- 

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

[CMake] Prevent ExternalProject from updating git submodules

2015-03-13 Thread Tim Gallagher
Hi everybody,

I'm plugging away at using the ExternalProject features to package up our code. 
Looking at the documentation for ExternalProject_Add, it says:

...
[GIT_SUBMODULES modules...] # Git submodules that shall be updated, all if empty
...

which is cool, but what do I do if I don't want any submodules updated at all? 
It seems my only choices are:

1. Update them all (leaving GIT_SUBMODULES empty)
2. Update some of them (set GIT_SUBMODULES to a list to update)

but there's no 3rd option of not updating them at all. 

Any advice on how to keep it from updating any submodules?

Thanks,

Tim
-- 

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


Re: [CMake] Getting empty package with CPack

2015-03-11 Thread Tim Gallagher
Nils,

Thanks! That definitely got my files into the package, I would have never 
figured that one out!

I have another, related question though. Maybe what I'm doing cannot be done, 
but I would like to have a different file layout when building a package than 
when using make install. I thought if I did:

set(CPACK_INSTALL_CMAKE_PROJECTS "${PROJECT_BINARY_DIR};LESLIE;ALL;/bin")

then all of my targets would go in /bin even though when I run 
`make install` all of my targets just go to $CMAKE_INSTALL_PREFIX. The way 
users who only have access to our binaries would use our code is very different 
from the way people who have access to our source tree would use the code and I 
need to figure out a way to package it that way.

Is it at all possible to have an install tree be unique when using CPack vs 
using the installation in CMake? Is that something that if I want to do, I'd 
have to use CPack outside of our CMake system? 

Thanks,

Tim

- Original Message -
From: "Nils Gladitz" 
To: "tim gallagher" , cmake@cmake.org
Sent: Wednesday, March 11, 2015 6:32:24 PM
Subject: Re: [CMake] Getting empty package with CPack

On 11.03.2015 21:17, Tim Gallagher wrote:
> Hi all,
>
> I'm trying to play with CPack to build an installer for our code and I'm 
> pretty confused. I am using the self-extracting TGZ generator on CMake 2.8.8. 
> My CMakeLists.txt is really long, but I included what I think are the 
> important parts under my signature.
>
> I configure the build and the package target shows up which is great. I can 
> see in the CPackConfig.cmake file that my variables are set the same as they 
> were in my CMakeLists.txt. When I run 'make package', it generates my .sh 
> file. But then when I run the extractor, it just creates an empty folder. I 
> would have expected it to create `/bin/leslie.x`, ` name>/bin/run_leslie.py` and `/bin/run_leslie.sh`.
>
> I also tried it with the CPACK_INSTALL_CMAKE_PROJECTS set to 
> "${PROJECT_BINARY_DIR};LESLIE;leslie;/bin" but to no avail.
>
> Does anybody have any suggestions on why my files aren't getting packaged? I 
> know the CMakeLists.txt prior to the CPack commands work, but this is my 
> first go at using CPack.

Try with relative install destinations e.g. "DESTINATION ." instead of 
"DESTINATION ${CMAKE_INSTALL_PREFIX}".
Relative paths are already relative to CMAKE_INSTALL_PREFIX by default 
where appropriate and many CPack generators can not handle absolute paths.

Nils
-- 

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


[CMake] Getting empty package with CPack

2015-03-11 Thread Tim Gallagher
Hi all,

I'm trying to play with CPack to build an installer for our code and I'm pretty 
confused. I am using the self-extracting TGZ generator on CMake 2.8.8. My 
CMakeLists.txt is really long, but I included what I think are the important 
parts under my signature. 

I configure the build and the package target shows up which is great. I can see 
in the CPackConfig.cmake file that my variables are set the same as they were 
in my CMakeLists.txt. When I run 'make package', it generates my .sh file. But 
then when I run the extractor, it just creates an empty folder. I would have 
expected it to create `/bin/leslie.x`, `/bin/run_leslie.py` and `/bin/run_leslie.sh`. 

I also tried it with the CPACK_INSTALL_CMAKE_PROJECTS set to 
"${PROJECT_BINARY_DIR};LESLIE;leslie;/bin" but to no avail. 

Does anybody have any suggestions on why my files aren't getting packaged? I 
know the CMakeLists.txt prior to the CPack commands work, but this is my first 
go at using CPack.

Thanks,

Tim

--

cmake_minimum_required(VERSION 2.8.6)

project(LESLIE)

...

set(LESLIE_MAJOR_VERSION GTR2)
set(LESLIE_MINOR_VERSION 0)
set(LESLIE_PATCH_VERSION 4)

...

install(FILES ${PROJECT_BINARY_DIR}/run_leslie.py DESTINATION 
${CMAKE_INSTALL_PREFIX}
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
   
install(FILES ${PROJECT_BINARY_DIR}/run_leslie.sh DESTINATION
   ${CMAKE_INSTALL_PREFIX})
   
install(TARGETS leslie
   RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})

set(CPACK_GENERATOR "STGZ")
set(CPACK_INSTALL_CMAKE_PROJECTS "${PROJECT_BINARY_DIR};LESLIE;ALL;/bin")
set(CPACK_PACKAGE_VERSION_MAJOR ${LESLIE_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${LESLIE_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${LESLIE_PATCH_VERSION})
set(CPACK_PACKAGE_VENDOR "Computational Combustion Laboratory")
include(CPack)
-- 

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


Re: [CMake] FindBlas and header file "blas.h"

2013-03-01 Thread Tim Gallagher
Also worth noting:

I just checked on an Ubuntu machine and the header file is called cblas.h, not 
blas.h. 

If none of that helps, then I'm out of suggestions. I don't use Ubuntu and most 
of my code is in Fortran :)

Tim

- Original Message -----
From: "Tim Gallagher" 
To: "Nicholas Kinar" 
Cc: cmake@cmake.org
Sent: Friday, March 1, 2013 1:06:34 PM
Subject: Re: [CMake] FindBlas and header file "blas.h"

And have you tried printing out the value of BLAS_INCLUDE_DIR? I'm not sure 
that actually exists, I don't see it set in my FindBLAS.cmake module. 

What is the path to blas.h? Have you verified it exists and is in one of the 
standard include locations such as /usr/include, /usr/local/include etc? 

It's possible it is in something like /usr/include/blas/blas.h and so it isn't 
found by default.

Tim

----- Original Message -
From: "Nicholas Kinar" 
To: "tim gallagher" 
Cc: cmake@cmake.org
Sent: Friday, March 1, 2013 12:57:33 PM
Subject: Re: [CMake] FindBlas and header file "blas.h"

On 01/03/2013 11:43 AM, Tim Gallagher wrote:
> Have you installed the development package for blas and lapack? Typically 
> distributions have a library-only package and then a development package that 
> includes the headers. Check for libblas-dev in Ubuntu.
>
> Tim
>

Thanks, Tim; yes, I can verify that I have installed the developer 
packages.  Here is my bash output when I try to use sudo to install 
libblas-dev.

nkinar@Betty:~$ sudo apt-get install libblas-dev
[sudo] password for nkinar:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libblas-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Moreover, running Cmake (via make compilation) tells me that the files 
are found; however, the "blas.h" header file is not found.

nkinar@Betty:/media/RESEARCH/DEVELOP-SEISMIC/dip$ make
-- A library with BLAS API found.
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Configuring done
-- Generating done
-- Build files have been written to: /media/RESEARCH/DEVELOP-SEISMIC/dip
[  9%] Building C object CMakeFiles/stest.dir/conjgrad.c.o
/media/RESEARCH/DEVELOP-SEISMIC/dip/conjgrad.c:26:18: fatal error: 
blas.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/stest.dir/conjgrad.c.o] Error 1
make[1]: *** [CMakeFiles/stest.dir/all] Error 2
make: *** [all] Error 2

What am I still doing wrong here?  Here is a full Cmake file that was 
used to create the output above:


cmake_minimum_required (VERSION 2.6)
project (stretch-test)

# Blas library
find_package( BLAS REQUIRED )
find_package( LAPACK REQUIRED )

# Required C99 compiler
set(CMAKE_C_FLAGS "-std=c99")

include_directories(${BLAS_INCLUDE_DIR} ${LAPACK_INCLUDE_DIR})

add_executable( stest
main.c
allp3.c
apfilt.c
conjgrad.c
dip3.c
divn.c
helper.c
trianglen.c
komplex.c
adjnull.c
c99.c
) # end

# link with math library on Linux
# link with blas on Linux
TARGET_LINK_LIBRARIES(stest m blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindBlas and header file "blas.h"

2013-03-01 Thread Tim Gallagher
And have you tried printing out the value of BLAS_INCLUDE_DIR? I'm not sure 
that actually exists, I don't see it set in my FindBLAS.cmake module. 

What is the path to blas.h? Have you verified it exists and is in one of the 
standard include locations such as /usr/include, /usr/local/include etc? 

It's possible it is in something like /usr/include/blas/blas.h and so it isn't 
found by default.

Tim

- Original Message -
From: "Nicholas Kinar" 
To: "tim gallagher" 
Cc: cmake@cmake.org
Sent: Friday, March 1, 2013 12:57:33 PM
Subject: Re: [CMake] FindBlas and header file "blas.h"

On 01/03/2013 11:43 AM, Tim Gallagher wrote:
> Have you installed the development package for blas and lapack? Typically 
> distributions have a library-only package and then a development package that 
> includes the headers. Check for libblas-dev in Ubuntu.
>
> Tim
>

Thanks, Tim; yes, I can verify that I have installed the developer 
packages.  Here is my bash output when I try to use sudo to install 
libblas-dev.

nkinar@Betty:~$ sudo apt-get install libblas-dev
[sudo] password for nkinar:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libblas-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Moreover, running Cmake (via make compilation) tells me that the files 
are found; however, the "blas.h" header file is not found.

nkinar@Betty:/media/RESEARCH/DEVELOP-SEISMIC/dip$ make
-- A library with BLAS API found.
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Configuring done
-- Generating done
-- Build files have been written to: /media/RESEARCH/DEVELOP-SEISMIC/dip
[  9%] Building C object CMakeFiles/stest.dir/conjgrad.c.o
/media/RESEARCH/DEVELOP-SEISMIC/dip/conjgrad.c:26:18: fatal error: 
blas.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/stest.dir/conjgrad.c.o] Error 1
make[1]: *** [CMakeFiles/stest.dir/all] Error 2
make: *** [all] Error 2

What am I still doing wrong here?  Here is a full Cmake file that was 
used to create the output above:


cmake_minimum_required (VERSION 2.6)
project (stretch-test)

# Blas library
find_package( BLAS REQUIRED )
find_package( LAPACK REQUIRED )

# Required C99 compiler
set(CMAKE_C_FLAGS "-std=c99")

include_directories(${BLAS_INCLUDE_DIR} ${LAPACK_INCLUDE_DIR})

add_executable( stest
main.c
allp3.c
apfilt.c
conjgrad.c
dip3.c
divn.c
helper.c
trianglen.c
komplex.c
adjnull.c
c99.c
) # end

# link with math library on Linux
# link with blas on Linux
TARGET_LINK_LIBRARIES(stest m blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindBlas and header file "blas.h"

2013-03-01 Thread Tim Gallagher
Have you installed the development package for blas and lapack? Typically 
distributions have a library-only package and then a development package that 
includes the headers. Check for libblas-dev in Ubuntu.

Tim

- Original Message -
From: "Nicholas Kinar" 
To: cmake@cmake.org
Sent: Friday, March 1, 2013 11:50:06 AM
Subject: [CMake] FindBlas and header file "blas.h"

Hello,

On Ubuntu 12.04, I am compiling some third-party program code that 
#includes the BLAS header file "blas.h".  Although Cmake does find the 
BLAS and LAPACK libraries, I receive the following gcc compiler error:

fatal error: blas.h: No such file or directory

I've tried to change this include to  other files such as "lapacke.h" 
but the include file is still not found.  What I am doing wrong here?  
My Cmake file is reproduced below.

Nicholas

#
cmake_minimum_required (VERSION 2.6)
project (stretch-test)

find_package( BLAS REQUIRED )
find_package( LAPACK REQUIRED )

set(CMAKE_C_FLAGS "-std=c99")

include_directories(${BLAS_INCLUDE_DIR} ${LAPACK_INCLUDE_DIR})

add_executable( stest
main.c)
# also link with C math library
TARGET_LINK_LIBRARIES(stest m blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Blog on parallel builds with CMake

2013-01-10 Thread Tim Gallagher
Good read.

The only suggestion I would make is for Unix Makefiles, rather than running 
'make -jN' is to run 'make -j -lN' which tells make to use as many cores until 
the load is greater than N.

This is nice because if I have a 12 core system, I can do 'make -j -l12' and it 
will build using 12 if I'm not doing anything else. But if I'm, say, looking at 
data in Paraview and that's using up a core, then make will only take 11 cores 
and not bog my system down. It makes it much nicer if you are doing multiple 
things on the same machine doing the compilation.

Tim

- Original Message -
From: "Bill Hoffman" 
To: "cmake" 
Sent: Thursday, January 10, 2013 4:28:46 PM
Subject: [CMake] Blog on parallel builds with CMake

I just put up a blog about parallel builds with CMake, that might be of 
interest to folks on the list:

http://www.kitware.com/blog/home/post/434

-Bill
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Adding Platform files

2012-12-15 Thread Tim Gallagher
Yup, you nailed it. The module path was being set after the call to project() 
and not before. 

Is there a naming convention for system names? I don't mind sending this 
upstream if there is interest. It's for Cray systems that use shared libraries 
(unlike Catamount which disables shared libraries). Makes building things like 
Paraview and Python much simpler on those platforms. I called it ModernCray 
since I have no idea what else it would be called.

Thanks,

Tim

- Original Message -
From: "Eric Noulard" 
To: "tim gallagher" 
Cc: "CMake List" 
Sent: Saturday, December 15, 2012 4:46:36 AM
Subject: Re: [CMake] Adding Platform files

2012/12/14 Tim Gallagher :
> Hi,
>
> I have a folder inside my code repository we use to store custom modules and 
> that folder was added to the search path. Inside that folder I added one 
> called Platform/ and put a custom platform file in there. But CMake says it 
> can't find the platform file.

How did you "add the folder to the search path" ?

In order for this to work one should modify CMAKE_MODULE_PATH
with something like:

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/MyCMakeModules")

the "Platform" directory should be below this custom dir.

**HOWEVER** you should be aware that platform files are read very
early in the CMake process and in any case during the "project(...)" command
processing.

So the CMAKE_MODULE_PATH modifications should appear BEFORE
any project(...) CMake command in order to be taken into account for that
particular project.

Usually you have something like:

cmake_minimum_required(VERSION 2.8)

# Update CMAKE_MODULE_PATH very soon
# in order to have access to Platform/.cmake files
# and avoid "unknown platform warning"
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/MyCMakeModules")

project(MyProject C)


With that it works for me.

> Is it possible to add custom platforms without having to put them in the 
> CMake install tree?

Yes definitely.
I guess you may be modifying CMAKE_MODULE_PATH "too late"?

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Adding Platform files

2012-12-14 Thread Tim Gallagher
Hi,

I have a folder inside my code repository we use to store custom modules and 
that folder was added to the search path. Inside that folder I added one called 
Platform/ and put a custom platform file in there. But CMake says it can't find 
the platform file. 

Is it possible to add custom platforms without having to put them in the CMake 
install tree?

Thanks,

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CMake project building other CMake projects

2012-10-19 Thread Tim Gallagher
Hi,

I'm working on getting our CMake project to build the other libraries we wrote 
and I'm not sure how it needs to be done. Our main code is a git repository and 
inside the repo is a lib/ directory with git submodules for our other 
libraries. 

What is the best way to get the main project to build these submodules? It 
seems like I could use ExternalProject to do it, even though I don't need to 
download/checkout anything, but it also looks like I could just 
add_subdirectory(lib/myLibrary) also. Which is the "best practice"? 

If I go the add_subdirectory route, do I need to namespace my variables 
somehow? For instance, all of our projects use CMAKE_INSTALL_PREFIX to indicate 
the installation directory, but if I were to build them all at once, they need 
to be installed different places, so will the names clash? Do I need to change 
all the variables in each library to be myLibrary_*?

If I use ExternalProject, do I have to then manually add the options to my main 
project's CMakeLists so the user can configure them and then pass them through 
to the submodule's configure step with -D...? 

Is there something else I'm missing in how to do this? It seems like projects 
we maintain and can include as git submodules could/should be built differently 
than projects like Python that we don't include as submodules. But our own 
projects also provide a *Config.cmake, so maybe they could be treated the 
same...

Tim

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Output assembly (g++ -S)

2012-10-18 Thread Tim Gallagher
Interestingly it only does this for C/C++ but does not do it for Fortran source 
files (at least in my project when I just tested it) even though -S is a valid 
option for Intel and GNU Fortran compilers.

Any possibility that could be corrected?

Tim

- Original Message -
From: "Bill Hoffman" 
To: cmake@cmake.org
Sent: Thursday, October 18, 2012 10:20:58 PM
Subject: Re: [CMake] Output assembly (g++ -S)

On 10/18/2012 9:47 PM, David Doria wrote:
> I am trying to produce the .s file that "g++ -S file.cpp" would
> produce, but on a CMake target (because I want the include path that
> I've setup through CMake, etc.)
>
> Consider a simple demo:
>
> PROJECT(Assembly)
> ADD_EXECUTABLE(Assembly Assembly.cpp ) # this produces an 'Assembly' 
> executable

CMake has targets to do that.  If you type make help you can see them. 
It should be something like this:

make Assembly.s

-Bill

--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake 2.6 and 2.8 find different fortran compilers with MPI?

2012-07-02 Thread Tim Gallagher
No problem. It sounds like you are going through the exact same pains and 
questions we went through when we set up our research CFD code with CMake a 
year ago. 

Likewise, the CC and CXX environment variables control the other compilers, if 
you use them. It's okay to use gcc or g++ with ifort, so long as ifort is used 
to link things. But sometimes you may want the entire Intel suite to be used, 
so you may want to set the CC and CXX variables in your modulefile also. 

Tim 

- Original Message -

From: "Eli Ateljevich"  
To: "tim gallagher"  
Cc: "CMake List"  
Sent: Monday, July 2, 2012 6:09:59 PM 
Subject: RE: [CMake] cmake 2.6 and 2.8 find different fortran compilers with 
MPI? 



Thanks Tim. We do have the module system set up including the compiler, so I’ll 
make sure it defines FC. 





From: Tim Gallagher [mailto:tim.gallag...@gatech.edu] 
Sent: Monday, July 02, 2012 2:59 PM 
To: Ateljevich, Eli 
Cc: CMake List 
Subject: Re: [CMake] cmake 2.6 and 2.8 find different fortran compilers with 
MPI? 


If you want it to find a particular compiler always, you should do: 

FC= cmake ... 

In other words, set the FC environment variable to the desired compiler. 

Likewise, FindMPI will find the first mpicc on your path. If that happens to be 
the ifort one, that's what you will get. If you have multiple compilers and 
multiple MPI installations, you might be better off installing the module 
system (http://linux.die.net/man/1/module) that is commonly used on HPC 
systems. This way you can ensure that only one installation of what you want is 
in your environment, and then you don't need to worry about manually setting 
things or putting things in your path in a particular order. 

Tim 
- Original Message -


From: "Eli Ateljevich"  
To: "CMake List"  
Sent: Monday, July 2, 2012 5:20:34 PM 
Subject: [CMake] cmake 2.6 and 2.8 find different fortran compilers with MPI? 
Hi, 
I wonder if anyone can help me get a consistent Fortran build out of 2.6 and 
2.8.8. I am using CMake 2.6 and 2.8, trying to come up with a compatible build. 
I had to rob some items from 2.8 to find things like MPI correctly and I have 
set the policies such that I believe they both use the same FindMPI.cmake. 

For some reason, my 2.6 installation “magically” found the Intel compiler 
ifort. I never did a set(CMAKE_Fortran_COMPILER). Version 2.8.8 does not do 
this and defaults to gfortran. The later FindMPI finds an Intel wrapper, not 
the gfortran version. 

Was this a bug fix or policy change? 
1. If this is a policy, can I manipulate it to make the two builds compatible 
2. What can I do about making the compiler and FindMPI consistent in general, 

Thanks very much, 
Eli 

-- 

Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 

--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] cmake 2.6 and 2.8 find different fortran compilers with MPI?

2012-07-02 Thread Tim Gallagher
If you want it to find a particular compiler always, you should do: 

FC= cmake ... 

In other words, set the FC environment variable to the desired compiler. 

Likewise, FindMPI will find the first mpicc on your path. If that happens to be 
the ifort one, that's what you will get. If you have multiple compilers and 
multiple MPI installations, you might be better off installing the module 
system (http://linux.die.net/man/1/module) that is commonly used on HPC 
systems. This way you can ensure that only one installation of what you want is 
in your environment, and then you don't need to worry about manually setting 
things or putting things in your path in a particular order. 

Tim 

- Original Message -

From: "Eli Ateljevich"  
To: "CMake List"  
Sent: Monday, July 2, 2012 5:20:34 PM 
Subject: [CMake] cmake 2.6 and 2.8 find different fortran compilers with MPI? 



Hi, 
I wonder if anyone can help me get a consistent Fortran build out of 2.6 and 
2.8.8. I am using CMake 2.6 and 2.8, trying to come up with a compatible build. 
I had to rob some items from 2.8 to find things like MPI correctly and I have 
set the policies such that I believe they both use the same FindMPI.cmake. 

For some reason, my 2.6 installation “magically” found the Intel compiler 
ifort. I never did a set(CMAKE_Fortran_COMPILER). Version 2.8.8 does not do 
this and defaults to gfortran. The later FindMPI finds an Intel wrapper, not 
the gfortran version. 

Was this a bug fix or policy change? 
1. If this is a policy, can I manipulate it to make the two builds compatible 
2. What can I do about making the compiler and FindMPI consistent in general, 

Thanks very much, 
Eli 
-- 

Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Using MPI and non-MPI compiler in the same cmake project?

2012-06-26 Thread Tim Gallagher
Don't change the compiler.

Do:

find_package(MPI REQUIRED)
add_definitions(${MPI_Fortran_COMPILE_FLAGS})
include_directories(${MPI_Fortran_INCLUDE_DIRS})
link_directories(${MPI_Fortran_LIBRARY_DIRS})
target_link_libraries( ${MPI_Fortran_LIBRARIES})
  
if(MPI_EXTRA_LIBRARY)
   target_link_libraries( ${MPI_EXTRA_LIBRARY})
endif()

get_target_property(CURRENT_LINK_FLAGS  LINK_FLAGS)
if(CURRENT_LINK_FLAGS)
set(MY_MPI_LINK_FLAGS "${CURRENT_LINK_FLAGS};${MPI_Fortran_LINK_FLAGS}")
else()
set(MY_MPI_LINK_FLAGS "${MPI_Fortran_LINK_FLAGS}")
endif()
if(MY_MPI_LINK_FLAGS)
   set_target_properties( PROPERTIES LINK_FLAGS 
${MY_MPI_LINK_FLAGS})
endif()

This way, you still use ifort to do the compilation but you add all the MPI 
required flags and libraries to the parallel code only. Any other targets that 
aren't parallel don't get the MPI libraries. 

The only reason FindMPI locates the executable is to get the flags for you, you 
don't actually want to use that as the compiler. If you wanted it as the 
compiler, you should do FC=f90mpi ccmake  instead and not even call 
find_package(MPI). You don't want to change the compiler variable once it's 
been set by CMake.

Tim

- Original Message -
From: "Eli Ateljevich" 
To: cmake@cmake.org
Sent: Monday, June 25, 2012 10:43:03 PM
Subject: [CMake] Using MPI and non-MPI compiler in the same cmake project?

Hi all,
My project is mostly built with Fortran that uses mpif90 as a wrapper. I use 
find_package(MPI REQUIRED) to locate f90mpi and then change set the 
CMAKE_Fortran_COMPILER to ${MPI_Fortran_COMPILER}.



This seemed to work fine until started wrapping up some utilities that do not 
need to be parallelized. The MPI compiler seems to take quite a bit longer to 
compile than the serial compiler (ifort). The utilities that would be 
appropriate for serial compilation have a slighlty different extension (f90 
instead of F90).



I realize it is unusual to maintain two compilers for the same language , but 
in this case the two are related as "mpi wrapper" and "wrapee". There seem to 
be a few possibilities:
1. Maintain a variable that refers to the compiler and flags for serial and 
switch to them for just the utilities. Is this even legal? Can I change 
CMAKE_Fortran_COMPILER at the file or library scope? Could I create a custom 
rule that somehow inherits from the Fortran rule or is this a can of worms?
2. Never switch to mpiwrapper, but instead make us of the libraries it finds. I 
have seen this technique referenced more than I have seen the use of mpif90, 
but I don't know what aspects of mpif90 might get left out by doing this. How 
would I maintain two sets of flags ... is there an easy way to override flags 
on a per-target or per-file basis?



Or is there a better way entirely?



Thanks so much,



Eli


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindHDF5.cmake configuration -- finds regular, can't find HL

2012-06-23 Thread Tim Gallagher
I reported this awhile back: 

http://public.kitware.com/Bug/view.php?id=12316 

The patch I attached would work, but it fails in some select cases so it wasn't 
put in. I don't remember the details, it may fail when there is no HL or 
something. But you can try it and see if it works for your case. 

Tim 

- Original Message -

From: "Eli Ateljevich"  
To: cmake@cmake.org 
Sent: Saturday, June 23, 2012 3:57:03 PM 
Subject: [CMake] FindHDF5.cmake configuration -- finds regular, can't find HL 



Hi all, 
I am supporting cmake version 2.6. I have included the latest FindHDF5.cmake 
file I could find in my distro … except for one dependency that needed to be 
added, this seems to work fine. 

When I try to find_package(HDF5 COMPONENTS … ) it works for the C (and Fortran) 
component but not for the HL library or Fortran_HL. Here is the output for the 
C language HL variant: 
-- Found HDF5: 
HDF5_hdf5_hl_LIBRARY_RELEASE-NOTFOUND;/usr/local/dms/pkg/hdf5/1.8.7-intel12.0-parallel/lib/libhdf5.a;/usr/lib64/libz.so;/usr/lib64/libm.so
 

Could it be cmake is looking for the unadorned libhdf5.a for the regular 
library and libhdf5-release or something like that for the hl library. Why the 
difference? If so is this a type of behavior that can be switched off? 

Here are the contents of the directory, in case the issue of the HL libraries 
not being there comes up: 
$ ls /usr/local/dms/pkg/hdf5/1.8.7-intel12.0-parallel/lib 
libhdf5.a libhdf5_hl.a libhdf5_hl.la 
libhdf5_fortran.a libhdf5hl_fortran.a libhdf5.la 
libhdf5_fortran.la libhdf5hl_fortran.la libhdf5.settings 

Thanks for any insight. I realize numerous patches have been made to 
FindHDF5.cmake, and that I might be voiding my warranty by backwards porting 
it, but it sure seems like it should work for all the components if it works 
for two of them. 

Eli 
-- 

Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Intel compilers

2012-05-10 Thread Tim Gallagher
Hi, 

If you do: 

CC=icc ccmake ../ 

it will work. Note this is all one line, without a semi-colon. 

As for the rest, I'll let somebody else answer. 

- Original Message -

From: "Mohammad Mirzadeh"  
To: cmake@cmake.org 
Sent: Thursday, May 10, 2012 8:21:23 PM 
Subject: [CMake] Intel compilers 


Hi, 


I have just started using CMake for my projects and have some problems getting 
it do exactly the things I want. So these are couple of questions I have: 


1) How can I change the compiler from GNU g++ to my preferred compiler, in this 
case intel's icc? I have tried CC=icc; ccmake ../ but that again defaults to 
g++ and picks up wrong compiler flags 


2) When I use the -ipo flag for icc, intel compiler complains that there are 
unresolved references whereas if I omit that, or just use g++, I don't have 
linking problems. Does the order of compilation (except main) matter when using 
target_link_libraries? 


3) How can I change from creating static libraries to just simply create object 
files and link to them? 


Thanks 




-- 

Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Setting COMPILE_FLAGS property on a target in only debug?

2012-05-04 Thread Tim Gallagher
Put an: 

if(CMAKE_BUILD_TYPE STREQUAL "Debug") 
endif() 

guard around the set_property call. 

Tim 

- Original Message -

From: "Robert Dailey"  
To: "CMake ML"  
Sent: Friday, May 4, 2012 4:16:47 PM 
Subject: [CMake] Setting COMPILE_FLAGS property on a target in only debug? 

I'm doing the following: 



set_property( TARGET ${target_name} APPEND_STRING PROPERTY 
COMPILE_FLAGS "/ZI /Gy " 
) 


However this applies to all configurations. I want to only set this compiler 
flag for debug builds, not release. How can I do this? 
-- 

Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] FORTRAN and BLAS Issue

2012-05-03 Thread Tim Gallagher
You're not using the results of the find_package. 

It should look like: 

cmake_minimum_required(VERSION 2.8) 
project(collision) 
enable_language(Fortran) 
FIND_PACKAGE(BLAS REQUIRED) 
add_definitions(-O3) 
add_executable(collision test.f90) 
target_link_libraries(collision ${BLAS_LIBRARIES}) 

Also, the add_definitions shouldn't really be used for things like -O3, it 
should be used for things like -DMY_FLAG or something. Flags like -O3 should be 
added to the CMAKE_Fortran_FLAGS. 

Tim 

- Original Message -

From: "Matthew Clay"  
To: cmake@cmake.org 
Sent: Thursday, May 3, 2012 11:25:23 PM 
Subject: [CMake] FORTRAN and BLAS Issue 

Fellow cmake users: 

I am experiencing a minor issue with cmake, and can't seem to find an answer 
browsing the web. I have a minimal working example that highlights the issue 
with my main code. The problem is this: compiling by myself with gfortran and 
the appropriate flags produces no errors, while attempting to build the code 
with cmake throws an error. 

The FORTRAN code--note that DDOT is the call to BLAS that I want to make: 

PROGRAM TEST 
IMPLICIT NONE 
DOUBLE PRECISION,DIMENSION(2) :: x,y ! The two vectors. 
REAL(KIND=8),EXTERNAL :: DDOT ! Their dot product. 
x(:) = (/ 1.,100. /) 
y(:) = (/ 1.,1. /) 
WRITE (*,*) DDOT(2,x,1,y,1) 
END PROGRAM TEST 

What works: 

gfortran test.f90 -O3 -lblas 
./a.out 

What doesn't work: 

cmake_minimum_required(VERSION 2.8) 
project(collision) 
enable_language(Fortran) 
FIND_PACKAGE(BLAS REQUIRED) 
add_definitions(-O3 -lblas) 
add_executable(collision test.f90) 

Upon attempting [ mkdir build && cd build && cmake .. && make ] as with any 
other code I get the following result: 

Scanning dependencies of target collision 
[100%] Building Fortran object CMakeFiles/collision.dir/test.f90.o 
Linking Fortran executable collision 
CMakeFiles/collision.dir/test.f90.o: In function `MAIN__': 
test.f90:(.text+0x7d): undefined reference to `ddot_' 
collect2: error: ld returned 1 exit status 
make[2]: *** [collision] Error 1 
make[1]: *** [CMakeFiles/collision.dir/all] Error 2 

It appears that BLAS is not being linked with the code...maybe? I am not a 
cmake expert, and would greatly appreciate any words of wisdom for 
troubleshooting this problem! 

Thanks, 
Matt 

-- 

Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Trying to use the latest release of Intel Fortran 2011 (update 9) with cmake...

2012-04-12 Thread Tim Gallagher
Did you try wiping out the existing build and starting it from scratch?

It sounds like there are still some module files floating around from the 
previous build with the previous Fortran version.

Tim

- Original Message -
From: "Dick Munroe" 
To: cmake@cmake.org
Sent: Thursday, April 12, 2012 2:48:00 PM
Subject: [CMake] Trying to use the latest release of Intel Fortran 2011 (update 
9) with cmake...

on windoze.  I installed the compiler, uninstalled the previous update 
(2), and fired up CMake at which point I can no longer build solutions 
with CMake.  Every time I try, I get a "this solution was built with an 
earlier version of fortran" or words to that effect.

Any clues what the problem might be?

Best,

Dick Munroe

--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Fortran 90 Module Issues in CMake

2012-03-02 Thread Tim Gallagher
I don't know the specifics of this case, but the only time we've ever had 
trouble with F90 modules is when we add a dependency and don't delete the build 
tree before trying to reconfigure. 

We have several hundred modules, many in the same directory and many used 
across directories and don't have any issues with it. I know that's not super 
helpful to hear when you have an issue, but the dependency scanner does seem to 
work. 

Have you tried wiping out the entire build tree and trying again? 

Tim 

- Original Message -

From: "Matthew Schuchard"  
To: "brad king"  
Cc: cmake@cmake.org 
Sent: Friday, March 2, 2012 10:28:09 AM 
Subject: [CMake] Fortran 90 Module Issues in CMake 

>> but I have found that this person:
>> http://www.cmake.org/pipermail/cmake/2010-November/040832.html >> had a very 
>> similar problem. > This one? > 
>> http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/32850/focus=32893
>>  Yes.
That person also had an issue with one Fortran 90 file using a module built by 
another Fortran 90 
file in the same target and directory, and had the same error message from 
gnumake as I did.
His solution was to manually add a dependency since in his case it appeared 
CMake missed it?
But I have about a hundred instances of this same-target/directory module 
dependence.

Also, I think some rpm installed in the background without my knowing it, so I 
restarted Firefox
and now I can view your examples of: 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/CMakeLists.txt;hb=v2.8.7
 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/a.f90;hb=v2.8.7
 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Library/b.f90;hb=v2.8.7
 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/CMakeLists.txt;hb=v2.8.7
 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Tests/Fortran/Executable/main.f90;hb=v2.8.7
 Something that confuses me is:

   1 INCLUDE_DIRECTORIES(${Library_MODDIR})

   7 IF(CMAKE_Fortran_MODDIR_FLAG)
   8   SET_TARGET_PROPERTIES(subdir_mods PROPERTIES
   9 Fortran_MODULE_DIRECTORY modules
  10 )
  11 ENDIF(CMAKE_Fortran_MODDIR_FLAG)

If a hardcoded directory "modules" is being specified as the output directory 
for modules built from
a.f90 and b.f90 when the compiler supports a module output flag, why isn't 
"modules" in the include 
directories so that a.f90 can find B.mod?  Or is "${Library_MODDIR}" an 
intrinsic CMake function which 
is assigned the local target's module output directory?

>> The problem is I need a Fortran 90 file to be built using a module from 
>> another Fortran 90 file in the same >> directory and target, and I need this 
>> often. > This is expected to work.  If one Fortran 90 source file in
> a single target provides a module and another one uses it then
> CMake will detect this and add the proper make dependencies to
> build them in the right order (and rebuild).

> -Brad

But this is not working for me.  I still have the error:

*** No rule to make target `dir/CMakeFiles/target.a.dir/foo2.mod.stamp', 
needed by `dir/foo.tmp.f'.  Stop.

for add_library(target foo.f90 foo2.f90), where foo.f90 has "USE foo."
This may be a similar issue as my Ada modules having the erroneous requires 
step which 
caused a red herring error to show up which you caught in January (vis a vis 
something other
than dependency checking is causing the error).  So why would a make rule for 
*.mod.stamp not be generated? 
-- 

Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Intel MKL with FindBLAS and FindLAPACK on OS X?

2012-02-01 Thread Tim Gallagher
In your MKL installation, do you have the mkl_link_tool in the mkl/tools 
folder? 

Tim 

- Original Message -

From: "Andreas Voegel"  
To: cmake@cmake.org 
Sent: Wednesday, February 1, 2012 1:11:02 AM 
Subject: [CMake] Intel MKL with FindBLAS and FindLAPACK on OS X? 

I am trying to include Intel's MKL in my project by including the following in 
my CMakeLists.txt file: 


set( ENV{BLA_VENDOR} "Intel10_64lp" ) 
find_package (LAPACK) 


Unfortunately, when I execute cmake I receive the following errors: 
-- A library with BLAS API not found. Please specify library location. 

-- LAPACK requires BLAS 
-- A library with LAPACK API not found. Please specify library location. 


If I instead use set( ENV{BLA_VENDOR} "Apple" ) in my CMakeLists.txt file, the 
Accelerate framework is successfully located. This, of course, leads me to 
believe that FindBLAS.cmake and/or FindLAPACK.cmake fail to locate my MKL 
install. 


The contents of my DYLD_LIBRARY_PATH environment variable are: 
/opt/intel/composer_xe_2011_sp1.8.269/compiler/lib:/opt/intel/composer_xe_2011_sp1.8.269/compiler/lib/intel64:/opt/intel/composer_xe_2011_sp1.8.269/ipp/../compiler/lib:/opt/intel/composer_xe_2011_sp1.8.269/ipp/lib:/opt/intel/composer_xe_2011_sp1.8.269/compiler/lib:/opt/intel/composer_xe_2011_sp1.8.269/mkl/lib:/opt/intel/composer_xe_2011_sp1.8.269/tbb/lib
 


Is there anything special I need to do to get FindLAPACK to locate my install? 
Is there some way I can force cmake to give me more information to help debug 
this problem? 


Thank you for your advice. 


Best regards, 
Andreas 
-- 

Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Check compiler flags

2012-01-24 Thread Tim Gallagher
Hi,

Is there a module for CheckFortranCompilerFlag? I see one for C and CXX, but 
not one for Fortran.

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CTest build/configure not appending

2012-01-23 Thread Tim Gallagher
Hi,

I have a CTest script that builds many different tests and sets it to APPEND by 
doing:

foreach(TESTCASE ${LESLIE_AVAILABLE_TESTCASES})
  set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE} 
'{${LESLIE_CONFIGURE_DICT_BASE}}'")
  ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
  set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE} 
'{${LESLIE_BUILD_DICT_BASE}}'")
  ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
endforeach()

But, when I look in the configure.xml and build.xml, or check the dashboard, it 
only has the final test case information. It doesn't have the 96 previous ones. 

Does append not do what I think it should do? 

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CTest continuous testing

2012-01-13 Thread Tim Gallagher
The devil is always in the little details. That does the trick nicely, thanks!

Tim

- Original Message -
From: "David Cole" 
To: gtg0...@mail.gatech.edu
Cc: cmake@cmake.org
Sent: Friday, January 13, 2012 2:37:29 PM
Subject: Re: [CMake] CTest continuous testing

See the cmake_common.cmake script (as seen here on a CMake Continuous
dashboard, and in other places):

  http://cdash.org/CDash/viewNotes.php?buildid=1911520

Notice that it does:

  ctest_update(RETURN_VALUE count)

and then checks whether count is > 0 or not. It only does stuff if
count > 0 or it's the first time, or it's not a continuous
dashboard...

You need logic like that, and do not execute the configure/build/test
steps when nothing came back from the update...


HTH,
David


On Fri, Jan 13, 2012 at 2:11 PM, Tim Gallagher  wrote:
> Hi,
>
> We have a test case suite setup to run in continuous mode and submit to 
> CDash. I followed instructions on the wiki 
> (http://www.cmake.org/Wiki/CMake_Scripting_Of_CTest#Continuous_Builds_.28new_Style.29)
>  and have a script that's below the signature.
>
> I was under the impression that continuous testing would run once when it 
> started each run, then sleep and check for changed files and if nothing 
> changed, go back to sleep and wait again, then check again, etc.. And if 
> files did change and ctest_update() pulled in new code, the tests would run 
> again.
>
> However, the behavior I am getting is that the entire test suite is run every 
> 5 minutes for the entire continuous run time, even though no files are being 
> updated. Some of the tests are failing, if that makes a difference.
>
> Was I mistaken on how it works? Or did I miss a step somewhere? Thanks,
>
> Tim
>
> ---
> while(${CTEST_ELAPSED_TIME} LESS 43200)
>  set(START_TIME ${CTEST_ELAPSED_TIME})
>
>  ctest_start("Continuous")
>  ctest_update()
>  # Copy over the files we need
>  configure_file(${CTEST_REPO_DIRECTORY}/CTest/CTestCustom.cmake
>    ${CTEST_REPO_DIRECTORY}/CTestCustom.cmake @ONLY)
>  configure_file(${CTEST_REPO_DIRECTORY}/CTest/CTestTestfile.cmake
>    ${CTEST_REPO_DIRECTORY}/CTestTestfile.cmake @ONLY)
>  configure_file(${CTEST_REPO_DIRECTORY}/CTest/CTestAvailableTests.cmake
>    ${CTEST_REPO_DIRECTORY}/CTestAvailableTests.cmake @ONLY)
>  configure_file(${CTEST_REPO_DIRECTORY}/CTest/runPythonTest.sh.in
>    ${CTEST_REPO_DIRECTORY}/runPythonTest.sh @ONLY)
>
>  include(${CTEST_REPO_DIRECTORY}/CTestAvailableTests.cmake)
>
>  foreach(TESTCASE ${LESLIE_AVAILABLE_TESTCASES})
>    set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE} 
> '{${LESLIE_CONFIGURE_DICT_BASE}}'")
>    ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
>    set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE} 
> '{${LESLIE_BUILD_DICT_BASE}}'")
>    ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
>  endforeach()
>
>  list(LENGTH LESLIE_CUSTOM_TESTCASE_BASE len1)
>  math(EXPR len2 "${len1} - 1")
>
>  foreach(value RANGE ${len2})
>    list(GET LESLIE_CUSTOM_TESTCASE_BASE ${value} TESTCASE_BASE)
>    list(GET LESLIE_CUSTOM_TESTCASE_CONFIG_DICT ${value} TESTCASE_CONFIG)
>    list(GET LESLIE_CUSTOM_TESTCASE_BUILD_DICT ${value} TESTCASE_BUILD)
>
>    set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE_BASE} 
> ${TESTCASE_CONFIG}")
>    ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
>    set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE_BASE} ${TESTCASE_BUILD}")
>    ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
>  endforeach()
>
>  ctest_test(BUILD "${CTEST_REPO_DIRECTORY}")
>  ctest_submit()
>
>  ctest_sleep(${START_TIME} 300 ${CTEST_ELAPSED_TIME})
> endwhile()
>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] CTest continuous testing

2012-01-13 Thread Tim Gallagher
Hi,

We have a test case suite setup to run in continuous mode and submit to CDash. 
I followed instructions on the wiki 
(http://www.cmake.org/Wiki/CMake_Scripting_Of_CTest#Continuous_Builds_.28new_Style.29)
 and have a script that's below the signature. 

I was under the impression that continuous testing would run once when it 
started each run, then sleep and check for changed files and if nothing 
changed, go back to sleep and wait again, then check again, etc.. And if files 
did change and ctest_update() pulled in new code, the tests would run again.

However, the behavior I am getting is that the entire test suite is run every 5 
minutes for the entire continuous run time, even though no files are being 
updated. Some of the tests are failing, if that makes a difference. 

Was I mistaken on how it works? Or did I miss a step somewhere? Thanks,

Tim

---
while(${CTEST_ELAPSED_TIME} LESS 43200)
  set(START_TIME ${CTEST_ELAPSED_TIME})

  ctest_start("Continuous")
  ctest_update()
  # Copy over the files we need 

  configure_file(${CTEST_REPO_DIRECTORY}/CTest/CTestCustom.cmake
${CTEST_REPO_DIRECTORY}/CTestCustom.cmake @ONLY)
  configure_file(${CTEST_REPO_DIRECTORY}/CTest/CTestTestfile.cmake
${CTEST_REPO_DIRECTORY}/CTestTestfile.cmake @ONLY)
  configure_file(${CTEST_REPO_DIRECTORY}/CTest/CTestAvailableTests.cmake
${CTEST_REPO_DIRECTORY}/CTestAvailableTests.cmake @ONLY)
  configure_file(${CTEST_REPO_DIRECTORY}/CTest/runPythonTest.sh.in
${CTEST_REPO_DIRECTORY}/runPythonTest.sh @ONLY)

  include(${CTEST_REPO_DIRECTORY}/CTestAvailableTests.cmake)

  foreach(TESTCASE ${LESLIE_AVAILABLE_TESTCASES})
set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE} 
'{${LESLIE_CONFIGURE_DICT_BASE}}'")
ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE} 
'{${LESLIE_BUILD_DICT_BASE}}'")
ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
  endforeach()

  list(LENGTH LESLIE_CUSTOM_TESTCASE_BASE len1)
  math(EXPR len2 "${len1} - 1")

  foreach(value RANGE ${len2})
list(GET LESLIE_CUSTOM_TESTCASE_BASE ${value} TESTCASE_BASE)
list(GET LESLIE_CUSTOM_TESTCASE_CONFIG_DICT ${value} TESTCASE_CONFIG)
list(GET LESLIE_CUSTOM_TESTCASE_BUILD_DICT ${value} TESTCASE_BUILD)

set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE_BASE} 
${TESTCASE_CONFIG}")
ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE_BASE} ${TESTCASE_BUILD}")
ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
  endforeach()

  ctest_test(BUILD "${CTEST_REPO_DIRECTORY}")
  ctest_submit()

  ctest_sleep(${START_TIME} 300 ${CTEST_ELAPSED_TIME})
endwhile()



--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Documentation request

2011-12-21 Thread Tim Gallagher
I like the idea of putting "new in #.#.#" when features are added, that would 
at least be an easy reminder on the documentation page that some things are not 
universal to 2.8.*. 

I also agree that it's not super clear that back documentation is available on 
the wiki. If you look at the documentation page, it says things like 
"Documentation for CMake 2.8", "Documentation for CMake 2.6" and then at the 
bottom under "Legacy Documentation for CMake" there is a section for CMake 2.4. 

To me that implies that 

A) documentation holds for all versions of 2.8.* or 2.6.* or 2.4.*;
B) there is only documentation for those versions and the wiki would hold other 
types of information (and if you just go to the main page of the wiki, there is 
no indication that old versions are documented, I had to search to find it).

So, I understand all to well how time consuming writing documentation is. And 
if space is an issue, how about the following:

A) Rename the links on the documentation page so that it says it is for the 
current version, so it would say "Documentation for CMake 2.8.7" when the next 
is released.
B) Under "Legacy Documentation", put a link to the CMake_Released_Versions page 
on the wiki to point people to that documentation. 

Does that sounds like a reasonable compromise? We've run into this frequently 
enough that I thought I'd bring it up, but as I said before, if we're the only 
ones who keep making these mistakes, then we can deal with it internally.

Tim

- Original Message -
From: "Renato Utsch" 
To: cmake@cmake.org
Sent: Wednesday, December 21, 2011 8:38:27 AM
Subject: Re: [CMake] Documentation request

Yes, but is not so easy to find. It would be easier to have it in the
documentation page (if the page hosts CMake 2.6 or CMake 2.4
documentations, why it doesn't host CMake 2.8.3 documentation? They
should be on the wiki too!), easier to find.

Renato

2011/12/21 Michael Wild :
> As I already said, all the old documentation (back to version 1.6,
> AFAIK) is available on the wiki.
>
> Michael
>
> On 12/21/2011 01:12 PM, Renato Utsch wrote:
>>> You ?
>>> This represents a fair amount of work...
>>> I bet that if no-one did it it is because it's a hUGe task.
>>
>> Sorry, I am not that good with english, I meant as the CMake team with
>> 'you'. But the 'CMake team' could do that with new releases, like,
>> writing this warning with additions in the newer releases.
>>
>> Or, the easier way, to mantain different versions of the documentation
>> at the site. This is not difficult, maybe put the latest doc in the
>> "Documentation" page and down in the "see also" of the documentation a
>> link to the older ones, or maybe everything in the documentation
>> page...
>>
>> Renato
>>
>>
>>
>> 2011/12/21 Eric Noulard :
>>> 2011/12/21 Renato Utsch :
 I had the same problem a yesterday (or the day before) with the
 string( FIND ) command...

 I tried to find the cmake 2.8.4 docs but I couldn't.
>>>
>>> cmake command **itself** is able to spit out its documentation.
>>> So
>>>
>>> cmake --help-command string
>>>
>>> will give you the hopefully up to date doc of the currently used cmake.
>>> In the same way:
>>> cmake --help-full
>>> cmake --help-html
>>>
>>> will give you a doc similar to
>>> http://www.cmake.org/cmake/help/cmake-2-8-docs.html
>>>
>>> but for the currently used cmake.
>>>
  I think you should do it, or at least to issue a warning (in the 
 documentation) in
 every command that wasn't introduced in CMake 2.8.0...
>>>
>>> You ?
>>> This represents a fair amount of work...
>>> I bet that if no-one did it it is because it's a hUGe task.
>>>
>>> --
>>> Erk
>>> Membre de l'April - « promouvoir et défendre le logiciel libre » -
>>> http://www.april.org
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at: 
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to s

[CMake] Documentation request

2011-12-20 Thread Tim Gallagher
Hi,

I don't know if this will get done, but is it possible for future releases of 
CMake to change the name on the website for the documentation? For example, if 
you just looked at the URL:

http://www.cmake.org/cmake/help/cmake-2-8-docs.html

and you didn't look at the header (which happens a lot if you come to this via 
Google or something and jump directly to it), you would assume the function 
documented there would work for 2.8.*. 

But, that certainly isn't true. We've hit a lot of things that exist in 2.8.4 
or .5 and not 2.8.3. To make things more complicated, on the HPC sites we run 
on, we have versions 2.8.3 (some full release, other's RC's), 2.8.4, 2.8.5, and 
2.8.6. So the stuff we write on one machine doesn't always work on the rest 
because we unknowingly use a function that doesn't exist in previous versions.

Can the URL be changed to something like:

http://www.cmake.org/cmake/help/cmake-2-8-7docs.html

and the previous versions kept up at least for a little while? Maybe have 3 
versions on the site at a time, appropriately named, so it isn't as confusing 
(and frustrating) to keep running into missing features?

Anybody else come across this problem, or are we just not good at paying 
attention? 

Thanks!

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Find package with version numbers

2011-12-14 Thread Tim Gallagher
Boost takes arguments for versions of the library if you need a concrete 
example.

Tim

- Original Message -
From: "Alexander Neundorf" 
To: cmake@cmake.org
Sent: Wednesday, December 14, 2011 5:11:45 PM
Subject: Re: [CMake] Find package with version numbers

On Wednesday 14 December 2011, Robert Dailey wrote:
> Is there any example of how to write a find module for find_package() that
> utilizes version numbers? How is the version number passed into the
> Find*.cmake module? The documentation on this is very confusing and
> discusses creating a version.cmake file. I looked in the CMake modules
> directory for an example but there are no version files...
> 
> I'm creating a find module for the Microsoft Platform SDK:
> FindMSPlatformSDK.cmake. I need to be able to call it like so:
> 
> find_package( MSPlatformSDK 7.0 )

See the readme file in the cmake modules directory.

In the Find-module, you have access to 
_FIND_VERSION_(MAJOR|MINOR|PATCH) etc. variables which 
you can check.

If you determine the version of the found package, you can then simply put the 
found version number into a variable, and use the new-style 
find_package_handle_standard_args(... VERSION_VAR ...) macro to evaluate it, 
it will fail if it is not good.

For creating a FooConfigVersion.cmake file (when installing your own library), 
you may use the WriteBasicConfigVersionFile.cmake (since cmake 2.8.6) which 
writes a basic version file for you, which you can install along with your 
library.

Alex
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindLAPACK problem

2011-12-13 Thread Tim Gallagher
I've found and fixed another problem.

When using Intel MKL, Pthreads is also required. There is a call to 
find_package for Threads in FindLAPACK, and when it checks that the libraries 
work in the macro, it links against them so the test build works fine. But at 
the end of the macro, when building the list of libraries used for lapack, it 
does not include threads as it should.

I've submitted another bug report and uploaded patches, again for both master 
and release. Ticket number is 12625. 

Tim

- Original Message -----
From: "Tim Gallagher" 
To: cmake@cmake.org
Sent: Tuesday, December 13, 2011 12:15:33 PM
Subject: Re: [CMake] FindLAPACK problem

My colleague, Andy Smith, found the problem. 

The CMAKE_FIND_LIBRARY_SUFFIXES variable was mispelled as 
CMAKE_FIND_LIBRRAY_SUFFIXES causing errors. 

I created a ticket in Mantis and attached patches for both origin/master and 
origin/release. The ticket is number 12624.

Tim

- Original Message -
From: "Tim Gallagher" 
To: cmake@cmake.org
Sent: Monday, December 12, 2011 10:01:54 PM
Subject: [CMake] FindLAPACK problem

Hi,

I sent this out awhile ago, saying it couldn't find the MKL LAPACK. But I think 
the problem may be bigger than that because it can't find non-MKL lapack for me 
either. I get:

-- A library with BLAS API found.
-- A library with BLAS API found.
CMake Error at /usr/share/cmake/Modules/FindLAPACK.cmake:295 (message):
  A required library with LAPACK API not found.  Please specify library
  location.
Call Stack (most recent call first):

but

|21:52||tgallagher@harpy:leslie|> ls /usr/lib64/libblas*
/usr/lib64/libblas.a  /usr/lib64/libblas_pic.a  /usr/lib64/libblas.so  
/usr/lib64/libblas.so.3  /usr/lib64/libblas.so.3.3.1

|21:52||tgallagher@harpy:leslie|> ls /usr/lib64/liblapack*
/usr/lib64/liblapack.a  /usr/lib64/liblapack.so
/usr/lib64/liblapack.so.3.3.1
/usr/lib64/liblapack_pic.a  /usr/lib64/liblapack.so.3

So I have BLAS and LAPACK installed from OpenSuSE and CMake 2.8.6. This is sort 
of a show stopper if we can't get FindLAPACK working. 

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindLAPACK problem

2011-12-13 Thread Tim Gallagher
My colleague, Andy Smith, found the problem. 

The CMAKE_FIND_LIBRARY_SUFFIXES variable was mispelled as 
CMAKE_FIND_LIBRRAY_SUFFIXES causing errors. 

I created a ticket in Mantis and attached patches for both origin/master and 
origin/release. The ticket is number 12624.

Tim

- Original Message -
From: "Tim Gallagher" 
To: cmake@cmake.org
Sent: Monday, December 12, 2011 10:01:54 PM
Subject: [CMake] FindLAPACK problem

Hi,

I sent this out awhile ago, saying it couldn't find the MKL LAPACK. But I think 
the problem may be bigger than that because it can't find non-MKL lapack for me 
either. I get:

-- A library with BLAS API found.
-- A library with BLAS API found.
CMake Error at /usr/share/cmake/Modules/FindLAPACK.cmake:295 (message):
  A required library with LAPACK API not found.  Please specify library
  location.
Call Stack (most recent call first):

but

|21:52||tgallagher@harpy:leslie|> ls /usr/lib64/libblas*
/usr/lib64/libblas.a  /usr/lib64/libblas_pic.a  /usr/lib64/libblas.so  
/usr/lib64/libblas.so.3  /usr/lib64/libblas.so.3.3.1

|21:52||tgallagher@harpy:leslie|> ls /usr/lib64/liblapack*
/usr/lib64/liblapack.a  /usr/lib64/liblapack.so
/usr/lib64/liblapack.so.3.3.1
/usr/lib64/liblapack_pic.a  /usr/lib64/liblapack.so.3

So I have BLAS and LAPACK installed from OpenSuSE and CMake 2.8.6. This is sort 
of a show stopper if we can't get FindLAPACK working. 

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] FindLAPACK problem

2011-12-12 Thread Tim Gallagher
Hi,

I sent this out awhile ago, saying it couldn't find the MKL LAPACK. But I think 
the problem may be bigger than that because it can't find non-MKL lapack for me 
either. I get:

-- A library with BLAS API found.
-- A library with BLAS API found.
CMake Error at /usr/share/cmake/Modules/FindLAPACK.cmake:295 (message):
  A required library with LAPACK API not found.  Please specify library
  location.
Call Stack (most recent call first):

but

|21:52||tgallagher@harpy:leslie|> ls /usr/lib64/libblas*
/usr/lib64/libblas.a  /usr/lib64/libblas_pic.a  /usr/lib64/libblas.so  
/usr/lib64/libblas.so.3  /usr/lib64/libblas.so.3.3.1

|21:52||tgallagher@harpy:leslie|> ls /usr/lib64/liblapack*
/usr/lib64/liblapack.a  /usr/lib64/liblapack.so
/usr/lib64/liblapack.so.3.3.1
/usr/lib64/liblapack_pic.a  /usr/lib64/liblapack.so.3

So I have BLAS and LAPACK installed from OpenSuSE and CMake 2.8.6. This is sort 
of a show stopper if we can't get FindLAPACK working. 

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CMake and Python

2011-11-22 Thread Tim Gallagher
Hi all,

I don't know if anybody would find this useful or not, but I thought I'd let 
everybody know about it and if somebody would like to use it, I can figure out 
the best way to get it out there. 

We have a fairly extensive python library that we use to setup our code and 
manipulate our data. Part of this process is generating/manipulating CMake 
cache files. To that end, I wrote a module that can do the following:

- Given a CMakeLists.txt, build a dictionary of available options (possibly 
including advanced) including the type and default values (and take in some 
options to turn on before checking for options, to activate if's for example; 
also allow the caller to specify a prefix they want to include, for instance 
'CMAKE' would result in a dictionary only containing CMAKE_* variables).
- Given a CMakeCache.txt file, build the above dictionary
- Given a dictionary of options (built from above or by hand), write out a 
script to generate the initial cache (to be used with cmake -C)
- Given a dictionary of options, take in another dictionary of options to 
modify original dictionary with possible include/exclude lists (an example use 
is to take a dictionary from the user to modify default values, combined with 
the include/exclude list to say "Only let the user change options X, Y, Z 
regardless of what they tried to change")

The final thing it currently does may get left in or stripped out if I release 
it to people -- it writes a simple python script to execute a code using MPI 
based on the values for the MPI variables found by CMake. This is because we 
use it to setup test cases and needed an easy way to determine the MPIEXEC and 
MAX_PROCS variables. 

So, if people are interested in using it or expanding it, let me know and I can 
throw it up on GitHub or something. If it's something useful for inclusion in 
CMake now or down the road, that can be figured out too.

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] get name of .lib file

2011-11-07 Thread Tim Gallagher
I think the CMAKE_SHARED_LIBRARY_PREFIX/CMAKE_SHARED_LIBRARY_SUFFIX variables 
would tell you what you want. We use them to determine the output name as:

${CMAKE_SHARED_LIBRARY_PREFX}${CMAKE_SHARED_LIBRARY_SUFFIX}

We also have an if statement in case STATIC libraries are built, in which case 
you just replace SHARED with STATIC in the variable names.

These came from:

http://cmake.org/Wiki/CMake_Useful_Variables

Tim

- Original Message -
From: "Tomasz Grobelny" 
To: cmake@cmake.org
Sent: Monday, November 7, 2011 8:23:10 AM
Subject: [CMake] get name of .lib file

I have a library created like this:
  add_library(mylib SHARED ${SOURCES} ${PRIVATE_HEADERS}
${PUBLIC_HEADERS})
Now I want to get names of all output files for mylib target (on Unix this
would be .so file, but on Windows it would be .dll, .lib and possibly .pdb
files). Is there any better way to get those names without constructing
them manually eg. using get_filename_component from main file? I get the
main file as follows:
  get_property(location TARGET mylib PROPERTY LOCATION)
Are there any other properties that would give me the other names?
-- 
Regards,
Tomasz Grobelny
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How the heck does one set options?

2011-11-02 Thread Tim Gallagher
You're right, I left out the doc string part by mistake. You can see the 
correct usage in your trace. For instance:

option(gtest_force_shared_crt "Use shared (DLL) run-time lib even when Google 
Test is built as static lib." ON)

Tim

- Original Message -
From: "Steven Velez" 
To: "Dan Kegel" 
Cc: gtg0...@mail.gatech.edu, cmake@cmake.org
Sent: Wednesday, November 2, 2011 9:48:18 PM
Subject: Re: [CMake] How the heck does one set options?

Just a guess, but the docs for option state:

  option( "help string describing option"
 [initial value])

  Provide an option for the user to select as ON or OFF. If no initial
value is provided, OFF is used.

In this description is not optional, but the initial value is.  In the
usage presented, I believe "ON" may be interpreted as the doc string
and the default value is being taken?  Maybe Tim made a mistake in his
reply.

I don't know personally, I've never used this.

Steven


On Wed, Nov 2, 2011 at 9:36 PM, Dan Kegel  wrote:
> On Wed, Nov 2, 2011 at 6:21 PM, Tim Gallagher  
> wrote:
>> Using set() as you have done only sets the value in the current scoping 
>> unit. If you did:
>>
>> set(gtest_force_shared_crt ON CACHE INTERNAL "")
>>
>> then it will be set to ON and hidden from the GUI display.
>>
>> If it will always be a bool and you want it displayed on the GUI, you can 
>> also do:
>>
>> option(gtest_force_shared_crt ON)
>
> Tried it, no change, still broken.
>
> $ grep gtest_force_shared_crt CMakeLists.txt build/CMakeCache.txt
> CMakeLists.txt:option(gtest_force_shared_crt ON)
> build/CMakeCache.txt:gtest_force_shared_crt:BOOL=OFF
>
> --trace shows
>
> CMakeLists.txt(23):  option(gtest_force_shared_crt ON )
> gtest/CMakeLists.txt(14):  option(gtest_force_shared_crt Use shared
> (DLL) run-time lib even when Google Test is built as static lib. OFF )
>
> So, now what?  How does one set an option declared by a subdirectory
> before entering that subdirectory?  Lots of people use gtest, surely
> someone has run into this before.
> - Dan
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] How the heck does one set options?

2011-11-02 Thread Tim Gallagher
Using set() as you have done only sets the value in the current scoping unit. 
If you did:

set(gtest_force_shared_crt ON CACHE INTERNAL "")

then it will be set to ON and hidden from the GUI display.

If it will always be a bool and you want it displayed on the GUI, you can also 
do:

option(gtest_force_shared_crt ON)

Tim

- Original Message -
From: "Dan Kegel" 
To: cmake@cmake.org
Sent: Wednesday, November 2, 2011 9:14:19 PM
Subject: [CMake] How the heck does one set options?

Right, so, I have this fragment:

set(gtest_force_shared_crt ON)
add_subdirectory(gtest)

Oddly, when I run cmake, that variable is off.  WTF?

Looking at the cache, I see

build/CMakeCache.txt:gtest_force_shared_crt:BOOL=OFF

It looks like someone else ran into this before,
http://www.mail-archive.com/cmake@cmake.org/msg20930.html

What am I missing?  Surely it can't be this hard to set options...
- Dan
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindLAPACK in git head

2011-10-17 Thread Tim Gallagher
I'm still trying to figure this one out. I went in an unset _libdir and 
manually set it to include the mkl path (even though it is the first thing on 
the LD_LIBRARY_PATH) and it still can't find it. In other words, 

set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 
/opt/intel/Compiler/11.1/072/mkl/lib/em64t)

And 

|13:35||tgallagher@harpy:bin_LEM_splicing|> ls  
/opt/intel/Compiler/11.1/072/mkl/lib/em64t/libmkl_lapack*
/opt/intel/Compiler/11.1/072/mkl/lib/em64t/libmkl_lapack95_ilp64.a  
/opt/intel/Compiler/11.1/072/mkl/lib/em64t/libmkl_lapack95_lp64.a  
/opt/intel/Compiler/11.1/072/mkl/lib/em64t/libmkl_lapack.so

And if I leave _libdir untouched so that it ends with ENV LD_LIBRARY_PATH, it 
also cannot find it even though:

|13:35||tgallagher@harpy:bin_LEM_splicing|> echo $LD_LIBRARY_PATH
/opt/intel/Compiler/11.1/072/mkl/lib/em64t:...

I'm stumped. 

Tim

- Original Message -
From: "Rolf Eike Beer" 
To: cmake@cmake.org
Sent: Monday, October 17, 2011 3:47:34 AM
Subject: Re: [CMake] FindLAPACK in git head

> Hi,
>
> We're having problems with FindLAPACK in the latest source head. It claims
> it cannot find LAPACK when previous versions of CMake find it just fine.
> It does not work with either the Generic version or the Intel version.
> FindBLAS correctly locates the library though.

No idea so far.

> And when we put in the path for the LAPACK_mkl_lapack_LIBRARY variable, it
> doesn't complain. But then during linking, we get:
>
> /opt/intel/Compiler/11.1/072/lib/intel64/libguide.so: undefined reference
> to `pthread_atfork'
> make[2]: *** [derivative/unitTests/utDerivativeTestc] Error 1
>
> even though libpthread.so exists and is on the library path in /usr/lib.

That means that you need to link against the pthread library. The problem
here is not that the library is not found, but that you did not tell CMake
to use it. Usually this is done by the LAPACK module, so the main reason
you are seeing this at all is that it did not find your library in the
first place.

Eike

Eike
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CTest outside of CMake

2011-10-17 Thread Tim Gallagher
Yes, we're writing the CTestTestfile.cmake with all of the available tests 
using add_test(). So it sounds like there is no way to only configure/build 
selected tests when using CTest outside of CMake, short of hand-writing the 
CTestTestfile with only the desired tests. 

I was going to suggest having a BUILD_COMMAND and CONFIGURE_COMMAND option to 
the add_test() call, but that sounds like that also won't fix the problem 
because the add_test is after the configure/build step. Obviously those would 
not be useful for projects using CMake, but it would be good for ones not using 
CMake. 

The way the entire process is set up -- we have our source code built with 
CMake. All of our test cases were created prior to CMake'ing things and are 
fairly involved to set up, so we have that setup.py script. That script creates 
the bin, input, and output directories, copies over the needed input files, 
etc.. Then it modifies the input files for the specific test case and writes 
out a restart file with the initial conditions. Then, in the bin directory, it 
creates a build directory where it configures CMake for the main code, and 
another build directory where it configures CMake for the utilities. Then it 
builds them all and runs the test cases on our cluster. The tests can be run 
external to ctest with:

./setup.py -t   

and we were trying to wrap all of that process up with CTest and use CDash to 
track the cases. But as users write more test cases, they asked if it was 
possible to make sure their case worked with CTest without having to build/run 
all of the other cases. 

It is like pulling teeth to just get them to add the add_test() line in the 
CTestTestfile even though it's just copy-pasting what's already there, so I was 
hoping there would be a way to do this without making them write custom files 
because I don't think that would actually happen. But, if that's not possible, 
then we'll work with what we have. 

Thanks,

Tim


- Original Message -
From: "David Cole" 
To: gtg0...@mail.gatech.edu
Cc: cmake@cmake.org
Sent: Monday, October 17, 2011 11:54:57 AM
Subject: Re: [CMake] CTest outside of CMake

On Mon, Oct 17, 2011 at 11:04 AM, Tim Gallagher
 wrote:
> Hi,
>
> Sorry I wasn't clearer. That section was from a script that we call with 
> ctest. The entire section that runs things looks like
>
> # Load our custom settings
> ctest_read_custom_files("${CTEST_REPO_DIRECTORY}")
> ctest_start("Nightly")
> ctest_update()
> foreach(TESTCASE ${LESLIE_AVAILABLE_TESTCASES})
>  set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE} 
> ${LESLIE_CONFIGURE_DICT}")
>  ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
>  set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE} ${LESLIE_BUILD_DICT}")
>  ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
> endforeach()
> ctest_test(BUILD "${CTEST_REPO_DIRECTORY}")
> ctest_submit()
>
> And we call ctest with
>
> ctest -S CTestScript.cmake
>
> My question is, if I only want to run a few tests, ie only run tests 2, 3, 4:
>
> ctest -S CTestScript.cmake -I 2,4
>
> This only run the ctest_test() on tests 2, 3, and 4, but I don't know how to 
> determine inside the script which tests will be run, so it configures/builds 
> all of the available tests since I have that loop.
>
> So, is there a variable that gets set or some way to determine which tests 
> are called from the command line inside the script in the event something 
> like -I or -R flags are used? Is there a variable that contains the list of 
> tests that CTest will run?
>

No, there is no such variable. The list of tests is not knowable until
after the configure step in a CMake-controlled project. The list of
tests is only read and known internally during the execution of the
ctest_test command. How does ctest even know the list of tests in your
case, when you are running a "setup.py" script as the configure
step...? Are you writing the CTestTestfile.txt files yourself?


> Hope that's clearer. Thanks,
>
> Tim
>
> - Original Message -
> From: "Eric Noulard" 
> To: gtg0...@mail.gatech.edu
> Cc: cmake@cmake.org
> Sent: Monday, October 17, 2011 3:06:48 AM
> Subject: Re: [CMake] CTest outside of CMake
>
> 2011/10/17 Tim Gallagher :
>> Hi,
>>
>> We have our project set up to run a series of test cases, but we are 
>> treating it as if we are not using CMake. I found a tutorial online on how 
>> to set it up, and we have it running just fine when we want to run all of 
>> the tests. But, I haven't figured out how to do the configure/build steps 
>> for selected tests only.
>>
>> For example, each test has it's own configure com

Re: [CMake] CTest outside of CMake

2011-10-17 Thread Tim Gallagher
Hi,

Sorry I wasn't clearer. That section was from a script that we call with ctest. 
The entire section that runs things looks like

# Load our custom settings  
  
ctest_read_custom_files("${CTEST_REPO_DIRECTORY}")
ctest_start("Nightly")
ctest_update()
foreach(TESTCASE ${LESLIE_AVAILABLE_TESTCASES})
  set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE} 
${LESLIE_CONFIGURE_DICT}")
  ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
  set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE} ${LESLIE_BUILD_DICT}")
  ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
endforeach()
ctest_test(BUILD "${CTEST_REPO_DIRECTORY}")
ctest_submit()

And we call ctest with 

ctest -S CTestScript.cmake 

My question is, if I only want to run a few tests, ie only run tests 2, 3, 4:

ctest -S CTestScript.cmake -I 2,4

This only run the ctest_test() on tests 2, 3, and 4, but I don't know how to 
determine inside the script which tests will be run, so it configures/builds 
all of the available tests since I have that loop. 

So, is there a variable that gets set or some way to determine which tests are 
called from the command line inside the script in the event something like -I 
or -R flags are used? Is there a variable that contains the list of tests that 
CTest will run?

Hope that's clearer. Thanks,

Tim

- Original Message -
From: "Eric Noulard" 
To: gtg0...@mail.gatech.edu
Cc: cmake@cmake.org
Sent: Monday, October 17, 2011 3:06:48 AM
Subject: Re: [CMake] CTest outside of CMake

2011/10/17 Tim Gallagher :
> Hi,
>
> We have our project set up to run a series of test cases, but we are treating 
> it as if we are not using CMake. I found a tutorial online on how to set it 
> up, and we have it running just fine when we want to run all of the tests. 
> But, I haven't figured out how to do the configure/build steps for selected 
> tests only.
>
> For example, each test has it's own configure command and build command. If I 
> do
>
> ctest -I 2,2
>
> then it configures and builds all the tests, but will only run the second 
> test.
>
> The driver script contains a section like:
>
> foreach(TESTCASE ${LESLIE_AVAILABLE_TESTCASES})
>  set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE} 
> ${LESLIE_CONFIGURE_DICT}")
>  ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
>  set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE} ${LESLIE_BUILD_DICT}")
>  ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
> endforeach()
>
> and the LESLIE_AVAILABLE_TESTCASES is a list of test cases names that match 
> the add_test() test names. Is it possible when running CTest with -I or -R 
> (or even without -I or -R) to figure out which tests it selects so we can 
> build LESLIE_AVAILABLE_TESTCASES from that?

I'm not sure to understand your whole testing process flow,
Is the script above part of a ctest -S script?

Filtering some tests may be done with test NAMES or LABELS
see EXCLUDE / INCLUDE or
EXCLUDE_LABEL / INCLUDE_LABEL
 arguments of ctest_test (ctest --help-command ctest_test)

However you does not seem to use ctest_test ?
How do you run your ctest command (which arguments/options are you using)?

Concerning labels
see http://www.kitware.com/blog/home/post/11 and reference therein.



-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] CTest outside of CMake

2011-10-16 Thread Tim Gallagher
Hi,

We have our project set up to run a series of test cases, but we are treating 
it as if we are not using CMake. I found a tutorial online on how to set it up, 
and we have it running just fine when we want to run all of the tests. But, I 
haven't figured out how to do the configure/build steps for selected tests 
only. 

For example, each test has it's own configure command and build command. If I 
do 

ctest -I 2,2

then it configures and builds all the tests, but will only run the second test. 

The driver script contains a section like:

foreach(TESTCASE ${LESLIE_AVAILABLE_TESTCASES})
  set(CTEST_CONFIGURE_COMMAND "./setup.py -t ${TESTCASE} 
${LESLIE_CONFIGURE_DICT}")
  ctest_configure(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
  set(CTEST_BUILD_COMMAND "./setup.py -t ${TESTCASE} ${LESLIE_BUILD_DICT}")
  ctest_build(BUILD "${CTEST_REPO_DIRECTORY}" APPEND)
endforeach()

and the LESLIE_AVAILABLE_TESTCASES is a list of test cases names that match the 
add_test() test names. Is it possible when running CTest with -I or -R (or even 
without -I or -R) to figure out which tests it selects so we can build 
LESLIE_AVAILABLE_TESTCASES from that?

Thanks,

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] FindLAPACK in git head

2011-10-16 Thread Tim Gallagher
Hi,

We're having problems with FindLAPACK in the latest source head. It claims it 
cannot find LAPACK when previous versions of CMake find it just fine. It does 
not work with either the Generic version or the Intel version. FindBLAS 
correctly locates the library though.

And when we put in the path for the LAPACK_mkl_lapack_LIBRARY variable, it 
doesn't complain. But then during linking, we get:

/opt/intel/Compiler/11.1/072/lib/intel64/libguide.so: undefined reference to 
`pthread_atfork'
make[2]: *** [derivative/unitTests/utDerivativeTestc] Error 1

even though libpthread.so exists and is on the library path in /usr/lib. 

Has anybody else experienced this issue? We've had it on a variety of machines 
with very different configurations.

Thanks,

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CTest of multiple projects

2011-10-14 Thread Tim Gallagher
Hi,

Is it possible to make CTest aware of other CTest things going on? For example, 
let's say I have a continuous build set up for two different projects, and each 
has 1 test in it that uses all the processors in the machine. 

Is it possible to set it up in a such a way that the two different projects 
don't get tested at the same time? 

Thanks,

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Attaching files for dashboard submission

2011-10-13 Thread Tim Gallagher
Hi,

I was looking around on the internet for how to attach files, specifically 
images, to CDash submissions with CTest. I saw some other mailing list posts 
related to it in which people said the attached files were showing up as plain 
text instead of images on the dashboard. 

The solution was to set the "type" variable in the  tag to 
something like image/png. Is there a way to do this without editing the 
Test.xml file? We are currently attaching the file with the ATTACHED_FILES 
property of the test. Is there a file-type variable that goes along with that?

Tim
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] export() vs. install(export...)

2011-09-18 Thread Tim Gallagher
It does make sense and answered most of my questions. Maybe rather than asking 
more questions, I can make some suggestions based on what I'm trying to do and 
see what people think:

1. It would be nice to be able to register installation trees in the registry 
so the user does not have to provide the _DIR variable to find the 
config file. 

2. It would likewise be nice if entries in the registry could be distinguished 
based on something other than the project name. For instance, we are always 
building our libraries with Intel and GNU compilers (in different build trees) 
and installing them both (in different installation trees, it's a Fortran 
project, so the module files are incompatible). It would be awesome if there 
was a way for find_package() to track down the version compiled with the same 
compiler currently being used based on the compiler ID string or something. 

Maybe there is a clever way to accomplish both of these that I'm missing. But, 
the vast majority of the time people complain that our code doesn't compile is 
because they specified the wrong _DIR variable and are mixing 
compilers. The registry seems like a great way to keep the user from having to 
figure out the _DIR variable for each of the libraries, but right now 
I don't know how or if it can be done. 

Has anybody else come across a similar issue and found a solution? 

Thanks,

Tim

- Original Message -
From: "Michael Wild" 
To: cmake@cmake.org
Sent: Monday, September 19, 2011 2:29:47 AM
Subject: Re: [CMake] export() vs. install(export...)

On 09/19/2011 01:14 AM, Tim Gallagher wrote:
> Hi,
> 
> I've been trying to figure out the exact differences between the 
> export() and install(export ...) functions and I have some questions 
> still.
> 
> From the documentation, EXPORT() makes available the build tree for
> a given target and puts the path to the build tree in the 
> ~/.cmake/packages/ directory while INSTALL(EXPORT ...)
> makes the install tree available.
> 
> What I don't understand is what happens with EXPORT() if you have 
> multiple builds of the same project. For example, we often build (in 
> two different directories) the same project with two compilers
> (Intel and GNU) and install them in two different locations. But the
> entries in the registry just show path names. How would
> find_package() work in that instance?

the ~/.cmake/packages/ registry is only queried if you don't
specify a _DIR variable which points to a directory containing
the -config.cmake (or Config.cmake) file. If not
specified, find_package() will use the latest build tree registered in
~/.cmake/package/.

> 
> When using INSTALL(EXPORT ...), I can get the information I need by 
> INCLUDE'ing the file, but I cannot find that file without the user's 
> input. Is there a way to put the path to the install tree in the 
> registry? If so, how would find_package() behave with multiple 
> installs?

See the documentation of the find_package() command for information on
where CMake looks for Config.cmake files.

> 
> If anybody has any suggestions, I would appreciate it.
> 
> Tim

Does this help?

Michael
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] export() vs. install(export...)

2011-09-18 Thread Tim Gallagher
Hi,

I've been trying to figure out the exact differences between the export() and 
install(export ...) functions and I have some questions still.

>From the documentation, EXPORT() makes available the build tree for a given 
>target and puts the path to the build tree in the ~/.cmake/packages/ 
>directory while INSTALL(EXPORT ...) makes the install tree available.

What I don't understand is what happens with EXPORT() if you have multiple 
builds of the same project. For example, we often build (in two different 
directories) the same project with two compilers (Intel and GNU) and install 
them in two different locations. But the entries in the registry just show path 
names. How would find_package() work in that instance? 

When using INSTALL(EXPORT ...), I can get the information I need by INCLUDE'ing 
the file, but I cannot find that file without the user's input. Is there a way 
to put the path to the install tree in the registry? If so, how would 
find_package() behave with multiple installs?

If anybody has any suggestions, I would appreciate it.

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Install optional targets

2011-08-28 Thread Tim Gallagher
Thanks for the help! This does exactly what we wanted. 

And, install(OPTIONAL) with EXCLUDE_FROM_ALL also works... perhaps that warning 
message should only be displayed if OPTIONAL isn't in the install() function as 
it's rather misleading...

Tim

- Original Message -
From: "Michael Hertling" 
To: cmake@cmake.org
Sent: Sunday, August 28, 2011 8:33:47 PM
Subject: Re: [CMake] Install optional targets

On 08/29/2011 01:20 AM, Tim Gallagher wrote:
> Hi,
> 
> I asked about this awhile back and haven't had any luck with it, so I'll try 
> again.
> 
> What we are trying to do is have a project (called Utilities) that has a 
> bunch of targets (the actual utility executables). Let's say there are 4 
> utils: pre, post, grid, and restart. We would like to do something like:
> 
> make pre
> make post
> make install
> 
> Where the "make install" step only installs the targets that have been built. 
> If each target is created with the add_executable() and then has an install() 
> (without OPTIONAL), then typing "make install" will build pre, post, grid and 
> restart. 
> 
> If each target has EXCLUDE_FROM_ALL and an install() (without OPTIONAL), 
> CMake warns that the behavior is undefined and "make install" does nothing. 
> 
> If each target has EXCLUDE FROM_ALL and OPTIONAL in the install(), the same 
> as above.
> 
> If each target is in all and OPTIONAL is in the install(), then "make 
> install" still builds all the targets, not just the ones already built. 
> 
> So it appears the "install" target depends on the "all" target. And since all 
> the utilities are part of "all," they get built, even when OPTIONAL is 
> specified. 
> 
> Is what we're trying to do possible? We have it working where we create 
> custom targets for each utility, ie:
> 
> make pre
> make post
> make install_pre
> make install_post
> 
> but it would be much nicer/easier if there was just a "install all targets 
> that have been built" step. 
> 
> Any suggestions?
> 
> Tim

You might decouple the "install" target from the "all" one by setting
CMAKE_SKIP_INSTALL_ALL_DEPENDENCY to TRUE in connection with OPTIONAL:

CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
PROJECT(OPTIONALINSTALL C)
SET(CMAKE_VERBOSE_MAKEFILE ON)
SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
FILE(WRITE ${CMAKE_BINARY_DIR}/f.c "void f(void){}\n")
ADD_LIBRARY(f SHARED f.c)
FILE(WRITE ${CMAKE_BINARY_DIR}/g.c "void g(void){}\n")
ADD_LIBRARY(g SHARED g.c)
INSTALL(TARGETS f g LIBRARY DESTINATION lib OPTIONAL)

AFAICS, this exemplary project does what you intend, i.e. selecting the
targets to build with the Make command and install each target that has
been built by "make install" later. The combination of EXCLUDE_FROM_ALL
with OPTIONAL should also work since, to the best of my knowledge, the
warning w.r.t. undefined behaviour can be be safely ignored in that
case. However, a "make" or "make all" would not build the affected
targets, in contrast to the approach outlined above.

'hope that helps.

Regards,

Michael
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Install optional targets

2011-08-28 Thread Tim Gallagher
Hi,

I asked about this awhile back and haven't had any luck with it, so I'll try 
again.

What we are trying to do is have a project (called Utilities) that has a bunch 
of targets (the actual utility executables). Let's say there are 4 utils: pre, 
post, grid, and restart. We would like to do something like:

make pre
make post
make install

Where the "make install" step only installs the targets that have been built. 
If each target is created with the add_executable() and then has an install() 
(without OPTIONAL), then typing "make install" will build pre, post, grid and 
restart. 

If each target has EXCLUDE_FROM_ALL and an install() (without OPTIONAL), CMake 
warns that the behavior is undefined and "make install" does nothing. 

If each target has EXCLUDE FROM_ALL and OPTIONAL in the install(), the same as 
above.

If each target is in all and OPTIONAL is in the install(), then "make install" 
still builds all the targets, not just the ones already built. 

So it appears the "install" target depends on the "all" target. And since all 
the utilities are part of "all," they get built, even when OPTIONAL is 
specified. 

Is what we're trying to do possible? We have it working where we create custom 
targets for each utility, ie:

make pre
make post
make install_pre
make install_post

but it would be much nicer/easier if there was just a "install all targets that 
have been built" step. 

Any suggestions?

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Overriding C compiler flags in CMakeLists files

2011-08-09 Thread Tim Gallagher
Interesting -- I guess this is sort of off topic from the original post, but 
that brings up a question:

How does setting the COMPILE_DEFINITIONS on the directory work then? I was 
under the impression (not having tried it) that those definitions would only be 
added when compiling files contained in the directory. I assumed COMPILE_FLAGS 
could, if it existed, operate the same way. 

Tim

- Original Message -
From: "Michael Wild" 
To: cmake@cmake.org
Sent: Tuesday, August 9, 2011 10:32:58 AM
Subject: Re: [CMake] Overriding C compiler flags in CMakeLists files

On Tue 09 Aug 2011 04:28:51 PM CEST, Tim Gallagher wrote:
> In your leaf CMakeLists.txt, try doing:
> 
> set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS
> ${LOCAL_COMPILE_FLAGS})
> 
> where ${SOURCE_FILES} is a list of the files in the directory and
> ${LOCAL_COMPILE_FLAGS} is the list of flags for those files.
> 
> Ideally you would want to set this for the entire directory, but
> according to the documentation, the COMPILE_FLAGS property doesn't exist
> for directories.
> 
> Tim
>

Setting a directory property wouldn't help, since the directory 
property is inherited by the target, not the source files. And since 
the target lives in the top-level CMakeLists.txt file, the directory 
properties wouldn't come into play at all.

Michael
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Overriding C compiler flags in CMakeLists files

2011-08-09 Thread Tim Gallagher
In your leaf CMakeLists.txt, try doing: 

set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS 
${LOCAL_COMPILE_FLAGS}) 

where ${SOURCE_FILES} is a list of the files in the directory and 
${LOCAL_COMPILE_FLAGS} is the list of flags for those files. 

Ideally you would want to set this for the entire directory, but according to 
the documentation, the COMPILE_FLAGS property doesn't exist for directories. 

Tim 

- Original Message -
From: "Andrei Buzgan"  
To: cmake@cmake.org 
Sent: Tuesday, August 9, 2011 6:33:38 AM 
Subject: [CMake] Overriding C compiler flags in CMakeLists files 

Hello, 

I'm trying to compile out-of-source an embedded C application using CMake and 
MinGW and to use specific compiler flags for some source files. 
I tried the approach described in 
http://www.cmake.org/pipermail/cmake/2011-April/043703.html but it didn't work 
for me. I'm describing below what i've done, maybe someone highlights what i 
did wrong: 

Project structure: 

Top_Dir 
|-- Build (from where I launch cmake) 
| |-- Output_Dir 
| |-- Toolchain.cmake 
| |-- build.bat 
|-- Sources 
|-- Module1 
| |-- module1.c 
| |-- module1.h 
| |-- CMakeLists.txt [1] 
|-- Module2 
| |-- module2.c 
| |-- module2.h 
| |-- CMakeLists.txt [2] 
|-- Module3 
| |-- module3.c 
| |-- module3.h 
| |-- CMakeLists.txt [3] 
|-- CMakeLists.txt [0] 

build.bat 
mkdir Output_Dir 
cd Output_Dir 
cmake ../../Sources -DCMAKE_TOOLCHAIN_FILE=../Toolchain.cmake -G"MinGW 
Makefiles" 

CMakeLists.txt [0] 
cmake_minimum_required( VERSION 2.8 ) 

project( My_Project C ASM ) 

include_directories( 
Module1 
Module2 
Module3 
) 

add_subdirectory( Module1 ) 
add_subdirectory( Module2 ) 
add_subdirectory( Module3) 

set( USER_C_COMPILER_FLAGS 
"c_flag1" 
"c_flag2" 
"c_flag3" 
) 

foreach( flag ${USER_C_COMPILER_FLAGS} ) 
set( USER_C_COMPILER_FLAGS_GENERAL "${USER_C_COMPILER_FLAGS_GENERAL} ${flag}" ) 
endforeach( flag ${USER_C_COMPILER_FLAGS} ) 

set( CMAKE_C_FLAGS ${USER_C_COMPILER_FLAGS_GENERAL} ) 

add_definitions( 
-D DEF1 
-D DEF2 
-D DEF3 
) 

set( USER_LINKER_FLAGS 
"link_flag1" 
"link_flag2" 
"link_flag3" 
) 

set( USER_TMP_LINKER_FLAGS "" ) 

foreach( flag ${USER_LINKER_FLAGS} ) 
set( USER_TMP_LINKER_FLAGS "${USER_TMP_LINKER_FLAGS} ${flag}" ) 
endforeach( flag ${USER_LINKER_FLAGS} ) 

set( CMAKE_EXE_LINKER_FLAGS ${USER_TMP_LINKER_FLAGS} ) 

set( PRJ_SOURCES 
Module1/module1.c 
Module2/module2.c 
Module3/module3.c 
) 

add_executable( My_Exec ${PRJ_SOURCES} ) 

set( CMAKE_VERBOSE_MAKEFILE ON ) 

I tried to place in any of the leaf CMakeLists.txt files ([1][2][3]) statements 
like 
set(USER_C_COMPILER_FLAGS_LOCAL "c_loc_flag1 c_loc_flag2 c_loc_flag3") 
set( CMAKE_C_FLAGS ${USER_C_COMPILER_FLAGS_LOCAL} ) 

and I expected to see different compiler flags for the sources in the 
respective directory, but instead ALL the sources were compiled with the flags 
defined in CMakeLists.txt[0] top level file. 

What I did wrong? I clearly miss something in the inheritance mechanisms of 
CMake. 

In Cmake Platform and Compiler folders i created the custom platform and 
compiler files with directives like: 
set( CMAKE_C_LINK_EXECUTABLE 
"${USER_CONFIG_LINKER}   -o " 
"${USER_CONFIG_CONVERTER}  -o " 
) 

set( CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm ASM ) 
set( CMAKE_ASM_OUTPUT_EXTENSION ".obj" ) 

set( CMAKE_ASM_COMPILE_OBJECT "   -o 
" ) 

set( CMAKE_ASM_FLAGS_INIT " a list of ASM flags " ) 
to make the assembler work of ASM files and to use the custom linker and 
executable converter specific for the compiler kit I use. 


Thanks, 
Andrei 


___ 
Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake ___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] MPI Compilers

2011-07-06 Thread Tim Gallagher
Along similar lines, we have it currently working with:

  find_package(MPI REQUIRED)
include(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(mpicc ${CMAKE_C_COMPILER_ID})
CMAKE_FORCE_CXX_COMPILER(mpicxx ${CMAKE_CXX_COMPILER_ID})
CMAKE_FORCE_Fortran_COMPILER(mpif90 ${CMAKE_Fortran_COMPILER_ID})

Which works, but I can't find where the compile flags are coming from. It's not 
using CMAKE_Fortran_FLAGS_*, but it does change it's flags based on the build 
type. Anybody have any idea how to set the flags?

Tim

- Original Message -----
From: "Tim Gallagher" 
To: cmake@cmake.org
Sent: Wednesday, July 6, 2011 12:31:49 PM
Subject: [CMake] MPI Compilers

Hi,

How do we tell the project to use the compilers found by FindMPI? On the master 
branch, FindMPI has been modified to create MPI__COMPILER, etc.., but how 
does one then specify that it should be used rather than the 
CMAKE__COMPILER?

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] MPI Compilers

2011-07-06 Thread Tim Gallagher
Hi,

How do we tell the project to use the compilers found by FindMPI? On the master 
branch, FindMPI has been modified to create MPI__COMPILER, etc.., but how 
does one then specify that it should be used rather than the 
CMAKE__COMPILER?

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Install targets

2011-07-01 Thread Tim Gallagher
Hi,

We have a project that has a main executable and dozens of utility executables 
that may or may not be needed. We can add an executable for each util with 
EXCLUDE_FROM_ALL defined so just typing make only does the main code and 
something like 'make grid' compiles the grid generator. 

But, how can we install these things? I see from the documentation that if 
EXCLUDE_FROM_ALL is set to true, the behavior is undefined. More generally, is 
there a way to set 'make install' to only install things that have been built 
(rather than the current behavior which is to build the default target if it's 
not built)? 

A work around would be to create custom install targets that use the cmake copy 
command to manually move the utility executable to the install directory, but 
it would be nice if 'make install' installed all targets built without building 
unbuilt ones...

Thanks,

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Test-specific configuration

2011-06-20 Thread Tim Gallagher
Hi,

I'm trying to set up automated testing of our code with CTest (we are using 
CMake), but I'm running into some issues I can't figure out the correct way to 
solve. Many of our tests require specific sets of options to be turned on/off 
in the configuration step. 

How is this done? We've used CTest for a much simpler code and there we created 
a bunch of different driver programs for unit tests that we added with 
add_executable() and add_test(), but there were no configuration options that 
changed for each test. 

In this case, if we have, say, 10 tests, each test will need a 
configure/build/run step with different options for configuration. What needs 
to go in the CMakeLists.txt? 

These will be submitted to CDash also, if that changes things.

Any help would be appreciated. 

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ccmake options organization

2011-06-13 Thread Tim Gallagher
I agree, I much prefer it too. But the bigger issue for us is that our builds 
are on remote machines that we cannot X-forward, so the gui isn't even an 
option. 

We've been hearing people in our lab say "It would be nice if..." and so I 
thought I'd throw it out there to see what others thought and if our guys are 
just lazy/crazy :)

Tim

- Original Message -
From: "Michael Wild" 
To: cmake@cmake.org
Sent: Monday, June 13, 2011 6:09:07 AM
Subject: Re: [CMake] ccmake options organization

On 06/13/2011 11:01 AM, Alexander Neundorf wrote:
> On Friday 10 June 2011, Tim Gallagher wrote:
>> Hi all,
>>
>> We have a code that has a lot of options to enable/disable at compile time,
>> and we'd also like to use ccmake to generate input files to run the code
>> (possibly several hundred options combined). But the way the curses gui
>> organizes things makes it really hard/tedious to keep track of things.
>>
>> Has anybody looked into creating something akin to tabs to organize
>> options? A simple way, for example, would be to put options with a common
>> prefix on it's own tab so they stay organized. So anything with CMAKE_
>> would be on a CMake tab, anything with MPI_ would be on an MPI tab, and so
>> on.
> 
> cmake-gui, the really graphical client, does that already in the "Grouped 
> View" mode. I'm not sure much work will still go into ccmake.
> 
> Alex

Perhaps other people will tune in, so I just want to say that I much
prefer ccmake over cmake-gui personally. Despite all its quirks which I
would love to see fixed it allows for much faster editing without
forcing me to tediously point and click with the mouse. But then, I'm
also a Vim user...

Although the grouping would be a nice feature to have in ccmake, it
doesn't bother me since I use the search feature to achieve much the
same. Instead of the grouping, I perhaps would even prefer a filter
feature. Searching and filtering should IMHO support regexes (or globbing).

Michael
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] ccmake options organization

2011-06-10 Thread Tim Gallagher
Hi all,

We have a code that has a lot of options to enable/disable at compile time, and 
we'd also like to use ccmake to generate input files to run the code (possibly 
several hundred options combined). But the way the curses gui organizes things 
makes it really hard/tedious to keep track of things.

Has anybody looked into creating something akin to tabs to organize options? A 
simple way, for example, would be to put options with a common prefix on it's 
own tab so they stay organized. So anything with CMAKE_ would be on a CMake 
tab, anything with MPI_ would be on an MPI tab, and so on. 

I've been looking through the cmake source and it looks like it uses the system 
installed ncurses (correct?) I haven't used (n)curses before, but I did some 
reading and it looks like the panel library that comes with it might be a good 
way to go. 

Has anybody else looked at this or think it would be useful? I'm willing to 
attempt putting it in myself, but I've never developed in the cmake source 
before, or used the curses library so I don't know if what I come up with would 
ever make it into the stream, even if it works. 

Thoughts?

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Status of FindHDF5.cmake in CMake?

2011-06-02 Thread Tim Gallagher
We've run into another issue with the way FindHDF5 works. 

On Cray systems, h5fc -show gives:

ifort -fPIC -I/opt/cray/hdf5/1.8.5.0/hdf5-intel/include 
-L/opt/cray/hdf5/1.8.5.0/hdf5-intel/lib 
/opt/cray/hdf5/1.8.5.0/hdf5-intel/lib/libhdf5hl_fortran.a 
/opt/cray/hdf5/1.8.5.0/hdf5-intel/lib/libhdf5_hl.a 
/opt/cray/hdf5/1.8.5.0/hdf5-intel/lib/libhdf5_fortran.a 
/opt/cray/hdf5/1.8.5.0/hdf5-intel/lib/libhdf5.a -lz -lm -Wl,-rpath 
-Wl,/opt/cray/hdf5/1.8.5.0/hdf5-intel/lib -L/usr/lib64

The FindHDF5 complains it can't find the libraries because it looks for the -l* 
portions and doesn't find the lines giving the .a files. 

I will try to think of a general way to make this work, but I'm not very well 
versed in cmake. So if anybody has any suggestions or knows how to fix it, we'd 
sure appreciate it!

Tim

- Original Message -
From: "Tim Gallagher" 
To: cmake@cmake.org
Sent: Friday, May 20, 2011 6:07:50 PM
Subject: Re: [CMake] Status of FindHDF5.cmake in CMake?

Will,

Sorry for the delay in responding. We tested the FindHDF5 you attached and it 
correctly located the Fortran libraries.

Thanks for including it in the updated version!

Tim

- Original Message -
From: "Will Dicharry" 
To: "J.S. van Bethlehem" 
Cc: cmake@cmake.org
Sent: Friday, May 20, 2011 5:32:16 PM
Subject: Re: [CMake] Status of FindHDF5.cmake in CMake?

J.S. van Bethlehem wrote:
> Hej Will,
> I'm not sure if this is the proper way to reply and I haven't checked 
> your second mail with the attachment. But I think in #3 you're 
> definitely doing something wrong. It took me quite a while to figure 
> out, because the documentation is rather sparse, but whenever there is 
> a hdf5-config.cmake file, you should not read that from a Find*.cmake 
> file. Whenever there is such a file present, what should happen is 
> that CMake finds it and reads it and that's that.
> Even more precise: whenever a user writes find_package(HDF5) and the 
> hdf5-config.cmake exists, CMake will read that file and will NOT go 
> look for FindHDF5.cmake. The hdf5-config.cmake should then explicitly 
> set all the (cached) variables you normally would have to 'calculate' 
> in the FindHDF5.cmake file.
> So to be short: the FindHDF5.cmake file should never be required to 
> look for hdf5-config.cmake - CMake should be left to be the one to do 
> that. The HDF5 installer should be the one that installs the 
> hdf5-config.cmake into for example /share/HDF5/cmake or some 
> similar path (look for documentation of find_package for possible 
> locations where CMake will look)
>

 From previous instructions by the Kitware developers, I was under the 
impression that I needed to do something like

find_package( HDF5 QUIET NO_MODULE )

from the FindHDF5.cmake module. It looks like FindVTK does this. Either 
way, the HDF5 CMake build does not set the standard *_INCLUDE_DIRS and 
*_LIBRARIES variables in the config file, so I have to do something. Can 
a Kitware person shed some light on this?

Thanks,
Will

> But again: I haven't read the actual file you created :P Maybe I'm 
> overlooking some details of this particular package.
>
> Greetsz,
> Jakob
>
> Will Dicharry wrote:
>> Hi All,
>>
>> I neglected the FindHDF5 module for a while because I was shifted to 
>> another project that was kind of far from CMake work, but there were 
>> a few requests for fixes features to the module. I think I have a 
>> file that has the important ones. It's attached to this message. 
>> Brad, I know I had CVS access, but I don't think I have Git access. 
>> If you'd like me to push my commits, I can but I think I'd need you 
>> to reauthorize me to do so.
>>
>> The changes to this module are:
>> 1. Tim Gallagher's (cc'd) patch to handle the HDF5 Fortran library.
>> 2. hdf5_hl is now an optional component that can be requested like 
>> the language bindings.
>> 3. If I can find hdf5-config.cmake from the native HDF5 cmake build, 
>> I use it.
>>
>> I'd like it if the people I cc'd (who appear to be interested in at 
>> least one of these features) could try it and see if it works for 
>> them. I'd also like to know if I did #3 correctly, since there don't 
>> really appear to be any modules in the CMake repository that wrap 
>> around config files that don't set the variables defined in the Find 
>> module.
>>
>> Thanks,
>> Will
>> 
>>
>> ___
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at 
>> http://www.kitware.c

Re: [CMake] Status of FindHDF5.cmake in CMake?

2011-05-20 Thread Tim Gallagher
Will,

Sorry for the delay in responding. We tested the FindHDF5 you attached and it 
correctly located the Fortran libraries.

Thanks for including it in the updated version!

Tim

- Original Message -
From: "Will Dicharry" 
To: "J.S. van Bethlehem" 
Cc: cmake@cmake.org
Sent: Friday, May 20, 2011 5:32:16 PM
Subject: Re: [CMake] Status of FindHDF5.cmake in CMake?

J.S. van Bethlehem wrote:
> Hej Will,
> I'm not sure if this is the proper way to reply and I haven't checked 
> your second mail with the attachment. But I think in #3 you're 
> definitely doing something wrong. It took me quite a while to figure 
> out, because the documentation is rather sparse, but whenever there is 
> a hdf5-config.cmake file, you should not read that from a Find*.cmake 
> file. Whenever there is such a file present, what should happen is 
> that CMake finds it and reads it and that's that.
> Even more precise: whenever a user writes find_package(HDF5) and the 
> hdf5-config.cmake exists, CMake will read that file and will NOT go 
> look for FindHDF5.cmake. The hdf5-config.cmake should then explicitly 
> set all the (cached) variables you normally would have to 'calculate' 
> in the FindHDF5.cmake file.
> So to be short: the FindHDF5.cmake file should never be required to 
> look for hdf5-config.cmake - CMake should be left to be the one to do 
> that. The HDF5 installer should be the one that installs the 
> hdf5-config.cmake into for example /share/HDF5/cmake or some 
> similar path (look for documentation of find_package for possible 
> locations where CMake will look)
>

 From previous instructions by the Kitware developers, I was under the 
impression that I needed to do something like

find_package( HDF5 QUIET NO_MODULE )

from the FindHDF5.cmake module. It looks like FindVTK does this. Either 
way, the HDF5 CMake build does not set the standard *_INCLUDE_DIRS and 
*_LIBRARIES variables in the config file, so I have to do something. Can 
a Kitware person shed some light on this?

Thanks,
Will

> But again: I haven't read the actual file you created :P Maybe I'm 
> overlooking some details of this particular package.
>
> Greetsz,
> Jakob
>
> Will Dicharry wrote:
>> Hi All,
>>
>> I neglected the FindHDF5 module for a while because I was shifted to 
>> another project that was kind of far from CMake work, but there were 
>> a few requests for fixes features to the module. I think I have a 
>> file that has the important ones. It's attached to this message. 
>> Brad, I know I had CVS access, but I don't think I have Git access. 
>> If you'd like me to push my commits, I can but I think I'd need you 
>> to reauthorize me to do so.
>>
>> The changes to this module are:
>> 1. Tim Gallagher's (cc'd) patch to handle the HDF5 Fortran library.
>> 2. hdf5_hl is now an optional component that can be requested like 
>> the language bindings.
>> 3. If I can find hdf5-config.cmake from the native HDF5 cmake build, 
>> I use it.
>>
>> I'd like it if the people I cc'd (who appear to be interested in at 
>> least one of these features) could try it and see if it works for 
>> them. I'd also like to know if I did #3 correctly, since there don't 
>> really appear to be any modules in the CMake repository that wrap 
>> around config files that don't set the variables defined in the Find 
>> module.
>>
>> Thanks,
>> Will
>> 
>>
>> ___
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at: 
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>


___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] linux cmake with intel compiler

2011-05-18 Thread Tim Gallagher
There's two ways we do it. If you are starting with a clean cache (first time 
you run ccmake), if you do:

CC=icc FC=ifort ccmake /path/to/source

It will set it up using Intel compilers.

We also do:

include(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(icc "Intel C Compiler")
CMAKE_FORCE_CXX_COMPILER(icpc "Intel C++ Compiler")
CMAKE_FORCE_Fortran_COMPILER(ifort "Intel Fortran Compiler")

Lastly, when using the Intel compiler, we add:

if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
   if(NOT CMAKE_Fortran_FLAGS_RELEASE)
  set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -xhost" CACHE STRING "" FORCE)
   endif()
  set(CMAKE_Fortran_FLAGS_DEBUG
  "${CMAKE_Fortran_FLAGS_DEBUG} -check noarg_temp_created -C -traceback" CA\
CHE STRING "" FORCE)
  set(CMAKE_Fortran_FLAGS_DEBUGHEAVY
  "${CMAKE_Fortran_FLAGS_DEBUG} -check noarg_temp_created -fpe0 -warn align\
ments -warn declarations -warn general -warn interfaces -warn truncated_source \
-warn uncalled -warn uninitialized -warn usage -common_args -warn unused -fp-st\
ack-check -check bounds -check uninit -check format" CACHE STRING "" FORCE)
   mark_as_advanced(CMAKE_Fortran_FLAGS_DEBUGHEAVY)
endif()

Hope that helps,

Tim

- Original Message -
From: "Eric Noulard" 
To: "gekso" 
Cc: cmake@cmake.org
Sent: Wednesday, May 18, 2011 7:09:07 AM
Subject: Re: [CMake] linux cmake with intel compiler

2011/5/18 gekso :
> Hello! Does anyone know how to use Intel Compiler with cmake on linux
> ("Unix Makefiles")?
> I've tried to set CC, CXX environment variables before cmake - no
> effect.

What do you mean by "no-effect" ?
gcc is found and used?

$ source /opt/intel/Compiler/11.1/064/bin/iccvars.sh
$ CC=/path/to/icc CXX=/path/to/icpc cmake /path/to/source

works for me on Linux for several project using CMake including CMake itself?
Test done with CMake 2.8.3.

Which version of CMake are you using?

> Call of intel compiler environment - no effect too..

Same question what does "no effect" mean ?
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Change variable default

2011-04-28 Thread Tim Gallagher
To put it in context, our cmake file looks like:



if(${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
   if(NOT CMAKE_Fortran_FLAGS_RELEASE)
  set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -xhost" CACHE STRING "" FORCE)
   endif()
  set(CMAKE_Fortran_FLAGS_DEBUG
  "${CMAKE_Fortran_FLAGS_DEBUG} -check noarg_temp_created -C -traceback" CA\
CHE STRING "" FORCE)
endif()



The other way you can try it, if it's not empty, is to do

if(${CMAKE_Fortran_FLAGS_RELEASE} STREQUAL ${CMAKE_Fortran_FLAGS_RELEASE_INIT})

As far as I know, CMAKE_*_FLAGS_*_INIT are the default values that it gets set 
to when cmake starts up. So if you check against that, you will see if the user 
has modified it.

Tim

- Original Message -
From: "Ilja Golshtein" 
To: gtg0...@mail.gatech.edu
Cc: cmake@cmake.org
Sent: Thursday, April 28, 2011 12:42:40 PM
Subject: Re: [CMake] Change variable default

Tim,

thank you.

Compiler and environment specific things become defined during "project" 
command execution.
It is too late to check if it is set afterwards because it actually IS SET.

I assume you are lucky and default value for CMAKE_Fortran_FLAGS_RELEASE is
empty, isn't it?

So the tricky point is to place customization code in proper place.

In my case 
==
set(CMAKE_CXX_FLAGS_DEBUG  "-g -wall"
  CACHE
  STRING "" 
  )
==
works perfectly if put at the top of CMakeLists.txt


28.04.2011, 19:23, "Tim Gallagher" :
> We do this:
>
> if(NOT CMAKE_Fortran_FLAGS_RELEASE)
>    set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -xhost" CACHE STRING "" FORCE)
> endif()
>
> In other words, if the flags haven't been set yet (initial start up), set 
> them to what we want. If they have been set (either changed by the user, or 
> specified on the cmake/ccmake line with -D), leave them alone.
>
> Tim
>
> - Original Message -
> From: "Ilja Golshtein" ;
> To: cmake@cmake.org
> Sent: Thursday, April 28, 2011 9:03:43 AM
> Subject: [CMake] Change variable default
>
> Hello!
>
> There are some CMAKE variables with default values. For example 
> CMAKE_CXX_FLAGS_DEBUG default value is '-g'.
> How is it possible to make it '-g -Wall'?
>
> What I don't want to have: User choice overwritten.
>
> What I want to have: Modified a variable cmake-time default. It must be 
> possible to change the variable via cmake -D or ccmake GUI.
>
> Thanks.
>
> --
> Best regards,
> Ilja Golshtein.
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-- 
Best regards,
Ilja Golshtein.
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Change variable default

2011-04-28 Thread Tim Gallagher
We do this:

if(NOT CMAKE_Fortran_FLAGS_RELEASE)
   set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -xhost" CACHE STRING "" FORCE)
endif()

In other words, if the flags haven't been set yet (initial start up), set them 
to what we want. If they have been set (either changed by the user, or 
specified on the cmake/ccmake line with -D), leave them alone.

Tim

- Original Message -
From: "Ilja Golshtein" 
To: cmake@cmake.org
Sent: Thursday, April 28, 2011 9:03:43 AM
Subject: [CMake] Change variable default

Hello!

There are some CMAKE variables with default values. For example 
CMAKE_CXX_FLAGS_DEBUG default value is '-g'. 
How is it possible to make it '-g -Wall'?

What I don't want to have: User choice overwritten.

What I want to have: Modified a variable cmake-time default. It must be 
possible to change the variable via cmake -D or ccmake GUI.

Thanks.

-- 
Best regards,
Ilja Golshtein.
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] List of possible completion values

2011-03-30 Thread Tim Gallagher
Hi,

Is there a way (and if not, how do I submit a feature request) to have a set of 
drop-down type options in the ccmake interface? The obvious example is for 
CMAKE_BUILD_TYPE, where something like hitting Enter scrolls through Release -> 
Debug -> MinSizeRel, etc..

Maybe somebody has already written something to do this somewhere and I just 
can't find it... 

Thanks,

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Fortran dependency scanning

2011-03-29 Thread Tim Gallagher
They are listed as dependencies for the target, ie:

add_executable(myexe Module1.F90) 

or

add_executable(myexe Module2.F90) 

depending on whether OPTION1 is defined or not (really, there's an 
option(USE_OPTION1) etc). 

The actual project is way more complicated than this -- we store the files to 
be processed in variables so it really looks like 

add_executable(myexe ${MY_SRC_FILES})

and I checked the variable and the correct module file is there but it's not 
being built in the correct order.

Tim

- Original Message -
From: "Brad King" 
To: gtg0...@mail.gatech.edu
Cc: "Tim Gallagher" , cmake@cmake.org
Sent: Tuesday, March 29, 2011 5:13:56 PM
Subject: Re: [CMake] Fortran dependency scanning

On 03/29/2011 11:53 AM, Tim Gallagher wrote:
> Hi,
> 
> We ran into an issue using CMake with our fortran project. We have 
> constructions such as:
> 
> ...
> #ifdef OPTION1
>   USE Module1
> #else
>   USE Module2
> #endif
> ...
> 
> It's not actually finding modules as dependencies. Any thoughts?

Are those modules provided by other sources in the same target or
other targets to which this target links?

-Brad
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Fortran dependency scanning

2011-03-29 Thread Tim Gallagher
Hi,

We ran into an issue using CMake with our fortran project. We have 
constructions such as:

...
#ifdef OPTION1
  USE Module1
#else
  USE Module2
#endif
...

It's not actually finding modules as dependencies. Any thoughts? I am using 
version 2.8.1, I can try to upgrade if somebody thinks it is fixed there.

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] FindHDF5.cmake patch

2011-03-17 Thread Tim Gallagher
Sure thing, it's attached.

Thanks,

Tim

- Original Message -
From: "Rolf Eike Beer" 
To: cmake@cmake.org
Sent: Thursday, March 17, 2011 5:18:44 PM
Subject: Re: [CMake] FindHDF5.cmake patch

Am Donnerstag 17 März 2011, 21:55:11 schrieb Tim Gallagher:
> Hi,
> 
> Our project uses HDF5 and Fortran, and while I was looking through the
> comments in the FindHDF5.cmake file, I saw that it doesn't support finding
> the Fortran bindings. So, I modified it to make it work to find the
> Fortran bindings.
> 
> Below is the diff output. Let me know if there's a more useful format.

"diff -au" gives much more readable results. The best would probably doing a 
git clone of CMake master, making a local commit with proper message of your 
changes and then sending in the output of "git format-patch HEAD^.."

Eike

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmakeFrom cd3fc24b6c5e9b8c0c7831bb0e075d77663d2088 Mon Sep 17 00:00:00 2001
From: Tim Gallagher 
Date: Thu, 17 Mar 2011 17:27:27 -0400
Subject: [PATCH] Modified the FindHDF5.cmake file to locate the Fortran bindings for the
 library in addition to the C and CXX bindings.

---
 Modules/FindHDF5.cmake |   32 +---
 1 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 90849a1..abcab9b 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -9,10 +9,9 @@
 # The module will optionally accept the COMPONENTS argument.  If no COMPONENTS
 # are specified, then the find module will default to finding only the HDF5 C
 # library.  If one or more COMPONENTS are specified, the module will attempt to
-# find the language bindings for the specified components.  Currently, the only
-# valid components are C and CXX.  The module does not yet support finding the
-# Fortran bindings.  If the COMPONENTS argument is not given, the module will
-# attempt to find only the C bindings.
+# find the language bindings for the specified components.  The only valid 
+# components are C, CXX, and Fortran.  If the COMPONENTS argument is not
+# given, the module will attempt to find only the C bindings.
 #
 # On UNIX systems, this module will read the variable HDF5_USE_STATIC_LIBRARIES
 # to determine whether or not to prefer a static link to a dynamic link for HDF5
@@ -33,12 +32,14 @@
 #  HDF5_DEFINITIONS - Required compiler definitions for HDF5
 #  HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings.
 #  HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
+#  HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
 #  HDF5_LIBRARIES - Required libraries for all requested bindings
 #  HDF5_FOUND - true if HDF5 was found on the system
 #  HDF5_LIBRARY_DIRS - the full set of library directories
 #  HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
 #  HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
 #  HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
+#  HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
 #  HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
 
 #=
@@ -57,12 +58,13 @@
 # This module is maintained by Will Dicharry .
 
 include(SelectLibraryConfigurations)
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)
 
 # List of the valid HDF5 components
 set( HDF5_VALID_COMPONENTS 
 C
 CXX
+Fortran
 )
 
 # try to find the HDF5 wrapper compilers
@@ -80,6 +82,13 @@ find_program( HDF5_CXX_COMPILER_EXECUTABLE
 DOC "HDF5 C++ Wrapper compiler.  Used only to detect HDF5 compile flags." )
 mark_as_advanced( HDF5_CXX_COMPILER_EXECUTABLE )
 
+find_program( HDF5_Fortran_COMPILER_EXECUTABLE
+NAMES h5fc h5pfc
+HINTS ENV HDF5_ROOT
+PATH_SUFFIXES bin Bin
+DOC "HDF5 Fortran Wrapper compiler.  Used only to detect HDF5 compile flags." )
+mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE )
+
 find_program( HDF5_DIFF_EXECUTABLE 
 NAMES h5diff
 HINTS ENV HDF5_ROOT
@@ -158,6 +167,7 @@ if( HDF5_INCLUDE_DIRS AND HDF5_LIBRARIES )
 else()
 _HDF5_invoke_compiler( C HDF5_C_COMPILE_LINE HDF5_C_RETURN_VALUE )
 _HDF5_invoke_compiler( CXX HDF5_CXX_COMPILE_LINE HDF5_CXX_RETURN_VALUE )
+_HDF5_invoke_compiler( Fortran HDF5_Fortran_COMPILE_LINE HDF5_Fortran_RETURN_VALUE )
 
 if( NOT HDF5_FIND_COMPONENTS )
 set( HDF5_LANGUAGE_BINDINGS "C" )
@@ -177,6 +187

[CMake] FindHDF5.cmake patch

2011-03-17 Thread Tim Gallagher
Hi, 

Our project uses HDF5 and Fortran, and while I was looking through the comments 
in the FindHDF5.cmake file, I saw that it doesn't support finding the Fortran 
bindings. So, I modified it to make it work to find the Fortran bindings. 

Below is the diff output. Let me know if there's a more useful format. This 
works on the RHEL 5 and openSUSE 11.4 distributions I have access to (although, 
openSUSE 11.4 messed up the HDF5 build in the repo -- h5fc says the mod file is 
in /usr/include when it's really in /usr/lib64/gfortran/modules). 

I updated the comments in the file also, and I'm CC'ing the maintainer just in 
case he misses it on the list.

Thanks,

Tim

tpgLaptop:/usr/share/cmake/Modules # diff FindHDF5.cmake FindHDF5.cmake_orig 
12,14c12,15
< # find the language bindings for the specified components.  The only valid 
< # components are C, CXX, and Fortran.  If the COMPONENTS argument is not
< # given, the module will attempt to find only the C bindings.
---
> # find the language bindings for the specified components.  Currently, the 
> only
> # valid components are C and CXX.  The module does not yet support finding the
> # Fortran bindings.  If the COMPONENTS argument is not given, the module will
> # attempt to find only the C bindings.
35d35
< #  HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
42d41
< #  HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper 
compiler
67d65
< Fortran
85,91d82
< find_program( HDF5_Fortran_COMPILER_EXECUTABLE
< NAMES h5fc h5pfc
< HINTS ENV HDF5_ROOT
< PATH_SUFFIXES bin Bin
< DOC "HDF5 Fortran Wrapper compiler.  Used only to detect HDF5 compile 
flags." )
< mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE )
< 
170d160
< _HDF5_invoke_compiler( Fortran HDF5_Fortran_COMPILE_LINE 
HDF5_Fortran_RETURN_VALUE )
190d179
< set( HDF5_Fortran_LIBRARY_NAMES_INIT hdf5_fortran 
${HDF5_C_LIBRARY_NAMES_INIT} )
212,218c201
<   if(${LANGUAGE} STREQUAL "Fortran")
<   set(HDF5_INCLUDE_FILENAME hdf5.mod)
< else()
<   set(HDF5_INCLUDE_FILENAME hdf5.h)
<   endif()
< 
< find_path( HDF5_${LANGUAGE}_INCLUDE_DIR ${HDF5_INCLUDE_FILENAME}
---
> find_path( HDF5_${LANGUAGE}_INCLUDE_DIR hdf5.h
340,341c323
< HDF5_CXX_COMPILER_EXECUTABLE
< HDF5_Fortran_COMPILER_EXECUTABLE )
---
> HDF5_CXX_COMPILER_EXECUTABLE )
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake with Cray Fortran

2011-03-08 Thread Tim Gallagher
Brad,

Thanks for your input -- setting it as Catamount was the trick. 

Is there a way to use a toolchain file with ccmake? It throws a warning saying 
it doesn't use the CMAKE_TOOLCHAIN_FILE. If I do it with cmake, everything is 
fine. 

Thanks again,

Tim

- Original Message -
From: "Brad King" 
To: "Tim Gallagher" 
Cc: gtg0...@mail.gatech.edu, cmake@cmake.org
Sent: Tuesday, March 8, 2011 8:28:08 AM
Subject: Re: [CMake] Cmake with Cray Fortran

On 03/07/2011 09:54 PM, Tim Gallagher wrote:
> How can I get it to drop the -rdynamic option?

That option appears because the host system name is probably Linux on which
that option is supported.  You need to set up a cross-compiling toolchain
file that sets the correct name of the target platform:

  http://www.cmake.org/Wiki/CMake_Cross_Compiling

CMake comes with a "Catamount" platform file that should work for newer Cray
machines too.  Set CMAKE_SYSTEM_NAME to "Catamount" in your toolchain file
to use it.

-Brad
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake with Cray Fortran

2011-03-07 Thread Tim Gallagher
Hi guys, 

Good news -- the system admins are installing 2.8.4 on all the government Cray 
machines! 

Bad news -- I can't actually get anything to work. I pulled the git repo 
version and built the master branch because of what David pointed out. However, 
I cannot figure out how to make it actually link. I get errors on all my 
executables saying 

ftn-2191 crayftn: ERROR in command line 
"ynamic" is an invalid argument to the "-r" option. 

How can I get it to drop the -rdynamic option? 

Tim 
- Original Message -
From: "David Partyka"  
To: "Eric Noulard"  
Cc: gtg0...@mail.gatech.edu, cmake@cmake.org 
Sent: Saturday, March 5, 2011 12:03:40 PM 
Subject: Re: [CMake] Cmake with Cray Fortran 

FYI, if you want to build static on cray, Brad just checked in a fix into CMake 
yesterday that addresses -Bdynamic link flags showing up in the link line even 
though you're trying to build static, often resulting in your executable 
prefering to link against shared system libraries rather than static. This was 
causing issues linking static while building ParaView on Jaguar. 


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5abfb571843dba949e010f3b2840d8882d0f3d73
 


On Sat, Mar 5, 2011 at 11:21 AM, Eric Noulard < eric.noul...@gmail.com > wrote: 



2011/3/5 Tim Gallagher < tim.gallag...@gatech.edu >: 

> Eric, 
> 
> Excellent! Thanks! 
> 
> I don't know a whole lot about CMake (yet) -- would it be possible to make 
> older versions aware of the compiler if I were to package only the updated 
> files rather than install my own version of CMake? In other words, was it 
> something simple like changing the CMakeFortranCompilerId.F file and if so, 
> could I tell another version of CMake to use my own copy of that file? 

I don't know I am not the author of the fix, 
I think Brad King was the one who did this, may be he will answer that. 


> It would be a lot easier if I only had to make our users put a few extra 
> files somewhere than have them all install their own version of CMake in 
> their home directories on all these Cray machines. 

May be deploying CMake 2.8.4 globally on each machine and set up appropriate 
module would even be easier for the users? 

Or may be this is not an option because you don'thave administrative 
privilege on those machines? 





-- 
Erk 
Membre de l'April - « promouvoir et défendre le logiciel libre » - 
http://www.april.org 
___ 
Powered by www.kitware.com 

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

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

Follow this link to subscribe/unsubscribe: 
http://www.cmake.org/mailman/listinfo/cmake 

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] CTest -- test dependencies

2011-03-05 Thread Tim Gallagher
Hi,

I have a question about CTest that maybe somebody can point me in the right 
direction. Let's say I have two unit tests, one tests a function F1 and the 
other tests a function F2 where F2 calls F1.

Is it possible to tell CTest not to run the test on F2 if the test on F1 
failed? I saw there's the DEPENDS property, but that seems to me to just delay 
the test until it's dependencies have already run. But it doesn't skip the test 
of the previous ones failed.

Does anybody have any ideas if this is possible? 

Thanks,

Tim
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Cmake with Cray Fortran

2011-03-05 Thread Tim Gallagher
It's not an option to do a global install. These are US government owned 
clusters. I asked them if they could install it and they won't for awhile -- 
they tend to remain a few versions back on everything until they run extensive 
tests on new versions.

Tim

- Original Message -
From: "Eric Noulard" 
To: gtg0...@mail.gatech.edu
Cc: "Tim Gallagher" , cmake@cmake.org
Sent: Saturday, March 5, 2011 11:21:20 AM
Subject: Re: [CMake] Cmake with Cray Fortran

2011/3/5 Tim Gallagher :
> Eric,
>
> Excellent! Thanks!
>
> I don't know a whole lot about CMake (yet) -- would it be possible to make 
> older versions aware of the compiler if I were to package only the updated 
> files rather than install my own version of CMake? In other words, was it 
> something simple like changing the CMakeFortranCompilerId.F file and if so, 
> could I tell another version of CMake to use my own copy of that file?

I don't know I am not the author of the fix,
I think Brad King was the one who did this, may be he will answer that.

> It would be a lot easier if I only had to make our users put a few extra 
> files somewhere than have them all install their own version of CMake in 
> their home directories on all these Cray machines.

May be deploying CMake 2.8.4 globally on each machine and set up appropriate
module would even be easier for the users?

Or may be this is not an option because you don'thave administrative
privilege on those machines?


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Cmake with Cray Fortran

2011-03-05 Thread Tim Gallagher
Eric,

Excellent! Thanks!

I don't know a whole lot about CMake (yet) -- would it be possible to make 
older versions aware of the compiler if I were to package only the updated 
files rather than install my own version of CMake? In other words, was it 
something simple like changing the CMakeFortranCompilerId.F file and if so, 
could I tell another version of CMake to use my own copy of that file?

It would be a lot easier if I only had to make our users put a few extra files 
somewhere than have them all install their own version of CMake in their home 
directories on all these Cray machines. 

Thanks agian,

Tim

- Original Message -
From: "Eric Noulard" 
To: gtg0...@mail.gatech.edu
Cc: "Tim Gallagher" , cmake@cmake.org
Sent: Saturday, March 5, 2011 3:23:53 AM
Subject: Re: [CMake] Cmake with Cray Fortran

2011/3/5 Tim Gallagher :
> Hi,
>
> I'm trying to use cmake with the Cray Fortran compiler. The compiler is 
> wrapped through a script called ftn.
>
> When I have the PrgEnv-pgi (pgi compiler) or the PrgEnv-gnu modules loaded, 
> it works with no issue.
>
> But, when I have it set to PrgEnv-cray, it doesn't work.

Hi Tim,

You should try with CMake 2.8.4.
It should include support for Cray compiler:
http://www.cmake.org/files/v2.8/CMakeChangeLog-2.8.4

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Cmake with Cray Fortran

2011-03-04 Thread Tim Gallagher
Hi,

I'm trying to use cmake with the Cray Fortran compiler. The compiler is wrapped 
through a script called ftn. 

When I have the PrgEnv-pgi (pgi compiler) or the PrgEnv-gnu modules loaded, it 
works with no issue.

But, when I have it set to PrgEnv-cray, it doesn't work.

I manually compiled the CMakeFortranCompilerId.F file and it compiles just 
fine. But, there's not any ifdef's inside it for the Cray compiler. My guess is 
this is the problem?

I've seen a few emails from last year about this issue, but that was for 
cross-compiling. This is not to cross compile -- this is on the Cray XE6 with 
CNL, so the compute nodes and head nodes are the same. Regardless, this is for 
something that runs on the head node anyway. 

The output from cmake is at the end of the email. I'm using Version 2.8.3-rc3.

Thanks,

Tim

CMake Error at 
/work/local/usp/cseb_cse/CSE.121510/Release/cmake-2.8.3/share/cmake-2.8/Modules/CMakeTestFortranCompiler.cmake:40
 (MESSAGE):
   The Fortran compiler "/opt/cray/xt-asyncpe/4.5/bin/ftn" is not able to
   compile a simple test program.

   It fails with the following output:

Change Dir: /u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp

   Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"

  /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
   CMakeFiles/cmTryCompileExec.dir/build

   gmake[1]: Entering directory
   `/work/local/u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp'

   /work/local/usp/cseb_cse/CSE.121510/Release/cmake-2.8.3/bin/cmake -E
   cmake_progress_report
   /u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp/CMakeFiles 1

   Building Fortran object


  CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o

   /opt/cray/xt-asyncpe/4.5/bin/ftn -o
   CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o -c
   
/u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp/testFortranCompiler.f


   Linking Fortran executable cmTryCompileExec

   /work/local/usp/cseb_cse/CSE.121510/Release/cmake-2.8.3/bin/cmake -E
   cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1

  /opt/cray/xt-asyncpe/4.5/bin/ftn
   CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o -o cmTryCompileExec
   -rdynamic

   ftn-2191 crayftn: ERROR in command line

 "ynamic" is an invalid argument to the "-r" option.

   ftn-2191 crayftn: ERROR in command line

 "namic" is an invalid argument to the "-r" option.

  gmake[1]: *** [cmTryCompileExec] Error 1
 
   gmake[1]: Leaving directory
   `/work/local/u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp'

   gmake: *** [cmTryCompileExec/fast] Error 2

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Cmake with Cray Fortran

2011-03-04 Thread Tim Gallagher
Hi,

I'm trying to use cmake with the Cray Fortran compiler. The compiler is wrapped 
through a script called ftn. 

When I have the PrgEnv-pgi (pgi compiler) or the PrgEnv-gnu modules loaded, it 
works with no issue.

But, when I have it set to PrgEnv-cray, it doesn't work.

I manually compiled the CMakeFortranCompilerId.F file and it compiles just 
fine. But, there's not any ifdef's inside it for the Cray compiler. My guess is 
this is the problem?

I've seen a few emails from last year about this issue, but that was for 
cross-compiling. This is not to cross compile -- this is on the Cray XE6 with 
CNL, so the compute nodes and head nodes are the same. Regardless, this is for 
something that runs on the head node anyway. 

The output from cmake is at the end of the email. I'm using Version 2.8.3-rc3.

Thanks,

Tim

CMake Error at 
/work/local/usp/cseb_cse/CSE.121510/Release/cmake-2.8.3/share/cmake-2.8/Modules/CMakeTestFortranCompiler.cmake:40
 (MESSAGE):
   The Fortran compiler "/opt/cray/xt-asyncpe/4.5/bin/ftn" is not able to
   compile a simple test program.

   It fails with the following output:

Change Dir: /u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp

   Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"

  /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
   CMakeFiles/cmTryCompileExec.dir/build

   gmake[1]: Entering directory
   `/work/local/u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp'

   /work/local/usp/cseb_cse/CSE.121510/Release/cmake-2.8.3/bin/cmake -E
   cmake_progress_report
   /u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp/CMakeFiles 1

   Building Fortran object


  CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o

   /opt/cray/xt-asyncpe/4.5/bin/ftn -o
   CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o -c
   
/u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp/testFortranCompiler.f


   Linking Fortran executable cmTryCompileExec

   /work/local/usp/cseb_cse/CSE.121510/Release/cmake-2.8.3/bin/cmake -E
   cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1

  /opt/cray/xt-asyncpe/4.5/bin/ftn
   CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o -o cmTryCompileExec
   -rdynamic

   ftn-2191 crayftn: ERROR in command line

 "ynamic" is an invalid argument to the "-r" option.

   ftn-2191 crayftn: ERROR in command line

 "namic" is an invalid argument to the "-r" option.

  gmake[1]: *** [cmTryCompileExec] Error 1
 
   gmake[1]: Leaving directory
   `/work/local/u/tgallagh/BoundaryConditions/build/CMakeFiles/CMakeTmp'

   gmake: *** [cmTryCompileExec/fast] Error 2

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake