Re: [CMake] Querying targets for Fortran module files & module file installation advice

2019-04-03 Thread Zaak Beekman
Awesome, thanks! On Wed, Apr 3, 2019 at 10:26 AM Brad King wrote: > On 4/3/19 10:09 AM, Zaak Beekman wrote: > > They contain the mod files. I didn't ask for a $ directory to > > be created for me within the CMAKE_Fortran_MODULE_DIRECTORY but it's > > there, and a

Re: [CMake] Querying targets for Fortran module files & module file installation advice

2019-04-03 Thread Zaak Beekman
Thanks so much Brad! On Wed, Apr 3, 2019 at 9:35 AM Brad King wrote: > The `install(DIRECTORY)` approach is the current recommendation. OK > Do those directories contain the `.mod` files or are they extra? > In the latter case, use `install(DIRECTORY)`'s options for excluding > content by patt

Re: [CMake] Querying targets for Fortran module files & module file installation advice

2019-04-03 Thread Zaak Beekman
build path, followed by a `foreach(...)` loop over all the found artifacts to install them with `file(INSTALL ...)`. This feels fragile, and un-idiomatic. Am I missing a better way to do this? Thanks, Zaak On Sun, Mar 31, 2019 at 5:10 PM Zaak Beekman wrote: > > Hi all, > > What's the

[CMake] Querying targets for Fortran module files & module file installation advice

2019-03-31 Thread Zaak Beekman
Hi all, What's the best approach for handling cross-platform (i.e., MSVS, Mac, Linux) installation of Fortran module files associated with libraries? After searching the docs, I couldn't find any good and obvious way to handle installation of Fortran module files associated with library targets.

Re: [CMake] Correct way to specify multiple build configurations for single config generators?

2018-12-10 Thread Zaak Beekman
Hi Craig, et al, Craig, once again, thank you for writing such a great reference and learning book! I have a few responses inline below. On Mon, Dec 10, 2018 at 6:34 AM Craig Scott wrote: > This is only going to be an issue for single-configuration generators. For > multi-config generators, you

[CMake] Correct way to specify multiple build configurations for single config generators?

2018-12-09 Thread Zaak Beekman
I have been reading the *excellent* book "Professional CMake". The author, Craig Scott, recommends the following best practices: - check the existence of `CMAKE_CONFIGURATION_TYPES` and only adding or pruning configurations if it's preset, *AFTER* your call to `project()` - do not set `CM

[CMake] FindMPI troubles on macOS w/ small reproducer

2018-10-29 Thread Zaak Beekman
Hi All, It seems to me that there is a bug in FindMPI in the latest CMake and/or in the Travis-CI macOS (`osx`) environment. Has anyone had success testing with the latest CMake a C & Fortran application that requires MPI on Travis-CI osx nodes? (Ideally using GNU compilers all the way.) If you co

Re: [CMake] Do transitive interace includes propagate to compilation of Fortran sources?

2018-07-27 Thread Zaak Beekman
On Fri, Jul 27, 2018 at 4:47 PM Zaak Beekman wrote: > I'm trying to use a superbuild to tightly control third party libraries > for an application. They will all be statically linked in the end (besides > deps like MPI that are effective system libraries). I have the following >

[CMake] Do transitive interace includes propagate to compilation of Fortran sources?

2018-07-27 Thread Zaak Beekman
ran sources) would get the `-I.../include/vtkmofo/mod` flag passed during compilation. Am I missing something? Thanks, Zaak Izaak "Zaak" Beekman --- HPC Scientist ParaTools Inc. <http://www.paratools.com/>

[CMake] Intel MPI on Windows under x86_64 MSYS2

2018-06-05 Thread Zaak Beekman
_TRAILING_WHITESPACE RESULT_VARIABLE WRAPPER_RETURN) Is this a bug in FindMPI.cmake or are we doing something wrong in the build system? The original thread can be seen at: https://github.com/sourceryinstitute/OpenCoarrays/issues/541 Many thanks, Zaak

Re: [CMake] Generating MSVS solution files that can be passed around

