-
Notifications
You must be signed in to change notification settings - Fork 9
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
Using find_package() in FindBaselibs to support generic build environments #29
Using find_package() in FindBaselibs to support generic build environments #29
Conversation
Changed FindBaselibs.cmake to use find_package() calls rather than hardcoded paths relative to BASEDIR. Added find-modules for ESMF, GFTL, and FLAP. Added mechanism for disabling the requiredness of ESMA dependencies.
This might take us a while to digest, but thanks for the work! As for your questions:
No. On Linux, we get But, I think for reasons @tclune might know better than I, we use
Yeeeeeeees...sort of. For example, this is what a Baselibs directory setup looks like:
For most of the libraries, yes, the include files are in
That's why we do |
Oh, and I want to ping @aerorahul who I think might be doing something similar with Baselibs for JEDI. |
And one more thing. My guess is is that But @aerorahul has been struggling with Baselibs so he might have more information. |
We have an updated version of |
Just to add to the history a bit here. The existing FindBaselibs was from my very early experience with CMake and was basically a kludge to allow us to proceed. Knowing better now, it is mostly a matter of prioritizing when to implement things the right/canonical way. As @aerorahul indicates, a proper FindNetCDF.cmake is a big step in that direction. Regarding |
Sounds good. I can add this to
This Is there a reason ESMA_cmake:develop's ecbuild external is on GEOS-ESM/ecbuild's |
@LiamBindle Regarding your last question: at the time we started this, there were some OS X and ifort portability issues that they had not anticipated. E.g., if you have just Intel Fortran then the MKL that is provided does not contain the C interfaces (which is odd, but true). But since one can obtain a full MKL for free, it should not be a real concern at this time. If GEOS can build with release/stable, I have no problem making that change. |
(And ignore my comment on the other branch.) |
Hi everyone. This PR is superseded by #57. |
Hi everyone,
This is a proposed fix for #28.
Note: This proposed change is not expected to change the default behavior of
ESMA_cmake
. If it does, I probably missed something!Proposed change
I would propose to use
find_package()
calls inFindBaselibs.cmake
, rather than hardcoded paths relative toBASEDIR
. Thesefind_package()
calls can resolve ESMA's dependencies in generic build environments, and the precedence ofBASEDIR
can be preserved by putting the hardcodedBASEDIR
paths inCMAKE_PREFIX_PATH
. I have added find-modules for ESMF, GFTL, and FLAP so that they can be found withfind_package()
. It looks like config-modules for fArgParse, pFUnit, and GFTL_SHARED come with their installations, so they should already be findable withfind_package()
.Special consideration
With this proposed fix, however, something else that should be considered is that not all ESMA dependencies are always necessary. For example, in GCHP, FLAP, fArgParse, GFTL_SHARED, and MKL are not necessary. Therefore, we need a mechanism for changing the "requiredness" of the dependencies that are found when
esma.cmake
is loaded. To do this, I added cache variables that control whether or not the "REQUIRED
" argument is passed tofind_package()
.This is related to #26. For example, to make GFTL_SHARED quiet you would make a cache entry for
GFTL_SHARED_IS_REQUIRED_ARG
and set its value toQUIET
.See geoschem/gchp_ctm/CMakeLists.txt for an example of loading
esma.cmake
and building ESMA libraries in an external project.Open questions
libesmf_fullylinked.a
the library GEOS-ESM needs to link on Apple machines? If so, I can add this toFindESMF.cmake
.BASEDIR
must look like based on the previousFindBaselibs.cmake
. Are libraries in${BASEDIR}/lib
, binaries in${BASEDIR}/bin
, and then include directories in${BASEDIR}/include/<library name>
? If so, I think I setCMAKE_PREFIX_PATH
properly. Otherwise, I'll have to updateCMAKE_PREFIX_PATH
.Also, I'll be at GMAO on September 25-27, and I'd be happy to talk about this PR then.
Let me know if you have any questions, comments, concerns, or if any clarification is needed.
Liam