Re: [CMake] ExternalProject git checkout --depth=1 ???
Hi, Have a look here: http://www.cmake.org/Bug/view.php?id=15291 You should be able to use, for the time being, DOWNLOAD_COMMAND and UPDATE_COMMAND to achieve this. (have not tested myself) Hope this helps. Cheers, Yngve On 08/01/15 23:58, Kent Williams wrote: I'm building the Mozilla Spidermonkey JS interpreter as an ExternalProject. So far so good, but I had a question/feature request: Wouldn't it be grand to be able to add --depth 1 to the git clone? This is perfect for grabbing giant repositories. Mozilla is more than 3 gigabytes with a full clone, and a depth=1 checkout is a 1/3 that. -- 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] version-info module?
Hi, Do you meen as in set_target_properties(mytarget PROPERTIES VERSION 1.0 SOVERSION 1) ? Cheers, Yngve Den 12. mai 2014 19:24, skrev Orion Poplawski: Is anyone aware of a cmake module that would be the equivalent of the -version-info mechanism in libtool for generating VERSION and SOVERSION? http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] find_package(MPI) overriding set(MPIEXEC) in CmakeList.txt
Hi, So, that means aprun is not in your path? In that case you could try the same, but give the path where cmake can find aprun: find_program(MPIEXEC aprun PATHS /path/to/aprun) (see cmake --help-command find_program for more info) I tried the same myself (not with aprun but another binary), and it worked as expected here. Since MPIEXEC is already found, the next find_program call inside FindMPI.cmake does not search again but use the binary found (as I understand it). Cheers, Yngve Den 10. jan. 2014 19:11, skrev Pettey . Lucas: That did not work. It still brings up the mpiexec from the operating system rather than the aprun job script submission command. Curiously, manually changing MPIEXEC in the CCMake Advanced screen works and is preserved throughout the configuration and Makefile generation process. I would really like to set up Cmake so that users don't have to change anything in the Advanced menu. Any other ideas are appreciated. Thanks Lucas From: cmake-boun...@cmake.org [cmake-boun...@cmake.org] on behalf of Yngve Inntjore Levinsen [yngve.levin...@gmail.com] Sent: Friday, January 10, 2014 5:33 AM To: Pettey . Lucas; cmake@cmake.org Subject: Re: [CMake] find_package(MPI) overriding set(MPIEXEC) in CmakeList.txt Hi, Did Den 09. jan. 2014 22:49, skrev Pettey . Lucas: Hello, On a Cray XE6, I am using find_package(MPI REQUIRED) in my CMakeLists.txt. It correctly finds all of the MPI stuff, except that it sets the MPIEXEC to the login node mpiexec command. I would like to override this behavior and set the MPIEXEC command to the aprun wrapper, but it is not working. I have tried using set(MPIEXEC aprun) both before and after the find_package(MPI REQUIRED) in my CMakeLists.txt. Thanks Lucas Hi, Did you try to use find_program? I think this will override the find_program inside FindMPI.cmake: find_program(MPIEXEC aprun) find_package(MPI REQUIRED) message(MPI exec: ${MPIEXEC}) Cheers, Yngve -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] find_package(MPI) overriding set(MPIEXEC) in CmakeList.txt
Hi, Did Den 09. jan. 2014 22:49, skrev Pettey . Lucas: Hello, On a Cray XE6, I am using find_package(MPI REQUIRED) in my CMakeLists.txt. It correctly finds all of the MPI stuff, except that it sets the MPIEXEC to the login node mpiexec command. I would like to override this behavior and set the MPIEXEC command to the aprun wrapper, but it is not working. I have tried using set(MPIEXEC aprun) both before and after the find_package(MPI REQUIRED) in my CMakeLists.txt. Thanks Lucas Hi, Did you try to use find_program? I think this will override the find_program inside FindMPI.cmake: find_program(MPIEXEC aprun) find_package(MPI REQUIRED) message(MPI exec: ${MPIEXEC}) Cheers, Yngve -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] ExternalProject_Add examples
Den 17. mars 2012 22:03, skrev Bill Lorensen: Folks, I've recently created a number of super builds using CMake's External Project mechanism. Each external project requires some sort of download, configuration, build and possibly install. The CMake defines needed to correctly access the results of the external project vary significantly. The trickiest part is find the proper download, configuration and CMake defines. For example, for the Point Cloud Library (http://pointclouds.org/) I created these external projects: VTK - git, cmake, make; VTK_DIR FLANN - zip, cmake, make install; FLANN_LIBRARY, FLANN_INCUDE_DIR Eigen - .tar.bz2,; EIGEN_INCLUDE_DIR Qhull - git, cmake, make;QHULL_LIBRARY,QHULL_INCLUDE_DIR Boost - .tar.gz, bootstrap.sh, b2; BOOST_ROOT GTest - .zip, cmake, make; GTEST_ROOT,GTEST_INCLUDE_DIR Slicer4 has many more. Should we start collecting sample ExternalProject_Add files for external projects? Bill Hi, For what it's worth, I would also mention a larger superbuild project at CERN called LCGsoft: http://svnweb.cern.ch/world/wsvn/lcgsoft/trunk/lcgcmake/ They built macros on top of ExternalProject_Add, see cmake/modules/lcgsoft-macros.cmake. Maybe some parts of this design are interesting to you. I have never used this myself, so I don't know the details. Cheers, Yngve -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] try_run or similar to find available Fortran integer kinds
Hi Zaak, Based on the test for fortran compilers, couldn't you do something similar? As I am no fortran expert I am not really sure which types you are looking for, but I would suspect you could get what you want based on the attached example? Cheers, Yngve Den 19. sep. 2013 22:03, skrev Zaak Beekman: Caveat: I am somewhat new to CMake. I am programming a library to compute diagnostic statistics on VERY large data sets. (Possibly in parallel too.) The algorithm is numerically stable and online/streaming. The Fortran standard makes no guarantee of what (signed) integer types are available on a given system, but provides a means of requesting integers of different sizes and will let you know at run time whether or not they exist. However, kind (type) specification of variables must occur at compile time. (This isn't strictly true in F03/F08 but compiler support is limited ATM.) Since the algorithm is designed for extremely large data sets (9TB!) and the number of elements visited in the set so far appears in the algorithm, I would like to use the largest available integer kind to keep track of this quantity so that it doesn't overflow. I think what I need to do is create a test program and use try_run() and then configure_file(), which leads me to my questions: 1. Can I have a multiple source file program and pass it to try_run()? It seems like the answer is no. 2. Since Fortran has no concept of a return value (not formally as far as the standard is concerned) it looks like I need to pass the information about available kind types in the RUN_OUTPUT_VARIABLE back to CMake and manipulate it there. Does this variable just get populated with a string which is whatever your code (that you try_ran) outputs to stdout? 3. Has someone written a module to diagnose available Fortran kind types? That they're willing to share? 4. If not, where do I look for advice and best practices to write one myself? TIA, Izaak Beekman === (301)244-9367 Princeton University Doctoral Candidate Mechanical and Aerospace Engineering ibeek...@princeton.edu mailto:ibeek...@princeton.edu UMD-CP Visiting Graduate Student Aerospace Engineering ibeek...@umiacs.umd.edu mailto:ibeek...@umiacs.umd.edu ibeek...@umd.edu mailto:ibeek...@umd.edu -- 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://www.cmake.org/mailman/listinfo/cmake cmake_minimum_required(VERSION 2.8) project(test_fortran_integers Fortran) macro(test_integer i) message(Checking for integer*${i}..) set(filename ${CMAKE_BINARY_DIR}/test_integer_${i}.f) file(WRITE ${filename} program main\n) file(APPEND ${filename} integer*${i} myinteger\n) file(APPEND ${filename} end program main\n) try_compile(HAVE_INTEGER_${i} ${CMAKE_BINARY_DIR} ${filename}) message(Checking for integer*${i}.. ${HAVE_INTEGER_${i}}) endmacro() test_integer(2) test_integer(4) test_integer(6) -- 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://www.cmake.org/mailman/listinfo/cmake
[CMake] signature separator
Hi all, I just noticed in Thunderbird (not sure how general this is), signatures are marked with -- (ie two dashes AND a space). The powered by kitware signature is appended with only two dashes. Would it be possible to request that you mark it with an extra space? Or is this just a specific problem/bug with Thunderbird? Or perhaps even something configurable? A quick search on the web reveals to me that this is probably some kind of Usenet definition (I have no knowledge in the matter, just noticed the dashes are there): http://en.wikipedia.org/wiki/Signature_block#Signatures_in_Usenet_postings Benefit is that signature will be greyed out when I read the messages, and signature is automatically removed when replying. The same request applies to the developers mailing list. Cheers, Yngve -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] signature separator
Den 04. sep. 2013 14:13, skrev Bill Hoffman: On 9/4/2013 7:35 AM, Rolf Eike Beer wrote: No, and this seems to be a problem with mailman. At least that is what I was told when I brought up the topic a while ago and the Kitware guys tried to solve it. Sadly the signature became even larger since then :/ Odd thing is it sometimes works... For example this message works for me in Thunderbird: http://www.cmake.org/pipermail/cmake/2013-September/055644.html I am not sure what the difference is... In the mailman interface there is a space after the -- Maybe it has to do with html emails? -Bill Ah yes, this e-mail is correctly formatted for me as well. But the signature is different in this case. Perhaps Julien has some special setting that overrides the default signature from Kitware? Or maybe the default signature is only added when the sender has not added his own signature? I try.. Cheers, Yngve -- This is my signature. -- 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://www.cmake.org/mailman/listinfo/cmake
[CMake] macro/functions in ctest scripts
Hi, I have a project where we use ctest/cdash but not cmake. I wanted to add a macro, but it looks like it doesn't support arguments correctly? (differing from the documentation in 'ctest --help-command macro') I tried to add this to the CTestTestfile.cmake: macro(hello MESSAGE) message(${MESSAGE}) endmacro(hello) hello(Hello World) This does not work (it gives a warning that the message command was called with wrong number of arguments). However, if I try to call just hello() I get an error stating that I called the macro with the wrong number of arguments.. What am I doing wrong here? I found the same behaviour with functions. Cheers, Yngve -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] macro/functions in ctest scripts
Den 08. aug. 2013 15:24, skrev Jakub Zakrzewski: Hi, macro(hello MESSAGE) message(${MESSAGE}) endmacro(hello) hello(Hello World) You're expecting MESSAGE to be variable name but you call it with string value. So message(${MESSAGE}) evaluates to message(${Hello World}) and this to message() and cmake does not like calling it with empty string :) Are you sure? The same macro works fine in a CMakeLists.txt file. I also tried message(MESSAGE) and message(${MESSAGE}) neither of which works (the first prints MESSAGE). The macro is also the same as what is in the example here (without the around but that shouldn't make an impact): http://www.cmake.org/cmake/help/syntax.html Based on my current knowledge of cmake the macro is proper cmake syntax. Cheers, Yngve -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] macro/functions in ctest scripts
Den 08. aug. 2013 17:32, skrev Matthew Woehlke: That said, have you tried naming the variable other than the name of a built-in command? I could imagine that might cause problems... Yes, I did not notice this problem by writing the hello world macro initially. My macro was something along the lines of set(MYBIN /path/to/somebin) macro(run_test testname f1) ... add_test(mytests_${testname} ${MYBIN} ${f1}) ... endmacro(run_test) And then when I noticed that this did not work (all tests were called mytests_, arguments were not added) I tried to just print ${testname} in a message inside the macro and noticed it was emtpy. Cheers, Yngve -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] macro/functions in ctest scripts
Den 08. aug. 2013 17:36, skrev Jakub Zakrzewski: Hi, a neee - just ignore this - I need more sleep... This indeed looks like a correct piece of code. Moreover - it works perfectly with my ctest... No problem. I noticed that if I add this in the ctest run script, i.e. the script I execute like ctest -S myscript.cmake, then the macro works correctly. Hence perhaps it is correct that the ctest --help-command is reporting this as such. However what I am trying to do now (not sure if it is supposed to work), is to add this to a 'CTestTestfile.cmake' file in the project itself, where the project is not using cmake (there is nothing to compile so it doesn't make much sense to use cmake). Cheers, Yngve -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Compiling Fortran Modules And
Den 13. mai 2013 20:08, skrev Pritchett-Sheats, Lori: Each dir* has *.F files that must be preprocessed to *.f90 files and then compiled. Hi, Just to give my two cents here. The standard filenaming scheme for fortran files are unless otherwise specified in the compile/preprocessing flags (as far as I know): .f/.f77: Fortran 77 files. .f90/.f95: Fortran 90/95 files. With lowercase 'f' the files are not supposed to be preprocessed, with uppercase 'F' the files should be preprocessed. Hence for Fortran 90 code which must be preprocessed, the filename ending should be .F90. The compiler will then take care of preprocessing (this is true for ifort and gfortran, I expect most compilers understand this). Alternatively for e.g. gfortran, the compile flag -cpp will preprocess a .f90 file as well before compiling. Hence, I do not quite understand why you don't use the file ending .F90 instead and just compile them directly? This is not directly related to cmake but it would make the cmake scripts easier because you don't need to create any custom commands. Cheers, Yngve -- 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 to install Fortran module files?
Hi, If you set the CMAKE_Fortran_MODULE_DIRECTORY variable, then all module files by default will be built into this folder. In our case we set this to ${CMAKE_BINARY_DIR}/fortran. Since nothing else is in this folder, you have a fairly good control over where your mod files are if you want to install them afterwards... I haven't really tried to install these myself, but I would imagine it should simply be install(DIRECTORY ${CMAKE_BINARY_DIR}/fortran DESTINATION include/fortran/project) (or wherever you want the module files relative to the install prefix.. Is there a correct place for them?) Hope this helps you along somewhat. Cheers, Yngve Den 10. mai 2013 19:24, skrev Neil Carlson: I'm trying to figure out how to install the module (.mod) files that are generated by the Fortran compiler. I've only found one thread on the topic from 3 years ago. The solution there was to find the appropriate directory in the build tree where these files were created and scarf up everything there that looked right and copy them to the desired install dir. It looks really fragile. Has cmake introduced any tools/hooks in the meantime that would simplify this, is is that still the way it has to be done? I'd be interested in hearing from anyone that has a working solution. Thanks! Neil -- 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] patch proposal for PythonInterp
On 12. april 2013 18:45, Rolf Eike Beer wrote: Yes, I will take a look. So far it looks not too bad. Yngve, please make the changes Brad requested and squash both patches together so I need to review only those changes that you really intend to do. Done: https://gitorious.org/eothred/cmake/commits/python_interp I've only touched the Python modules because I was upset by all the crap having been done to it by downstreams. I don't really care for Python at all. So I would love to see if you or anyone else steps up and takes ownership of those. Of course I'll be still around and answer questions, but I would really prefer if someone would have a regular look on those things who actually as a clue or an interst of Python (I have neither). Eike I will consider it, but I am no expert programmer yet so I cannot guarantee my crap level is that much less of the previous developer.. I also have a problem that I have no Windows machine available for testing at the moment (nor OSX), which I think is important when you want to make modules cross platform. Cheers, Yngve -- 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] patch proposal for PythonInterp
On 21. mars 2013 18:30, Rolf Eike Beer wrote: Yngve Inntjore Levinsen wrote: On 21. mars 2013 12:00, Rolf Eike Beer wrote: Am 21.03.2013 11:03, schrieb Yngve Inntjore Levinsen: Hi, I have a suggestion for the PythonInterp. On a system I am compiling my code on, I need to find the python binary which is newer than 2.5. However, the default /usr/bin/python is 2.4. If I then set the variable (which is not documented in the header by the way) PythonInterp_FIND_VERSION to 2.5, it will first search for the following list of binary names: python2.5 python2 python. This looks like you are using CMake 2.8.7 or before. Upgrade. cmake --version cmake version 2.8.10.2 Have a look at line 64 and 79 of FindPythonInterp.cmake. If e.g. PythonInterp_FIND_VERSION is set to 2.5, then _Python_NAMES in line 64 is equal to python2.5;python2;python It then finds python2 or python. Since PYTHON_EXECUTABLE then is found in line 79, it does not check the other versions (2.6 and 2.7). Or? Oh, you are right. It takes the other versions only into account after doing a first find attempt. This is because it tries to pick up the systems default python for a given major first, e.g. whatever you have configured for python 2.x. But what it doesn't do is drop and search more if that is a too old version. Patches welcome. Eike Hi, I have now finished a patch which I am quite sure does not break old logic, while fixing this problem. It should be said that I know little about code conventions and it is perhaps not as pretty as it could be, so please feel free to clean up of course! :) The patch can be found on my clone on gitorious, in the branch 'python_interp': https://gitorious.org/eothred/cmake For historical reasons I kept the first proposal as a first commit, but this is breaking slightly the old logic (system defaults searched last). Where do I submit the merge request? Open a bug report? Best Regards, Yngve -- 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] patch proposal for PythonInterp
On 11. april 2013 21:31, Matthew Woehlke wrote: Where do I submit the merge request? Open a bug report? I would recommend following the 'share a topic' instructions at http://www.cmake.org/Wiki/CMake/Git/Develop. Thanks for the link, but I feel this is more for module keepers, and this is not my module. I think Eike is responsible for this module (at least he has the last commits), so I would prefer if he or someone else with commit access could push it to the stage repository for review (if they agree with the patch). In case you find it easier I also attach the patches. Note that the second patch reverts the changes in the first patch (which is the one I sent earlier). Best Regards, Yngve From 861cfe1ee2b65e99d2b402b2dcdca84fac71a14a Mon Sep 17 00:00:00 2001 From: Yngve Inntjore Levinsen yngve.levin...@gmail.com Date: Thu, 11 Apr 2013 19:59:55 +0200 Subject: [PATCH 1/2] first proposal (not ideal) --- Modules/FindPythonInterp.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake index 7fb65b8..60a0f53 100644 --- a/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake @@ -39,15 +39,17 @@ if(PythonInterp_FIND_VERSION) if(PythonInterp_FIND_VERSION MATCHES ^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$) string(REGEX REPLACE ^([0-9]+\\.[0-9]+).* \\1 _PYTHON_FIND_MAJ_MIN ${PythonInterp_FIND_VERSION}) string(REGEX REPLACE ^([0-9]+).* \\1 _PYTHON_FIND_MAJ ${_PYTHON_FIND_MAJ_MIN}) -list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ}) +list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN}) unset(_PYTHON_FIND_OTHER_VERSIONS) if(NOT PythonInterp_FIND_VERSION_EXACT) foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) +list(APPEND _Python_NAMES python${_PYTHON_V}) endif() endforeach() endif() +list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ}) unset(_PYTHON_FIND_MAJ_MIN) unset(_PYTHON_FIND_MAJ) else() -- 1.8.0.2 From 46bba97a2b3de429fecc1ec3413721b6d288c604 Mon Sep 17 00:00:00 2001 From: Yngve Inntjore Levinsen yngve.levin...@gmail.com Date: Thu, 11 Apr 2013 20:34:15 +0200 Subject: [PATCH 2/2] second proposal I think this is not breaking old logic while fixing issue with python/python2 being too old Tested on my system, which has python/python2 = 2.4, but also python2.6 available. Before, 'find_package(PythonInterp 2.5)' would find python2 and note that it was too old. Now, it finds python2.6 --- Modules/FindPythonInterp.cmake | 90 -- 1 file changed, 52 insertions(+), 38 deletions(-) diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake index 60a0f53..3703f6c 100644 --- a/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake @@ -39,17 +39,15 @@ if(PythonInterp_FIND_VERSION) if(PythonInterp_FIND_VERSION MATCHES ^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$) string(REGEX REPLACE ^([0-9]+\\.[0-9]+).* \\1 _PYTHON_FIND_MAJ_MIN ${PythonInterp_FIND_VERSION}) string(REGEX REPLACE ^([0-9]+).* \\1 _PYTHON_FIND_MAJ ${_PYTHON_FIND_MAJ_MIN}) -list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN}) +list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ}) unset(_PYTHON_FIND_OTHER_VERSIONS) if(NOT PythonInterp_FIND_VERSION_EXACT) foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) -list(APPEND _Python_NAMES python${_PYTHON_V}) endif() endforeach() endif() -list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ}) unset(_PYTHON_FIND_MAJ_MIN) unset(_PYTHON_FIND_MAJ) else() @@ -77,8 +75,8 @@ unset(_PYTHON1_VERSIONS) unset(_PYTHON2_VERSIONS) unset(_PYTHON3_VERSIONS) -# Search for newest python version if python executable isn't found -if(NOT PYTHON_EXECUTABLE) +# This macro will search for all versions specified in input argument list +macro(_Find_Other_Versions) foreach(_CURRENT_VERSION ${_Python_VERSIONS}) set(_Python_NAMES python${_CURRENT_VERSION}) if(WIN32) @@ -89,50 +87,66 @@ if(NOT PYTHON_EXECUTABLE) PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] ) endforeach() +endmacro() + +# Search for newest python version if python executable isn't found +if(NOT PYTHON_EXECUTABLE) +_Find_Other_Versions(${_Python_VERSIONS}) endif() # determine python version string -if(PYTHON_EXECUTABLE) -execute_process(COMMAND
Re: [CMake] The else() in CMAKE_TOOLCHAIN_FILE
On 03. april 2013 13:13, Johannes Zarl wrote: Hi, On Tuesday, 2. April 2013, 06:42:47, Ashi wrote: I think I find something to explain this: the config.cmake(the CMAKE_TOOLCHAIN_FILE) is reloaded several times. on first-load, the A is set, but on second-load and later-load, the A is not set. I think I can get around this problem when A is kept set. However, I don't know how can I keep the value set in cmake. Could anyone give me some suggestion? Thanks! I'm not entirely sure what you're trying to do, but it seems like you would want to make A, B, and C into cache variables. That way subsequent cmake runs will use the same value... Johannes Hi, I'm thinking that one solution could be to create three (or four?) toolchain files, one for each if clause? Cheers, Yngve -- 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 to configure Fortran compiler, flags, and so on.
Hi, If you define variables in your environment before configuring cmake they will be read by cmake. The following environment variables (maybe I forget some) are relevant for fortran code: FC = fortran compiler FFLAGS = fortran flags (added to default flags) LDFLAGS = linker flags (any language) In addition, you can read any variables you want in your cmake script using $ENV{}, for example set(MY_FFLAGS_DOUBLE $ENV{FFLAGS_DOUBLE}) Note, if you already have run cmake once in your build folder, it will ignore FFLAGS etc and use the cached variables. Hence I would recommend to protect these ENV{} calls in if defined clauses to get same behaviour: if(NOT DEFINED MY_FFLAGS_DOUBLE) set(MY_FFLAGS_DOUBLE $ENV{FFLAGS_DOUBLE} CACHE STRING Fortran double flags) endif() Here I also added CACHE so that this variable is stored for next runs of cmake. I think this is close to what you are asking for (and is the same behaviour you will have for FFLAGS and friends). Hope this helps! Cheers, Yngve On 31. mars 2013 01:33, Daniel Carrera wrote: Hello all, I am starting to learn about CMake. So far I have only written very minimal CMakeLists.txt files. I am wondering how hard it would be to make CMake read some configuration options for Fortran 95 from an external file similar to this: myprogram.conf FC = mpif90 F77 = $(FC) FFLAGS = -fbounds-check -I/usr/lib/openmpi/include/ FFLAGS_DOUBLE = -fdefault-real-8 The end users are largely the developers. The program is recompiled and rerun regularly and these settings rarely change, so they need to be in some sort of global config file. I was thinking that it might make sense to write a thin shell script wrapper around CMake that basically does this: source $CONF_PATH/myprogram.conf cmake $SOURCE_PATH So then all those settings become environment variables. And then I'd do something inside CMakeLists.txt to make sure that CMake uses the contents of those variables to compile the program. Am I on the right track here? Or am I just badly re-inventing the wheel? If I am on the right track, can someone show me how I would get CMake to use these variables? I have tried to find documentation, but what I've found seems specific to C/C++: http://www.cmake.org/Wiki/CMake_Useful_Variables Thanks for the help. Cheers, Daniel. -- Lord of the rings calendar in your Linux/Unix/Mac terminal: cat /usr/share/calendar/calendar.lotr -- 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] Quick question: CMAKE_CXX_FLAGS vs CMAKE_CXX_COMPILE_FLAGS
Hi, I believe compile flags are *not* used during linking, while CMAKE_CXX_FLAGS will also be used during linking (if your linker language is C++). I do not know of any other differences, but perhaps an expert wants to correct me.. Cheers, Yngve On 02. april 2013 11:21, Daniel Carrera wrote: Hi everyone, What is the difference between CMAKE_CXX_COMPILE_FLAGS and CMAKE_CXX_FLAGS? The wiki only mentions CMAKE_CXX_FLAGS and CMAKE_C_FLAGS, and those are clearly used for compiling. But if you Google for CMake examples (e.g with MPI) you will quickly find CMake scripts that have CMAKE_CXX_COMPILE_FLAGS. I am experimenting with CMake and I want to figure out if I should be using CMAKE_Fortran_FLAGS or CMAKE_Fortran_COMPILE_FLAGS. Thanks for the help. Cheers, Daniel. -- Lord of the rings calendar in your Linux/Unix/Mac terminal: cat /usr/share/calendar/calendar.lotr -- 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] patch proposal for PythonInterp
Hi, I have a suggestion for the PythonInterp. On a system I am compiling my code on, I need to find the python binary which is newer than 2.5. However, the default /usr/bin/python is 2.4. If I then set the variable (which is not documented in the header by the way) PythonInterp_FIND_VERSION to 2.5, it will first search for the following list of binary names: python2.5 python2 python. It then finds python2 (and would find python) which points to python2.4. I do not have python2.5 on this system, only 2.6. Now I know my way around this myself, but I think the implementation of this script would be nicer with the attached patch. The list of binary names in the first search then becomes: python2.5 python2.7 python2.6 python2.5 python2 python Any comments? Do people agree? Am I missing some important reason for the current behaviour? Cheers, Yngve diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake index 7fb65b8..60a0f53 100644 --- a/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake @@ -39,15 +39,17 @@ if(PythonInterp_FIND_VERSION) if(PythonInterp_FIND_VERSION MATCHES ^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$) string(REGEX REPLACE ^([0-9]+\\.[0-9]+).* \\1 _PYTHON_FIND_MAJ_MIN ${PythonInterp_FIND_VERSION}) string(REGEX REPLACE ^([0-9]+).* \\1 _PYTHON_FIND_MAJ ${_PYTHON_FIND_MAJ_MIN}) -list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ}) +list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN}) unset(_PYTHON_FIND_OTHER_VERSIONS) if(NOT PythonInterp_FIND_VERSION_EXACT) foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS}) if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN) list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V}) +list(APPEND _Python_NAMES python${_PYTHON_V}) endif() endforeach() endif() +list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ}) unset(_PYTHON_FIND_MAJ_MIN) unset(_PYTHON_FIND_MAJ) else() -- 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] patch proposal for PythonInterp
On 21. mars 2013 12:00, Rolf Eike Beer wrote: Am 21.03.2013 11:03, schrieb Yngve Inntjore Levinsen: Hi, I have a suggestion for the PythonInterp. On a system I am compiling my code on, I need to find the python binary which is newer than 2.5. However, the default /usr/bin/python is 2.4. If I then set the variable (which is not documented in the header by the way) PythonInterp_FIND_VERSION to 2.5, it will first search for the following list of binary names: python2.5 python2 python. This looks like you are using CMake 2.8.7 or before. Upgrade. Eike -- cmake --version cmake version 2.8.10.2 Have a look at line 64 and 79 of FindPythonInterp.cmake. If e.g. PythonInterp_FIND_VERSION is set to 2.5, then _Python_NAMES in line 64 is equal to python2.5;python2;python It then finds python2 or python. Since PYTHON_EXECUTABLE then is found in line 79, it does not check the other versions (2.6 and 2.7). Or? Cheers, Yngve -- 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 program suffix
On 11/03/13 08:57, Chandan Choudhury wrote: -- Chandan kumar Choudhury NCL, Pune INDIA On Mon, Mar 11, 2013 at 1:19 PM, Michael Wild them...@gmail.com mailto:them...@gmail.com wrote: On Mon, Mar 11, 2013 at 8:42 AM, Chandan Choudhury iitd...@gmail.com mailto:iitd...@gmail.com wrote: Thanks Michael for your quick reply. I indeed tried the following command: CMAKE_PREFIX_PATH=/soft/sudip/abc/apps/fftw-3.3.3 CC=icc cmake .. -DCMAKE_INSTALL_PREFIX=/soft/sudip/abc/apps/gromacs/461 -DCMAKE_EXECUTABLE_SUFFIX=_461 make -j 12 make install But the suffix was not added to the executables. Might be I am missing something or doing silly. Kindly have a look. Chandan -- Chandan kumar Choudhury NCL, Pune INDIA On Mon, Mar 11, 2013 at 12:34 PM, Michael Wild them...@gmail.com mailto:them...@gmail.com wrote: On Mon, Mar 11, 2013 at 7:56 AM, Chandan Choudhury iitd...@gmail.com mailto:iitd...@gmail.com wrote: Dear cmake users, I am very new to cmake. I really find it interesting. I installed gromacs (4.6.1) with it. One simple query regarding its usage is, how do I add program suffix to the executables created. Chandan Just set the CMAKE_EXECUTABLE_SUFFIX variable in the CMake cache. Be careful that on Windows this should include the .exe suffix. HTH Michael That's a bit difficult to debug remotely. Here a few hints: * Look into the CMakeCache.txt file and verify that the CMAKE_EXECUTABLE_SUFFIX is correct. CMakeCache.txt contains the CMAKE_EXECUTABLE_SUFFIX entry as: //No help, variable specified on the command line. CMAKE_EXECUTABLE_SUFFIX:UNINITIALIZED=_461 * Grep the sources for this variable, it might be that one of the CMakeLists.txt or *.cmake files overrides the cache entry. There is no entry of CMAKE_EXECUTABLE_SUFFIX in CMakeLists.txt. Chandan 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 Hi, Do you mean how to add it to the CMakeLists.txt files? I sometimes use the target property OUTPUT_NAME: add_executable(mybin ${sources}) set_target_properties(mybin PROPERTIES OUTPUT_NAME mybin${BINARY_POSTFIX}) Then, you can add your own suffix with: cmake -DBINARY_POSTFIX=suffix ../ If there is any official cmake variables to use for this I am not aware of it (but I am no cmake developer neither). Cheers, Yngve -- 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 program suffix
On 11/03/13 09:24, Eric Noulard wrote: I think Chandan meant globally for all executables. That's the purpose of CMAKE_EXECUTABLE_SUFFIX as already pointed out by Michael. see : cmake --help-variable CMAKE_EXECUTABLE_SUFFIX Now it doesn't seems to work for Chandan. I guess the variable is forcibly written by CMakeGenericSystem.cmake during early CMake startup. So that you cannot overwrite its value on the command line. try to add variable_watch(CMAKE_EXECUTABLE_SUFFIX) at the very top of main CMakeLists.txt You may try to do that from within the CMakeLists.txt after the project(...) statement (or enable_language) Hi, Yes I tried to set the same variable on my machine but does not work here neither (Linux). Perhaps this only works for platforms where this variable is traditionally non-empty? As also Michael pointed out, this would not really be a solution for non-developers of a software for sure (and I now see Chandan said it was a question regarding usage). Cheers, Yngve -- 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 program suffix
Hi, I don't think the CMAKE_EXECUTABLE_SUFFIX will have any more effect for you this time, and if it did you would probably get binary_472_461 in this particular case. Otherwise yes, I believe using GMX_BINARY_SUFFIX should do the trick (had a quick look at the source). Generally for cmake projects you can check which options are available using either the graphical interface, or using ccmake after you have configured: cmake ../ ccmake . Cheers, Yngve On 11/03/13 10:49, Chandan Choudhury wrote: Dear Micheal, Yngve Decker and Eric Thank for remarks. Micheal you are right that I want to append a suffix to every executable being installed. I already have an earlier version of gromacs installed, the suffix would help me to distinguish the between the two. While looking out for the string SUFFIX in the CMakeCache.txt, I encountered a phrase as //Suffix for GROMACS binaries (default: _d for double, _mpi for // MPI, _mpi_d for MPI and double). GMX_BINARY_SUFFIX:STRING= What I can understand is if I use the following command it might serve the purpose. CMAKE_PREFIX_PATH=/soft/sudip/abc/apps/fftw-3.3.3 *GMX_BINARY_SUFFIX=_472* CC=icc cmake .. -DCMAKE_INSTALL_PREFIX=/soft/sudip/abc/apps/gromacs/461 -DCMAKE_EXECUTABLE_SUFFIX=_461 make -j 12 make install Chandan -- Chandan kumar Choudhury NCL, Pune INDIA On Mon, Mar 11, 2013 at 2:26 PM, Yngve Inntjore Levinsen yngve.levin...@gmail.com mailto:yngve.levin...@gmail.com wrote: On 11/03/13 09:24, Eric Noulard wrote: I think Chandan meant globally for all executables. That's the purpose of CMAKE_EXECUTABLE_SUFFIX as already pointed out by Michael. see : cmake --help-variable CMAKE_EXECUTABLE_SUFFIX Now it doesn't seems to work for Chandan. I guess the variable is forcibly written by CMakeGenericSystem.cmake during early CMake startup. So that you cannot overwrite its value on the command line. try to add variable_watch(CMAKE_EXECUTABLE_SUFFIX) at the very top of main CMakeLists.txt You may try to do that from within the CMakeLists.txt after the project(...) statement (or enable_language) Hi, Yes I tried to set the same variable on my machine but does not work here neither (Linux). Perhaps this only works for platforms where this variable is traditionally non-empty? As also Michael pointed out, this would not really be a solution for non-developers of a software for sure (and I now see Chandan said it was a question regarding usage). Cheers, Yngve -- Powered by www.kitware.com http://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
[CMake] help with lahey (fortran) patch
Hello, I am in the process of preparing a patch proposal for the Lahey/Fujitsu Fortran compiler (lf95). As I am not a programming expert nor a cmake expert, I tried to base myself on the already available files for Intel/NAG and friends in the Modules directory. Some specific questions in addition to general feedback: - There is a MODDIR and MODPATH flag for cmake/fortran, what is the difference? For lf95 the flag --mod can have a list of paths separated by ':', while -M can only get one path. I believe the latter is where the created modules are placed. - Adding --staticlink. For me that makes sense since you usually want to distribute the binaries to people which does not have lf95 libraries available. What is the preference for cmake though? I notice for Intel you do the opposite, and explicitly say that you want to link dynamically to the Intel libraries.. - Did I get the flags correctly done? It is working in my tests but maybe I still did something wrong.. - There are some extra recommended flags for lf95 in the documentation, should they be turned on or will they be too specific? See page 50-51 of this pdf: http://www.lahey.com/docs/UsersGuideEXP73_revD05.pdf - Will this be correct on Windows? I don't have a machine to test... - Where would I submit the proposal? I attach both the patch and the output of lf95 --help, since I suppose not many people actually have this compiler available.. There is a freely available documentation on the web for the very curious, which you can find here: http://www.lahey.com/doc.htm Cheers, Yngve diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index f861e39..3debd0e 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -146,6 +146,10 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG -V) set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG NAG Fortran Compiler) + list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS LAHEY) # Lahey/Fujitsu.. + set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_LAHEY --version) + set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_LAHEY Lahey/Fujitsu Fortran 95 Compiler) + # Try to identify the compiler. set(CMAKE_Fortran_COMPILER_ID) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) diff --git a/Modules/Compiler/LAHEY-Fortran.cmake b/Modules/Compiler/LAHEY-Fortran.cmake new file mode 100644 index 000..7d77d5f --- /dev/null +++ b/Modules/Compiler/LAHEY-Fortran.cmake @@ -0,0 +1,8 @@ +include(Compiler/LAHEY) +__compiler_lahey(Fortran) + + +set(CMAKE_Fortran_MODDIR_FLAG --mod ) +set(CMAKE_Fortran_MODPATH_FLAG -M ) +set(CMAKE_Fortran_FORMAT_FIXED_FLAG -fix) +set(CMAKE_Fortran_FORMAT_FREE_FLAG -nfix) diff --git a/Modules/Compiler/LAHEY.cmake b/Modules/Compiler/LAHEY.cmake new file mode 100644 index 000..c8bc219 --- /dev/null +++ b/Modules/Compiler/LAHEY.cmake @@ -0,0 +1,31 @@ + +#= +# Copyright 2002-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the License); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__COMPILER_LAHEY) + return() +endif() +set(__COMPILER_LAHEY 1) + +macro(__compiler_lahey lang) + # Feature flags. + set(CMAKE_${lang}_VERBOSE_FLAG --verbose) + + # Initial configuration flags. + set(CMAKE_${lang}_FLAGS_INIT ) + set(CMAKE_${lang}_FLAGS_DEBUG_INIT -g -o0) + set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT -os) + set(CMAKE_${lang}_FLAGS_RELEASE_INIT -o2) + set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT -g -o2) +endmacro() diff --git a/Modules/Platform/Linux-LAHEY-Fortran.cmake b/Modules/Platform/Linux-LAHEY-Fortran.cmake new file mode 100644 index 000..7db7c6c --- /dev/null +++ b/Modules/Platform/Linux-LAHEY-Fortran.cmake @@ -0,0 +1,11 @@ +set(CMAKE_Fortran_VERBOSE_FLAG -Wl,-v) # Runs gcc under the hood. + +# Need one -Wl, level to send flag through to gcc. +# Use -Xlinker to get through gcc to real linker. +set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS --shared) +set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG -Wl,-rpath,) +set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP :) +set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG -Wl,-rpath-link,-Xlinker,) +set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG -Wl,-soname,) +# We want to link statically to lf95 specific libraries in all cases.. +set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS --staticlink) usage: lf95 [@RESPFILE] [FILENAMES] [SWITCHES] @RESPFILE is a file containing
Re: [CMake] how to compile as 32bit on a 64bit Linux host ?
Hello, On 15/02/13 15:41, Martin Koller wrote: I'm just not sure if it is enough to change the compiler flags or if there is more to change (paths etc.) This is why I prefer toolchain files over adding an option inside the CMakeLists.txt files. On some systems you probably also want to change the search path for libraries in particular (often /usr/lib32 instead of /usr/lib), so that the find_package() commands and similar does not find the incompatible 64 bit libraries. In our system we both have an option to force 32 bit (which basically just adds -m32 to compile flags), and I have a toolchain file (which corresponds to my stackoverflow answer). I find the toolchain file to be more accurate/flexible to get correct setup. In addition to the three lines you might also want to set paths (I do not need that on my system for my projects), something along the lines of: set(CMAKE_FIND_ROOT_PATH /usr/lib32) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) Cheers, Yngve -- 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 to compile as 32bit on a 64bit Linux host ?
It is true, I actually never had problems just adding -m32 on my machines, but I assumed some systems are more difficult than others.. But what do I know? :) Cheers, Yngve On 15/02/13 16:33, clin...@elemtech.com wrote: Or simply specify -m32 at the first configure CFLAGS=-m32 CXXFLAGS=-m32 cmake ../src find_library() works correctly if you do that, and it automatically detects if the 32 bit libraries are in /usr/lib32 or /usr/lib. Clint -- 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] CPack: Packaging debug and release configurations in a single zip
On 7/2/13 7:54 PM, Patrick Johnmeyer wrote: On Thu, Feb 7, 2013 at 12:41 PM, Yngve Inntjore Levinsen yngve.levin...@gmail.com mailto:yngve.levin...@gmail.com wrote: I think you are fighting the tool in any case, because you are asking to build multiple configurations in one build folder (?). Normally you would create one build folder per configuration.. Which I guess is what you are doing today. No, the Visual Studio generator is not a /single-configuration generator/. all configurations are bundled into the single generated solution file. This is the standard behavior of CMake under basic usage. Your solution using ExternalProject looks promising, though, I will try this out. Thanks! Aha, I have mostly used the Makefile generator, and never VS, so I didn't know that. I agree, the externalproject trick proposed by Ansis sounds better. Good luck! Cheers, Yngve -- 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] CPack: Packaging debug and release configurations in a single zip
Did you try to create two targets and add per-target compile flags? Something along the lines of add_library(mylib_rel ${sources}) add_library(mylib_dbg ${sources}) set_target_properties(mylib_rel PROPERTIES COMPILE_FLAGS -O3) set_target_properties(mylib_dbg PROPERTIES COMPILE_FLAGS -O0 -g) Not entirely sure if COMPILE_FLAGS is a valid property of targets though, but I would imagine there is a solution which looks similar to this.. Cheers, Yngve On 02/06/2013 08:09 PM, Patrick Johnmeyer wrote: I have looked through the CMake wikis and several mailing list threads that the following google search returned, and I have not found a definitive answer to my question. [site:www.cmake.org/pipermail/cmake http://www.cmake.org/pipermail/cmake CPack multiple configurations in one package] My team delivers debug and release libraries, built under Visual Studio. We would like to package the debug and release libraries in a single zip file. However, I can only figure out how to get CPack to generate the zip for one configuration at a time. I could merge the two zip files after the fact, but it seems to me that there must be an easy way to get CPack to do this. Is there? Regards, pj -- 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] CPack: Packaging debug and release configurations in a single zip
Hi, I think you are fighting the tool in any case, because you are asking to build multiple configurations in one build folder (?). Normally you would create one build folder per configuration.. Which I guess is what you are doing today. Instead of specifying the compile flags manually you can instead use the variables ${CMAKE_C_FLAGS_RELEASE} and ${CMAKE_C_FLAGS_DEBUG}, and you could set it so it only builds the second target based on an option: option(BUILD_BOTH_LIBVERSIONS Build both debug and optimized library OFF) if(BUILD_BOTH_LIBVERSIONS) add_library(...) set_target_properties(...) set_target_properties(...) install(...) endif() Cheers, Yngve On 02/07/2013 07:26 PM, Patrick Johnmeyer wrote: On Thu, Feb 7, 2013 at 3:12 AM, Yngve Inntjore Levinsen yngve.levin...@gmail.com mailto:yngve.levin...@gmail.com wrote: Did you try to create two targets and add per-target compile flags? What you suggest is replacing configurations with targets. That may be possible, but runs counter to how CMake natively works. I feel like I would be fighting the tool to do it this way. -- 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] have problem when I precompile *.f90 with -fpp using ifort
Hi, Just a wild guess here. Since people often write fortran code starting from column 7, they tend to forget that preprocessor statements have to start at column 1 (I'm talking from personal head-scratching)... Do you have any spaces before the #? If so, remove them and try again. It does sound like cmake is doing what you ask it to, since it is recognizing it as a preprocessor statement. Cheers, Yngve On Saturday 21. July 2012 15.18.39, Lei Pan wrote: Hello: I have two files: main.f90, mod_a.f90. in mod_a.f90 - MODULE mod_a ... #ifdef PSV ... #endif ... END - part of my CMakeLists: -- add_library(mod mod_a.f90) add_definitions(-DPSV) add_executable(main main.f90) target_link_libraries(main ${NETCDF_FORTRAN_LIB} mod) set_target_properties(main PROPERTIES COMPILE_FLAGS -fpp) - make output: **/**/mod_a.f90(15): warning #5117: Bad # preprocessor line #ifdef PSV -^ **/**/mod_a.f90(20): warning #5117: Bad # preprocessor line #endif -^ how to write the CMakeLists.txt in the situation? Thank you! signature.asc Description: This is a digitally signed message part. -- 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] Easier way to override variables
Hi Romain, Have a look at the help for the function set: $ cmake --help-command set If I understand the documentation, this should be what you are looking for: set(MY_VAR NEW_VALUE FORCE) Cheers, Yngve On Wednesday 18. July 2012 15.49.31, Romain LEGUAY wrote: Hello everyone, I don't find in any example to override a variable. I proceed this way: unset(MY_VAR CACHE) set(MY_VAR MY_NEW_VALUE) I have many variables so I would like to have just one line to change just the value of the variable (not its documentation) in one line like this: set(MY_VAR MY_NEW_VALUE FORCED) Is it possible? Thank you, Romain -- 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] set ranlib/ar in toolchain file
Hi Eric, Thanks for your suggestion. If one shouldn't set RANLIB/AR oneself, then I find it a bit confusing that the information about those variables are listed here: http://www.cmake.org/Wiki/CMake_Useful_Variables But perhaps that list is meant for different stuff? Your suggestion did not set the right ranlib/ar binaries. I did have a look in the file CMakeFindBinUtils.cmake, where a suggestion of setting _CMAKE_TOOLCHAIN_PREFIX came up. This actually worked. Not sure if it is expected to work though, so I would be happy to hear if someone has the official solution. If it is expected, perhaps one could add the information about how this variable work to the Wiki pages for toolchains? Perhaps one could use this variable also when searching for the compilers and linkers? Cheers, Yngve On Wednesday 4. July 2012 22.19.49, Eric Noulard wrote: 2012/7/4 Yngve Inntjore Levinsen yngve.levin...@gmail.com: Hi, I try to set up my toolchain file for building Windows executables in a Linux environment. I started with the example from http://www.cmake.org/Wiki/CmakeMingw The only thing I noticed was that I needed to use ar and ranlib from MinGW as well, for creating the archives. I can do this by manually editing the file CMakeFiles/CMakeCXXCompiler.cmake after cmake has run. Code compiles successfully. I then tried to add the following two lines to the toolchain file: SET(CMAKE_AR i486-mingw32-ar) SET(CMAKE_RANLIB i486-mingw32-ranlib) You shouldn't need to set CMAKE_AR or CMAKE_RANLIB yourself. Could you try the toolchain file I uploaded here http://www.cmake.org/Wiki/images/c/c2/Toolchain-cross-mingw32-linux.cmake (refered on the very same page you used: http://www.cmake.org/Wiki/CmakeMingw) If you SET(COMPILER_PREFIX i486-mingw32) it should work out of the box. (yes, the prefix for my MinGW install is different from the example) Sadly, that makes the initial compiler test fail. For fortran it actually still works, but the test fails for c and c++. I have tried to search for a while without finding out what I do wrong. Please tell me. Or ask if something is unclear. What is the exact command line you used when invoking CMake with you Toolchain file ? Did you try from a pristine build tree? Using the provided toolchain, after you updated with the proper prefix if you put the toolchain file at the root of your source tree, then you can do: cd sourcedir mkdir build-win32 cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-cross-mingw32-linux.cmake .. should work as expected without tweaking AR or RANLIB. -- 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] set ranlib/ar in toolchain file
Hi Eric, On Thursday 5. July 2012 10.22.17, Eric Noulard wrote: Which ranlib/ar was discovered by CMake? /usr/bin/ar and /usr/bin/ranlib. I need it to discover the ones with the mingw prefix. You did not give us the exact command line you use with the output given by the cmake run. The command I use for cmake is simply cmake -DCMAKE_TOOLCHAIN_FILE=file sourcepath. For better understanding what I do wrong, I attach both the now working toolchain file I have, and the non-working one. With the non-working one I get the following grep result afterwards: $ grep RANLIB **/* CMakeCache.txt:CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib CMakeCache.txt://ADVANCED property for variable: CMAKE_RANLIB CMakeCache.txt:CMAKE_RANLIB-ADVANCED:INTERNAL=1 CMakeFiles/CMakeCCompiler.cmake:SET(CMAKE_RANLIB /usr/bin/ranlib) CMakeFiles/CMakeCXXCompiler.cmake:SET(CMAKE_RANLIB /usr/bin/ranlib) CMakeFiles/CMakeFortranCompiler.cmake:SET(CMAKE_RANLIB /usr/bin/ranlib) With the now working one I get the following result: $ grep RANLIB **/* CMakeCache.txt:CMAKE_RANLIB:FILEPATH=/usr/bin/i486-mingw32-ranlib CMakeCache.txt://ADVANCED property for variable: CMAKE_RANLIB CMakeCache.txt:CMAKE_RANLIB-ADVANCED:INTERNAL=1 CMakeFiles/CMakeCCompiler.cmake:SET(CMAKE_RANLIB /usr/bin/i486-mingw32- ranlib) CMakeFiles/CMakeCXXCompiler.cmake:SET(CMAKE_RANLIB /usr/bin/i486-mingw32- ranlib) CMakeFiles/CMakeFortranCompiler.cmake:SET(CMAKE_RANLIB /usr/bin/i486-mingw32- ranlib) I can ensure you that on my box the provided toolchain works and discover a coherent set of mingw compiler and tools (include ar/ranlib) there must be something specific in your case. OK, perhaps I use different cmake version? I have 2.8.8 installed. $ uname -a Linux PCBE13951 3.4.3-1-CHAKRA #1 SMP PREEMPT Mon Jun 18 17:39:58 UTC 2012 x86_64 GNU/Linux Best Regards, Yngve# the name of the target operating system SET(CMAKE_SYSTEM_NAME Windows) # Choose an appropriate compiler prefix # for classical mingw32 # see http://www.mingw.org/ #set(COMPILER_PREFIX i586-mingw32msvc) # for 32 or 64 bits mingw-w64 # see http://mingw-w64.sourceforge.net/ set(COMPILER_PREFIX i486-mingw32) #set(COMPILER_PREFIX x86_64-w64-mingw32 # which compilers to use for C and C++ find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres) #SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres) find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc) #SET(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc) find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++) #SET(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++) find_program(CMAKE_Fortran_COMPILER NAMES ${COMPILER_PREFIX}-gfortran) # here is the target environment located SET(USER_ROOT_PATH $ENV{HOME}/win32-dev/) message(UHOME: ${USER_ROOT_PATH}) SET(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX} ${USER_ROOT_PATH}) # adjust the default behaviour of the FIND_XXX() commands: # search headers and libraries in the target environment, search # programs in the host environment set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # An example of how the cross compiler for mingw could look like # Assuming you are ona Unix platform and want to build for Windows. # You need to modify this with your own paths/binary names... # the name of the target operating system SET(CMAKE_SYSTEM_NAME Windows) # which compilers to use SET(CMAKE_C_COMPILER i486-mingw32-gcc) SET(CMAKE_CXX_COMPILER i486-mingw32-g++) SET(CMAKE_Fortran_COMPILER i486-mingw32-gfortran) SET(CMAKE_RC_COMPILER i486-mingw32-windres) SET(CMAKE_LINKER i486-mingw32-ld) # this prefix is used by cmake to find ar/ranlib SET(_CMAKE_TOOLCHAIN_PREFIX i486-mingw32-) # here is the target environment located SET(CMAKE_FIND_ROOT_PATH /usr/i486-mingw32) # adjust the default behaviour of the FIND_XXX() commands: # search headers and libraries in the target environment, search # programs in the host environment set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Finally we set some Mad-X options.. option( MADX_STATIC Turn on for static linking ON) -- 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] set ranlib/ar in toolchain file
Hi Eike and Eric, That was an incredible wild guess, you were spot on. Changing the title to PROJECT(project C CXX Fortran) instead of having Fortran first in the list solved it. Now both toolchain files work. Why is that though? Something buggy with the Fortran part in cmake? Thanks! Best Regards, Yngve On Thursday 5. July 2012 17.43.49, Rolf Eike Beer wrote: Eric Noulard wrote: if it is the case could try enabling C language first? i.e. project(Whatever C) ... enable_language(Fortran) enable_language(CXX) Why not just project(Whatever C CXX Fortran) then? 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
[CMake] set ranlib/ar in toolchain file
Hi, I try to set up my toolchain file for building Windows executables in a Linux environment. I started with the example from http://www.cmake.org/Wiki/CmakeMingw The only thing I noticed was that I needed to use ar and ranlib from MinGW as well, for creating the archives. I can do this by manually editing the file CMakeFiles/CMakeCXXCompiler.cmake after cmake has run. Code compiles successfully. I then tried to add the following two lines to the toolchain file: SET(CMAKE_AR i486-mingw32-ar) SET(CMAKE_RANLIB i486-mingw32-ranlib) (yes, the prefix for my MinGW install is different from the example) Sadly, that makes the initial compiler test fail. For fortran it actually still works, but the test fails for c and c++. I have tried to search for a while without finding out what I do wrong. Please tell me. Or ask if something is unclear. Thanks! Cheers, Yngve -- 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] set ranlib/ar in toolchain file
Hi, I try to set up my toolchain file for building Windows executables in a Linux environment. I started with the example from http://www.cmake.org/Wiki/CmakeMingw The only thing I noticed was that I needed to use ar and ranlib from MinGW as well, for creating the archives. I can do this by manually editing the file CMakeFiles/CMakeCXXCompiler.cmake after cmake has run. Code compiles successfully. I then tried to add the following two lines to the toolchain file: SET(CMAKE_AR i486-mingw32-ar) SET(CMAKE_RANLIB i486-mingw32-ranlib) (yes, the prefix for my MinGW install is different from the example) Sadly, that makes the initial compiler test fail. For fortran it actually still works, but the test fails for c and c++. I have tried to search for a while without finding out what I do wrong. Please tell me. Or ask if something is unclear. Thanks! Cheers, Yngve -- 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] cdash/coverage
Dear developers, I have what I think is a minor confusion about how to set up a client to do coverage analysis. I have added the coverage flags to a new build type DebugCoverage, which also includes flags from the Debug build type. My ctest script now looks something like this (uninteresting parts excluded): ... ctest_start(ExperimentalCoverage) set(cfg_options -DCMAKE_BUILD_TYPE=DebugCoverage ) set(CTEST_CMAKE_GENERATOR Unix Makefiles) set(CTEST_UPDATE_COMMAND cvs) ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) ctest_update() ctest_configure(OPTIONS ${cfg_options}) ctest_build(NUMBER_ERRORS PROJ_BUILD_ERRORS) if(NOT ${PROJ_BUILD_ERRORS}) ctest_test() ctest_coverage() endif() ctest_submit() Now, when running the ctest_coverage(), it is complaining that it cannot find any of the .gcda files. The files are there from what I can see (I checked that they were there during the run of ctest_test() in a separate terminal). They are not empty. If I go to the build directory afterwards and manually run make ExperimentalCoverage, then the coverage analysis is ran. I can then run make ExperimentalSubmit and the coverage analysis is submitted to the cdash dashboard. May I ask if anyone of you see what my mistake is? Please do not hesitate to ask if more information is needed! Cheers, Yngve -- 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] CheckIncludeFiles problem
Dear all, I have a problem with CheckIncludeFiles that I cannot figure out. I'm sure I'm just making a stupid mistake though, but I am unable to figure out what. The following code is in CMakeLists.txt: include(CheckIncludeFiles) check_include_files(readline/history.h HAVE_READLINE_HISTORY_H) check_include_files(sys/select.h HAVE_SYS_SELECT_H) And both headers are installed on my system: $ ls -lh /usr/include/sys/select.h /usr/include/readline/history.h -rw-r--r-- 1 root root 9,9K 21.07.2011 04:40 /usr/include/readline/history.h -rw-r--r-- 1 root root 4,1K 26.10.2011 20:03 /usr/include/sys/select.h CMake only finds sys/select.h though, and I don't see the difference. What might I be missing? I use cmake version 2.8.7. Thanks! Cheers, Yngve -- 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] CheckIncludeFiles problem
Hi Micha, Aha, thanks! That was more clever than I would expect, and it was the problem. readline/history.h was dependent on stdio.h being include beforehand. Just in case anyone else reads this mail in the future, here is a documentation on how to check an array of include files: http://www.cmake.org/Wiki/CMake:How_To_Write_Platform_Checks For instance: CHECK_INCLUDE_FILES (stdio.h;readline/history.h HAVE_READLINE_HISTORY_H) Cheers, Yngve On Torsdag 2. februar 2012 13.46.09, Micha Renner wrote: May be, there is an error when the compiler process the header file. During CHECK_INCLUDE_FILES CMake invokes the Compiler to check whether the header file works fines. In most cases reason is a missing additional header files (but not always). So, check the log files of CMake in the binary directory of your project. Greetings Micha Am Donnerstag, den 02.02.2012, 11:58 +0100 schrieb Yngve Inntjore Levinsen: Dear all, I have a problem with CheckIncludeFiles that I cannot figure out. I'm sure I'm just making a stupid mistake though, but I am unable to figure out what. The following code is in CMakeLists.txt: include(CheckIncludeFiles) check_include_files(readline/history.h HAVE_READLINE_HISTORY_H) check_include_files(sys/select.h HAVE_SYS_SELECT_H) And both headers are installed on my system: $ ls -lh /usr/include/sys/select.h /usr/include/readline/history.h -rw-r--r-- 1 root root 9,9K 21.07.2011 04:40 /usr/include/readline/history.h -rw-r--r-- 1 root root 4,1K 26.10.2011 20:03 /usr/include/sys/select.h CMake only finds sys/select.h though, and I don't see the difference. What might I be missing? I use cmake version 2.8.7. Thanks! Cheers, Yngve -- 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] CPack : OS X package installation directory
Hi, Søndag 25. desember 2011 20.32.41 skrev Nicholas Yue: Hi, I would like to package up my software to install (via DMG and PKG) to the /Applications/my-software directory Is the variable CMAKE_INSTALL_PREFIX what you are looking for? Have a look at: cmake --help-variable CMAKE_INSTALL_PREFIX How should one configure CMakeLists.txt INSTALL and CPack variable to install software in the above location i.e. /Applications/my-software Also, is there a way to check the installation without actually doing the full installation steps e.g. is there some flags/files to check the installation directory after the DMG/PKG is created ? make -n works at least, and likewise e.g. ctest -N (n/N means dry-run I believe). You could try make install -n at least to see where make is moving stuff. Unsure if cpack has something similar. Regards Cheers, Yngve -- 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 a cmake option via make targets?
Onsdag 02 november 2011 skrev szalai endre: Hi guys, I am using Rational Purify for runtime error checks in C++. To use it, you have to call purify instead of the C++ linker at link phase. To do so, I have the following cmake file: // project(myproject ) option (USE_PURIFY Use Rational Purify for runtime error checks OFF) IF (USE_PURIFY) set(CMAKE_CXX_LINK_EXECUTABLE purify ${CMAKE_CXX_LINK_EXECUTABLE}) ENDIF (USE_PURIFY) add_executable (myproject HelloWorld.cc) // This adds the option and changes the linker (prepending with purify). This works fine. Now I would like to trigger the IF() line from a make target. Say, when I type make myproject_purify, I would like to set the option (or prepend the linker, whichever is best). I am quite uncertain how to do it with cmake. I did not find any hint if I can set options from cmake itself or not. Also, whenever I define a new make target, I have to supply a shell command and it seems I cannot execute cmake commands there. So my question: how would you set an option via a make target? Any hints? Thanks, Mc -- 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 Hi, Just an idea, would it be possible to just add a second target and use set_target_properties() somehow? I'm guessing it would be something like: set(sources HelloWorld.cc) add_executable (myproject ${sources}) add_executable (myproject_purify ${sources} EXCLUDE_FROM_ALL) set_target_properties(myproject_purify CMAKE_CXX_LINK_EXECUTABLE purify ${CMAKE_CXX_LINK_EXECUTABLE}) I have not tested this, so I might be wrong. Cheers, Yngve-- 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] Problems with FindPythonInterp
Fredag 07 oktober 2011 skrev Yngve Inntjore Levinsen: Dear all, I have some configuration scripts in python that needs to be run for my project, so I use the FindPythonInterp package. This has nicely found the version 2.7 on my system so far, but now it suddenly finds /usr/bin/python which is a soft link to version 3.2. My script doesn't work with python 3. First: Is it possible to set a requirement that it should be python version 2? Second: This for some weird reason only happens on my desktop, even though I have pretty much exactly the same setup on my laptop. On my laptop it finds /usr/bin/python2.7 (as it always has). They both have the same python versions installed (2.7 and 3.2), and they both have the same cmake version installed (2.8.6). I am running Arch Linux. On my laptop: -- Found PythonInterp: /usr/bin/python2.7 On my desktop: -- Found PythonInterp: /usr/bin/python (found version 3.2.2) I'm sure there must be some differences in what's installed on the two systems, but I cannot figure out what. I tried find_package(PythonInterp 2.7 REQUIRED) but that still found the 3.2 version and only commented that 2.7 was required. Let me know if I can provide further information. Cheers, Yngve Hi, I did not receive any response to my mail. Here is the solution which was the best I could come up with: First, I made a copy of each of the python scripts and gave them new names with _py3 at the end. I converted those to python 3 syntax (2to3 helps you quite a bit to get started). Then I added the following in my cmake script: if(PYTHON_VERSION_MAJOR) if(${PYTHON_VERSION_MAJOR} EQUAL 3) set(PYSCRPT_END _py3) endif() endif() Finally I added ${PYSCRPT_END} to all python script names where they occured in the cmake scripts. That way cmake chooses the correct scripts automatically, which is a good enough solution for me. I would say though, I'd recommend that you create a way to require python 2. It isn't as easy for everyone to rewrite their code, some needed libraries might be missing. It is stupid if cmake cannot be used on systems where both python 2 and python 3 are installed for this rather simple reason. Cheers, Yngve -- 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] Problems with FindPythonInterp
Onsdag 12 oktober 2011 skrev Campbell Barton: On Tue, Oct 11, 2011 at 10:50 PM, Yngve Inntjore Levinsen yngve.levin...@gmail.com wrote: Fredag 07 oktober 2011 skrev Yngve Inntjore Levinsen: Dear all, I have some configuration scripts in python that needs to be run for my project, so I use the FindPythonInterp package. This has nicely found the version 2.7 on my system so far, but now it suddenly finds /usr/bin/python which is a soft link to version 3.2. My script doesn't work with python 3. First: Is it possible to set a requirement that it should be python version 2? Second: This for some weird reason only happens on my desktop, even though I have pretty much exactly the same setup on my laptop. On my laptop it finds /usr/bin/python2.7 (as it always has). They both have the same python versions installed (2.7 and 3.2), and they both have the same cmake version installed (2.8.6). I am running Arch Linux. On my laptop: -- Found PythonInterp: /usr/bin/python2.7 On my desktop: -- Found PythonInterp: /usr/bin/python (found version 3.2.2) I'm sure there must be some differences in what's installed on the two systems, but I cannot figure out what. I tried find_package(PythonInterp 2.7 REQUIRED) but that still found the 3.2 version and only commented that 2.7 was required. Let me know if I can provide further information. Cheers, Yngve Hi, I did not receive any response to my mail. Here is the solution which was the best I could come up with: First, I made a copy of each of the python scripts and gave them new names with _py3 at the end. I converted those to python 3 syntax (2to3 helps you quite a bit to get started). Then I added the following in my cmake script: if(PYTHON_VERSION_MAJOR) if(${PYTHON_VERSION_MAJOR} EQUAL 3) set(PYSCRPT_END _py3) endif() endif() Finally I added ${PYSCRPT_END} to all python script names where they occured in the cmake scripts. That way cmake chooses the correct scripts automatically, which is a good enough solution for me. I would say though, I'd recommend that you create a way to require python 2. It isn't as easy for everyone to rewrite their code, some needed libraries might be missing. It is stupid if cmake cannot be used on systems where both python 2 and python 3 are installed for this rather simple reason. Cheers, Yngve -- 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 Proper python3 support (which allows selecting python2 also), is not trivial I think because it needs to support ABI flags for 3.2+, and no ABI flags for previous versions (cant recall which version exactly API flags were added). Since CMake currently only supports python2.x some quick fix not to select python binary which is version 3.x should be pretty easy. On a similar topic, I maintain a py3.x find module which supports ABI flags, perhaps helpful for updating CMake's support for py3: https://svn.blender.org/svnroot/bf- blender/trunk/blender/build_files/cmake/Modules/FindPythonLibsUnix.cmake Hi, I am using the FindPythonInterp module (though both are relevant). Before 2.8.6 that module only found python 2, even if /usr/bin/python was python 3 as it is on my system. Something similar to Qt I suppose would be a decent solution, where you have FindQt, FindQt3 and FindQt4. As for the difference between my laptop and desktop by the way, I figured it out. I had installed a git version at some point on my laptop. They reported to be the same cmake version, which is why I didn't notice at first. Cheers, Yngve -- 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] Problems with FindPythonInterp
Dear all, I have some configuration scripts in python that needs to be run for my project, so I use the FindPythonInterp package. This has nicely found the version 2.7 on my system so far, but now it suddenly finds /usr/bin/python which is a soft link to version 3.2. My script doesn't work with python 3. First: Is it possible to set a requirement that it should be python version 2? Second: This for some weird reason only happens on my desktop, even though I have pretty much exactly the same setup on my laptop. On my laptop it finds /usr/bin/python2.7 (as it always has). They both have the same python versions installed (2.7 and 3.2), and they both have the same cmake version installed (2.8.6). I am running Arch Linux. On my laptop: -- Found PythonInterp: /usr/bin/python2.7 On my desktop: -- Found PythonInterp: /usr/bin/python (found version 3.2.2) I'm sure there must be some differences in what's installed on the two systems, but I cannot figure out what. I tried find_package(PythonInterp 2.7 REQUIRED) but that still found the 3.2 version and only commented that 2.7 was required. Let me know if I can provide further information. Cheers, Yngve -- 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] cdash e-mail configuration
Dear all, I feel a bit ignorant for asking this, but how do I get cdash to send e-mails? In the installation instructions it only states how to change default sent- from and reply-to addresses, but what do I need to actually configure on the server? My server is not sending out anything :( Thanks in advance for any suggestions! Cheers, Yngve ___ 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] server paths on windows
Dear developers, I believe I *potentially* have found a problem with cmake on windows. I had my project path starting with \\my.url\dfs\bla\bla\project, and when I tried to generate MinGW makefiles I got errors telling me that the compilers were broken. I moved my project to D:\bla\My Documents\project, and the generation went fine. I suspect that \\ was replaced by single \, hence using an invalid path. I could also be simply wrong, I am completely lost in a non-unix environment (it took me an hour to understand there actually is something called PATH on Windows as well..). Please ask if any information is needed. I am using CMake 2.8.5 I believe (definitely 2.8). Things are a bit confusing for me since I am not used to Windows, and this is a remote desktop. I believe it is XP 32 bit. Actually, now I'm lost again. I moved my project folder one level down from My Documents, and then I got the same errors. The full path was then D:\Profiles\username\project\, with a build folder inside. I post this mail anyway in case it is useful for any debugging purposes. Add My Documents between username and project, and it works. Best Regards, Yngve ___ 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] problem with CMAKE_FIND_LIBRARY_SUFFIXES/FindBLAS/BLA_STATIC
Tirsdag 05 juli 2011 16.25.49 skrev Yngve Inntjore Levinsen : Dear developers, I am having what looks like a problem with library suffixes which I am not able to figure out. Essentially, our project has an option which when turned on adds a -static to the compiler flags. This then obviously need any libraries to be static if one should use them. I then wanted to link against BLAS/LAPACK, but need to require that the suffix is e.g. .a when on a linux system. First I tried to set the BLA_STATIC. However, it seems that even though I have a libblas.a in my /usr/lib/, it does not find it. It should be noted that libblas.a is a symbolic link to libgoto2.a which is another symbolic link to libgoto2_penrynp-r1.13.a. Unsure if this causes any problems (?). Another user reported that instead of failing to find the libraries, it just went on using the dynamic libraries which he had on his system. Looking at how BLA_STATIC is defined, that makes sense if he didn't have the libblas.a in his system. Linking then failed obviously. I figured in our case it would be better to just set the CMAKE_FIND_LIBRARY_SUFFIXES ourselves, instead of using BLA_STATIC. However, I still have the problem that it does not find my libblas.a file. Anyone knows what I am doing wrong? I am using cmake version 2.8.4, and he is using Debian Sid (unsure which version of cmake, but I can check if it is important). Cheers, Yngve Dear all, I found the problem finally. What I did was mixing strings and lists (as I understand it), so I set the CMAKE_FIND_LIBRARY_SUFFIXES in this manner: set(CMAKE_FIND_LIBRARY_SUFFIXES .a) That did not work. Difficult for you to know that was what I did in any case, sorry for not adding that info in the first mail. Removing the , and then it worked: set(CMAKE_FIND_LIBRARY_SUFFIXES .a) In FindBLAS.cmake I find the following: if(BLA_STATIC) set(CMAKE_FIND_LIBRARY_SUFFIXES .a;.so) endif(BLA_STATIC) I believe the second line should be set(CMAKE_FIND_LIBRARY_SUFFIXES .a .so) instead? (same fix goes for APPLE/WIN32 part) Or is there some other difference between lists and strings which I am unable to comprehend? Cheers, Yngve ___ 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] problem with CMAKE_FIND_LIBRARY_SUFFIXES/FindBLAS/BLA_STATIC
Dear developers, I am having what looks like a problem with library suffixes which I am not able to figure out. Essentially, our project has an option which when turned on adds a -static to the compiler flags. This then obviously need any libraries to be static if one should use them. I then wanted to link against BLAS/LAPACK, but need to require that the suffix is e.g. .a when on a linux system. First I tried to set the BLA_STATIC. However, it seems that even though I have a libblas.a in my /usr/lib/, it does not find it. It should be noted that libblas.a is a symbolic link to libgoto2.a which is another symbolic link to libgoto2_penrynp-r1.13.a. Unsure if this causes any problems (?). Another user reported that instead of failing to find the libraries, it just went on using the dynamic libraries which he had on his system. Looking at how BLA_STATIC is defined, that makes sense if he didn't have the libblas.a in his system. Linking then failed obviously. I figured in our case it would be better to just set the CMAKE_FIND_LIBRARY_SUFFIXES ourselves, instead of using BLA_STATIC. However, I still have the problem that it does not find my libblas.a file. Anyone knows what I am doing wrong? I am using cmake version 2.8.4, and he is using Debian Sid (unsure which version of cmake, but I can check if it is important). Cheers, Yngve ___ 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 ] Specify linker for a mixed language Fortran/C++ application (linux)
Tirsdag 28 juni 2011 18.52.48 skrev Raphael Muenster : Yep, great) setting the LINKER_LANGUAGE to Fortran did it. Thanks, Raphael Am 28.06.2011 15:48, schrieb Brad King: On 06/27/2011 02:39 PM, Raphael Münster wrote: # name of the project PROJECT(Q2P1) enable_language (Fortran) Languages can also be specified in the project command: project(Q2P1 C CXX Fortran) I invoke cmake like this CC=mpicc CXX=mpic++ cmake -DCMAKE_Fortran_COMPILER=mpif90 FYI, you can use CC=mpicc CXX=mpic++ FC=mpif90 cmake ... and you do not need to set CMAKE_Fortran_COMPILER at all in the cmake code. So the question is how can I tell cmake to use mpif90 to link the program? Set the LINKER_LANGUAGE target property: http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:LINKER_LANGUAGE with code like set_property(TARGET Q2P1 PROPERTY LINKER_LANGUAGE Fortran) -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 ___ 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 Just as a side-note, mpif90 is a wrapper compiler for mpi right? Have a look at this thread, which discusses the recommended way to compile MPI code with cmake: http://www.cmake.org/pipermail/cmake/2011-June/045032.html My preferred way is also to specify in the project() command which languages are used. That way if you have a pure fortran project cmake doesn't test your c/c++ compiler etc. Cheers, Yngve ___ 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] set custom linker in linux
Ah, that's a different problem. I believe you need to write a specific toolchain file in your case, since your compiler creates binaries which does not work on your own platform (?). See e.g. here: http://www.cmake.org/pipermail/cmake/2008-July/022868.html Others might want to correct me if I'm wrong.. Cheers, Yngve Fredag 24 juni 2011 09.51.14 skrev gekso : Doesn't work.. What I have is: # export CC=i686-android-linux-gcc # export CXX=i686-android-linux-gcc skipped long paths to compiler The C compiler i686-android-linux-gcc is not able to compile a simple test program. It fails with the following output: Change Dir: .../CMakeFiles/CMakeTmp Run Build Command:/usr/bin/make cmTryCompileExec/fast /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build make[1]: Entering directory `CMakeFiles/CMakeTmp' /cmake-2.8.4/bin/cmake -E cmake_progress_report /CMakeFiles/CMakeTmp/CMakeFiles 1 Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o .../i686-android-linux-gcc -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c.../CMakeFiles/CMakeTmp/testCCompiler.c Linking C executable cmTryCompileExec /cmake-2.8.4/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1 .../i686-android-linux-gcc CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o cmTryCompileExec -rdynamic .../i686-android-linux-4.4.3/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld: crt1.o: No such file: No such file or directory collect2: ld returned 1 exit status May be I can add -lc to linker command line? 2011/6/23 Yngve Inntjore Levinsen yngve.levin...@gmail.com: Torsdag 23 juni 2011 13.34.24 skrev gekso : Hello! Please, help to to set custom linker. I use gcc1/g++1 instead of basic gcc/g++ on system. I've tried to export CC/CXX, but I need to change linker from ld to g++1. Is it possible? ___ 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 Hi, Try: set(CMAKE_LINKER g++1) I think it should work (or something similar), but haven't tested.. Cheers, Yngve ___ 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] set custom linker in linux
Torsdag 23 juni 2011 13.34.24 skrev gekso : Hello! Please, help to to set custom linker. I use gcc1/g++1 instead of basic gcc/g++ on system. I've tried to export CC/CXX, but I need to change linker from ld to g++1. Is it possible? ___ 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 Hi, Try: set(CMAKE_LINKER g++1) I think it should work (or something similar), but haven't tested.. Cheers, Yngve ___ 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] simple cdash script
Dear developers, I am sure this has been answered before, but I cannot find the information. I apologize in advance for my ignorance. I have set up our project with cmake/ctest, and have a cdash server running. I have configured everything so that if I run in the source directory mkdir build;cd build;cmake ..;make Experimental then I get a submitted report in the Experimental category on the cdash server. Now, what I note here is that I do not get the configuration part included as a part of the report (it does run cmake a second time, but that only runs the update part), and I do not get the svn update (?). What I am looking for is a simple script that includes those two as well. In principle it should just need to explain ctest where the svn repository path is, and then tell it to run cmake+make+ctest for that project in a specified temporary folder. Everything else is set up in CMakeLists.txt and CTestConfig.cmake (including information about cdash server location++). The examples I've come across have been significantly more complex and I am a bit confused about what should be configured where clearly. Thank you very much for your help! Best Regards, Yngve I. Levinsen ___ 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] piping commands to executable
Dear developers, I have a bit of an issue with ctest. In our project we usually generate a binary which we pipe in scripts with the commands we want to execute (some defined parser language). Now at first I would have liked to do something like ADD_TEST(testsample executable script.txt) ADD_TEST(testsample executable script.txt) or perhaps ADD_TEST(testsample executable script.txt) The first one fails because executable script.txt is not found anywhere. The second and third just hangs (the executable will enter interactive mode if it does not get anything piped in, much like how python behaves). I solved this before by adding tests which were executing a simple bash script, where the command executable script.txt was added. This works, but then when I want to do memory checks etc, that will not work since the memory check is done on the bash script and not the actual process (or so it seems to me). Is there any clever solution on how to pipe commands into an interpreter. As an example, you could show me how to do this test perhaps: echo 'print hello' | python I apologize if I am using wrong terms or if this is easily found in the documentation. My understanding of piping in and out and right and left is slightly limited... Thanks, Yngve ___ 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] cdash build name
Dear developers, I apologize if this has been answered before. I have just set up CDash and I noticed that the build name in the report is typically Linux-c++ or similar. Now for our project Fortran is the main language, and we want to test on many different compilers. Hence I would prefer it stated Linux-ifort, Linux-gfortran and so on. I tried the following in CTestConfig.cmake: find_program(UNAME NAMES uname) macro(getuname name flag) exec_program(${UNAME} ARGS ${flag} OUTPUT_VARIABLE ${name}) endmacro(getuname) getuname(osname -s) # getuname(osrel -r) getuname(cpu-m) set(CTEST_BUILD_NAME ${osname}-${cpu}-prod) message(CTEST name: ${CTEST_BUILD_NAME}) When configuring the message shows the build name I would like to have (or, I would understand how to modify it to my liking), but on the CDash web page it still states Linux-c++. Anyone knows a solution/what I am doing wrong? When I click on the report it also states that the compiler name is /usr/bin/c++ and unknown version. Ideally I would also like this information to change to the fortran compiler information. Thanks for your help! Best Regards, Yngve ___ 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] cdash build name
First off, thanks for an abnormally quick reply! :) On Tuesday 17 May 2011 14.01.00 Rolf Eike Beer wrote: Yngve Inntjore Levinsen wrote: set(CTEST_BUILD_NAME ${osname}-${cpu}-prod) message(CTEST name: ${CTEST_BUILD_NAME}) When configuring the message shows the build name I would like to have (or, I would understand how to modify it to my liking), but on the CDash web page it still states Linux-c++. You must set the build name before including the CTest modules. Aha, did not know that. Tried and now it works very well (using BUILDNAME and not CTEST_BUILD_NAME), thanks a bunch! Anyone knows a solution/what I am doing wrong? When I click on the report it also states that the compiler name is /usr/bin/c++ and unknown version. Ideally I would also like this information to change to the fortran compiler information. The compiler version is always unknown as this information is not transferred (properly) in the XML to CDash. See http://www.cmake.org/Bug/view.php?id=7867 Oh well then we just have to wait for the bug to be fixed I guess... Eike Eike Best Regards, Yngve ___ 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] osx 10.6 10.5 compability issue
Dear all, I have compiled my code in OSX Snow Leopard, and then a colleague using OSX Leopard wanted to use the bundle. However, he had some strange error saying something like: dyld error: unknown required load command (sorry I don't have the exact error print at hand) I tried to google it and it looks like it is some kind of incompatibility with the dylibs between the two OS versions. Is there some flag I can set in CMakeLists.txt so that I compile a compatible version which will work on OSX Leopard as well? Or do you have another solution? Please ask any questions if something is unclear! I apologize if this has been answered before, but I couldn't find it. Best Regards, Yngve I. Levinsen ___ 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] osx 10.6 10.5 compability issue
Hi Michael, I notice you know a lot about CMake and OSX, thanks once again! I'll give it a try asap. Cheers, Yngve On Thursday 28 April 2011 06:04:18 PM Michael Jackson wrote: You probably want to set the CMAKE_OSX_DEPLOYMENT_TARGET to 10.5 and recompile. ___ Mike Jackson www.bluequartz.net Principal Software Engineer mike.jack...@bluequartz.net BlueQuartz Software Dayton, Ohio On Apr 28, 2011, at 11:58 AM, Yngve Inntjore Levinsen wrote: Dear all, I have compiled my code in OSX Snow Leopard, and then a colleague using OSX Leopard wanted to use the bundle. However, he had some strange error saying something like: dyld error: unknown required load command (sorry I don't have the exact error print at hand) I tried to google it and it looks like it is some kind of incompatibility with the dylibs between the two OS versions. Is there some flag I can set in CMakeLists.txt so that I compile a compatible version which will work on OSX Leopard as well? Or do you have another solution? Please ask any questions if something is unclear! I apologize if this has been answered before, but I couldn't find it. Best Regards, Yngve I. Levinsen ___ 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] cpack 32bit rpm on a 64bit system
Dear Eric, I have tried again a few times without success, and tried with the version 2.8.4 that you provided. Since this didn't succeed I figured I should test with a helloworld binary and see how that goes. Of course it works just fine, even with the 2.6 series installed on the server. The CMakeLists.txt is below for those interested. I will send a new e-mail if I figure out that there is some issues with the packaging, but for now we close the case. I'd say it is about 99% sure I am doing something wrong ;) By the way, in this script I did not specify i686 or x86_64, will it then default to the latter or does it check the binary format to some extent? Thanks for your efforts! Cheers, Yngve cmake_minimum_required (VERSION 2.6) project (hello Fortran) set (CMAKE_Fortran_FLAGS ${CMAKE_Fortran_FLAGS} -m32) set (CMAKE_Fortran_LINK_FLAGS ${CMAKE_Fortran_LINK_FLAGS} -static ) add_executable(hello hello.F90) INSTALL(TARGETS hello BUNDLE DESTINATION . RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) set (CPACK_RPM_PACKAGE_RELEASE 1) set (CPACK_RPM_PACKAGE_LICENSE custom) set (CPACK_RPM_PACKAGE_GROUP Development/Tools) include (CPack) On Wednesday 16 February 2011 02:01:28 PM Eric Noulard wrote: 2011/2/16 Yngve Inntjore Levinsen yngve.levin...@gmail.com: The server OS is quite conservative when it comes to new packages, so I already had to go into a fight to get 2.6 series installed. I do not think that is possible system-wide but I am of course able to compile cmake myself and put it on my own share. I understand. You may try 2.8.3 (or even todays 2.8.4) without compiling it by taking precompiled one: http://www.cmake.org/files/v2.8/cmake-2.8.3-Linux-i386.tar.gz or http://www.cmake.org/files/v2.8/cmake-2.8.4-Linux-i386.tar.gz Untar them somewhere in your directory. Then invoke the installed CMake. I propose you let me know how to do it with 2.8.3 and I do that workaround. I'm not sure it will work with CMake 2.8.3 but it would easier for me to fix it in the maintained 2.8.x branch than trying to fix the unmaintained 2.6.4. Normally set(CPACK_RPM_PACKAGE_ARCHITECTURE i686) should be enough. If it is not try: $ setarch i686 $ cpack -G RPM this last method may work with CMake 2.6.4 too. I can put a feature request to upgrade cmake. I forgot to answer one of your questions, I build 32bit with the -m32 flag, that is correct. ___ 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] cpack 32bit rpm on a 64bit system
Dear Eric, So I answered my own question perhaps, the very issue was in fact that I set CPACK_RPM_PACKAGE_ARCHITECTURE to i686 when I tried to build. Commenting out that part and the packaging worked. Two questions: - Will this package now be installable on both 32 and 64bit systems? If not, can I get it to be installable on both architectures somehow? - Why shouldn't I set the variable? Cheers, Yngve On Thursday 17 February 2011 11:35:40 AM Yngve Inntjore Levinsen wrote: Dear Eric, I have tried again a few times without success, and tried with the version 2.8.4 that you provided. Since this didn't succeed I figured I should test with a helloworld binary and see how that goes. Of course it works just fine, even with the 2.6 series installed on the server. The CMakeLists.txt is below for those interested. I will send a new e-mail if I figure out that there is some issues with the packaging, but for now we close the case. I'd say it is about 99% sure I am doing something wrong ;) By the way, in this script I did not specify i686 or x86_64, will it then default to the latter or does it check the binary format to some extent? Thanks for your efforts! Cheers, Yngve cmake_minimum_required (VERSION 2.6) project (hello Fortran) set (CMAKE_Fortran_FLAGS ${CMAKE_Fortran_FLAGS} -m32) set (CMAKE_Fortran_LINK_FLAGS ${CMAKE_Fortran_LINK_FLAGS} -static ) add_executable(hello hello.F90) INSTALL(TARGETS hello BUNDLE DESTINATION . RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) set (CPACK_RPM_PACKAGE_RELEASE 1) set (CPACK_RPM_PACKAGE_LICENSE custom) set (CPACK_RPM_PACKAGE_GROUP Development/Tools) include (CPack) On Wednesday 16 February 2011 02:01:28 PM Eric Noulard wrote: 2011/2/16 Yngve Inntjore Levinsen yngve.levin...@gmail.com: The server OS is quite conservative when it comes to new packages, so I already had to go into a fight to get 2.6 series installed. I do not think that is possible system-wide but I am of course able to compile cmake myself and put it on my own share. I understand. You may try 2.8.3 (or even todays 2.8.4) without compiling it by taking precompiled one: http://www.cmake.org/files/v2.8/cmake-2.8.3-Linux-i386.tar.gz or http://www.cmake.org/files/v2.8/cmake-2.8.4-Linux-i386.tar.gz Untar them somewhere in your directory. Then invoke the installed CMake. I propose you let me know how to do it with 2.8.3 and I do that workaround. I'm not sure it will work with CMake 2.8.3 but it would easier for me to fix it in the maintained 2.8.x branch than trying to fix the unmaintained 2.6.4. Normally set(CPACK_RPM_PACKAGE_ARCHITECTURE i686) should be enough. If it is not try: $ setarch i686 $ cpack -G RPM this last method may work with CMake 2.6.4 too. I can put a feature request to upgrade cmake. I forgot to answer one of your questions, I build 32bit with the -m32 flag, that is correct. ___ 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] cpack 32bit rpm on a 64bit system
Dear Eric, First, thank you for a very quick reply! The log you requested is attached. The rpmbuild.out file is empty, and the rpmbuild.err has one line which states: error: No compatible architectures found for build I am using cmake/cpack version 2.6-patch 4. I have rpmbuild version 4.4.2.3. Why I am doing it? I suppose it is a rather weird request, but I want to build a 32bit binary on my 64bit server and distribute the program to many people that still use a 32bit machine. In order to have maximum compability, it has been decided that we should provide a statically linked 32bit executable. It is not necessary to provide this in an rpm of course, but it would be nice if it was possible. Thank you for your help! Cheers, Yngve On Tuesday 15 February 2011 08:10:23 PM Eric Noulard wrote: 2011/2/15 Yngve Inntjore Levinsen yngve.levin...@gmail.com: Dear CMakers, I am trying to package a 32bit binary on a 64bit system. It breaks with the (useless?) verbose output which follows below. What I could find of useful information was in _CPack_Packages/Linux/RPM/rpmbuild.err, which stated error: No compatible architectures found for build Which version of CMake/CPack ? I tried to set CPACK_RPM_PACKAGE_ARCHITECTURE and CPACK_PACKAGE_ARCHITECTURE to i686, but that didn't do much. I found that e.g. the TGZ generator works just fine, so I suppose it is something with the RPM generator, but I am not clever enough to figure out what... Can anyone help? Could you send me the log obtained with: cpack -V -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM and send me the advertised rpmbuild.err, rpmbuild.out, yourpackageName.spec files? Some more questions: What is your linux distribution ? How did you build the 32bits binaries with CMake (? add -m32 using CFLAGS?) ? RPM packaging of 32bits apps on 64bits may not be portable at all, why are you trying to do that ? cpack -V -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM CPack: Enable Verbse CPack Verbose: Read CPack config file: CPack Verbose: Read CPack configuration file: /path/to/build/CPackConfig.cmake CPack Verbose: Specified generator: RPM CPack Verbose: Use generator: cmCPackRPMGenerator CPack Verbose: For project: madX CPack: Create package using RPM CPack Verbose: Read description file: /usr/share/cmake/Templates/CPack.GenericDescription.txt CPack Verbose: Remove toplevel directory: /path/to/build/_CPack_Packages/Linux/RPM CPack: Install projects CPack: - Run preinstall target for: madX CPack: - Install project: madX CPack Verbose: Install configuration: Release CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/bin/madx_dev CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/lib/libmadx.a CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/c6t.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/madxdict.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/madxl.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/matchptcknobs.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/tpsa.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/madxd.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/madx.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/madxreg.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/rplot.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/c_wrappers.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/c_wrappers_prototypes.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/c_prototypes.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/fortran_prototypes.h CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/fortran_wrappers.h CPack: Compress package CPack Verbose: Compress files to: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux.rpm CPackRPM:Debug: using user-specified build arch = i686 CPackRPM:Debug: User defined Requires: libgcc = 4.1.0, libxau = 1.0.5 CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = /path/to/build/_CPack_Packages/Linux/RPM CPackRPM:Debug: CPACK_TOPLEVEL_TAG= Linux CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY = /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux CPackRPM:Debug
Re: [CMake] cpack 32bit rpm on a 64bit system
On Wednesday 16 February 2011 11:31:47 AM Eric Noulard wrote: 2011/2/16 Yngve Inntjore Levinsen yngve.levin...@gmail.com: Dear Eric, First, thank you for a very quick reply! The log you requested is attached. The rpmbuild.out file is empty, and the rpmbuild.err has one line which states: error: No compatible architectures found for build I am using cmake/cpack version 2.6-patch 4. I have rpmbuild version 4.4.2.3. CMake 2.6.4 is ancient...and the 2.6.x branch has been stopped. Would you be able to try 2.8.3 see http://www.cmake.org/files/v2.8/ ? Why I am doing it? I suppose it is a rather weird request, but I want to build a 32bit binary on my 64bit server and distribute the program to many people that still use a 32bit machine. In order to have maximum compability, it has been decided that we should provide a statically linked 32bit executable. It is not necessary to provide this in an rpm of course, but it would be nice if it was possible. It should be, and it should work because you build static. I do not remember the state of CPack RPM in 2.6.4 so I have to dig it out in order to see how you can enforce the appropriate arch. Before I do that, could you tell me if you can afford to use CMake 2.8.3 ? The server OS is quite conservative when it comes to new packages, so I already had to go into a fight to get 2.6 series installed. I do not think that is possible system-wide but I am of course able to compile cmake myself and put it on my own share. I propose you let me know how to do it with 2.8.3 and I do that workaround. I can put a feature request to upgrade cmake. I forgot to answer one of your questions, I build 32bit with the -m32 flag, that is correct. Cheers, Yngve ___ 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] cpack 32bit rpm on a 64bit system
Dear CMakers, I am trying to package a 32bit binary on a 64bit system. It breaks with the (useless?) verbose output which follows below. What I could find of useful information was in _CPack_Packages/Linux/RPM/rpmbuild.err, which stated error: No compatible architectures found for build I tried to set CPACK_RPM_PACKAGE_ARCHITECTURE and CPACK_PACKAGE_ARCHITECTURE to i686, but that didn't do much. I found that e.g. the TGZ generator works just fine, so I suppose it is something with the RPM generator, but I am not clever enough to figure out what... Can anyone help? Cheers and thanks, Yngve cpack -V -G RPM CPack: Enable Verbse CPack Verbose: Read CPack config file: CPack Verbose: Read CPack configuration file: /path/to/build/CPackConfig.cmake CPack Verbose: Specified generator: RPM CPack Verbose: Use generator: cmCPackRPMGenerator CPack Verbose: For project: madX CPack: Create package using RPM CPack Verbose: Read description file: /usr/share/cmake/Templates/CPack.GenericDescription.txt CPack Verbose: Remove toplevel directory: /path/to/build/_CPack_Packages/Linux/RPM CPack: Install projects CPack: - Run preinstall target for: madX CPack: - Install project: madX CPack Verbose: Install configuration: Release CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/bin/madx_dev CPack Verbose: Installing: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux/usr/include/madX/fortran_wrappers.h CPack: Compress package CPack Verbose: Compress files to: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux.rpm CPack: Finalize package CPack Verbose: Copy final package: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux.rpm to /path/to/build/madX-4.01.45-Linux.rpm CPack Error: Problem copying the package: /path/to/build/_CPack_Packages/Linux/RPM/madX-4.01.45-Linux.rpm to /path/to/build/madX-4.01.45-Linux.rpm CPack Error: Error when generating package: madX ___ 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] Detecting 32/64 bit systems
I have done the same thing myself, using size of INT instead of P which is of course following the exact same logic. After attempting several strategies I found this one to be the safest way to detect 32/64bit systems, so I recommend using SIZEOF as well. Cheers, Yngve On Sunday 13 February 2011 08:00:41 PM Ryan Pavlik wrote: Yep CMAKE_SIZEOF_VOID_P will be 4 if you've chosen a generator like Visual Studio 9.0 2008, and 8 if you've chosen Visual Studio 9.0 2008 Win64 Ryan On Sat, Feb 12, 2011 at 11:41 AM, Dominik Szczerba domi...@itis.ethz.chwrote: Quite right. So you claim that on Windows CMAKE_SIZEOF_VOID will tell me the *target* build system, not the physical one, while it will mach CMAKE_SYSTEM_PROCESSOR if the both are the same? Many thanks for the clarification. Dominik On Sat, Feb 12, 2011 at 6:34 PM, Ryan Pavlik rpav...@iastate.edu wrote: CMAKE_SIZEOF_VOID_P will tell you the difference between target bit-widths: 8 (for 64 bit) vs 4 (for 32 bit) - remember that just because you're running on a 64-bit system doesn't mean you're compiling a 64-bit binary. Ryan On Sat, Feb 12, 2011 at 11:29 AM, Dominik Szczerba domi...@itis.ethz.ch wrote: OK, got it experimentally. You have CMAKE_SYSTEM_PROCESSOR But wait, is the description below correct? http://www.cmake.org/Wiki/CMake_Useful_Variables Opposed to the explanations there, which I saw, but took as not what I need, on my systems it amounts to i686 and x86_64, exactly what I need. Dominik On Sat, Feb 12, 2011 at 6:19 PM, Dominik Szczerba domi...@itis.ethz.ch wrote: Hi, I can't really find a clear solution in google: how would one go about detecting if the system is 32 or 64 bit? There are UNIX, WIN32 etc. flags, but nothing really for the architecture. Thanks a lot, Dominik ___ 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 -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com Internal VRAC/HCI Site: http://tinyurl.com/rpavlik ___ 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] linking static vs dynamic
If you want everything linked statically I believe you can use the variable, BUILD_SHARED_LIBS, something like OPTION( BUILD_SHARED_LIBS Set to OFF to build static libraries OFF ) I do believe it will still use dynamic libraries if static aren't available, but I am unsure about that part. Cheers, Yngve On Sunday 13 February 2011 12:08:58 AM Dominik Szczerba wrote: Yes, full paths seem to work fine for me. Many thanks for your feedback! Dominik On Sat, Feb 12, 2011 at 11:11 PM, Michael Hertling mhertl...@online.de wrote: On 02/12/2011 09:39 PM, Andreas Pakulat wrote: On 12.02.11 21:20:58, Dominik Szczerba wrote: I never actually saw a solution to this problem in cmake: I need to link (independent constraint from above) with libguide.a and not libguide.so (in intel compiler, does not matter much), but both are available, and cmake always takes the shared one when given guide as the desired library to be linked. Is there an elegant way of static linking (other than -static passed to the linker for static linking of everything) of this particular lib other than hacking (like deleting the .so from the folder)? No, i.e. no elegant way. What you can do is force cmake to search only for .a files by setting a cmake variable, unfortunately I don't remember which one and can't easily find it right now. The archive of this list has more info as well as the cmake manual or the FAQ on the cmake website. Andreas Hi Dominik, it's CMAKE_FIND_LIBRARY_SUFFIXES; setting it to .a on *nix makes FIND_LIBRARY() search for static libraries only. It can be set to its original value at any time to restore the previous behaviour. However, if you know that you're looking exactly for libguide.a and have control over the FIND_LIBRARY() call, i.e. it's not buried in a find module or config file, you should follow Alexander's advice, use the library's full name in FIND_LIBRARY() and pass the latter's result to TARGET_LINK_LIBRARIES(). 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 ___ 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] Detecting 32/64 bit systems
Sorry, I meant LONG actually, I was a bit tired when I wrote the mail. Perhaps I should change to VOID instead, thanks for the tip. This was my previous code: INCLUDE(CheckTypeSize) CHECK_TYPE_SIZE (long LONG_SIZE) #4 if 32bit, 8 if 64bit... I don't actually build for Windows yet, so I suppose that is why I didn't notice the potential problem... Cheers, Yngve On Monday 14 February 2011 10:35:26 AM Rolf Eike Beer wrote: I have done the same thing myself, using size of INT instead of P which is of course following the exact same logic. After attempting several strategies I found this one to be the safest way to detect 32/64bit systems, so I recommend using SIZEOF as well. sizeof(int) is 4 on basically all systems I have ever seen (ignoring those 16bit machines of 286 areas or things like that) so this test is basically useless. Also testing for sizeof(long) will get you into trouble as this 8 for Un*x64 but 4 for Win64. The best way is usually sizeof(void*) even if there are programming model where you would get a 32 bit pointer even in a 64 bit executable but those have to be explicitely enabled and are barely ever used from my experience. 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] CMake without C/C++ tests
I was quite sure that you need your project to use at least one language, but that it does not need to be C/C++. If you have issues with the internal test then a special TOOLCHAIN file is the way to go. I had to do this for a special fortran compiler that only built 32bit packages on a 64bit system. If memory servers me well you just need to put INCLUDE(CMakeForceCompiler) in your toolchain file. Cheers, Yngve On Monday, January 31, 2011 11:59:11 AM Дима wrote: So, I put the line project (astl NONE) in CmakeLists.txt But it does not work, i got these messages $ cmake -DCMAKE_TOOLCHAIN_FILE=/home/Void/devel/svnroot/trunk/gcc/libstdc++-v3/astl/ToolchainFile.cmake /home/Void/devel/svnroot/trunk/gcc/libstdc++-v3/astl/ -- Configuring done CMake Error: Cannot determine link language for target astl. CMake Error: CMake can not determine linker language for target:astl -- Generating done -- Build files have been written to: /home/Void/devel/svnroot/trunk/gcc/libstdc++-v3/astl void@Impedance-Pad-T410:/home/Void/devel/build-astl$ Then i googled this http://www.cmake.org/pipermail/cmake/2006-July/010380.html and add SET_TARGET_PROPERTIES(astl PROPERTIES LINKER_LANGUAGE CXX) to CMakeLists.txt And got these CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKE_CXX_CREATE_STATIC_LIBRARY After it I add SET(CMAKE_CXX_CREATE_STATIC_LIBRARY CMAKE_CXX_COMPILER -o TARGET OBJECTS) in my CmakeLists.txt And finally, after cmake command, i got these void@Impedance-Pad-T410:/home/Void/devel/build-astl$ make Scanning dependencies of target astl Linking CXX static library libastl.a Error running link command: No such file or directory make[2]: *** [libastl.a] Error 2 make[1]: *** [CMakeFiles/astl.dir/all] Error 2 make: *** [all] Error 2 void@Impedance-Pad-T410:/home/Void/devel/build-astl$ Also, i can not compile project with standard gcc due to project (astl NONE) So, how can I remove -rdynamic option? Is it possible? 28.01.2011, 20:20, Eric Noulard eric.noul...@gmail.com: 2011/1/28 Дима dima...@yandex.ru;: How can I change or disable C/C++ testing during cmake command? project(YourProject NONE) from the doc; Set a name for the entire project. project(projectname [languageName1 languageName2 ... ] ) Sets the name of the project. Additionally this sets the variables projectName_BINARY_DIR and projectName_SOURCE_DIR to the respective values. Optionally you can specify which languages your project supports. Example languages are CXX (i.e. C++), C, Fortran, etc. By default C and CXX are enabled. E.g. if you do not have a C++ compiler, you can disable the check for it by explicitly listing the languages you want to support, e.g. C. By using the special language NONE all checks for any language can be disabled. PS CMake tries to compile with -rdynamic option, but our port of gcc does not support it yet. Then may be you should set up a specific compiler ID. -- 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] cpack bundle on osx
Thank you so much for your tips and help Michael! My stupid mistake as you can see it below is that I ran the install target command AFTER the fixup_bundle. Hence the app did not exist in its location when the fixup_bundle ran, but when I checked afterwards it all looked as one would expect. Last question, anyone have some tip on how to set up a terminal application in an app bundle? Currently I have to suggest to the user to open the bundle and go to the MacOS folder and click on the binary file there. This is of course a minor issue, but would be nicer if a click on the app bundle itself would have the same behaviour... Something I can set in the plist file perhaps? Cheers Yngve On 1/20/11 9:02 PM, Michael Jackson wrote: There are a lot of different reasons it can fail. I usually end up debugging through the fixup_bundle() code and placing lots of message(STATUS ) commands in order to try and follow what is going on. There are already some through out the cmake code you usually just have to set a cmake variable to 1 to get them to print. You can try posting the complete output from your make install run to try and see what is going on. -- Mike Jacksonwww.bluequartz.net On Jan 20, 2011, at 2:35 PM, Yngve Levinsen wrote: Well I do have a folder structure, which looks like this: $ ls -R madx_dev.app/ Contents madx_dev.app//Contents: Info.plist MacOS Resources madx_dev.app//Contents/MacOS: madx_dev madx_dev.app//Contents/Resources: MadX.icns But it does not seem that the fixup-command does anything for me with the current configuration. Don't get why. On 20 January 2011 15:40, Michael Jacksonmike.jack...@bluequartz.net wrote: If you are creating a command line program then the included fixup_bundle will not work since it looks for a .app folder structure to fix. Instead you probably want to pass in the path to the executable located in ${CMAKE_INSTALL_PREFIX}/bin/MyExecutable to BundleUtilities. Any library located in /usr/lib or System/Library/* will NOT be copied into your bundle/Folder structure as those are considered system libraries and available on every OS X system. -- Mike Jacksonwww.bluequartz.net On Jan 20, 2011, at 6:15 AM, Yngve Inntjore Levinsen wrote: Thank you for your kind reply Michael, it got me some bit further and I think I understand a bit more. I could not see any examples of the usage of the BundleUtilities in CMake, but the example given in the Wiki works as expected on my machine. I forgot to add some significant parts of my CMakeLists.txt file. I have also made some fixes, so the current parts look like this: ... if (APPLE) # So that we get the system X11 libraries if they exist: set(CMAKE_LIBRARY_PATH /usr/lib/ /usr/X11/lib/ ${CMAKE_LIBRARY_PATH}) endif (APPLE) ... if(APPLE) SET(MACOSX_BUNDLE_STARTUP_COMMAND madx${BINARY_POSTFIX}) SET(MACOSX_BUNDLE_ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmakesrc/MadX.icns) SET(MACOSX_BUNDLE_LONG_VERSION_STRING MadX ${BINARY_POSTFIX} version ${madX_MAJOR_VERSION}.${madX_MINOR_VERSION}.${madX_PATCH_LEVEL}) SET(MACOSX_BUNDLE_BUNDLE_NAME MadX${BINARY_POSTFIX}) SET(MACOSX_BUNDLE_GUI_IDENTIFIER MadX${BINARY_POSTFIX}) # add icns to the .app/Resources with these TWO commands: SET(srcfiles ${srcfiles} ${CMAKE_CURRENT_SOURCE_DIR}/cmakesrc/MadX.icns) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/cmakesrc/MadX.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) endif(APPLE) add_executable(madx${BINARY_POSTFIX} MACOSX_BUNDLE ${srcfiles}) SET_TARGET_PROPERTIES(madx${BINARY_POSTFIX} PROPERTIES LINKER_LANGUAGE Fortran) ... FIND_PACKAGE(X11) IF(X11_FOUND) message(Found X11 libraries) INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(madx${BINARY_POSTFIX} ${X11_X11_LIB}) ENDIF(X11_FOUND) ... target_link_libraries(madx${BINARY_POSTFIX} z) target_link_libraries(madx${BINARY_POSTFIX} pthread) target_link_libraries(madx${BINARY_POSTFIX} c) target_link_libraries(madx${BINARY_POSTFIX} gcc_eh) ... if(APPLE) set(APPS \${CMAKE_INSTALL_PREFIX}/madx${BINARY_POSTFIX}.app) # paths to executables set(DIRS ) message(aps: ${APPS}) INSTALL(CODE include(BundleUtilities) message(\aps: ${APPS}\) fixup_bundle(\${APPS}\ \\ \${DIRS}\) COMPONENT Runtime) INSTALL(TARGETS madx${BINARY_POSTFIX} BUNDLE DESTINATION . COMPONENT Runtime RUNTIME DESTINATION bin COMPONENT Runtime ) else(APPLE) INSTALL(TARGETS madx${BINARY_POSTFIX} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) endif(APPLE) ... # so that we can build dragndrop on osx (actually needed?): set(CPACK_BINARY_DRAGNDROP ON) include (CPack) ... What I don't understand is why it does not work on my own project. From what I can see you can actually replace the fixup_bundle() in the example with simply fixup_bundle(\${APPS}\ \\ \\). This still gives the following result when I check the binary with otools: otool -L _CPack_Packages/Darwin/DragNDrop
Re: [CMake] cpack bundle on osx
It is a pure terminal application, so you are probably right. However, the old way to install it was that a user had to first install Fink, then wait a few hours for the correct gcc version to be installed with gfortran, then download the correct version of the executable. Or he/she could download the specific libraries you needed manually and use this install_name_tool to manually relink the libraries. In the end it felt quite complicated for many, every user did something different, and helping people out when they got stuck was a mess. Perhaps I should use some of the other packaging types, like tgz or zip. I will play around with it. At least now I have something that works and is self-contained which was my main goal. Cheers, Yngve On Friday, January 21, 2011 02:16:56 pm Michael Jackson wrote: IS your application a GUI application or an terminal application? If it is really a terminal application then you really should NOT be creating an .app bundle but instead just a plain executable. ___ Mike Jackson www.bluequartz.net Principal Software Engineer mike.jack...@bluequartz.net BlueQuartz Software Dayton, Ohio On Jan 21, 2011, at 5:10 AM, Yngve Inntjore Levinsen wrote: Thank you so much for your tips and help Michael! My stupid mistake as you can see it below is that I ran the install target command AFTER the fixup_bundle. Hence the app did not exist in its location when the fixup_bundle ran, but when I checked afterwards it all looked as one would expect. Last question, anyone have some tip on how to set up a terminal application in an app bundle? Currently I have to suggest to the user to open the bundle and go to the MacOS folder and click on the binary file there. This is of course a minor issue, but would be nicer if a click on the app bundle itself would have the same behaviour... Something I can set in the plist file perhaps? Cheers Yngve On 1/20/11 9:02 PM, Michael Jackson wrote: There are a lot of different reasons it can fail. I usually end up debugging through the fixup_bundle() code and placing lots of message(STATUS ) commands in order to try and follow what is going on. There are already some through out the cmake code you usually just have to set a cmake variable to 1 to get them to print. You can try posting the complete output from your make install run to try and see what is going on. -- Mike Jacksonwww.bluequartz.net On Jan 20, 2011, at 2:35 PM, Yngve Levinsen wrote: Well I do have a folder structure, which looks like this: $ ls -R madx_dev.app/ Contents madx_dev.app//Contents: Info.plist MacOS Resources madx_dev.app//Contents/MacOS: madx_dev madx_dev.app//Contents/Resources: MadX.icns But it does not seem that the fixup-command does anything for me with the current configuration. Don't get why. On 20 January 2011 15:40, Michael Jacksonmike.jack...@bluequartz.net wrote: If you are creating a command line program then the included fixup_bundle will not work since it looks for a .app folder structure to fix. Instead you probably want to pass in the path to the executable located in ${CMAKE_INSTALL_PREFIX}/bin/MyExecutable to BundleUtilities. Any library located in /usr/lib or System/Library/* will NOT be copied into your bundle/Folder structure as those are considered system libraries and available on every OS X system. -- Mike Jacksonwww.bluequartz.net On Jan 20, 2011, at 6:15 AM, Yngve Inntjore Levinsen wrote: Thank you for your kind reply Michael, it got me some bit further and I think I understand a bit more. I could not see any examples of the usage of the BundleUtilities in CMake, but the example given in the Wiki works as expected on my machine. I forgot to add some significant parts of my CMakeLists.txt file. I have also made some fixes, so the current parts look like this: ... if (APPLE) # So that we get the system X11 libraries if they exist: set(CMAKE_LIBRARY_PATH /usr/lib/ /usr/X11/lib/ ${CMAKE_LIBRARY_PATH}) endif (APPLE) ... if(APPLE) SET(MACOSX_BUNDLE_STARTUP_COMMAND madx${BINARY_POSTFIX}) SET(MACOSX_BUNDLE_ICON_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmakesrc/MadX.icns) SET(MACOSX_BUNDLE_LONG_VERSION_STRING MadX ${BINARY_POSTFIX} version ${madX_MAJOR_VERSION}.${madX_MINOR_VERSION}.${madX_PATCH_LEVEL}) SET(MACOSX_BUNDLE_BUNDLE_NAME MadX${BINARY_POSTFIX}) SET(MACOSX_BUNDLE_GUI_IDENTIFIER MadX${BINARY_POSTFIX}) # add icns to the .app/Resources with these TWO commands: SET(srcfiles ${srcfiles} ${CMAKE_CURRENT_SOURCE_DIR}/cmakesrc/MadX.icns) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/cmakesrc/MadX.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) endif(APPLE) add_executable(madx${BINARY_POSTFIX
Re: [CMake] cpack bundle on osx
, current version 1.0.0) In principle the only thing not available in /usr/ is the gfortran library (right), but I guess I should expect that it would copy everything that is linked to a library residing in /opt/local in the same manner as for QtTest. However, the fixup_utilities does not relink any of those libraries. What am I doing wrong? Are there anything you need to set prior to the install(CODE ... command? I have been trying to read through the QtTest example, and I don't see anything that should imply so. I have too many questions at once I suppose, but there is still one more important: My application is a terminal app, so it does not come with a GUI. Does this mean that the bundle-concept of osx is not fitted very well to my application? Can I somehow run a script that will open my application in a new Terminal.app window or something of that sort? I realized that other applications work so that if you click on the Name.app you see the GUI only, whereas if you click on the executable Contents/MacOS/Name you first see a terminal that then opens the GUI...? Is e.g. Octave bundled, and how is that done? Cheers Yngve On 1/19/11 4:42 PM, Michael Jackson wrote: You will need to look into the BundleUtilities functionality, specifically the fixup_bundle() function. This will copy and fixup dependent dylibs/frameworks needed by your project. There is a short example that uses Qt that you can download. You will also probably need to properly configure a plist that resides in your Application bundle. THere are CMake variables for this that you can set then CMake will create a default plist for you. There are a number of examples, CMake itself is one, that uses the fixup_bundle() in its own code. Separate from all of that is all the CPack variables that you probably need to set. Here is a macro that I wrote for one of my own projects: #--- # This macro will set all the variables necessary to have a good OS X Application # bundle. The variables are as follows: # PROJECT_NAME - which can be taken from the ${PROJECT_NAME} variable is needed # DEBUG_EXTENSION - The extension used to denote a debug built Application. Typically # this is '_debug' # ICON_FILE_PATH - The complete path to the bundle icon file # VERSION_STRING - The version string that you wish to use for the bundle. For OS X # this string is usually .YY.ZZ in type. Look at the Apple docs for more info #--- macro(ConfigureMacOSXBundlePlist PROJECT_NAME DEBUG_EXTENSION ICON_FILE_PATH VERSION_STRING) # message(STATUS ConfigureMacOSXBundlePlist for ${PROJECT_NAME} ) IF(CMAKE_BUILD_TYPE MATCHES Release) SET(DBG_EXTENSION ) else() set(DBG_EXTENSION ${DEBUG_EXTENSION}) endif() get_filename_component(ICON_FILE_NAME ${ICON_FILE_PATH} NAME) #CFBundleGetInfoString SET(MACOSX_BUNDLE_INFO_STRING ${PROJECT_NAME}${DBG_EXTENSION} Version ${VERSION_STRING}, Copyright 2009 BlueQuartz Software.) SET(MACOSX_BUNDLE_ICON_FILE ${ICON_FILE_NAME}) SET(MACOSX_BUNDLE_GUI_IDENTIFIER ${PROJECT_NAME}${DBG_EXTENSION}) #CFBundleLongVersionString SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${PROJECT_NAME}${DBG_EXTENSION} Version ${VERSION_STRING}) SET(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}${DBG_EXTENSION}) SET(MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION_STRING}) SET(MACOSX_BUNDLE_BUNDLE_VERSION ${VERSION_STRING}) SET(MACOSX_BUNDLE_COPYRIGHT Copyright 2010, BlueQuartz Software. All Rights Reserved.) SET(${PROJECT_NAME}_PROJECT_SRCS ${${PROJECT_NAME}_PROJECT_SRCS} ${ICON_FILE_PATH}) SET_SOURCE_FILES_PROPERTIES(${ICON_FILE_PATH} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) endmacro() Hope that helps ___ Mike Jackson www.bluequartz.net Principal Software Engineer mike.jack...@bluequartz.net BlueQuartz Software Dayton, Ohio On Jan 19, 2011, at 7:08 AM, Yngve Inntjore Levinsen wrote: Dear fellow cmake users, I am trying to create a bundle of my project that I build using CMake. I have tried using the DragNDrop generator, which works to some extent. I do manage to create a .app folder which contains the one binary that is the outcome of the project in the Contents/MacOS folder. I do also create a .dmg file. However: - When clicking the .dmg I am first presented with the license (great!) before the dmg is mounted and I see an empty folder (??) - When clicking on thepackage.app nothing happens. However, clicking on the binary in Contents/MacOS works as expected. - I would also like to know how to include the shared libraries (dylib) that I need. I currently depend on stuff that is installed with MacPorts, and I don't want to require that the user have to install all that stuff. Isn't the bundle
[CMake] cpack bundle on osx
Dear fellow cmake users, I am trying to create a bundle of my project that I build using CMake. I have tried using the DragNDrop generator, which works to some extent. I do manage to create a .app folder which contains the one binary that is the outcome of the project in the Contents/MacOS folder. I do also create a .dmg file. However: - When clicking the .dmg I am first presented with the license (great!) before the dmg is mounted and I see an empty folder (??) - When clicking on the package.app nothing happens. However, clicking on the binary in Contents/MacOS works as expected. - I would also like to know how to include the shared libraries (dylib) that I need. I currently depend on stuff that is installed with MacPorts, and I don't want to require that the user have to install all that stuff. Isn't the bundle supposed to be self-contained? Ideally I would like the bundle to automatically include the libraries that are listed with the otools -L binary command... Question: Where do I find the DragNDrop documentation/examples? On the wiki ( http://www.paraview.org/Wiki/CMake:CPackPackageGenerators#DragNDrop_.28OSX_only.29 ) there are only two small lines, and my googling skills are apparently not good enough.. Here is an extraction of the relevant part of my CMakeLists.txt: ... if(APPLE) add_executable(madx${BINARY_POSTFIX} MACOSX_BUNDLE ${srcfiles}) SET_TARGET_PROPERTIES(madx${BINARY_POSTFIX} PROPERTIES CPACK_BUNDLE_STARTUP_COMMAND madx${BINARY_POSTFIX}) SET_TARGET_PROPERTIES(madx${BINARY_POSTFIX} PROPERTIES CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/cmakesrc/MadX.icns) else(APPLE) add_executable(madx${BINARY_POSTFIX} ${srcfiles}) endif(APPLE) ... I also set some CPACK_BUNDLE properties because I earlier on tried to use the BUNDLE generator, but from what I understand this should have nothing to do with the DragNDrop generator? Thank you all for reading and thanks in advance for all help you might provide! Cheers, Yngve ___ 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] Extra include/lib paths - multiple entries
On Thursday 18 November 2010 12:00:52 Adam J Richardson wrote: On Wed, 17 Nov 2010 13:12:42 +0100 Yngve Inntjore Levinsen yngve.levin...@gmail.com wrote: On Wednesday 17 November 2010 12:30:06 Adam J Richardson wrote: Is this a correct specification for multiple include/lib paths in environment variables? If not, what should I use instead? Sometimes it seems to work, other times not... CMAKE_INCLUDE_PATH=C:/Compilers/Includes;C:/Compilers/MinGW/include CMAKE_LIBRARY_PATH=C:/Compilers/Libs;C:/Compilers/MinGW/lib This is how I would write it: INCLUDE_DIRECTORIES(C:/Compilers/Includes C:/Compilers/MinGW/include) TARGET_LINK_LIBRARIES(your binary file name C:/Compilers/Libs C:/Compilers/MinGW/lib) I mostly use *nix systems though, so I am not perfectly sure how to get it correct on Windows.. Thanks for the reply Yngve. I wasn't clear: I need to specify the paths in the environment, not the CMakeLists.txt file. I use mostly *nix too, so adding Win-specific bits to the CMakeLists.txt isn't acceptable. I'm guessing on the *nix buildslaves I would have env vars: CMAKE_INCLUDE_PATH=/usr/include:/usr/myfunkylib/include CMAKE_LIBRARY_PATH=/usr/lib:/usr/myfunkylib/lib using colons as separators rather than semicolons as on Windows. Right? Or not? Should I be using one or the other for both types of environment, since CMake is xplat? Or is my approach entirely wrong? I would like to use CMAKE_*_PATH since those are included automatically and I'm a lazy developer. ;) Ah, OK. You could use if-sentences in cmakelists? I use that to include some specific osx/linux variations. if (CMAKE_SYSTEM_NAME STREQUAL Linux) whatever I need to do for Linux only... endif (CMAKE_SYSTEM_NAME STREQUAL Linux) I am no expert using CMake myself, so I am probably not the best one to ask. In my head your approach seems reasonable. I am afraid this is the limit of my knowledge in this matter... Cheers Yngve ___ 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] Extra include/lib paths - multiple entries
On Wednesday 17 November 2010 12:30:06 Adam J Richardson wrote: Hi list, Is this a correct specification for multiple include/lib paths in environment variables? If not, what should I use instead? Sometimes it seems to work, other times not... CMAKE_INCLUDE_PATH=C:/Compilers/Includes;C:/Compilers/MinGW/include CMAKE_LIBRARY_PATH=C:/Compilers/Libs;C:/Compilers/MinGW/lib Thanks, Adam J Richardson Hi, This is how I would write it: INCLUDE_DIRECTORIES(C:/Compilers/Includes C:/Compilers/MinGW/include) TARGET_LINK_LIBRARIES(your binary file name C:/Compilers/Libs C:/Compilers/MinGW/lib) I mostly use *nix systems though, so I am not perfectly sure how to get it correct on Windows.. Cheers Yngve ___ 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] pass compile flags to initial compiler test..
Once again, thank you very much for your contribution Hannes! For the completeness of the thread, I post the solution here. This solution is general for all compilers that fails with rdynamic (e.g. if you try to compile windows binaries in linux, where you want -shared, not -rdynamic) Apply this command in your toolchain file (replace Fortran with C and/or CXX depending on which of your compilers cannot handle this flag): SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ) Then the compile test works FINALLY! :D Best Regards Yngve On Thursday 23 September 2010 08:03:27 Molsen, Hannes wrote: You could try to run cmake with --debug-trycompile parameter. Then navigate to %BUILD%/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec.dir/ and have a look into the file flags.make There you can see, whether the CompilerId Test was compiled with -rdynamic or not. If it was, you could try to set the Flags in your toolchain file by hand, which means, copy the ones out of the flags.make that you need, and set them with SET(CMAKE_Fortran_FLAGS_INIT ) in your tc. (I don't know a better solution for sure to remove one flag from a flag-string. But you might also want to take a look at LIST(REMOVE_ITEM [LIST] [ITEM]), but I haven't used it for flags and I don't know if and how this works for strings, so it's just an idea...) - Hannes -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Yngve Inntjore Levinsen Sent: Dienstag, 21. September 2010 17:08 To: cmake@cmake.org Subject: Re: [CMake] pass compile flags to initial compiler test.. Hi, The output follows below this message. It fails because of the -rdynamic flag I think. In the CMakeLists.txt file I can suppress this with the command SET(CMAKE_SKIP_RPATH ON), but this does not seem to have any effect in the toolchain file (?). If I try to manually compile/link without the rdynamic flag I get this: $ lf95 -fPIC -Wa,--32 CMakeFiles/CompilerIdFortran/CMakeFortranCompilerId.F90 -L/usr/lib f95: warning: Invalid suboption PIC specified for -f. Encountered 0 errors, 0 warnings in file CMakeFiles/CompilerIdFortran/CMakeFortranCompilerId.F90. $ ls -gh total 28K -rwxr-xr-x 1 si 13K 21.09.2010 17:04 a.out* -rw-r--r-- 1 si 13K 21.09.2010 16:58 CMakeCache.txt drwxr-xr-x 6 si 2.0K 21.09.2010 16:58 CMakeFiles/ Best Regards Yngve I. Levinsen Output from cmake with toolchain file: $ cmake -DCMAKE_TOOLCHAIN_FILE=../LinuxLF95.cmake .. -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- The Fortran compiler identification is unknown -- Check for working C compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.3.2/x86_64-slc5-gcc34-opt/bin/gcc -- Check for working C compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.3.2/x86_64-slc5-gcc34-opt/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.3.2/x86_64-slc5-gcc34-opt/bin/g++ -- Check for working CXX compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.3.2/x86_64-slc5-gcc34-opt/bin/g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working Fortran compiler: /afs/cern.ch/sw/fortran/lahey/lf9562c/bin/lf95 -- Check for working Fortran compiler: /afs/cern.ch/sw/fortran/lahey/lf9562c/bin/lf95 -- broken CMake Error at /usr/share/cmake/Modules/CMakeTestFortranCompiler.cmake:25 (MESSAGE): The Fortran compiler /afs/cern.ch/sw/fortran/lahey/lf9562c/bin/lf95 is not able to compile a simple test program. It fails with the following output: Change Dir: /afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/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 `/afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/CMakeFiles/CMakeTmp/CMakeFiles 1 Building Fortran object CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o /afs/cern.ch/sw/fortran/lahey/lf9562c/bin/lf95 -o CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o -Wa,--32 -c /afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/CMakeFiles/CMakeTmp/testFortranCompiler.f Encountered 0 errors, 0 warnings in file /afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/CMakeFiles/CMakeTmp/testFortranCompiler.f. Linking Fortran executable cmTryCompileExec /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1 /afs/cern.ch/sw/fortran/lahey
Re: [CMake] CMake and Absoft Fortran compilers
Do you know how to compile for Fortran in general? I don't know the Absoft compiler, but I've used some others. First off you need to enable Fortran language. This you can do by e.g. PROJECT(projectname Fortran CXX C) where you after the project name gives a list of the languages you use in your project. Next you can enable the compiler of choice with (replace g95 with the binary of your compiler) SET(CMAKE_Fortran_COMPILER g95) You can set this when you call cmake instead, like this cmake -DCMAKE_Fortran_COMPILER=g95 path Then you can continue setting Fortran specific flags based on compiler: if (CMAKE_Fortran_COMPILER MATCHES gfortran) set (CMAKE_Fortran_FLAGS_RELEASE -g -funroll-loops -fno-range-check -fno-f2c -O2 ) set (CMAKE_Fortran_FLAGS_DEBUG-fno-f2c -O0 -g ) set (CMAKE_Fortran_LINK_FLAGS ${CMAKE_Fortran_LINK_FLAGS} -static ) elseif (CMAKE_Fortran_COMPILER_ID STREQUAL Intel) ... endif (CMAKE_Fortran_COMPILER MATCHES gfortran) I hope this helps, not quite sure this was what you asked for? By the way, you need CMake 2.6.x or newer I believe, fortran support is quite limited (or non-existent?) in earlier versions. Best Regards Yngve On Wednesday 22 September 2010 19:03:49 Michael Jackson wrote: Does anyone use CMake in combination with the Absoft fortran compilers? What environment variables would need to be set to have cmake detect the Absoft compilers? Like you can set CC or CXX vars. Thanks for any information. ___ Mike Jackson www.bluequartz.net Principal Software Engineer mike.jack...@bluequartz.net BlueQuartz Software Dayton, Ohio ___ 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] pass compile flags to initial compiler test.. now an assembler issue
Hi, Again Hannes, thank you for your help! It is very valuable to me and I'm learning even more about how cmake and compiling in general works! :) I added a toolchain file (did not know about this feature before), but it seems that the option SET(CMAKE_SKIP_RPATH ON) is ignored in the toolchain file? This means that the compiler test fails. I could skip this by using the command CMAKE_FORCE_Fortran_COMPILER(lf95 Lahey) but sadly this was from what I can see added in CMake 2.8.1 (for C and CXX it is available in 2.6.x). Since on our server we have version 2.6.4 installed, I find myself very close but no sigar. Perhaps I should rather try to convince the person in charge that we don't need support for this compiler... Best Regards Yngve I. Levinsen On Tuesday 21 September 2010 08:23:17 Molsen, Hannes wrote: Hi Yngve, -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Yngve Inntjore Levinsen Sent: Montag, 20. September 2010 18:38 To: cmake@cmake.org Subject: Re: [CMake] pass compile flags to initial compiler test.. now an assembler issue Hi, Thank you for your very quick response Hannes! I tried to set SET(CMAKE_Fortran_FLAGS_INIT ...) in my CMakeLists.txt, but since it didn't work I tried to dig a bit deeper. If you put that in your CMakeLists.txt it will not be used for the initial compiler test, as the CMakeLists.txt is processed after the test. You have to write it either in a toolchain / platform file [1] or add it (haven't tried this myself) to your toolchain in the gui (+ add entry) [2] [1] http://www.paraview.org/Wiki/CMake_Cross_Compiling [2] http://mash-project.eu/wiki/images/5/51/CMakeGui_Start.png It seems that my early assumptions were wrong, if I enter the folder CMakeFiles/CompilerIdFortran/ and try to compile manually I get the following output: $ lf95 CMakeFortranCompilerId.F Encountered 0 errors, 0 warnings in file CMakeFortranCompilerId.F. /tmp/asmHexTje.s: Assembler messages: /tmp/asmHexTje.s:51: Error: suffix or operands invalid for `push' Does anyone know what this means? I hardly know what an assembler is.. Just for the assembler: Usually you compile your file from high language to the binary with intermediate steps. The last step before the object code is the assembler where mnemonics are translated into processor operation codes [3]. One of these mnemonics is push which causes a data word to be pushed on the stack. For me this looks like a problem regarding your compiler flags, because this error message may arise if you try to push between 32 and 64 bit words. I suppose you double check your compiler manual for the correct flags. But I'm not really speaking from experience in this point, it's more an idea what to look for than a solution :) [3] http://en.wikipedia.org/wiki/Assembly_language#Assembler Yngve - Hannes --- This communication contains confidential information. If you are not the intended recipient please return this email to the sender and delete it from your records. Diese Nachricht enthält vertrauliche Informationen. Sollten Sie nicht der beabsichtigte Empfänger dieser E-mail sein, senden Sie bitte diese an den Absender zurück und löschen Sie die E-mail aus Ihrem System. ___ 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] pass compile flags to initial compiler test..
Hi, The output follows below this message. It fails because of the -rdynamic flag I think. In the CMakeLists.txt file I can suppress this with the command SET(CMAKE_SKIP_RPATH ON), but this does not seem to have any effect in the toolchain file (?). If I try to manually compile/link without the rdynamic flag I get this: $ lf95 -fPIC -Wa,--32 CMakeFiles/CompilerIdFortran/CMakeFortranCompilerId.F90 -L/usr/lib f95: warning: Invalid suboption PIC specified for -f. Encountered 0 errors, 0 warnings in file CMakeFiles/CompilerIdFortran/CMakeFortranCompilerId.F90. $ ls -gh total 28K -rwxr-xr-x 1 si 13K 21.09.2010 17:04 a.out* -rw-r--r-- 1 si 13K 21.09.2010 16:58 CMakeCache.txt drwxr-xr-x 6 si 2.0K 21.09.2010 16:58 CMakeFiles/ Best Regards Yngve I. Levinsen Output from cmake with toolchain file: $ cmake -DCMAKE_TOOLCHAIN_FILE=../LinuxLF95.cmake .. -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- The Fortran compiler identification is unknown -- Check for working C compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.3.2/x86_64-slc5-gcc34-opt/bin/gcc -- Check for working C compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.3.2/x86_64-slc5-gcc34-opt/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.3.2/x86_64-slc5-gcc34-opt/bin/g++ -- Check for working CXX compiler: /afs/cern.ch/sw/lcg/contrib/gcc/4.3.2/x86_64-slc5-gcc34-opt/bin/g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working Fortran compiler: /afs/cern.ch/sw/fortran/lahey/lf9562c/bin/lf95 -- Check for working Fortran compiler: /afs/cern.ch/sw/fortran/lahey/lf9562c/bin/lf95 -- broken CMake Error at /usr/share/cmake/Modules/CMakeTestFortranCompiler.cmake:25 (MESSAGE): The Fortran compiler /afs/cern.ch/sw/fortran/lahey/lf9562c/bin/lf95 is not able to compile a simple test program. It fails with the following output: Change Dir: /afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/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 `/afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/CMakeFiles/CMakeTmp' /usr/bin/cmake -E cmake_progress_report /afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/CMakeFiles/CMakeTmp/CMakeFiles 1 Building Fortran object CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o /afs/cern.ch/sw/fortran/lahey/lf9562c/bin/lf95 -o CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o -Wa,--32 -c /afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/CMakeFiles/CMakeTmp/testFortranCompiler.f Encountered 0 errors, 0 warnings in file /afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/CMakeFiles/CMakeTmp/testFortranCompiler.f. Linking Fortran executable cmTryCompileExec /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1 /afs/cern.ch/sw/fortran/lahey/lf9562c/bin/lf95 -fPIC -Wa,--32 CMakeFiles/cmTryCompileExec.dir/testFortranCompiler.f.o -o cmTryCompileExec -rdynamic /usr/bin/ld: bad -rpath option gmake[1]: *** [cmTryCompileExec] Error 1 gmake[1]: Leaving directory `/afs/cern.ch/user/y/ylevinse/scratch1/public/madx-cmake/buildlahey/CMakeFiles/CMakeTmp' gmake: *** [cmTryCompileExec/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:3 (PROJECT) -- Configuring incomplete, errors occurred! On Tuesday 21 September 2010 15:33:04 Molsen, Hannes wrote: Hi, what part of the compiler test fails? The detect ABI or the check working test? Could you post the output? Maybe it's a similar problem as I had in [1] - Hannes [1] http://www.mail-archive.com/cmake@cmake.org/msg31486.html -Original Message- From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of Yngve Inntjore Levinsen Sent: Dienstag, 21. September 2010 14:55 To: cmake@cmake.org Subject: Re: [CMake] pass compile flags to initial compiler test.. now an assembler issue Hi, Again Hannes, thank you for your help! It is very valuable to me and I'm learning even more about how cmake and compiling in general works! :) I added a toolchain file (did not know about this feature before), but it seems that the option SET(CMAKE_SKIP_RPATH ON) is ignored in the toolchain file? This means that the compiler test fails. I could skip this by using the command CMAKE_FORCE_Fortran_COMPILER(lf95 Lahey) but sadly this was from what I can see added in CMake 2.8.1 (for C and CXX it is available in 2.6.x). Since
[CMake] pass compile flags to initial compiler test
I am trying to use a rather vanilla compiler for my CMake project (Lahey-Fujitsu lf95 fortran compiler). This compiler (or perhaps just the particular version I have available) does only compile 32bit binaries, so on 64bit systems the initial test fails. In order for the test to succeed I need to pass some flags to the cmake script to be used for this initial testing, but I have not succeeded in finding information about how to do this. Anybody knows? Thanks in advance for your help! Best Regards Yngve I. Levinsen ___ 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