2018-04-24 Thread Zaak Beekman
through registry keys, the machine arch is queried and the included CMake is launched with the correct MSVS version and arch specified to the -G generator flag. Thanks to all for all your help and suggestions! Best, Zaak On Thu, Apr 19, 2018 at 5:37 PM Zaak Beekman wrote: > Thanks Jano, tha

Re: [CMake] Generating MSVS solution files that can be passed around

2018-04-19 Thread Zaak Beekman
eeded, but I suppose not. > > We use cmake like that. We've committed a copy in our git repo, and have a > simple means to update cmake for everyone > in the team at once. > > Jano > > On Thu, Apr 19, 2018 at 6:55 PM, Zaak Beekman wrote: > >> Ha, yeah that’s

Re: [CMake] Generating MSVS solution files that can be passed around

2018-04-19 Thread Zaak Beekman
Ha, yeah that’s an option. The problem is that they’re not “my” contractors. They are the client’s contractors. We’ll see. On Thu, Apr 19, 2018 at 12:52 PM Cristian Adam wrote: > On Thu, Apr 19, 2018 at 5:46 PM, Zaak Beekman wrote: > >> The situation is that we have a client wh

Re: [CMake] Generating MSVS solution files that can be passed around

2018-04-19 Thread Zaak Beekman
On Thu, Apr 19, 2018 at 11:51 AM Konstantin Tokarev wrote: > Then your best choice is probably Premake (http://premake.github.io/) > No. Big project. Have build system. CMake has 1st class language support for Fortran. I can't introduce a LUA dependency. -- Powered by www.kitware.com Please

[CMake] Generating MSVS solution files that can be passed around

2018-04-19 Thread Zaak Beekman
gate whether the CMake licensing allows for that. Thanks, Zaak Izaak "Zaak" Beekman --- HPC Scientist ParaTools Inc. <http://www.paratools.com/> ibeek...@paratools.com 1509 16th St, NW Washi

Re: [CMake] CMake 3.11 Fortran submodule parallel compilation fails for a single target

2018-04-12 Thread Zaak Beekman
Just FYI. I found an OK work around in that issue. On Thu, Apr 12, 2018 at 9:22 AM Brad King wrote: > On 04/11/2018 01:44 PM, Zaak Beekman wrote: > > I thought that CMake had Fortran submodule support as of 3.8 or 3.10. > > CMake 3.7 added support to the Fortran dependency scan

[CMake] CMake 3.11 Fortran submodule parallel compilation fails for a single target

2018-04-11 Thread Zaak Beekman
such a way that CMake will generate a make file that ensures the source files are processed in the correct order, even with `make -j`? Thanks, Zaak Izaak "Zaak" Beekman --- HPC Scientist ParaTools Inc. <h

[CMake] Transitive linker flags

2018-04-09 Thread Zaak Beekman
m wondering, if it's worth spending my limited time investigating this further or is this expected/common-practice/acceptable usage? Thanks, Zaak Izaak "Zaak" Beekman --- HPC Scientist ParaTools Inc. <

Re: [CMake] Overloading/shadowing/redefining CMake intrinsic commands

2018-04-04 Thread Zaak Beekman
it out! Thanks, Zaak Izaak "Zaak" Beekman --- HPC Scientist ParaTools Inc. <http://www.paratools.com/> 5520 Research Park Drive Suite 100 Baltimore, MD 21228 phone: (443)

[CMake] Overloading/shadowing/redefining CMake intrinsic commands

2018-04-04 Thread Zaak Beekman
n redefine it if needed. Otherwise, the child project will run as intended when configured and built on its own (i.e. just with GFortran, w/o coarray support & OpenCoarrays). Thanks, Zaak Izaak "Zaak" Beekman --

[CMake] Help with find module for package w/ components

2018-02-23 Thread Zaak Beekman
I need some guidance. I am writing a find module for a package that defines multiple library archives, includes and Fortran module files. I would like to make a "best practices" and "modern" find module and define a target so that transitive properties are propagated correctly. I would like to defi

Re: [CMake] FindMPI

2016-12-01 Thread Zaak Beekman
On Thu, Dec 1, 2016 at 2:02 PM Chuck Atkins wrote: > > I think the logic is a bit backwards on this and if you were to make a > change, I'd suggest it be there and re-order a few things such that if MPI > things haven't been already explicitly set then the *first* thing to do > (rather than last)

Re: [CMake] FindMPI

2016-11-30 Thread Zaak Beekman
OK, upon more careful reading of the documentation for FindMPI, and realizing that I am using CMake 3.6 not 3.7 I have adjusted my approach to be consistent with the documentation and your suggestions. I don't know if the documentation actually needs expanding upon... I think I just failed to full

Re: [CMake] FindMPI

2016-11-28 Thread Zaak Beekman
- > Chuck Atkins > Staff R&D Engineer, Scientific Computing > Kitware, Inc. > > > On Wed, Nov 23, 2016 at 6:05 PM, Zaak Beekman wrote: > > Hi, > > I want to be able to pass FC=mpif90 (or FC=$(which mpif90)) and CC=mpicc > etc. OR also be able to pass a c

Re: [CMake] FindMPI

2016-11-28 Thread Zaak Beekman
/path/to/mpicc > -DMPI_CXX_COMPILER=/path/to/mpiCC > -DMPI_Fortran_COMPILER=/path/to/mpif90 > > -- > Chuck Atkins > Staff R&D Engineer, Scientific Computing > Kitware, Inc. > > > On Wed, Nov 23, 2016 at 6:05 PM, Zaak Beekman wrote: > > Hi, > > I want to be

[CMake] FindMPI

2016-11-23 Thread Zaak Beekman
Hi, I want to be able to pass FC=mpif90 (or FC=$(which mpif90)) and CC=mpicc etc. OR also be able to pass a compiler and use FindMPI to add link, compile and include flags. I'm encountering an issue when my MPI implementation is not on my PATH, I want CMake to be able to look in an additional loca

Re: [CMake] oversubscribing OpenMPI in tests

2016-06-16 Thread Zaak Beekman
t the most elegant solution, but > it seems fairly robust. > > > > -kt > > > > *From:* CMake [mailto:cmake-boun...@cmake.org] *On Behalf Of *Zaak Beekman > *Sent:* Thursday, June 16, 2016 9:14 AM > *To:* cmake@cmake.org > *Subject:* [CMake] oversubscribing OpenMPI in tes

[CMake] oversubscribing OpenMPI in tests

2016-06-16 Thread Zaak Beekman
Does anyone know a good way to determine if `find_package(MPI REQUIRED)` is returning OpenMPI? I need to know, because OpenMPI does not handle oversubscribed (more ranks than cores) tests well without explicitly telling OpenMPI that you are oversubscribing. This can be done by creating a hosts file

Re: [CMake] FORTRAN name mangling

2016-01-11 Thread Zaak Beekman
> So if I require Fortran 2003 for our fortran codes then this whole > ?fortran name-mangling? thing becomes a moot point, i.e. I do not have to > actually worry about it at all for our project. Just have to keep the C > header consistent with the FORTRAN functions, but that part is on our devs. >

Re: [CMake] MPI wrappers vs FindMPI

2015-12-07 Thread Zaak Beekman
Dec 7, 2015 at 8:56 AM Brad King wrote: > On 12/04/2015 05:51 PM, Zaak Beekman wrote: > > What are the pros and cons of using FindMPI over passing FC=mpif90 and > CC=mpicc? > > It shouldn't matter much if all the code in the project is meant > to be build for MPI. Using p

[CMake] MPI wrappers vs FindMPI

2015-12-04 Thread Zaak Beekman
>From working on a Homebrew formula < https://github.com/Homebrew/homebrew/pull/46547> for OpenCoarrays < https://github.com/sourceryinstitute/opencoarrays> I'm under the impression that common practice is to use FindMPI over passing mpicc and mpif90 to cmake directly. Is this correct, and the way

[CMake] option for gcov coverage and overriding optimization flag

2015-06-12 Thread Zaak Beekman
I’m having trouble determining the right way to enforce `-O0` optimization level when the user selects a boolean cache entry to enable code coverage with gcov. I tried something like: if ( ENABLE_CODE_COVERAGE ) set ( CMAKE_Fortran_FLAGS “${CMAKE_Fortran_FLAGS} -fprofile-arcs -ftest-coverag

[CMake] fortran modules and parallel builds

2015-02-25 Thread Zaak Beekman
When multiple executables or libraries depend on the same fortran source file that contains a module, parallel (Makefile) builds are failing for me because the .mod file is getting moved/renamed/written by more than one process at a time. Is there a way to have the same module containing sourcefile

Re: [CMake] Adding module CheckFortranCompilerFlag.cmake (Nicolas Bock)

2015-01-30 Thread Zaak Beekman
Great! I would certainly like this functionality to be officially added to CMake and in the mean time will use your module... speaking of which, it seems that it was scrubbed from the digest email, or not originally attached. Can you please send it to me? On Thu, Jan 29, 2015 at 8:42 PM wrote: >

Re: [CMake] OS X Fortran flags (Bill Somerville)

2014-10-24 Thread Zaak Beekman
Hi Bill, I feel your pain. I suspect a CMake bug is hidden away somewhere causing this behavior, and have struggled with this quite a lot. I *think* explicitly passing the relevant option to the linker fixes this, although I have some other CMake/Fortran/Mac hackery happening in my CMakeLists.txt

Re: [CMake] CMake, Xcode, and Intel Fortran? (digitalriptide)

2014-10-24 Thread Zaak Beekman
I suspect an issue with Xcode/Intel compilers independent of CMake. Have you tried creating and building a new Fortran project in Xcode? If it doesn't work, have you upgraded Xcode recently? I have no experience with Xcode, but I do know that Apple pushed out an Xcode update recently and that the

Re: [CMake] CMake and user friendliness (Drew DeVault)

2014-09-22 Thread Zaak Beekman
Well, it depends on who you are expecting the "user" to be and what their background is. I always configure new cmake buiulds with cmake-gui or ccmake, which I find to be much easier than auto tools, because the documentation and ability to set options is in the same place--one stop shopping. No ne

[CMake] find_package() vs ExternalProject_Add()

2014-05-08 Thread Zaak Beekman
Am I correct in stating that ExternalProject_Add() cannot completely replace find_package()? e.g. if I point ExternalProject_Add() to download a software package (which uses a CMake build system and exports its targets and provides a -config.cmake file) the only thing this does is to provide a tar

[CMake] install directory structure with -targets.cmake and -config.cmake

2014-05-07 Thread Zaak Beekman
Looking at page 80 in 'Mastering CMake' fifth edition, is says that the -targets.cmake "file contains code such as `get_filename_component (_self "${CMAKE_CURRENT_LIST_FILE}" PATH)` `get_filename_component (PREFIX "${_self}/../.." ABOSULTE)`" I'm on Mac OS X using CMake 2.8.12 and was emulating a

Re: [CMake] install name for fortran dylibs on mac

2014-05-02 Thread Zaak Beekman
I one more quick point: I don't want to install the libraries to standard locations because there may be multiple Fortran compilers installed on a given system, and client code cannot be built and linked using a different compiler than the library. Therefore the library and mod files and CMake pack

[CMake] OSX Bundles and wrapper scripts

2014-04-23 Thread Zaak Beekman
If I want to create an OSX bundle, but I want the main executable to be a configured wrapper script written in bash, what is the best way to go about doing that? It seems that the Also, how do I get the wrapper script to correctly call the compiled executable so that the app bundle is relocatable?

[CMake] osx bundle question

2014-04-20 Thread Zaak Beekman
I compile my Fortran and C project using the GCC and Intel compilers on Mac OS X. After calls to fixup_bundle the required dynamic libraries get copied into the Contents/MacOS/ directory, and libgcc_s.1.dylib is copied there when compiling with either of the compilers. However, the output of otool

[CMake] Strange behavior with OSX_DEPLOYMENT_TARGET

2014-04-17 Thread Zaak Beekman
I'm not sure if this is a bug, but in my top level CMakeLists.txt file I try to do something like this: cmake_minimum_required ( VERSION 2.8.11 FATAL_ERROR ) include ( checkOutOfSource.cmake ) include ( configureBuilds.cmake ) include ( configurePlatform.cmake ) enable_language ( C ) enable_langua

Re: [CMake] [CMake BUG] CMake (2.8.12.2) adding extraneous libraries at the end of the link command

2014-04-16 Thread Zaak Beekman
er wa y to do this? Izaak Beekman === (301)244-9367 Princeton University Doctoral Candidate Mechanical and Aerospace Engineering ibeek...@princeton.edu UMD-CP Visiting Graduate Student Aerospace Engineering ibeek...@umiacs.umd.edu ibeek...@umd.edu On Tue, Apr 15, 2014 at 5:24 PM, Zaak Beekma

Re: [CMake] [CMake BUG] CMake (2.8.12.2) adding extraneous libraries at the end of the link command

2014-04-15 Thread Zaak Beekman
k...@umiacs.umd.edu ibeek...@umd.edu On Tue, Apr 15, 2014 at 10:56 AM, Zaak Beekman wrote: > Brad, thanks so much for your help! From the online documentation it can > be hard to figure out which variable/property controls certain features as > someone with limited CMake experience. &

Re: [CMake] [CMake BUG] CMake (2.8.12.2) adding extraneous libraries at the end of the link command

2014-04-15 Thread Zaak Beekman
Brad, thanks so much for your help! From the online documentation it can be hard to figure out which variable/property controls certain features as someone with limited CMake experience. One strange detail I forgot was that this problem does not appear on Mac/OS X for the same project using the in

[CMake] [CMake BUG] CMake (2.8.12.2) adding extraneous libraries at the end of the link command

2014-04-14 Thread Zaak Beekman
I have a mixed language project, most of which is in Fortran, but some of it is in C. I have disabled C++ and enabled C and Fortran explicitly. I am using the 32 bit Intel composer XE 13.1.0 2013 compilers (on a Linux x86_64 RHEL 5 Linux machine) and I am building static executables so that they ca

Re: [CMake] Dependencies

2014-02-05 Thread Zaak Beekman
I might also add that the set_property() approach has an additional advantage over the set_source_files_properties(): The APPEND and APPEND_STRING options allow you to add properties like dependencies without overwriting the values which already exist. > Hi Phil. > > >> If your FOO.asm is used as

Re: [CMake] retrieving and manipulating (Fortran) dependency information

2014-02-03 Thread Zaak Beekman
ngineering ibeek...@umiacs.umd.edu ibeek...@umd.edu On Mon, Feb 3, 2014 at 11:46 AM, Brad King wrote: > On 01/30/2014 05:43 PM, Zaak Beekman wrote: > > I noticed that output_required_files is deprecated. > > Yes, it has been marked as such since CMake 2.8.5: > > http:/

[CMake] retrieving and manipulating (Fortran) dependency information

2014-01-30 Thread Zaak Beekman
I noticed that output_required_files is deprecated. Is there a way to determine the dependencies of a Fortran source file that I can then manipulate in a CMakeLists.txt file? Fortran dependency resolution is a pain, and I need to determine dependencies for a custom target. TIA, Zaak -- Powered b

Re: [CMake] try_run() fortran support

2013-10-02 Thread Zaak Beekman
Please ignore this post; I didn't understand where try_run() was looking for the source code previously. My most recent post has this resolved, and a solution to diagnosing the largest available Fortran integer at compile time so that it can be inserted via an appropriate preprocessing directive at

[CMake] try_compile() to determine the largest available Fortran integer

2013-10-02 Thread Zaak Beekman
Hi, I managed to write a macro to determine the largest available Fortran integer kind so that it can be #defined at compile time where needed--via compiler supplied preprocessors or the cpp. The macro I wrote needs some more refinement/abstraction, but the basic technique is there. I am sharing i

Re: [CMake] try_run or similar to find available Fortran integer kinds

2013-09-20 Thread Zaak Beekman
On Fri, Sep 20, 2013 at 12:00 PM, wrote: > Is your original > message saying that a Fortran compiler might compile > > integer*8 myinteger > > but fail at runtime? > No, my point is that there is no guarantee that integer*8 or integer*16 exist at all (at compile time) but you can query whether

[CMake] try_run or similar to find available Fortran integer kinds

2013-09-19 Thread 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 g

[CMake] Problems/bugs with intel compilers and CMAKE_OSX_{ARCHITECTURES, DEPLOYMENT_TARGET}

2013-08-05 Thread Zaak Beekman
Hi, I'm not sure if I should submit a bug report about this or not, but there are two issues with building distributable binaries with the Intel compilers on Mac OS X. 1. I think that '-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}' should be added to all the linker flags. Without t

[CMake] Robust check/prevention of in source builds

2013-08-02 Thread Zaak Beekman
Hi, I am wondering what the best way to detect and prevent in source builds is. Some potential pitfalls are relative paths vs absolute paths, and symbolic links (build_dir -> source_dir). If anyone has any suggestions, I'd love to hear them. Obviously string comparisons handle neither of these nefa

Re: [CMake] Clever way to download and install cmake package?

2013-08-01 Thread Zaak Beekman
On Thu, Aug 1, 2013 at 7:07 PM, Moreland, Kenneth wrote: > The easiest solution is to simply copy UseLATEX.cmake to your project > and update it by hand when necessary, which is probably never. That's what > I do. > > -Ken > > Sent from my iPad so blame autocorrect. > I am using a subtree merg

[CMake] Clever way to download and install cmake package?

2013-08-01 Thread Zaak Beekman
Hi, I am using the UseLATEX package, and I was wondering if there was a way to automatically download the UseLATEX.cmake file to be included in the CMakeLists.txt file. I was thinking of using the ExternalProject module, however, I'm not sure this will work. When is the external project downloaded

Re: [CMake] support for .f03/.F03 suffix (Fortran 2003)

2013-07-31 Thread Zaak Beekman
> dear all, > > it seems that CMake currently does not support .f03/.F03 suffix > for Fortran 2003 files. > > is there a way for me to tell CMake to treat these files as it would treat > files ending with .f90 or .f95. i can then assign special flags to them via > source file > properties. > > than

[CMake] Fortran project directory stucture/layout advice

2013-06-11 Thread Zaak Beekman
So this question is not 100% about cmake, but I am going to ask anyway. What is a good project layout (for a CMake project) that will let me: a) group related components b) allow testing and building of individual components c) without causing maintenance/debugging headaches, and having to update

[CMake] CMAKE__COMPILER_ID

2013-05-25 Thread Zaak Beekman
It seems hard to find documentation for this variable. Is it set by enable_language()? Can I call enable_language() BEFORE I call project()? Does anyone know a good way to provide default, compiler specific values for CMAKE__FLAGS in the cache? It seems that calling set() with the CACHE option won

[CMake] Finding memory leaks on OS X mountain lion (10.8)

2013-05-25 Thread Zaak Beekman
Does anyone have any experience adding tests to check for memory leaks on Macs? I come from more of a Linux background and am new to CMake and CTest. I am not using CDash yet, and writing software in C and Fortran. It seems that Valgrind is still very experimental for Mac, especially for Mountain

[CMake] Best way to build and test same project with different compilers?

2013-05-17 Thread Zaak Beekman
Hi, I'm pretty new to CMake/CTest, and I was wondering what the best way to switch between compilers is when testing and building the same project with multiple compilers. It seems deleting the CMake cache from cmake-gui doesn't always work to switch compilers (which I am specifying with `export CC

Re: [CMake] How to install Fortran module files?

2013-05-12 Thread Zaak Beekman
On Fri, May 10, 2013 at 8:48 PM, wrote: > I'm trying to figure out how to install the module (.mod) files that are > generated by the Fortran compiler. > [SNIP] > Thanks! > Neil > Neil, I'm curious why you want to install the .mod files. As far as I know, I don't think you need these at run