cmake support for /opt/local CUDD install

This commit is contained in:
James Cherry 2019-03-24 19:41:05 -07:00
parent 20ab0a1f23
commit 37df007eca
3 changed files with 352 additions and 338 deletions

View File

@ -205,7 +205,7 @@ set(STA_SOURCE
verilog/VerilogReader.cc verilog/VerilogReader.cc
verilog/VerilogLex.cc verilog/VerilogLex.cc
verilog/VerilogParse.cc verilog/VerilogParse.cc
) )
set(STA_HEADERS set(STA_HEADERS
app/StaMain.hh app/StaMain.hh
@ -399,6 +399,7 @@ set(STA_TCL_FILES
dcalc/DelayCalc.tcl dcalc/DelayCalc.tcl
parasitics/Parasitics.tcl parasitics/Parasitics.tcl
sdf/Sdf.tcl sdf/Sdf.tcl
tcl/Compatibility.tcl
verilog/Verilog.tcl verilog/Verilog.tcl
) )
@ -431,12 +432,10 @@ endif()
################################################################ ################################################################
# #
# Locate CUDD bdd packagte # Locate CUDD bdd packagte
# -DCUDD=0 to not use CUDD.
# CUDD variable has precidence over environment variable. # Look for library in CUDD/lib, CUDD/cudd/lib
if("${CUDD}" STREQUAL "") # Look for header in CUDD/include, CUDD/cudd/include
set(CUDD $ENV{CUDD}) #
endif()
if("${CUDD}" STREQUAL "" OR "${CUDD}" STREQUAL "0") if("${CUDD}" STREQUAL "" OR "${CUDD}" STREQUAL "0")
set(CUDD_INCLUDE "") set(CUDD_INCLUDE "")
set(CUDD_LIB "") set(CUDD_LIB "")
@ -444,12 +443,28 @@ if("${CUDD}" STREQUAL "" OR "${CUDD}" STREQUAL "0")
set(CUDD 0) set(CUDD 0)
message(STATUS "CUDD library: not found") message(STATUS "CUDD library: not found")
else() else()
set(CUDD_INCLUDE ${CUDD}/include) find_library(CUDD_LIB NAMES cudd PATHS ${CUDD}/lib ${CUDD}/lib/cudd)
find_library(CUDD_LIB NAMES cudd PATHS ${CUDD}/lib)
if (CUDD_LIB) 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 # CUDD referenced by StaConfig.hh.cmake
set(CUDD 1) set(CUDD 1)
message(STATUS "CUDD library: ${CUDD_LIB}") 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()
endif() endif()
@ -491,7 +506,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
/usr/local/lib /usr/local/lib
) )
set(TCL_NO_DEFAULT_PATH FALSE) set(TCL_NO_DEFAULT_PATH FALSE)
endif() endif()
if (NOT TCL_LIB) if (NOT TCL_LIB)
# bagbiter cmake doesn't have a way to pass NO_DEFAULT_PATH as a parameter. # bagbiter cmake doesn't have a way to pass NO_DEFAULT_PATH as a parameter.
@ -639,7 +654,7 @@ set(STA_INCLUDE_DIRS
verilog verilog
${TCL_HEADER_DIR} ${TCL_HEADER_DIR}
${CUDD_INCLUDE} ${CUDD_INCLUDE}
) )
########################################################### ###########################################################
# Library # Library
@ -654,7 +669,7 @@ target_include_directories(OpenSTA PUBLIC ${STA_INCLUDE_DIRS})
target_compile_features(OpenSTA target_compile_features(OpenSTA
PUBLIC cxx_auto_type PUBLIC cxx_auto_type
) )
########################################################### ###########################################################
# Executable # Executable

View File

@ -86,20 +86,20 @@ bison 1.35 3.0.4 2.3
flex 2.5.4 2.6.4 2.5.35 flex 2.5.4 2.6.4 2.5.35
``` ```
These packages are optional: These packages are **optional**:
``` ```
libz 1.1.4 1.2.5 1.2.8 libz 1.1.4 1.2.5 1.2.8
cudd 2.4.1 3.0.0 cudd 2.4.1 3.0.0
``` ```
CUDD is a binary decision diageram (BDD) package that is used to improve conditional timing arc handling. 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. Note that the file hierarchy of the CUDD installation changed with version 3.0.
Some changes to the CMake are required to support older versions. Some changes to CMakeLists.txt are required to support older versions.
You may use the `--prefix ` option to `configure` to install in a location other than When building CUDD you may use the `--prefix ` option to `configure` to
the default (`/usr/local/lib`). install in a location other than the default (`/usr/local/lib`).
``` ```
cd $HOME/cudd-3.0.0 cd $HOME/cudd-3.0.0
mkdir $HOME/cudd mkdir $HOME/cudd
@ -107,6 +107,21 @@ mkdir $HOME/cudd
make make
make install 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
```
The Zlib library is an optional. If CMake finds libz, OpenSTA can The Zlib library is an optional. If CMake finds libz, OpenSTA can
read Verilog, SDF, SPF, and SPEF files compressed with gzip. read Verilog, SDF, SPF, and SPEF files compressed with gzip.
@ -121,7 +136,7 @@ git clone https://xp-dev.com/git/opensta
cd opensta cd opensta
mkdir build mkdir build
cd build cd build
cmake .. -DCUDD=$HOME/cudd cmake ..
make make
``` ```
The default build type is release to compile optimized code. The default build type is release to compile optimized code.
@ -135,7 +150,7 @@ CMAKE_BUILD_TYPE DEBUG|RELEASE
CMAKE_CXX_FLAGS - additional compiler flags CMAKE_CXX_FLAGS - additional compiler flags
TCL_LIB - path to tcl library TCL_LIB - path to tcl library
TCL_HEADER - path to tcl.h TCL_HEADER - path to tcl.h
CUDD - path to cudd installation ($HOME/cudd if following install shown above) CUDD - path to cudd installation
ZLIB_ROOT - path to zlib ZLIB_ROOT - path to zlib
CMAKE_INSTALL_PREFIX CMAKE_INSTALL_PREFIX
``` ```

View File

@ -14,22 +14,6 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2019, Parallax Software, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#ifndef STA_GENCLKS_H #ifndef STA_GENCLKS_H
#define STA_GENCLKS_H #define STA_GENCLKS_H