Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cmake #40

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 22 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ jobs:
- checkout
- run: |
apt-get -q update -y
apt-get -q install -y libedit-dev zlib1g-dev m4 build-essential
mkdir install
apt-get -q install -y libedit-dev zlib1g-dev m4 build-essential wget
wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz
tar -xf cmake-3.22.1-linux-x86_64.tar.gz
export PATH="`pwd`/cmake-3.22.1-linux-x86_64/bin:$PATH"
export VLSI_TOOLS_SRC=`pwd`
export ACT_HOME=$VLSI_TOOLS_SRC/install
export LD_LIBRARY_PATH="$ACT_HOME/lib:$LD_LIBRARY_PATH"
mkdir $ACT_HOME
cp act/lang/HACK_expr.h act/lang/expr.h
cp act/lang/HACK_expr.c act/lang/expr.c
./configure $ACT_HOME
./build
make install
make runtest
./build.sh
cmake --install build
./test.sh

centos8:
docker:
Expand All @@ -26,14 +32,20 @@ jobs:
- run: |
yum install -y 'dnf-command(config-manager)'
yum config-manager --set-enabled powertools -y
yum install -y gcc gcc-c++ diffutils make libedit-devel zlib-devel m4
mkdir install
yum install -y gcc gcc-c++ diffutils make libedit-devel zlib-devel m4 wget
wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz
tar -xf cmake-3.22.1-linux-x86_64.tar.gz
export PATH="`pwd`/cmake-3.22.1-linux-x86_64/bin:$PATH"
export VLSI_TOOLS_SRC=`pwd`
export ACT_HOME=$VLSI_TOOLS_SRC/install
export LD_LIBRARY_PATH="$ACT_HOME/lib:$LD_LIBRARY_PATH"
mkdir $ACT_HOME
cp act/lang/HACK_expr.h act/lang/expr.h
cp act/lang/HACK_expr.c act/lang/expr.c
./configure $ACT_HOME
./build
make install
make runtest
./build.sh
cmake --install build
./test.sh



