@@ -99,15 +99,26 @@ add_library(libvpr STATIC
9999target_include_directories (libvpr PUBLIC ${LIB_INCLUDE_DIRS} )
100100target_include_directories (libvpr PUBLIC ${READ_EDIF_SRC_DIR} )
101101
102+ # Find if Eigen is installed. Eigen is used within the Analytical Solver of the
103+ # Analytical Placement flow. If Eigen is not installed, certain solvers cannot
104+ # be used.
105+ find_package (Eigen3 3.3 NO_MODULE)
106+ if (TARGET Eigen3::Eigen)
107+ target_link_libraries (libvpr Eigen3::Eigen)
108+ target_compile_definitions (libvpr PUBLIC -DEIGEN_INSTALLED)
109+ message (STATUS "Eigen3: Found" )
110+ else ()
111+ message (STATUS "Eigen3: Not Found. Some features may be disabled." )
112+ endif (TARGET Eigen3::Eigen)
113+
102114#VPR_ANALYTIC_PLACE is initialized in the root CMakeLists
103- #Check Eigen dependency
115+ # NOTE: This is the cluster-level Analytical Placement which existed before the
116+ # flat Analytical Placement flow.
104117if (${VPR_ANALYTIC_PLACE} )
105118 message (STATUS "VPR Analytic Placement: Requested" )
106- find_package (Eigen3 3.3 NO_MODULE)
107119 if (TARGET Eigen3::Eigen)
108120 message (STATUS "VPR Analytic Placement dependency (Eigen3): Found" )
109121 message (STATUS "VPR Analytic Placement: Enabled" )
110- target_link_libraries (libvpr Eigen3::Eigen)
111122 target_compile_definitions (libvpr PUBLIC -DENABLE_ANALYTIC_PLACE)
112123 else ()
113124 message (STATUS "VPR Analytic Placement dependency (Eigen3): Not Found (Download manually with sudo apt install libeigen3-dev, and rebuild)" )
@@ -132,19 +143,21 @@ endif ()
132143set_target_properties (libvpr PROPERTIES PREFIX "" ) #Avoid extra 'lib' prefix
133144
134145#Specify link-time dependencies
146+ find_package (ZLIB)
135147target_link_libraries (libvpr
136- libvtrutil
137- libarchfpga
138- libsdcparse
139- libblifparse
140- libtatum
141- libargparse
142- libpugixml
143- librrgraph
144- libreadedif
145- ${OPENSSL_LIBRARIES}
146- ${VERIFIC_LIBS} dl
147- )
148+ libvtrutil
149+ libarchfpga
150+ libsdcparse
151+ libblifparse
152+ libtatum
153+ libargparse
154+ libpugixml
155+ librrgraph
156+ libreadedif
157+ ${OPENSSL_LIBRARIES}
158+ ${VERIFIC_LIBS}
159+ ZLIB::ZLIB dl
160+ )
148161
149162if (VPR_USE_SERVER)
150163 target_link_libraries (libvpr
@@ -330,7 +343,7 @@ file(GLOB_RECURSE TEST_SOURCES test/*.cpp)
330343add_executable (test_vpr ${TEST_SOURCES} )
331344target_link_libraries (test_vpr
332345 Catch2::Catch2WithMain
333- libvpr)
346+ libvpr -lz )
334347
335348#Suppress IPO link warnings if IPO is enabled
336349get_target_property (TEST_VPR_USES_IPO vpr INTERPROCEDURAL_OPTIMIZATION )
0 commit comments