From 937af31d4c4279edf8613805fe9761b621333ad9 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Fri, 14 Jun 2024 18:01:29 +0200 Subject: [PATCH 1/2] include nauty objects into libscip - skip the separate nauty lib - fixes problems for users of static lib due to libscip not including nauty objects; shared lib was ok - problems was introduced with !3427 --- CMakeLists.txt | 10 ++++------ src/CMakeLists.txt | 18 +++--------------- src/nauty/CMakeLists.txt | 21 --------------------- 3 files changed, 7 insertions(+), 42 deletions(-) delete mode 100644 src/nauty/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index da7fb938b9..2c72e46ca7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,6 @@ set(CMAKE_CXX_STANDARD 14) #search the selected symmetry computation program message(STATUS "Finding symmetry computation program \"${SYM}\"") -unset(NAUTY_TARGET) if(SYM STREQUAL "bliss" OR SYM STREQUAL "sbliss") if(SYM STREQUAL "bliss") message(STATUS "Support SYM: bliss") @@ -174,16 +173,15 @@ elseif(SYM STREQUAL "nauty" OR SYM STREQUAL "snauty") set(SYM_LIBRARIES ${NAUTY_DIR}/nauty/nauty.a) set(SYM_PIC_LIBRARIES ${NAUTY_DIR}/nauty/nauty.a) else() - add_subdirectory(src/nauty) - set(SYM_PIC_LIBRARIES nauty) - set(NAUTY_TARGET nauty) + include_directories(src/nauty) + set(sym nauty/nauty.c nauty/nautil.c nauty/nausparse.c nauty/schreier.c nauty/naurng.c) endif() if(SYM STREQUAL "nauty") message(STATUS "Support SYM: nauty") - set(sym symmetry/compute_symmetry_nauty.c) + set(sym ${sym} symmetry/compute_symmetry_nauty.c) elseif(SYM STREQUAL "snauty") message(STATUS "Support SYM: sassy+nauty") - set(sym symmetry/compute_symmetry_sassy_nauty.cpp symmetry/build_sassy_graph.cpp) + set(sym ${sym} symmetry/compute_symmetry_sassy_nauty.cpp symmetry/build_sassy_graph.cpp) # sassy needs C++-17 set(CMAKE_CXX_STANDARD 17) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 11cf764ff9..e6fda2d595 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1068,24 +1068,12 @@ if(SHARED) set(ZIMPL_NEEDED 0) target_link_libraries(libscip PRIVATE ${ZIMPL_PIC_LIBRARIES} ${LPS_PIC_LIBRARIES} ${SYM_PIC_LIBRARIES}) add_executable(scip main.c ${scipsources} ${objscipsources} ${lpisources} ${tpisources} ${symsources}) - if(DEFINED NAUTY_TARGET) - target_link_libraries(scip PRIVATE ${NAUTY_TARGET}) - endif() else() set(SOPLEX_NEEDED ${SOPLEX_FOUND}) set(ZIMPL_NEEDED ${ZIMPL_FOUND}) - if(DEFINED NAUTY_TARGET) - target_link_libraries(libscip PRIVATE ${ZIMPL_LIBRARIES} ${LPS_LIBRARIES}) - else() - target_link_libraries(libscip PRIVATE ${ZIMPL_LIBRARIES} ${LPS_LIBRARIES} ${SYM_LIBRARIES}) - endif() + target_link_libraries(libscip PRIVATE ${ZIMPL_LIBRARIES} ${LPS_LIBRARIES} ${SYM_LIBRARIES}) add_executable(scip main.c) - if(DEFINED NAUTY_TARGET) - target_link_libraries(scip PUBLIC libscip) - target_link_libraries(scip PRIVATE ${NAUTY_TARGET}) - else() - target_link_libraries(scip PUBLIC libscip) - endif() + target_link_libraries(scip PUBLIC libscip) endif() add_executable(SCIP::SCIP ALIAS scip) @@ -1161,7 +1149,7 @@ install(TARGETS scip libscip EXPORT scip-targets INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # Add all targets to the build-tree export set -export(TARGETS scip libscip ${NAUTY_TARGET} +export(TARGETS scip libscip FILE "${PROJECT_BINARY_DIR}/scip-targets.cmake") # make soplex and zimpl dir absolute for the config file diff --git a/src/nauty/CMakeLists.txt b/src/nauty/CMakeLists.txt deleted file mode 100644 index 0b167ddec0..0000000000 --- a/src/nauty/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -cmake_minimum_required(VERSION 3.9) - -# Set the project name -project(nauty) - -# Add the source files -set(SOURCE_FILES - nauty.c - nautil.c - nausparse.c - schreier.c - naurng.c -) - -# fPIC -if(SHARED) - set(CMAKE_POSITION_INDEPENDENT_CODE ON) -endif() - -# Add the library target -add_library(nauty STATIC ${SOURCE_FILES}) From db71bb7a8e9d599cf2437e24714852085401e0f5 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Fri, 14 Jun 2024 22:16:38 +0200 Subject: [PATCH 2/2] fix prototype --- src/nauty/naurng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nauty/naurng.c b/src/nauty/naurng.c index bc5a73bf55..aa9b868698 100644 --- a/src/nauty/naurng.c +++ b/src/nauty/naurng.c @@ -87,7 +87,7 @@ ran_init_time(unsigned long long extra) } unsigned long long -ran_nextran() +ran_nextran(void) /*SV added void*/ /* Make a 64-bit random number */ { return KISS;