From 0ea1aae23203df7bd55764fe9f4bddb746aa1061 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 2 Oct 2023 06:59:01 -0700 Subject: [PATCH 1/5] build: do not install libresource.so Problem: libresource.so was previously a convenience library, but is now installed by default. However, it has a generic name that could easily become confusing, and is named simply `libresource.so`, which doesn't follow standard shared library naming conventions. Make libresource a static convenience library instead and do not install it. The library should be renamed something like `libfluxion-resoruce.so` and possibly be versioned with an soname if installed in the future. Fixes #1093 --- resource/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resource/CMakeLists.txt b/resource/CMakeLists.txt index 64a7dd408..4c1cfc974 100644 --- a/resource/CMakeLists.txt +++ b/resource/CMakeLists.txt @@ -40,7 +40,7 @@ set(RESOURCE_HEADERS store/resource_graph_store.hpp ) -add_library(resource SHARED +add_library(resource STATIC policies/dfu_match_locality.cpp policies/dfu_match_var_aware.cpp policies/dfu_match_policy_factory.cpp @@ -87,8 +87,6 @@ target_link_libraries(resource PUBLIC jobspec_conv Boost::filesystem ) -install(TARGETS resource - LIBRARY) add_subdirectory(modules) add_subdirectory(reapi) From 54ba3ac75951129a134b0234156f4c82c7b6fb01 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 2 Oct 2023 07:15:08 -0700 Subject: [PATCH 2/5] build: set CMAKE_INSTALL_LIBDIR to flux-core libdir Problem: If flux-core was configured with a different libdir, then Fluxion modules can't be found by default. Ensure that CMAKE_INSTALL_LIBDIR matches the flux-core libdir by using FLUX_CORE_LIBDIR when flux-core is found by pkgconfig. Fixes #1092 --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e71a6f65d..da7523bd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,8 @@ find_package(FluxCore REQUIRED) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(STATUS "flux core found and no specific prefix specified, using ${FLUX_CORE_PREFIX}") set(CMAKE_INSTALL_PREFIX ${FLUX_CORE_PREFIX} CACHE PATH "..." FORCE) + message(STATUS "Using flux-core libdir of ${FLUX_CORE_LIBDIR}") + set(CMAKE_INSTALL_LIBDIR ${FLUX_CORE_LIBDIR} CACHE PATH "..." FORCE) endif() if(DEFINED ENV{PYTHON}) set(Python_EXECUTABLE $ENV{PYTHON} CACHE FILEPATH "") From 79ec8fc84167a9f6dbbdd1b8b63a06d843ef8eb1 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 2 Oct 2023 07:32:27 -0700 Subject: [PATCH 3/5] build: make docs by default when configured Problem: In the old build system, docs were built by default with `make`, but that is no longer the case with the CMake based build. Add the ALL keyword to the docs target so docs are built by default when configured. Fixes #1091 --- doc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 5e0d99b55..a6e683d67 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -47,6 +47,6 @@ if(SPHINX AND ENABLE_DOCS) ${Python_EXECUTABLE} -m sphinx -b html ${CMAKE_CURRENT_SOURCE_DIR} ./html ) add_custom_target(html DEPENDS ${man5_html_outputs}) - add_custom_target(docs + add_custom_target(docs ALL DEPENDS html manpages) endif() From bddcfbb3bcc5eecaeb11cb32d45ed48cda60faed Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 2 Oct 2023 13:14:05 -0700 Subject: [PATCH 4/5] build: link reapi golang bindings with planner Problem: Now that libresource is no longer marked SHARED, it seems that the reapi Go bindings need to explicitly include libplanner and libplanner_cxx. Add the explicit linkage to planner in CGO_LIBRARY_FLAGS. --- resource/reapi/bindings/go/src/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/reapi/bindings/go/src/test/CMakeLists.txt b/resource/reapi/bindings/go/src/test/CMakeLists.txt index 9c0a87b8f..8d139f8ca 100644 --- a/resource/reapi/bindings/go/src/test/CMakeLists.txt +++ b/resource/reapi/bindings/go/src/test/CMakeLists.txt @@ -3,7 +3,7 @@ set(SRCS main.go) set(CGO_CFLAGS "-I${CMAKE_BINARY_DIR}/resource/reapi/bindings/c") # This is currently passed but not used because when passed into add_custom_command the spaces are escaped -set(CGO_LIBRARY_FLAGS "-Wl,-R ${CMAKE_BINARY_DIR}/resource -L${CMAKE_BINARY_DIR}/resource/reapi/bindings -L${CMAKE_BINARY_DIR}/resource/libjobspec -ljobspec_conv -lreapi_cli -L${CMAKE_BINARY_DIR}/resource -lresource -lflux-idset -lstdc++ -lczmq -ljansson -lhwloc -lboost_system -lflux-hostlist -lboost_graph -lyaml-cpp") +set(CGO_LIBRARY_FLAGS "-Wl,-R ${CMAKE_BINARY_DIR}/resource -L${CMAKE_BINARY_DIR}/resource/reapi/bindings -L${CMAKE_BINARY_DIR}/resource/libjobspec -ljobspec_conv -lreapi_cli -L${CMAKE_BINARY_DIR}/resource -lresource -L${CMAKE_BINARY_DIR}/resource/planner/c -lplanner -L${CMAKE_BINARY_DIR}/resource/planner/c++ -lplanner_cxx -lflux-idset -lstdc++ -lczmq -ljansson -lhwloc -lboost_system -lflux-hostlist -lboost_graph -lyaml-cpp") # This ensures the main binary is cleaned up set_directory_properties( From 48bac5fed6ec98d6c13c07b0d6aebda9b1a95bc9 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 2 Oct 2023 13:47:55 -0700 Subject: [PATCH 5/5] build: do not build html docs by default Problem: In the previous version of the build system, html documentation was only built in ReadTheDocs or explicitly via `make html`, but currently html docs are built by default. This causes the build to fail if the sphinx_rtd_theme is not installed, whereas previously the build would succeed (with manpages available). Remove html from the default docs build target. --- doc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index a6e683d67..067865e1f 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -48,5 +48,5 @@ if(SPHINX AND ENABLE_DOCS) ) add_custom_target(html DEPENDS ${man5_html_outputs}) add_custom_target(docs ALL - DEPENDS html manpages) + DEPENDS manpages) endif()