-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add support for CMake to GCHP (updated) #27
Add support for CMake to GCHP (updated) #27
Conversation
… this prevents GC's scope from being polluted by ESMA variables
…Hp/CMakeLists line endings to dos
Thanks Liam. I am very excited to try this out! Just let me know when it's ready. |
Hi Lizzie. I think it's ready to go! I haven't validated the executable, but everything should compile fine. Also, if anyone else would like to try it out, please do! Where to startThe instructions for building GCHP with CMake are here. You'll have to have ESMF and gFTL built and installed somewhere on your machine (as a part of a different GCHP build is fine). NotesThese are a few things that might be helpful to know ahead of time. They should be covered in the instructions, but I think it might be helpful to go in knowing these.
FeedbackI'd really appreciate any feedback/ideas that you have about how it could be improved (anything and everything)! If anything doesn't work, or if anything is confusing, please let me know! 😄 Also, if anyone wants help, let me know when you plan to try it out and I'll make sure I'm on Slack! Note: I'll be away on June 7-11. --Liam |
Hi Liam,
/local/elundgren/rundirs/gchp_standard/build $ cmake -DCMAKE_PREFIX_PATH="/local/elundgren/gFTL" .
gfortran: error: unrecognized command line option ‘-Wno-’; did you mean ‘-gno-z’? But it did not actually stop until here: I am not sure if having nf-config would have affected this. That is it for comments on the tutorial. But I have several other general questions.
Thanks so much for your work on this!!! |
Hi Lizzie, Thanks for trying it out and for your comments! Oh no! That was my bad. As of last Thursday, I still hadn't tried the GCHP build with GNU compilers. Sorry, I completely blanked on communicating that. A bug in my Yesterday morning I tried the build with GNU compilers and it looks like it's working now. I had to make two small fixes (for some missing Easy things
I can add these to the final set of instructions. For demoing the CMake builds, I'm just assuming a run directory was already created (using
Sounds good, PS: See my "Improving usability" below. If you set
This is okay. I think the language I used here is confusing. I'll change "version" to "repo description". These are the output of git describe so when the repo's are ahead of a tagged version, a more verbose description is printed (also, some of the tags might be missing on my branch so you might get something like ESMF
I thought that ESMF was going to be made an external dependency. Is that happening in a later version? Right now my CMake scripts are expecting ESMF to be built and installed in a separate step, using ESMF's instructions. I was expecting users to do this locally or to get their sysadmin to install ESMF system-wide, and then point CMake to their install with CMake doesn't need much from ESMF. In fact, the only reference to ESMF in our CMakeLists is a call to Note: In the v8.0.0 snapshot, So, because of this, it doesn't really matter how ESMF is built. It's easiest and safest if ESMF is an external dependency (then we just call
General things
Note: The following is CMake's default behavior (i.e. these aren't decision I've made) The Makefiles that CMake generates have Cleaning is somewhat different though. Before explaining the difference, I should mention that This means that after modifying source code there's no need to clean before recompiling. The
I'll defer to your judgement on this because you have a better understanding of users' workflow than I do. I do, however, have concerns about this. IMO a benefit of using CMake to build GEOS-Chem is that CMake has a somewhat standard way of building software. This means that building GEOS-Chem with CMake is similar to building any other software project with CMake. This makes troubleshooting easier (errors aren't unique to GEOS-Chem so they're easier to google), improves familiarity for new users (or familiarity for GEOS-Chem users building other software; also, someone that's familiar with CMake probably doesn't even need to read the build instructions), and ultimately it should break GEOS-Chem's build procedure into transparent steps. I know I haven't quite got things right from the usability standpoint yet, but I think that with a little more playing around I can get it right. I think some of the things that made the run directory's Makefile so useful are included in CMake's default behavior (recompiling and tiered build options with the dependency solving). For things that aren't related to building GEOS-Chem, though, like cleaning up the run directory, I totally get that a utility script is helpful for that. Improving usabilityI think that I could make things easier by getting users to set environment variables along side If you set the
Previously, I said that the CMake build system didn't require any environment setup, so I've shied away from using these. But, I think that this would make the build system easier to use because it would just work out of the box. Thanks again for your help! Let me know what you think. Liam |
I just updated the GCHP build instructions (here). Now when you initialize your build directory you shouldn't get any errors (because the ESMF and GFTL install locations are specified with the |
Hi Liam, I wonder if it makes the most sense to include CMake capability for GCHP in the version that includes the restructuring rather than 12.5? Development of it will start very soon so it seems logical to direct work towards that version rather than one that is both more difficult to work with and very short-lived. |
Hi Lizzie, Okay, I see, that makes sense. I thought that ESMF removal was more immediate.
I agree. The payoff for getting CMake into 12.5 rather than the version with restructuring is probably pretty slim, and there's a lot more potential for problems if ESMF is built as an ExternalProject. For the time being, it's fine to use an ESMF build from another instance of GCHP as your ESMF installation (i.e. something like Thanks, |
Hi everyone,
This is an updated PR (replacing PR #23) adding CMake support to GCHP.
After the changes in 12.4.0, I did a bit of an overhaul of the GC-Classic build system. The main goal of the overhaul was simplifying things and to cleaning things up. Because of the changes in 12.4.0 (especially the removal of compiler definitions by FlexGrid), I was able to make some nice simplifications to the build system.
As a part of the overhaul, I took some time to come up with rules for controlling the GEOS-Chem build from an external project (e.g. GCHP), and this new PR uses those rules to control how the code in GC-Classic is built. This means the GC-Classic build system is almost unaware of GCHP (and GCHP builds the code in GC-Classic similar to how any other project would build GEOS-Chem).
The GC-Classic overhaul ended up making the GCHP build a lot easier too (I only added 5 files to GCHP besides the
cmake/
directory which is copied from ESMA, and ESMA's CMakeLists are almost stock). And because of this, I decided to rewrite the GCHP build system yesterday afternoon (so that the commit history doesn't have my development history).I'll update this PR when it's ready to be tried out!
Liam