cmake CUDD_DIR option

This commit is contained in:
James Cherry 2020-04-04 15:53:51 -07:00
parent 4c04aa0291
commit 7172beea17
2 changed files with 16 additions and 17 deletions

View File

@ -26,6 +26,8 @@ endif()
project(STA VERSION 2.0.18)
option(CUDD_DIR "CUDD BDD package directory")
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -560,15 +562,16 @@ endif()
#
# Locate CUDD bdd package.
#
set(CUDD 0)
find_library(CUDD_LIB
NAMES cudd
PATHS ENV CUDD
NAME cudd
PATHS ${CUDD_DIR}
PATH_SUFFIXES lib lib/cudd
)
if (CUDD_LIB)
message(STATUS "CUDD library: ${CUDD_LIB}")
get_filename_component(CUDD_LIB_DIR "${CUDD_LIB}" PATH)
get_filename_component(CUDD_LIB_PARENT1 "${CUDD_LIB_DIR}" PATH)
get_filename_component(CUDD_LIB_PARENT2 "${CUDD_LIB_PARENT1}" PATH)
find_file(CUDD_HEADER cudd.h
PATHS ${CUDD_LIB_PARENT1}/include ${CUDD_LIB_PARENT1}/include/cudd)
if (CUDD_HEADER)
@ -580,10 +583,6 @@ if (CUDD_LIB)
message(STATUS "CUDD header: not found")
endif()
else()
set(CUDD_INCLUDE "")
set(CUDD_LIB "")
set(CUDD_FOUND FALSE)
set(CUDD 0)
message(STATUS "CUDD library: not found")
endif()
@ -611,7 +610,6 @@ set(STA_INCLUDE_DIRS
search
util
verilog
${CUDD_INCLUDE}
)
###########################################################
@ -642,7 +640,9 @@ add_library(OpenSTA
)
target_include_directories(OpenSTA
PUBLIC ${STA_INCLUDE_DIRS}
PUBLIC
${STA_INCLUDE_DIRS}
${CUDD_INCLUDE}
${TCL_INCLUDE_PATH}
)
@ -675,13 +675,10 @@ target_link_libraries(sta
OpenSTA
sta_swig
${TCL_LIBRARY}
${CUDD_LIB}
ZLIB
CUDD_LIB
)
if (ZLIB_FOUND)
target_link_libraries(sta ${ZLIB_LIBRARIES})
endif()
message(STATUS "STA executable: ${STA_HOME}/app/sta")
# g++ std::thread apparently still needs -pthreads.

View File

@ -89,7 +89,8 @@ or [here](https://sourceforge.net/projects/cudd-mirror/).
Note that the file hierarchy of the CUDD installation changed with version 3.0.
Some changes to CMakeLists.txt are required to support older versions.
The cmake file searchs in the normal places for the CUDD library.
Use the CUDD_DIR option to set the install directory if it is not in
one of the normal install directories.
When building CUDD you may use the `--prefix ` option to `configure` to
install in a location other than the default (`/usr/local/lib`).
@ -99,8 +100,9 @@ mkdir $HOME/cudd
./configure --prefix $HOME/cudd
make
make install
# export location of cudd for make to find it
export CUDD=$HOME/cudd/lib
cd <opensta>/build
cmake .. -DCUDD_DIR=$HOME/cudd
```
The Zlib library is an optional. If CMake finds libz, OpenSTA can