-
Notifications
You must be signed in to change notification settings - Fork 525
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 externally provided third-party libraries #1779
Comments
One possible solution: https://github.com/cpm-cmake/CPM.cmake Also some chatter on the cmake repo about enabling a seamless integration of |
Just to reframe this a little bit, there's really two separate parts:
|
I have started working on this following the same If using CMake with a clean install and no installed packages (so expect to use all the submodules), this works just fine and compiles. But if I compile a second time that requires updating cmake, the build fails (but cmake is still successful). In this case, the packages are found in the system because they are already built with a previous OpenMC build and it is reported that the module is found. CMake is ultimately successful still. But then in the make process gls fails (see error below), even though it is still using the exact same Details: CMake/make output from a clean install:
Force Cmake to run again, without removing install files (can reproduce this by just adding a blank line to the
Two questions:
|
If the I was able to reproduce that error you're seeing, and it looks like we should be using the namespaced name for gsl-lite-v1 in target_link_libraries: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d588cb84..38069662a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -446,7 +446,7 @@ endif()
# target_link_libraries treats any arguments starting with - but not -l as
# linker flags. Thus, we can pass both linker flags and libraries together.
target_link_libraries(libopenmc ${ldflags} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}
- pugixml faddeeva xtensor gsl-lite-v1 fmt::fmt)
+ pugixml faddeeva xtensor gsl::gsl-lite-v1 fmt::fmt)
if(dagmc)
target_compile_definitions(libopenmc PRIVATE DAGMC) |
Presumably, the |
This solution is maybe a little dirty, but we could set up all the submodules as forks under There are some unmerged patches I have to use with |
@kkiesling Yeah, I found the behavior you're seeing a little strange too. To reproduce what you were seeing, I explicitly had to add my install directory to @gridley I understand the motivation to tweak things for GPU porting purposes, but I'd rather not be in the game of managing our own versions of these dependencies. Each time we want to update our own version, there will be potential conflicts to be resolved. |
my cmake line included |
Closed by #2006 |
Along the same lines as #1778, OpenMC should allow using third-party libraries that are not vendored in order to play nicely when it is built as part of a larger software stack. We recently started allowing this for pugixml and fmt, but xtensor, xtl, and gsl-lite are forced to be our own vendored versions.
I'll note that this is not a hypothetical issue -- we've run into problems recently with builds of ENRICO, which may include both OpenMC and Shift, having conflicting copies of pugixml and gsl-lite.
The text was updated successfully, but these errors were encountered: