The source code and dockerfile for the GSW2024 AI Lab.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

75 lines
3.8 KiB

4 weeks ago
  1. cmake_minimum_required(VERSION 3.0.0)
  2. project(pycarl)
  3. find_package(carl REQUIRED)
  4. find_package(carlparser QUIET)
  5. add_subdirectory(resources/pybind11)
  6. set(PYCARL_HAS_CLN ${CARL_USE_CLN_NUMBERS})
  7. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/definitions.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/definitions.h)
  8. # Core
  9. file(GLOB_RECURSE PYCARL_CORE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/core/*.cpp)
  10. pybind11_add_module(core ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_core.cpp ${PYCARL_CORE_SOURCES})
  11. target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
  12. target_link_libraries(core PRIVATE lib_carl)
  13. # Typed core
  14. file(GLOB_RECURSE PYCARL_TYPED_CORE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/typed_core/*.cpp)
  15. pybind11_add_module(gmp ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_gmp.cpp ${PYCARL_TYPED_CORE_SOURCES})
  16. target_include_directories(gmp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
  17. target_link_libraries(gmp PRIVATE lib_carl)
  18. pybind11_add_module(cln ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_cln.cpp ${PYCARL_TYPED_CORE_SOURCES})
  19. target_include_directories(cln PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
  20. target_link_libraries(cln PRIVATE lib_carl)
  21. target_compile_definitions(cln PUBLIC "PYCARL_USE_CLN=ON")
  22. # Formula
  23. file(GLOB_RECURSE PYCARL_FORMULA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/formula/*.cpp)
  24. pybind11_add_module(formula ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_formula.cpp ${PYCARL_FORMULA_SOURCES})
  25. target_include_directories(formula PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
  26. target_link_libraries(formula PRIVATE lib_carl)
  27. set_target_properties(formula PROPERTIES OUTPUT_NAME "formula")
  28. # Typed formula
  29. file(GLOB_RECURSE PYCARL_TYPED_FORMULA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/typed_formula/*.cpp)
  30. pybind11_add_module(formula-gmp ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_typed_formula.cpp ${PYCARL_TYPED_FORMULA_SOURCES})
  31. target_include_directories(formula-gmp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
  32. target_link_libraries(formula-gmp PRIVATE lib_carl)
  33. set_target_properties(formula-gmp PROPERTIES OUTPUT_NAME "formula")
  34. pybind11_add_module(formula-cln ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_typed_formula.cpp ${PYCARL_TYPED_FORMULA_SOURCES})
  35. target_include_directories(formula-cln PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
  36. target_link_libraries(formula-cln PRIVATE lib_carl)
  37. target_compile_definitions(formula-cln PUBLIC "PYCARL_USE_CLN=ON")
  38. set_target_properties(formula-cln PROPERTIES OUTPUT_NAME "formula")
  39. # Parse
  40. file(GLOB_RECURSE PYCARL_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/parse/*.cpp)
  41. pybind11_add_module(parse ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_parse.cpp ${PYCARL_PARSE_SOURCES})
  42. target_include_directories(parse PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
  43. target_link_libraries(parse PRIVATE lib_carl carl-parser)
  44. set_target_properties(parse PROPERTIES OUTPUT_NAME "parse")
  45. # Typed parse
  46. file(GLOB_RECURSE PYCARL_TYPED_PARSE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/typed_parse/*.cpp)
  47. pybind11_add_module(parse-gmp ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES})
  48. target_include_directories(parse-gmp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
  49. target_link_libraries(parse-gmp PRIVATE lib_carl carl-parser)
  50. set_target_properties(parse-gmp PROPERTIES OUTPUT_NAME "parse")
  51. pybind11_add_module(parse-cln ${CMAKE_CURRENT_SOURCE_DIR}/src/mod_typed_parse.cpp ${PYCARL_TYPED_PARSE_SOURCES})
  52. target_include_directories(parse-cln PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src)
  53. target_link_libraries(parse-cln PRIVATE lib_carl carl-parser)
  54. target_compile_definitions(parse-cln PUBLIC "PYCARL_USE_CLN=ON")
  55. set_target_properties(parse-cln PROPERTIES OUTPUT_NAME "parse")