-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1 cmake #3
1 cmake #3
Conversation
Thanks Bob. For installing the
So for Meson 0.55 or later, it gets the full path of the library from I think this should work for any platform. Of course the whole thing is still far from ideal and only a workaround until such time as Meson (hopefully) has support for installing Fortran modules "properly". I've tested it on an Ubuntu 18 VM , with various versions of Meson from 0.54.3 up to the latest 0.55.3. I have confirmed the behaviour was changed in Meson 0.55.0. I don't have access to any non-Linux machines though. Could you try this on your Windows setup? |
This change seems to work on OSX and Windows; the only issue I've noticed is that if you use a different build directory than This is minor; I was testing with multiple different build directories simultaneously but most users will follow the instructions and use The important part is that |
Hmm, no I'd call that a bug. The build directory name shouldn't be hard-coded in there. I'll fix that. |
It would be good to incorporate the build instructions for both Meson and CMake (which you have added in Your readme also says "Due to issues with the meson/ninja build process, the Fortran |
I just tried a CMake build of Zofu on an Ubuntu 18 machine, and got the following error:
This is CMake 3.10.2. Any idea what the problem is? What I did was |
I have an idea what might be causing that. I've only checked with the latest CMake so let me try a test; I'm guessing this is a simple mod. |
Thanks, that seems to have fixed the problem. I have just added a new Github action so that the CI will also do a CMake build and run the unit tests on push. |
I've just added some README instructions for building, testing and installing with CMake. It could perhaps do with some more material on how to configure the CMake build for e.g. debug/release, specifying different directories for lib install, include dir for modules etc. Do you think you could add something along those lines? |
I'll add some more info about configuring with CMake; I've been juggling a few other projects but I should have time this weekend. |
I added more configuration to |
Thanks Bob, looking good... I think we are ready to merge this, and release as v.1.1. |
I had to make one more change, as the CI unit tests were failing- Meson 0.56 has just been released and it looks like you can't compare meson.version() with a string any more. I found there is actually a version_compare() function which you are meant to use, so I've changed it to do that. |
This PR provides CMake support and a (rather brittle) workaround for recent meson versions changing the build directory location for the zofu library and not properly installing Fortran
.mod
files.CMake is supported in two ways, first in building, documenting, packaging, and installing Zofu itself, and second, by providing helper functions to allow CMake to detect and use and existing Zofu installation and to assist in compiling Zofu-based unit tests and adding them to CTest's test plan. More information is available under
contrib/cmake/README.md
and in the.cmake
files themselves, especiallyFindZOFU.cmake
andZOFUhelper.cmake
.This has been tested with meson 0.55.3. The main issue with not properly installing Fortran
.mod
files is that earlier versions of meson wrote.mod
files under./build/zofu@sha
. Version 0.55.3 renames this build directory according to the zofu library filename, such asbuild/libzofu.a.p/
build/libzofu.so.p/
build/libzofu.dll.p/
andprobably
build/libzofu.dylib.p/
on OSX (I haven't tested on OSX yet...)The following has been added to
meson.build
.Several failed attempts at dynamically setting
mod_path
are commented out inmeson.build
; they are retained for information purposes but can be deleted.A final note: I've tested the CMake build process for Zofu on both Windows and Linux. An MPI-enabled build was attempted on Linux; it found the MPI libraries and module files but failed because the
.mod
files did not match the more recent compiler I was using. MPI was installed as a Linux Mint package and not built from source, so the error is understandable. I suspect it would have succeeded if I was using the vendor-supplied version ofgfortran
but I haven't confirmed that.