simplify cudd cmake support

This commit is contained in:
James Cherry 2020-04-03 09:23:27 -07:00
parent ed3e34d816
commit 4c04aa0291
2 changed files with 30 additions and 45 deletions

View File

@ -558,41 +558,33 @@ endif()
################################################################
#
# Locate CUDD bdd packagte
# -DCUDD=0 to not use CUDD.
# Look for library in CUDD/lib, CUDD/cudd/lib
# Look for header in CUDD/include, CUDD/cudd/include
# Locate CUDD bdd package.
#
if("${CUDD}" STREQUAL "" OR "${CUDD}" STREQUAL "0")
find_library(CUDD_LIB
NAMES cudd
PATHS ENV 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)
get_filename_component(CUDD_INCLUDE "${CUDD_HEADER}" PATH)
message(STATUS "CUDD header: ${CUDD_HEADER}")
# CUDD referenced by StaConfig.hh.cmake
set(CUDD 1)
else()
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")
else()
find_library(CUDD_LIB NAMES cudd PATHS ${CUDD}/lib ${CUDD}/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}/include ${CUDD_LIB_PARENT2}/include/cudd)
if (CUDD_HEADER)
get_filename_component(CUDD_INCLUDE "${CUDD_HEADER}" PATH)
message(STATUS "CUDD header: ${CUDD_HEADER}")
# CUDD referenced by StaConfig.hh.cmake
set(CUDD 1)
else()
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()
endif()
if("${SSTA}" STREQUAL "")

View File

@ -80,11 +80,17 @@ libz 1.1.4 1.2.5 1.2.8
cudd 2.4.1 3.0.0
```
CUDD is a binary decision diageram (BDD) package that is used to improve conditional timing arc handling. OpenSTA does not require it to be installed. It is available [here](https://www.davidkebo.com/source/cudd_versions/cudd-3.0.0.tar.gz) or [here](https://sourceforge.net/projects/cudd-mirror/).
CUDD is a binary decision diageram (BDD) package that is used to
improve conditional timing arc handling. OpenSTA does not require it
to be installed. It is available
[here](https://www.davidkebo.com/source/cudd_versions/cudd-3.0.0.tar.gz)
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.
When building CUDD you may use the `--prefix ` option to `configure` to
install in a location other than the default (`/usr/local/lib`).
```
@ -93,21 +99,8 @@ mkdir $HOME/cudd
./configure --prefix $HOME/cudd
make
make install
```
To not use CUDD specify `CUDD=0`.
Cmake looks for the CUDD library in `CUDD/lib, CUDD/cudd/lib`
and for the header in `CUDD/include, CUDD/cudd/include`.
```
# equivalent to -DCUDD=0
cmake ..
or
cmake .. -DCUDD=0
or
# look in ~/cudd/lib, ~/cudd/include
cmake .. -DCUDD=$HOME/cudd
or
# look in /usr/local/lib/cudd, /usr/local/include/cudd
cmake .. -DCUDD=/usr/local
# export location of cudd for make to find it
export CUDD=$HOME/cudd/lib
```
The Zlib library is an optional. If CMake finds libz, OpenSTA can