-
Notifications
You must be signed in to change notification settings - Fork 82
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
Possible to build without internet access aka pre-built dependencies? #128
Comments
Good question, I don't know. I'm curious to hear if your idea works. If it does, let's please add it to the repo. @scivision let us know if you have any ideas about how best to handle this situation with CMake. |
Note: Something like this might be needed anyway. We have hopes to move from Baselibs to spack in the future. In that case, you'd almost have to separate out the builds (I think) to spack-ize this. |
Good news, I'm close. Bad news, I'm afraid I'm doing something..."bad" with CMake. So, the issue seems to be some weird interaction with the way I build HDF5 and I guess how
This is because we don't build HDF5 with CMake, but rather autotools and we install it oddly (for legacy reasons), so we have to sort of tell it where to find things. Ugly, but when I put some prints in the find_package(HDF5 COMPONENTS Fortran REQUIRED)
message(STATUS "HDF5_FOUND: ${HDF5_FOUND}")
message(STATUS "HDF5_LIBRARIES: ${HDF5_LIBRARIES}") I see:
Now the first time I tried if (HDF5_IS_PARALLEL)
message(STATUS "HDF5 is parallel")
target_link_libraries(HDF5::HDF5 INTERFACE MPI::MPI_Fortran)
endif() and that got me past the first issue. Huzzah. But now when I do make:
To me that looks like it can't find the HL libraries. So, I made some modifications: find_package(HDF5 COMPONENTS Fortran REQUIRED
OPTIONAL_COMPONENTS C HL)
if (HDF5_HL_FOUND)
message(STATUS "HDF5 HL is available")
target_link_libraries(HDF5::HDF5 INTERFACE hdf5::hdf5_hl hdf5::hdf5_hl_fortran)
endif()
if (HDF5_IS_PARALLEL)
message(STATUS "HDF5 is parallel")
target_link_libraries(HDF5::HDF5 INTERFACE MPI::MPI_Fortran)
endif() And that seemed to work. For reasons I don't understand, I needed to ask for both But this seems...wrong. I'd have thought Is this because we build HDF5 as static maybe? |
Great! I don't understand it either. My rule of thumb has been that if the linker asks for dependencies and I don't understand why, just make it happy. Yes, the PR will be very welcome. |
Okay. I've made a draft PR (see #129) so you can see my changes. Good news, works for me (at least the neural-fortran
|
I'm wondering if maybe the reordering I did with |
Well, I can change that error to another error by moving things around. Dang it. @milancurcic Can you try out my branch locally? I'm wondering if this is just Baselibs being weird or if I did break things. |
Yes, I'll try it in the afternoon. |
Thanks. Some good news. I can get it to work for me in the FetchContent way, but only by changing h5fortran. 😦 The change is this code:
and I seem to have to do:
So this must be an order-of-operations thing, but I'm danged if I can figure it out. If I don't have the Grah. |
A user I help support with the GEOS model has asked for neural-fortran to be used. The main issue I'm currently having is how I can build it in my "usual" way.
For example, currently I use ESMA-Baselibs to install the "base libraries" used by GEOS. Now, Baselibs is "nice" for clusters in that I can clone it on a node with internet access (and download a few things not on GitHub and not submodule-able) and then do all the other tasks on a compute node where things like
make -j10
are allowed (head nodes maaaaybe they'd allowmake -j2
).The issue I see here is that if I use the CMake install method, it looks like it always uses
FetchContent
which of course would fail on a compute node at CMake time since it couldn't get the code since compute nodes can't see the internet.So, I wondered, do you have ideas on how to handle this? My first thought was I can add functional-fortran, h5fortran, and json-fortran as submodules, but I think I'd need to do something like in, say,
functional.cmake
:Does that look about right? I'm going to try this and see in some test builds but I even wondered if you'd be willing to support such a change.
The text was updated successfully, but these errors were encountered: