From 0a969a6802cb447dc261404dd034086dee8b0087 Mon Sep 17 00:00:00 2001 From: Sergey Dolgov Date: Tue, 15 Oct 2024 16:13:15 -0700 Subject: [PATCH] merged patched VPR-CMakefile --- include/CMAKE_fix/PATCHED_VPR/CMakeLists.txt | 45 +++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/include/CMAKE_fix/PATCHED_VPR/CMakeLists.txt b/include/CMAKE_fix/PATCHED_VPR/CMakeLists.txt index f7cecb8b..c36661c4 100644 --- a/include/CMAKE_fix/PATCHED_VPR/CMakeLists.txt +++ b/include/CMAKE_fix/PATCHED_VPR/CMakeLists.txt @@ -99,15 +99,26 @@ add_library(libvpr STATIC target_include_directories(libvpr PUBLIC ${LIB_INCLUDE_DIRS}) target_include_directories(libvpr PUBLIC ${READ_EDIF_SRC_DIR}) +# Find if Eigen is installed. Eigen is used within the Analytical Solver of the +# Analytical Placement flow. If Eigen is not installed, certain solvers cannot +# be used. +find_package(Eigen3 3.3 NO_MODULE) +if (TARGET Eigen3::Eigen) + target_link_libraries (libvpr Eigen3::Eigen) + target_compile_definitions(libvpr PUBLIC -DEIGEN_INSTALLED) + message(STATUS "Eigen3: Found") +else () + message(STATUS "Eigen3: Not Found. Some features may be disabled.") +endif (TARGET Eigen3::Eigen) + #VPR_ANALYTIC_PLACE is initialized in the root CMakeLists -#Check Eigen dependency +# NOTE: This is the cluster-level Analytical Placement which existed before the +# flat Analytical Placement flow. if(${VPR_ANALYTIC_PLACE}) message(STATUS "VPR Analytic Placement: Requested") - find_package(Eigen3 3.3 NO_MODULE) if (TARGET Eigen3::Eigen) message(STATUS "VPR Analytic Placement dependency (Eigen3): Found") message(STATUS "VPR Analytic Placement: Enabled") - target_link_libraries (libvpr Eigen3::Eigen) target_compile_definitions(libvpr PUBLIC -DENABLE_ANALYTIC_PLACE) else () message(STATUS "VPR Analytic Placement dependency (Eigen3): Not Found (Download manually with sudo apt install libeigen3-dev, and rebuild)") @@ -132,19 +143,21 @@ endif () set_target_properties(libvpr PROPERTIES PREFIX "") #Avoid extra 'lib' prefix #Specify link-time dependencies +find_package(ZLIB) target_link_libraries(libvpr - libvtrutil - libarchfpga - libsdcparse - libblifparse - libtatum - libargparse - libpugixml - librrgraph - libreadedif - ${OPENSSL_LIBRARIES} - ${VERIFIC_LIBS} dl -) + libvtrutil + libarchfpga + libsdcparse + libblifparse + libtatum + libargparse + libpugixml + librrgraph + libreadedif + ${OPENSSL_LIBRARIES} + ${VERIFIC_LIBS} + ZLIB::ZLIB dl + ) if(VPR_USE_SERVER) target_link_libraries(libvpr @@ -330,7 +343,7 @@ file(GLOB_RECURSE TEST_SOURCES test/*.cpp) add_executable(test_vpr ${TEST_SOURCES}) target_link_libraries(test_vpr Catch2::Catch2WithMain - libvpr) + libvpr -lz) #Suppress IPO link warnings if IPO is enabled get_target_property(TEST_VPR_USES_IPO vpr INTERPROCEDURAL_OPTIMIZATION)