Expand Down
15 changes: 4 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
Makefile.deps
arm64_*
i386_*
x86_64_*
*.arm64_*
*.i386_*
*.x86_64_*
lib*_arm64_*.a
lib*_i386_*.a
lib*_x86_64_*.a
.act_history
*.so
*~
**/*~
.cproject
.project
.pydevproject

.idea
build
cmake-build-debug
35 changes: 35 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cmake_minimum_required(VERSION 3.20)

project(ActLib)
enable_language(CXX)
enable_language(C)
enable_testing()

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# ensure the environment is configured correctly. We were doing shared libraries
# wrong before. The right way is to have their location added to LD_LIBRARY_PATH
if(NOT DEFINED ENV{ACT_HOME})
message(
FATAL_ERROR "Set the enviroment variable 'ACT_HOME' to the install location"
)
endif()
string(REGEX MATCH "^(.*:)?$ENV{ACT_HOME}/lib/?(:.*)?$"
ACTHOME_LIB_IS_IN_LD_PATH $ENV{LD_LIBRARY_PATH})
if(NOT ACTHOME_LIB_IS_IN_LD_PATH)
message(FATAL_ERROR "Add $ENV{ACT_HOME}/lib to LD_LIBRARY_PATH")
endif()
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/config")
message(
FATAL_ERROR
"Run `./configure`. This will check that the dependencies are installed, and generate config, which is needed for legacy support in installation"
)
endif()

include_directories(.)

add_compile_options(-g -ubsanitizer=undefined -O2)

add_subdirectory(act)
add_subdirectory(scripts)
16 changes: 0 additions & 16 deletions act/.gitignore

This file was deleted.

46 changes: 46 additions & 0 deletions act/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -------------------------------------------------------------------------
#
# Copyright (c) 2022 Henry Heffan
#
# 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin
# Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# -------------------------------------------------------------------------

function(install_shim folder old_path old_file new_path new_file)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${new_file}.shim
COMMAND
echo \"\#pragma message \\\"DEPRECATED ACT INCLUDE: prefer \\'\#include
<${new_path}${new_file}>\\' to \\'\#include
<${old_path}${old_file}>\\'\\\"\" >
${CMAKE_CURRENT_BINARY_DIR}/${old_file}.shim
COMMAND echo \"\#include \\\"${new_path}${new_file}\\\"\" >>
${CMAKE_CURRENT_BINARY_DIR}/${old_file}.shim)
add_custom_target(MakeShim_Act_${folder}_${new_file}.shim ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${old_file}.shim)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${old_file}.shim
DESTINATION $ENV{ACT_HOME}/include/${old_path}
RENAME ${old_file})
endfunction()

add_subdirectory(common)
add_subdirectory(pgen)
add_subdirectory(miniscm)
add_subdirectory(lang)
add_subdirectory(passes)
add_subdirectory(transform)
add_subdirectory(simulation)
add_subdirectory(tech)
84 changes: 0 additions & 84 deletions act/Makefile

This file was deleted.

4 changes: 4 additions & 0 deletions act/common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# proprietary files
coi.h
NSOutputInt.h

99 changes: 99 additions & 0 deletions act/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# -------------------------------------------------------------------------
#
# Copyright (c) 2022 Henry Heffan
#
# 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin
# Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# -------------------------------------------------------------------------

set(ACT_COMMON_LIB_VLSI_HEADERS
array.h
bitset.h
misc.h
hash.h
qops.h
config.h
atrace.h
avl.h
lzw.h
lex.h
file.h
heap.h
except.h
pp.h
list.h
bool.h
names.h
mstring.h
mytime.h
path.h
log.h
sim.h
agraph.h
int.h)
set(ACT_COMMON_LIB_VLSI_SOURCES
bitset.c
misc.c
hash.c
config.c
atrace.c
avl.c
lzw.c
lex.c
file.c
heap.c
except.c
pp.c
list.c
bool.c
names.c
mstring.c
time.c
ext.c
path.c
log.cc
sim.cc
agraph.cc
int.cc)

add_library(ActCommonLib STATIC ${ACT_COMMON_LIB_VLSI_HEADERS}
${ACT_COMMON_LIB_VLSI_SOURCES})
set_target_properties(ActCommonLib PROPERTIES OUTPUT_NAME vlsilib)

add_library(ActCommonLibSh SHARED ${ACT_COMMON_LIB_VLSI_HEADERS}
${ACT_COMMON_LIB_VLSI_SOURCES})
set_target_properties(ActCommonLibSh PROPERTIES OUTPUT_NAME vlsilib_sh)

add_library(ActASimLib STATIC mem.h mem.cc hconfig.h hconfig.cc simdes.h
simdes.cc)
target_compile_options(ActASimLib PRIVATE -DFAIR -DASYNCHRONOUS)
set_target_properties(ActASimLib PROPERTIES OUTPUT_NAME asim)

add_library(ActASimLibSh SHARED mem.h mem.cc hconfig.h hconfig.cc simdes.h
simdes.cc)
target_compile_options(ActASimLibSh PRIVATE -DFAIR -DASYNCHRONOUS)
set_target_properties(ActASimLibSh PROPERTIES OUTPUT_NAME asim_sh)

install(FILES ${ACT_COMMON_LIB_VLSI_HEADERS}
DESTINATION $ENV{ACT_HOME}/include/act/common/)
install(FILES mem.h hconfig.h simdes.h
DESTINATION $ENV{ACT_HOME}/include/act/common/)
install(TARGETS ActCommonLib ActCommonLibSh ActASimLib ActASimLibSh
DESTINATION $ENV{ACT_HOME}/lib/)

# create and install shims
foreach(X IN ITEMS ${ACT_COMMON_LIB_VLSI_HEADERS})
install_shim(Common_Lib common/ ${X} act/common/ ${X})
endforeach()
File renamed without changes.
4 changes: 2 additions & 2 deletions common/agraph.h → act/common/agraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#define __ACT_GRAPH_H__

#include <iterator>
#include <common/array.h>
#include <common/list.h>
#include "act/common/array.h"
#include "act/common/list.h"

class AGinfo {
public:
Expand Down
2 changes: 1 addition & 1 deletion common/array.h → act/common/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef __ARRAY_H__
#define __ARRAY_H__

#include <common/misc.h>
#include "act/common/misc.h"

/*
*
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion common/atrace.h → act/common/atrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef __ATRACE_H__
#define __ATRACE_H__

#include <common/hash.h>
#include "act/common/hash.h"
#include <sys/types.h>
#include <netinet/in.h>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading