From c41622910689b542bc932262722a338f7535f619 Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Mon, 19 May 2025 15:04:49 -0700 Subject: [PATCH] CMake output lib/exe fixes (#244) * Fixes #167 * No need to make app/ directory, it's already there * Put lib/exe only in build dir, update docs and other references accordingly * Remove gitignore stuff * Bump CMake version too * Minor correction to be more exact * Update regression_vars.tcl * Requested txt fixes * Update date --- .gitignore | 5 ----- CMakeLists.txt | 12 ++++-------- Dockerfile.centos7 | 2 +- Dockerfile.ubuntu22.04 | 2 +- README.md | 4 ++-- doc/ApiChanges.txt | 2 +- doc/ChangeLog.txt | 8 +++++++- test/regression_vars.tcl | 2 +- 8 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index c57d983a..c0aabe31 100644 --- a/.gitignore +++ b/.gitignore @@ -15,11 +15,6 @@ cmake-build-debug build pvt -app/sta -app/libOpenSTA.* -app/sta.exe -app/sta.dSYM - # iverilog turd examples/gcd_tb diff --git a/CMakeLists.txt b/CMakeLists.txt index ed9615bc..620f9cbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14) cmake_policy(SET CMP0086 NEW) endif() -project(STA VERSION 2.6.2 +project(STA VERSION 2.7.0 LANGUAGES CXX ) @@ -471,9 +471,6 @@ target_include_directories(sta_swig # Library ########################################################### -# compatibility with configure -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${STA_HOME}/app) - add_library(OpenSTA) target_sources(OpenSTA @@ -553,13 +550,12 @@ target_compile_options(OpenSTA set_target_properties(OpenSTA PROPERTIES CXX_EXTENSIONS OFF) target_compile_features(OpenSTA PUBLIC cxx_std_17) +message(STATUS "STA library: ${CMAKE_BINARY_DIR}/libOpenSTA.a") + ########################################################### # Executable ########################################################### -# compatibility with configure -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${STA_HOME}/app) - # Note executable and lib name cannot be the same because # on osx something is case insensitive. Using STA for the # lib name results in "No rule to make target ../depend. @@ -570,7 +566,7 @@ target_link_libraries(sta OpenSTA ) -message(STATUS "STA executable: ${STA_HOME}/app/sta") +message(STATUS "STA executable: ${CMAKE_BINARY_DIR}/sta") ################################################################ # Install diff --git a/Dockerfile.centos7 b/Dockerfile.centos7 index 7738ac87..abe82211 100644 --- a/Dockerfile.centos7 +++ b/Dockerfile.centos7 @@ -64,4 +64,4 @@ RUN source /opt/rh/devtoolset-11/enable && \ make -j`nproc` # Run sta on entry -ENTRYPOINT ["/OpenSTA/app/sta"] +ENTRYPOINT ["/OpenSTA/build/sta"] diff --git a/Dockerfile.ubuntu22.04 b/Dockerfile.ubuntu22.04 index bee8b31e..9a803c8f 100644 --- a/Dockerfile.ubuntu22.04 +++ b/Dockerfile.ubuntu22.04 @@ -40,4 +40,4 @@ RUN cd OpenSTA && \ make -j`nproc` # Run sta on entry -ENTRYPOINT ["OpenSTA/app/sta"] +ENTRYPOINT ["OpenSTA/build/sta"] diff --git a/README.md b/README.md index 32082042..cbf82ce8 100644 --- a/README.md +++ b/README.md @@ -157,8 +157,8 @@ cmake -DCUDD_DIR= ,. make ``` The default build type is release to compile optimized code. -The resulting executable is in `app/sta`. -The library without a `main()` procedure is `app/libSTA.a`. +The resulting executable is in `build/sta`. +The library without a `main()` procedure is `build/libOpenSTA.a`. Optional CMake variables passed as -D= arguments to CMake are show below. diff --git a/doc/ApiChanges.txt b/doc/ApiChanges.txt index 7f4863b8..d243dee0 100644 --- a/doc/ApiChanges.txt +++ b/doc/ApiChanges.txt @@ -24,7 +24,7 @@ This file summarizes STA API changes for each release. -Release 2.6.2 2024/03/30 +Release 2.6.2 2025/03/30 ------------------------ The following functions have been renamed to to_string and return std::string diff --git a/doc/ChangeLog.txt b/doc/ChangeLog.txt index d2bc6b97..68bee06b 100644 --- a/doc/ChangeLog.txt +++ b/doc/ChangeLog.txt @@ -3,7 +3,13 @@ OpenSTA Timing Analyzer Release Notes This file summarizes user visible changes for each release. -Realase 2.6.1 2025/03/30 +Release 2.7.0 2025/05/19 +------------------------- + +The OpenSTA library `libOpenSTA` and `sta` executable are now built in the +build directory instead of `app/`. + +Release 2.6.1 2025/03/30 ------------------------- The -list_annotated and -list_not_annotated arguments to the diff --git a/test/regression_vars.tcl b/test/regression_vars.tcl index 5818e4c2..2d0b5b0f 100644 --- a/test/regression_vars.tcl +++ b/test/regression_vars.tcl @@ -35,7 +35,7 @@ # Application program to run tests on. set app "sta" set sta_dir [file dirname $test_dir] -set app_path [file join $sta_dir "app" $app] +set app_path [file join $sta_dir "build" $app] # Application options. set app_options "-no_init -no_splash -exit" # Log files for each test are placed in result_dir.