Skip to content

Commit cb8c990

Browse files
committed
chg: dev: cleanup readme and xcode setup, use internal gtest for xcode
* add ctest -C <config> arg for multiconfig generators * fix adhoc test command arg file path, remove redundant test Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
1 parent fd0004e commit cb8c990

File tree

4 files changed

+38
-47
lines changed

4 files changed

+38
-47
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
ubuntu-24.04-gcc-13,
3232
ubuntu-22.04-clang-14,
3333
macOS-13-gcc,
34-
macOS-14-clang,
34+
macOS-13-clang,
3535
]
3636

3737
include:
@@ -63,11 +63,11 @@ jobs:
6363
version: "12"
6464
toxcmd: abc,tests
6565

66-
- name: macOS-14-clang
67-
os: macOS-14
66+
- name: macOS-13-clang
67+
os: macOS-13
6868
compiler: xcode
69-
version: "15.4"
70-
toxcmd: "base -- Xcode"
69+
version: "15.1"
70+
toxcmd: "ctestwin -- Xcode"
7171

7272
steps:
7373
- uses: actions/checkout@v4
@@ -125,14 +125,16 @@ jobs:
125125
- name: Install and setup MacOS packages
126126
if: runner.os == 'macOS'
127127
run: |
128-
brew install googletest
129-
if [ "${{ matrix.compiler }}" = gcc ]; then
128+
brew update
129+
#brew upgrade
130+
if [ "${{ matrix.compiler }}" = xcode ]; then
131+
sudo xcode-select -s /Applications/Xcode_${{ matrix.version }}.app/Contents/Developer
132+
ls -ls /Applications/
133+
else
130134
brew install gcc@${{ matrix.version }}
131135
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
132136
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
133-
else
134-
ls -ls /Applications/
135-
sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app
137+
brew install googletest
136138
fi
137139
138140
- name: Build and test MacOS

CMakeLists.txt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ option(COVERAGE_BUILD "Enable source-based LLVM code coverage" OFF)
7575
option(ABC_SKIP_EXE "Skip building executable (build libs only)" OFF)
7676
option(VENDOR_GTEST "download googletest" OFF)
7777

78-
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
79-
exec_program(/usr/bin/uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val)
80-
# If we aren't cross-compiling then the two are equal.
81-
if(NOT CMAKE_CROSSCOMPILING)
82-
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
83-
endif()
84-
endif()
85-
8678
add_library(abc_interface INTERFACE)
8779

8880
set(ABC_HEADERS
@@ -181,6 +173,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
181173
"_CRT_SECURE_NO_WARNINGS"
182174
"_XKEYCHECK_H"
183175
)
176+
set(CMAKE_DEBUG_POSTFIX d)
184177
endif()
185178
if(WIN32)
186179
if(MINGW OR MSYS)
@@ -479,18 +472,13 @@ if(BUILD_TESTING)
479472

480473
enable_testing()
481474
add_test(NAME base_test
482-
COMMAND base_test i10.aig
483-
WORKING_DIRECTORY "${abc_SOURCE_DIR}"
475+
COMMAND base_test "${abc_SOURCE_DIR}/i10.aig"
476+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
484477
)
485478

486479
# Add source-based llvm code coverage targets.
487480
# Note this requires recent clang/llvm tooling.
488481
if(COVERAGE_BUILD)
489-
add_test(NAME main_test
490-
COMMAND abc -c "r i10.aig; b; ps; b; rw -l; rw -lz; b; rw -lz; b; ps; cec"
491-
WORKING_DIRECTORY "${abc_SOURCE_DIR}"
492-
)
493-
494482
include(coverage)
495483
add_coverage(abc)
496484
add_coverage(base_test)

README.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The source code is provided for research and evaluation only. For commercial usa
2222

2323
References:
2424

25-
[1] L. Fan and C. Wu, "FPGA technology mapping with adaptive gate decompostion", ACM/SIGDA FPGA International Symposium on FPGAs, 2023.
25+
[1] L. Fan and C. Wu, "FPGA technology mapping with adaptive gate decompostion", ACM/SIGDA FPGA International Symposium on FPGAs, 2023.
2626

2727
Minimum desktop tools needed:
2828

@@ -85,8 +85,8 @@ There are several `tox -e` environment commands available in the current tox fil
8585
* `ctest` - build/run tests using ctest => static lib and "test" executable
8686
* `grind` - run cmake Debug build with valgrind
8787
* Misc utility commands:
88-
* `clean` - clean the make build files
89-
* `unbuild` - clean the cmake build/ directory/files
88+
* `clean` - clean the automake/autoconf build byproducts
89+
* `cclean` - clean the cmake build/ directory/files
9090
* `lint` - run cpplint style checks
9191

9292
### Compiling manually:
@@ -96,10 +96,10 @@ To compile ABC as a static library, type `make libabc.a`.
9696
To compile ABC as a shared library, type `make lib`.
9797
To compile ABC as a shared library with soname, type `ABC_USE_SONAME=1 make lib`.
9898

99-
When ABC is used as a static library, two additional procedures, `Abc_Start()`
100-
and `Abc_Stop()`, are provided for starting and quitting the ABC framework in
101-
the calling application. A simple demo program (file src/demo.c) shows how to
102-
create a stand-alone program performing DAG-aware AIG rewriting, by calling
99+
When ABC is used as a static library, two additional procedures, `Abc_Start()`
100+
and `Abc_Stop()`, are provided for starting and quitting the ABC framework in
101+
the calling application. A simple demo program (file src/demo.c) shows how to
102+
create a stand-alone program performing DAG-aware AIG rewriting, by calling
103103
APIs of ABC compiled as a static library.
104104

105105
To build the demo program
@@ -138,15 +138,16 @@ or in the batch mode:
138138
The current version of ABC can be compiled with C compiler or C++ compiler.
139139

140140
* To compile as C code (default): make sure that `CC=gcc` and `ABC_NAMESPACE` is not defined.
141-
* To compile as C++ code without namespaces: make sure that `CC=g++` and `ABC_NAMESPACE` is not defined.
141+
* To compile as C++ code without namespaces: make sure that `CC=g++` and `ABC_NAMESPACE` is not
142+
defined (deprecated).
142143
* To compile as C++ code with namespaces: make sure that `CC=g++` and `ABC_NAMESPACE` is set to
143144
the name of the requested namespace. For example, add `-DABC_NAMESPACE=xxx` to OPTFLAGS.
144145

145146
## Building a shared library
146147

147148
* Compile the code as position-independent by adding `ABC_USE_PIC=1`.
148-
* Build the `libabc.so` target:
149-
149+
* Build the `libabc.so` target:
150+
150151
make ABC_USE_PIC=1 lib
151152

152153
## Adding new source files
@@ -159,10 +160,10 @@ For each module with new sources:
159160

160161
## Bug reporting:
161162

162-
Please try to reproduce all the reported bugs and unexpected features using the latest
163+
Please try to reproduce all the reported bugs and unexpected features using the latest
163164
version of ABC available from https://github.com/berkeley-abc/abc
164165

165-
If the bug still persists, please provide the following information:
166+
If the bug still persists, please provide the following information:
166167

167168
1. ABC version (when it was downloaded from GitHub)
168169
1. Linux distribution and version (32-bit or 64-bit)
@@ -173,7 +174,7 @@ If the bug still persists, please provide the following information:
173174

174175
## Troubleshooting:
175176

176-
1. If compilation does not start because of the cyclic dependency check,
177+
1. If compilation does not start because of the cyclic dependency check,
177178
try touching all files as follows: `find ./ -type f -exec touch "{}" \;`
178179
1. If compilation fails because readline is missing, install 'readline' library or
179180
compile with `make ABC_USE_NO_READLINE=1`
@@ -188,19 +189,19 @@ compile with `make ABC_USE_NO_PTHREADS=1`
188189

189190
The following comment was added by Krish Sundaresan:
190191

191-
"I found that the code does compile correctly on Solaris if gcc is used (instead of
192-
g++ that I was using for some reason). Also readline which is not available by default
193-
on most Sol10 systems, needs to be installed. I downloaded the readline-5.2 package
194-
from sunfreeware.com and installed it locally. Also modified CFLAGS to add the local
195-
include files for readline and LIBS to add the local libreadline.a. Perhaps you can
192+
"I found that the code does compile correctly on Solaris if gcc is used (instead of
193+
g++ that I was using for some reason). Also readline which is not available by default
194+
on most Sol10 systems, needs to be installed. I downloaded the readline-5.2 package
195+
from sunfreeware.com and installed it locally. Also modified CFLAGS to add the local
196+
include files for readline and LIBS to add the local libreadline.a. Perhaps you can
196197
add these steps in the readme to help folks compiling this on Solaris."
197198

198199
The following tutorial is kindly offered by Ana Petkovska from EPFL:
199200
https://www.dropbox.com/s/qrl9svlf0ylxy8p/ABC_GettingStarted.pdf
200201

201202
## Final remarks:
202203

203-
Unfortunately, there is no comprehensive regression test. Good luck!
204+
Unfortunately, there is no comprehensive regression test. Good luck!
204205

205-
This system is maintained by Alan Mishchenko <alanmi@berkeley.edu>. Consider also
206+
This system is maintained by Alan Mishchenko <alanmi@berkeley.edu>. Consider also
206207
using ZZ framework developed by Niklas Een: https://bitbucket.org/niklaseen/abc-zz (or https://github.com/berkeley-abc/abc-zz)

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ commands =
8585
clang: lcov_cobertura {toxinidir}/build/coverage/lcov.info --base-dir {toxinidir}/src --output coverage.xml
8686
{base,libs}: cmake --build . --target install
8787
{base,libs}: bash -c 'find $PREFIX/ -type f -name \*abc\* -o -name demo | xargs ls -lh'
88-
ctest: ctest -j {env:CPUS} --build-generator {posargs:"Ninja"} --build-and-test . build --build-options -DABC_USE_NAMESPACE={env:ABC_USE_NAMESPACE} -DABC_SKIP_EXE=ON -DCMAKE_BUILD_TYPE={env:BUILD_TYPE} --test-command ctest --rerun-failed --output-on-failure -V
89-
ctestwin: ctest --build-generator {posargs:"Visual Studio 16 2019"} --build-and-test . build --build-options -DVENDOR_GTEST=ON -DBUILD_SHARED_LIBS=ON -DABC_USE_NO_PTHREADS=ON -DABC_USE_NO_READLINE=ON -DCMAKE_BUILD_TYPE={env:BUILD_TYPE} --test-command ctest --rerun-failed --output-on-failure -V
88+
ctest: ctest -j {env:CPUS} --build-generator {posargs:"Ninja"} --build-and-test . build --build-options -DABC_USE_NAMESPACE={env:ABC_USE_NAMESPACE} -DABC_SKIP_EXE=ON -DCMAKE_BUILD_TYPE={env:BUILD_TYPE} --test-command ctest -C {env:BUILD_TYPE} --rerun-failed --output-on-failure -V
89+
ctestwin: ctest --build-generator {posargs:"Visual Studio 16 2019"} --build-and-test . build --build-options -DVENDOR_GTEST=ON -DBUILD_SHARED_LIBS=ON -DABC_USE_NO_PTHREADS=ON -DABC_USE_NO_READLINE=ON -DCMAKE_BUILD_TYPE={env:BUILD_TYPE} --test-command ctest -C {env:BUILD_TYPE} --rerun-failed --output-on-failure -V
9090
ctest: bash -c 'ls -lh build/*abc* || true'
9191
lint: bash -c 'cpplint --output=gsed {toxinidir}/src/base/main/* {toxinidir}/lib/*'
9292
grind: bash -c 'cmake -G {posargs:"Ninja"} -S . -B build -DCMAKE_BUILD_TYPE=Debug'

0 commit comments

Comments
 (0)