-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a127cfa
commit 4a93fcf
Showing
2 changed files
with
139 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,145 @@ | ||
cmake_minimum_required(VERSION 3.9) | ||
project (Seto LANGUAGES CXX C) | ||
cmake_minimum_required(VERSION 3.1) | ||
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) | ||
|
||
include(GNUInstallDirs) | ||
|
||
find_package(OpenMP) | ||
set(CUDD_DIR ${CMAKE_SOURCE_DIR}/libs/cudd) | ||
if(MSVC OR MINGW) | ||
if (CMAKE_CL_64) | ||
set(CUDD_CONFIG_DIR ${CMAKE_SOURCE_DIR}/libs/cudd-config/windows) | ||
else() | ||
set(CUDD_CONFIG_DIR ${CMAKE_SOURCE_DIR}/libs/cudd-config/windows-32) | ||
endif() | ||
else() | ||
set(CUDD_CONFIG_DIR ${CMAKE_SOURCE_DIR}/libs/cudd-config/unix) | ||
endif() | ||
set(UNISTD_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libs/unistd) | ||
set(GETOPT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libs/getopt) | ||
|
||
add_library(libminisat STATIC | ||
# Impl files | ||
libs/minisat/core/Solver.cc | ||
libs/minisat/core/SolverTypes.cc | ||
libs/minisat/utils/Options.cc | ||
# Header files for IDEs | ||
libs/minisat/core/Dimacs.h | ||
libs/minisat/core/Solver.h | ||
libs/minisat/core/SolverTypes.h | ||
libs/minisat/mtl/Alg.h | ||
libs/minisat/mtl/Alloc.h | ||
libs/minisat/mtl/Heap.h | ||
libs/minisat/mtl/IntTypes.h | ||
libs/minisat/mtl/Map.h | ||
libs/minisat/mtl/Queue.h | ||
libs/minisat/mtl/Sort.h | ||
libs/minisat/mtl/Vec.h | ||
libs/minisat/mtl/XAlloc.h | ||
libs/minisat/utils/Options.h) | ||
set(SOURCES | ||
${CUDD_DIR}/cudd/cuddAddAbs.c | ||
${CUDD_DIR}/cudd/cuddAddApply.c | ||
${CUDD_DIR}/cudd/cuddAddFind.c | ||
${CUDD_DIR}/cudd/cuddAddInv.c | ||
${CUDD_DIR}/cudd/cuddAddIte.c | ||
${CUDD_DIR}/cudd/cuddAddNeg.c | ||
${CUDD_DIR}/cudd/cuddAddWalsh.c | ||
${CUDD_DIR}/cudd/cuddAndAbs.c | ||
${CUDD_DIR}/cudd/cuddAnneal.c | ||
${CUDD_DIR}/cudd/cuddApa.c | ||
${CUDD_DIR}/cudd/cuddAPI.c | ||
${CUDD_DIR}/cudd/cuddApprox.c | ||
${CUDD_DIR}/cudd/cuddBddAbs.c | ||
${CUDD_DIR}/cudd/cuddBddCorr.c | ||
${CUDD_DIR}/cudd/cuddBddIte.c | ||
${CUDD_DIR}/cudd/cuddBridge.c | ||
${CUDD_DIR}/cudd/cuddCache.c | ||
${CUDD_DIR}/cudd/cuddCheck.c | ||
${CUDD_DIR}/cudd/cuddClip.c | ||
${CUDD_DIR}/cudd/cuddCof.c | ||
${CUDD_DIR}/cudd/cuddCompose.c | ||
${CUDD_DIR}/cudd/cuddDecomp.c | ||
${CUDD_DIR}/cudd/cuddEssent.c | ||
${CUDD_DIR}/cudd/cuddExact.c | ||
${CUDD_DIR}/cudd/cuddExport.c | ||
${CUDD_DIR}/cudd/cuddGenCof.c | ||
${CUDD_DIR}/cudd/cuddGenetic.c | ||
${CUDD_DIR}/cudd/cuddGroup.c | ||
${CUDD_DIR}/cudd/cuddHarwell.c | ||
${CUDD_DIR}/cudd/cuddInit.c | ||
${CUDD_DIR}/cudd/cuddInteract.c | ||
${CUDD_DIR}/cudd/cuddLCache.c | ||
${CUDD_DIR}/cudd/cuddLevelQ.c | ||
${CUDD_DIR}/cudd/cuddLinear.c | ||
${CUDD_DIR}/cudd/cuddLiteral.c | ||
${CUDD_DIR}/cudd/cuddMatMult.c | ||
${CUDD_DIR}/cudd/cuddPriority.c | ||
${CUDD_DIR}/cudd/cuddRead.c | ||
${CUDD_DIR}/cudd/cuddRef.c | ||
${CUDD_DIR}/cudd/cuddReorder.c | ||
${CUDD_DIR}/cudd/cuddSat.c | ||
${CUDD_DIR}/cudd/cuddSign.c | ||
${CUDD_DIR}/cudd/cuddSolve.c | ||
${CUDD_DIR}/cudd/cuddSplit.c | ||
${CUDD_DIR}/cudd/cuddSubsetHB.c | ||
${CUDD_DIR}/cudd/cuddSubsetSP.c | ||
${CUDD_DIR}/cudd/cuddSymmetry.c | ||
${CUDD_DIR}/cudd/cuddTable.c | ||
${CUDD_DIR}/cudd/cuddUtil.c | ||
${CUDD_DIR}/cudd/cuddWindow.c | ||
${CUDD_DIR}/cudd/cuddZddCount.c | ||
${CUDD_DIR}/cudd/cuddZddFuncs.c | ||
${CUDD_DIR}/cudd/cuddZddGroup.c | ||
${CUDD_DIR}/cudd/cuddZddIsop.c | ||
${CUDD_DIR}/cudd/cuddZddLin.c | ||
${CUDD_DIR}/cudd/cuddZddMisc.c | ||
${CUDD_DIR}/cudd/cuddZddPort.c | ||
${CUDD_DIR}/cudd/cuddZddReord.c | ||
${CUDD_DIR}/cudd/cuddZddSetop.c | ||
${CUDD_DIR}/cudd/cuddZddSymm.c | ||
${CUDD_DIR}/cudd/cuddZddUtil.c | ||
${CUDD_DIR}/util/cpu_stats.c | ||
${CUDD_DIR}/util/cpu_time.c | ||
${CUDD_DIR}/util/cstringstream.c | ||
${CUDD_DIR}/util/datalimit.c | ||
${CUDD_DIR}/util/pathsearch.c | ||
${CUDD_DIR}/util/pipefork.c | ||
${CUDD_DIR}/util/prtime.c | ||
${CUDD_DIR}/util/strsav.c | ||
${CUDD_DIR}/util/texpand.c | ||
${CUDD_DIR}/util/ucbqsort.c | ||
${CUDD_DIR}/util/safe_mem.c | ||
${CUDD_DIR}/st/st.c | ||
${CUDD_DIR}/epd/epd.c | ||
${CUDD_DIR}/mtr/mtrBasic.c | ||
${CUDD_DIR}/mtr/mtrGroup.c | ||
${CUDD_DIR}/cplusplus/cuddObj.cc | ||
) | ||
|
||
target_include_directories(libminisat | ||
PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libs> | ||
) | ||
add_library(cudd STATIC ${SOURCES}) | ||
target_include_directories(cudd PRIVATE ${CUDD_DIR}/cudd ${CUDD_DIR}/util ${CUDD_DIR}/st ${CUDD_DIR}/epd ${CUDD_DIR}/mtr ${CUDD_DIR} ${CUDD_CONFIG_DIR}) | ||
if (MSVC) | ||
target_include_directories(cudd PRIVATE ${UNISTD_INCLUDE_DIR} ${GETOPT_INCLUDE_DIR}) | ||
endif() | ||
#add_dependencies(cudd CUDD_DOWNLOAD) | ||
|
||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libs) | ||
if (MSVC) | ||
set(CUDD_INCLUDE_DIR ${CUDD_DIR}/cplusplus ${CUDD_DIR}/cudd ${CUDD_DIR}/util ${CUDD_CONFIG_DIR} ${UNISTD_INCLUDE_DIR} ${GETOPT_INCLUDE_DIR} PARENT_SCOPE) | ||
else() | ||
set(CUDD_INCLUDE_DIR ${CUDD_DIR}/cplusplus ${CUDD_DIR}/cudd ${CUDD_DIR}/util ${CUDD_CONFIG_DIR} PARENT_SCOPE) | ||
endif() | ||
|
||
# Grab the files | ||
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) | ||
file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h) | ||
set(PBLIB_DIR ${CMAKE_SOURCE_DIR}/libs/pblib/pblib) | ||
|
||
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} | ||
include/main.h) | ||
set(PBLIB_SOURCE_FILES | ||
${PBLIB_DIR}/auxvarmanager.cpp | ||
${PBLIB_DIR}/clausedatabase.cpp | ||
${PBLIB_DIR}/formula.cpp | ||
${PBLIB_DIR}/helper.cpp | ||
${PBLIB_DIR}/incpbconstraint.cpp | ||
${PBLIB_DIR}/IncrementalData.cpp | ||
${PBLIB_DIR}/IncSimplePBConstraint.cpp | ||
${PBLIB_DIR}/pb2cnf.cpp | ||
${PBLIB_DIR}/PBConfig.cpp | ||
${PBLIB_DIR}/pbconstraint.cpp | ||
${PBLIB_DIR}/PBFuzzer.cpp | ||
${PBLIB_DIR}/PBParser.cpp | ||
${PBLIB_DIR}/preencoder.cpp | ||
${PBLIB_DIR}/SimplePBConstraint.cpp | ||
${PBLIB_DIR}/VectorClauseDatabase.cpp | ||
${PBLIB_DIR}/encoder/adderencoding.cpp | ||
${PBLIB_DIR}/encoder/amo.cpp | ||
${PBLIB_DIR}/encoder/bdd.cpp | ||
${PBLIB_DIR}/encoder/BDD_Seq_Amo.cpp | ||
${PBLIB_DIR}/encoder/bimander_amo_encoding.cpp | ||
${PBLIB_DIR}/encoder/binary_amo.cpp | ||
${PBLIB_DIR}/encoder/BinaryMerge.cpp | ||
${PBLIB_DIR}/encoder/cardencoding.cpp | ||
${PBLIB_DIR}/encoder/commander_encoding.cpp | ||
${PBLIB_DIR}/encoder/Encoder.cpp | ||
${PBLIB_DIR}/encoder/k-product.cpp | ||
${PBLIB_DIR}/encoder/naive_amo_encoder.cpp | ||
${PBLIB_DIR}/encoder/sorting_merging.cpp | ||
${PBLIB_DIR}/encoder/SortingNetworks.cpp | ||
${PBLIB_DIR}/encoder/SWC.cpp | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} libminisat) | ||
target_link_libraries(${PROJECT_NAME} pblib) | ||
if( python3.10_FOUND ) | ||
target_link_libraries(${PROJECT_NAME} python3.10) #needed for networkx usage | ||
endif() | ||
target_link_libraries(${PROJECT_NAME} cudd) | ||
if( OpenMP_FOUND ) | ||
target_link_libraries(${PROJECT_NAME} OpenMP::OpenMP_CXX) | ||
endif() | ||
target_include_directories(${PROJECT_NAME} PRIVATE ${CUDD_INCLUDE_DIR}) | ||
add_dependencies(${PROJECT_NAME} cudd) | ||
|
||
if( python3.10_FOUND ) | ||
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" ) | ||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -I/usr/include/python3.10) | ||
endif() | ||
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" ) | ||
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /wd4267 -I/usr/include/python3.10) | ||
endif() | ||
else() | ||
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" ) | ||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra) | ||
endif() | ||
if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" ) | ||
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /wd4267) | ||
endif() | ||
endif() | ||
add_library(pblib STATIC ${PBLIB_SOURCE_FILES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters