diff options
author | dhuth <derickhuth@gmail.com> | 2015-01-30 14:52:48 -0700 |
---|---|---|
committer | dhuth <derickhuth@gmail.com> | 2015-01-30 14:52:48 -0700 |
commit | 7e39433ddb5f3ac5298207d5f4e8072eb193fa7a (patch) | |
tree | e185ac16a4af9df7d29d189dde7ef3b8bd6c19e1 /omega | |
parent | f9ec04bd879eccdb9e581cbedc1cec1cba83a5fb (diff) | |
download | chill-7e39433ddb5f3ac5298207d5f4e8072eb193fa7a.tar.gz chill-7e39433ddb5f3ac5298207d5f4e8072eb193fa7a.tar.bz2 chill-7e39433ddb5f3ac5298207d5f4e8072eb193fa7a.zip |
Added libtools support
Diffstat (limited to 'omega')
-rw-r--r-- | omega/Makefile | 32 | ||||
-rw-r--r-- | omega/Makefile.am | 2 | ||||
-rw-r--r-- | omega/Makefile.config | 35 | ||||
-rw-r--r-- | omega/Makefile.rules | 37 | ||||
-rw-r--r-- | omega/code_gen/obj/Makefile | 49 | ||||
-rw-r--r-- | omega/code_gen/obj/Makefile.am | 10 | ||||
-rw-r--r-- | omega/configure.ac | 38 | ||||
-rw-r--r-- | omega/omega_calc/obj/Makefile | 57 | ||||
-rw-r--r-- | omega/omega_calc/obj/Makefile.am | 32 | ||||
-rw-r--r-- | omega/omega_lib/include/omega/omega_core/oc.h | 25 | ||||
-rw-r--r-- | omega/omega_lib/obj/Makefile | 57 | ||||
-rw-r--r-- | omega/omega_lib/obj/Makefile.am | 47 | ||||
-rw-r--r-- | omega/omega_lib/src/omega_core/oc.cc | 21 |
13 files changed, 152 insertions, 290 deletions
diff --git a/omega/Makefile b/omega/Makefile deleted file mode 100644 index 7e4204d..0000000 --- a/omega/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -# DON'T EDIT -- put changes in Makefile.config. - -BASEDIR = ./ -include $(BASEDIR)/Makefile.config - -all: - cd omega_lib/obj; $(MAKE) -ifeq ($(BUILD_CODEGEN), true) - cd code_gen/obj; $(MAKE) -endif - cd omega_calc/obj; $(MAKE) - -depend: - cd omega_lib/obj; $(MAKE) depend -ifeq ($(BUILD_CODEGEN), true) - cd code_gen/obj; $(MAKE) depend -endif - cd omega_calc/obj; $(MAKE) depend - -clean: - cd omega_lib/obj; $(MAKE) clean - cd code_gen/obj; $(MAKE) clean - cd omega_calc/obj; $(MAKE) clean - -veryclean: - cd omega_lib/obj; $(MAKE) veryclean - cd code_gen/obj; $(MAKE) veryclean - cd omega_calc/obj; $(MAKE) veryclean - -install: - cp -rL bin lib include $(DEST_DIR) - diff --git a/omega/Makefile.am b/omega/Makefile.am new file mode 100644 index 0000000..d4a353d --- /dev/null +++ b/omega/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS=omega_lib/obj omega_calc/obj code_gen/obj + diff --git a/omega/Makefile.config b/omega/Makefile.config deleted file mode 100644 index fd4791f..0000000 --- a/omega/Makefile.config +++ /dev/null @@ -1,35 +0,0 @@ -# Edit this file to customize for your system. - -# whether CodeGen+ is built -BUILD_CODEGEN = true - -ifneq ($(strip $(wildcard $(ROSEHOME))),) -BUILD_ROSE = true -BUILD_SUIF = false -else -BUILD_ROSE = false -endif - -CC = g++ -# CC = icc -Kc++ -CFLAGS = -g -DEPENDENCE_CFLAGS = -M - -AR = ar - -INCL_PATH = -I$(BASEDIR)/basic/include -I../include -LIBS = -LIB_PATH = - -# default installation path -ifeq ($(shell whoami), root) -DEST_DIR = /usr/local/ -else -DEST_DIR = $(HOME)/ -endif -# uncomment below to overwrite default path -# DEST_DIR = - -# DO NOT CHANGE -OMEGA_BUILD_DATE = $(shell date +%m/%d/%Y) - diff --git a/omega/Makefile.rules b/omega/Makefile.rules deleted file mode 100644 index ead5bc3..0000000 --- a/omega/Makefile.rules +++ /dev/null @@ -1,37 +0,0 @@ -# DON'T EDIT -- put changes in Makefile.config. - -.SUFFIXES: -.PHONY: all depend clean veryclean depend_self clean_self veryclean_self - -# Executable target; can have only one per directory -$(EXEC_TARGET): $(OBJS) - $(CC) $(CFLAGS) $(LIB_PATH) $(OBJS) $(LIBS) -o $(EXEC_TARGET) - -# Library target; can have only one per directory -$(LIB_TARGET): $(OBJS) - $(AR) -rs $(LIB_TARGET) $(OBJS) - - -# Implicit rules: make C files in ../src/ directory - -%.o: ../src/%.c - $(CC) $(CFLAGS) $(INCL_PATH) -c $< - -%.o: %.cc - $(CC) $(CFLAGS) $(INCL_PATH) -c $< - -%.o: ../src/%.cc - $(CC) $(CFLAGS) $(INCL_PATH) -c $< - -#Special rule for .cc files in basic directory, ConstString and Link -%.o: $(BASEDIR)/basic/src/%.cc - $(CC) $(CFLAGS) $(INCL_PATH) -c $< - -depend_self: - $(CC) $(DEPENDENCE_CFLAGS) $(INCL_PATH) $(SRCS) > Makefile.deps - -clean_self: - -rm -f *.o - -veryclean_self: clean_self - -rm -f $(LIB_TARGET) $(EXEC_TARGET) diff --git a/omega/code_gen/obj/Makefile b/omega/code_gen/obj/Makefile deleted file mode 100644 index dbc65fe..0000000 --- a/omega/code_gen/obj/Makefile +++ /dev/null @@ -1,49 +0,0 @@ - -# DON'T EDIT -- put any locally required changes in Makefile.config. - - -LIB_TARGET=libcodegen.a - -all: $(LIB_TARGET) -depend: depend_self -clean: clean_self -veryclean: veryclean_self - -BASIC_SRC = ../src/codegen.cc ../src/CG_stringBuilder.cc ../src/CG.cc ../src/CG_utils.cc -BASIC_OBJ = $(BASIC_SRC:../src/%.cc=%.o) - - -ROSE_SRC = ../src/rose_attributes.cc ../src/CG_roseRepr.cc ../src/CG_roseBuilder.cc -ROSE_OBJ = $(ROSE_SRC:../src/%.cc=%.o) - -OBJS = ${BASIC_OBJ} -SRCS = ${BASIC_SRC} - -BASEDIR=../.. -include $(BASEDIR)/Makefile.config - -INCL_PATH := $(INCL_PATH) -I../../omega_lib/include - - - - -ifeq ($(BUILD_ROSE), true) -OBJS := $(OBJS) $(ROSE_OBJ) -SRCS := $(SRCS) $(ROSE_SRC) -INCL_PATH := $(INCL_PATH) -I${ROSEHOME}/include -I${BOOSTHOME}/include -endif - -ifeq ($(BUILD_ROSE), true) -IR_OBJ = $(ROSE_SRC:../src/%.cc=%.o) -endif - -include $(BASEDIR)/Makefile.rules - - -# suppress warning of constant char * conversion nuiance in suif -$(IR_OBJ): %.o: ../src/%.cc - $(CC) -Wno-write-strings $(CFLAGS) $(INCL_PATH) -c $< -o $@ - -ifeq ($(shell test -f Makefile.deps && echo "true"), true) -include Makefile.deps -endif diff --git a/omega/code_gen/obj/Makefile.am b/omega/code_gen/obj/Makefile.am new file mode 100644 index 0000000..cd85b8b --- /dev/null +++ b/omega/code_gen/obj/Makefile.am @@ -0,0 +1,10 @@ + +noinst_LIBRARIES =libcodegen.a + +libcodegen_a_SOURCES =../src/codegen.cc ../src/CG_stringBuilder.cc ../src/CG.cc ../src/CG_utils.cc +libcodegen_a_CFLAGS =-Wno-write-strings +libcodegen_a_CPPFLAGS =-I../include -I../../omega_lib/include -I$(ROSEHOME)/include -I$(BOOSTHOME)/include +#if BUILD_ROSE +libcodegen_a_SOURCES += ../src/rose_attributes.cc ../src/CG_roseRepr.cc ../src/CG_roseBuilder.cc +#endif + diff --git a/omega/configure.ac b/omega/configure.ac new file mode 100644 index 0000000..35e7581 --- /dev/null +++ b/omega/configure.ac @@ -0,0 +1,38 @@ +### note: I have no idea what version of omega this is. +### If it's not 0.1.0, feel free to change it +AC_INIT([omega],[0.1.0]) +AC_CONFIG_AUX_DIR([.]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) + +### Use the C++ compiler for linking (C is default) ### +AC_SUBST([CCLD],["$""(CXX)"]) +AC_DEFINE([OMEGA_VERSION],["0.1.0"],[Omega version]) + +AM_PROG_LEX +AC_PROG_CC +AC_PROG_CXX +AC_PROG_RANLIB +AC_PROG_YACC + +AC_ARG_WITH([rose],[ + AS_HELP_STRING([--with-rose],[set rose home]) + ],[ + AC_SUBST([ROSEHOME], [$withval]) + AC_DEFINE([BUILD_ROSE],[],[Use Rose]) + ],[ + AC_SUBST([ROSEHOME], ["${ROSEHOME}"])]) + +AC_ARG_WITH([boost],[ + AS_HELP_STRING([--with-boost],[set boost home])],[ + AC_SUBST([BOOSTHOME], [$withval])],[ + AC_SUBST([BOOSTHOME], ["${BOOSTHOME}"])]) + +AC_CONFIG_HEADERS([include/config.h]) +AC_CONFIG_FILES([ + omega_lib/obj/Makefile + omega_calc/obj/Makefile + code_gen/obj/Makefile]) + +AC_OUTPUT + + diff --git a/omega/omega_calc/obj/Makefile b/omega/omega_calc/obj/Makefile deleted file mode 100644 index 4001c83..0000000 --- a/omega/omega_calc/obj/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# Makefile for release 1.0 of the omega system -# DON'T EDIT -- put any locally required changes in Makefile.config. -# See INSTALL for more details. - -EXEC_TARGET=oc - - -all: $(EXEC_TARGET) - -clean: clean_self - -veryclean: veryclean_self - - -SRCS := ../src/AST.cc ../src/myflex.cc -OBJS := $(SRCS:../src/%.cc=%.o) - -YACC_SRCS := lex.yy.cc parser.tab.cc -YACC_OBJS := $(YACC_SRCS:.cc=.o) - -depend: $(YACC_SRCS) depend_self - -SRCS := $(SRCS) $(YACC_SRCS) -OBJS := $(OBJS) $(YACC_OBJS) - -BASEDIR=../.. -include $(BASEDIR)/Makefile.config - -LIB_PATH := $(LIB_PATH) -L../../omega_lib/obj -LIBS := $(LIBS) -lomega - -ifeq ($(BUILD_CODEGEN), true) -LIB_PATH := $(LIB_PATH) -L../../code_gen/obj -LIBS := $(LIBS) -lcodegen -CFLAGS := $(CFLAGS) -DBUILD_CODEGEN -endif - -CFLAGS := $(CFLAGS) -INCL_PATH := -I. $(INCL_PATH) -I../../omega_lib/include -I../../code_gen/include - -include $(BASEDIR)/Makefile.rules - -# lex/yacc related -.PHONY: parser.tab.o - -lex.yy.cc: ../src/parser.ll - flex++ $< - -parser.tab.hh parser.tab.cc: ../src/parser.yy - bison -t -d $< - -parser.tab.o: parser.tab.cc - $(CC) $(CFLAGS) -DOMEGA_BUILD_DATE="\"$(OMEGA_BUILD_DATE)\"" $(INCL_PATH) -c $< - -ifeq ($(shell test -f Makefile.deps && echo "true"), true) -include Makefile.deps -endif diff --git a/omega/omega_calc/obj/Makefile.am b/omega/omega_calc/obj/Makefile.am new file mode 100644 index 0000000..4420f89 --- /dev/null +++ b/omega/omega_calc/obj/Makefile.am @@ -0,0 +1,32 @@ +noinst_PROGRAMS=oc + +SRCDIR=../src + + +build_date = "\"`date +%m/%d/%Y`\"" + +BUILT_SOURCES=$(SRCDIR)/lex.yy.cc $(SRCDIR)/parser.tab.cc +AM_YFLAGS=-d -t + +calc_includes =-I$(SRCDIR) +calc_includes+=-I../include +calc_includes+=-I../../omega_lib/include -I../../code_gen/include +calc_includes+=-I../../basic/include + +#calc_libs =../../omega_lib/obj/libomega.a +#calc_libs+=../../code_gen/obj/libcodegen.a +calc_libs =-lomega -lcodegen +calc_lib_paths =-L../../omega_lib/obj -L../../code_gen/obj +calc_lib_paths+=-L$(ROSEHOME)/lib -L$(BOOSTHOME)/lib + +oc_SOURCES=$(SRCDIR)/AST.cc $(SRCDIR)/myflex.cc $(SRCDIR)/lex.yy.cc $(SRCDIR)/parser.tab.cc +oc_LDADD=$(calc_libs) +oc_LDFLAGS=$(calc_lib_paths) +oc_CPPFLAGS=$(calc_includes) -DBUILD_CODEGEN -DOMEGA_BUILD_DATE=$(build_date) + +$(SRCDIR)/lex.yy.cc: $(SRCDIR)/parser.tab.cc $(SRCDIR)/parser.ll + flex++ -o $(SRCDIR)/lex.yy.cc $(SRCDIR)/parser.ll + +$(SRCDIR)/parser.tab.cc: + bison -t -d -o $(SRCDIR)/parser.tab.cc $(SRCDIR)/parser.yy + diff --git a/omega/omega_lib/include/omega/omega_core/oc.h b/omega/omega_lib/include/omega/omega_core/oc.h index e12491a..e4f5444 100644 --- a/omega/omega_lib/include/omega/omega_core/oc.h +++ b/omega/omega_lib/include/omega/omega_core/oc.h @@ -66,8 +66,29 @@ extern FILE *outputFile; /* printProblem writes its output to this file */ // #define eqnnzero(e,s) {int *p00,*r00; p00 = (int *)(e); r00 = &p00[headerWords+1+(s)]; while(p00 < r00) *p00++ = 0;} // #define eqnzero(e) eqnnzero(e,nVars) -void eqnncpy(eqn *dest, eqn *src, int); -void eqnnzero(eqn *e, int); +//void eqnncpy(eqn *dest, eqn *src, int); +//void eqnnzero(eqn *e, int); + +inline void eqnncpy(eqn *dest, eqn *src, int nVars) { + dest->key = src->key; + dest->touched = src->touched; + dest->color = src->color; + dest->essential = src->essential; + dest->varCount = src->varCount; + for (int i = 0; i <= nVars; i++) + dest->coef[i] = src->coef[i]; +} + + +inline void eqnnzero(eqn *e, int nVars) { + e->key = 0; + e->touched = 0; + e->color = EQ_BLACK; + e->essential = 0; + e->varCount = 0; + for (int i = 0; i <= nVars; i++) + e->coef[i] = 0; +} extern int mayBeRed; diff --git a/omega/omega_lib/obj/Makefile b/omega/omega_lib/obj/Makefile deleted file mode 100644 index 3d0ffd2..0000000 --- a/omega/omega_lib/obj/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# Makefile for release 1.0 of the omega system -# DON'T EDIT -- put any locally required changes in Makefile.config. -# See INSTALL for more details. - -LIB_TARGET = libomega.a - -all: $(LIB_TARGET) -depend: depend_self -clean: clean_self -veryclean: veryclean_self - - - -BASIC_SRC = $(BASEDIR)/basic/src/ConstString.cc $(BASEDIR)/basic/src/Link.cc -BASIC_OBJ = ConstString.o Link.o - -OC_SRC = ../src/omega_core/oc.cc ../src/omega_core/oc_solve.cc \ - ../src/omega_core/oc_simple.cc ../src/omega_core/oc_eq.cc \ - ../src/omega_core/oc_problems.cc ../src/omega_core/oc_print.cc \ - ../src/omega_core/oc_quick_kill.cc ../src/omega_core/oc_exp_kill.cc \ - ../src/omega_core/oc_query.cc ../src/omega_core/oc_util.cc \ - ../src/omega_core/oc_global.cc -OC_OBJ = $(addsuffix .o, $(basename $(notdir $(OC_SRC)))) - -PRES_SRC = ../src/pres_print.cc ../src/pres_rear.cc ../src/pres_beaut.cc \ - ../src/pres_dnf.cc ../src/pres_conj.cc ../src/pres_quant.cc \ - ../src/pres_decl.cc ../src/pres_logic.cc ../src/pres_form.cc \ - ../src/pres_cnstr.cc ../src/pres_var.cc ../src/pres_gen.cc \ - ../src/pres_col.cc ../src/pres_subs.cc -PRES_OBJ = $(addsuffix .o, $(basename $(notdir $(PRES_SRC)))) - -REL_SRC = ../src/Relations.cc ../src/Relation.cc ../src/RelBody.cc ../src/RelVar.cc \ - ../src/evac.cc ../src/farkas.cc ../src/hull_legacy.cc ../src/hull_simple.cc -REL_OBJ = $(addsuffix .o, $(basename $(notdir $(REL_SRC)))) - -FANCY_SRC = ../src/reach.cc ../src/closure.cc -FANCY_OBJ = $(addsuffix .o, $(basename $(notdir $(FANCY_SRC)))) - - -LIB_SRC = ${FANCY_SRC} ${REL_SRC} ${PRES_SRC} ${OC_SRC} ${BASIC_SRC} -LIB_OBJ = ${OC_OBJ} ${BASIC_OBJ} ${FANCY_OBJ} ${REL_OBJ} ${PRES_OBJ} - -OBJS=$(LIB_OBJ) -SRCS=$(LIB_SRC) -OBJS=$(LIB_OBJ) - -BASEDIR=../.. -include $(BASEDIR)/Makefile.config -include $(BASEDIR)/Makefile.rules - -#Extra rule for nonstandard source layout -%.o: ../src/omega_core/%.cc - $(CC) $(CFLAGS) $(INCL_PATH) -c $< -o $@ - -ifeq ($(shell test -f Makefile.deps && echo "true"), true) -include Makefile.deps -endif diff --git a/omega/omega_lib/obj/Makefile.am b/omega/omega_lib/obj/Makefile.am new file mode 100644 index 0000000..455fc58 --- /dev/null +++ b/omega/omega_lib/obj/Makefile.am @@ -0,0 +1,47 @@ +noinst_LIBRARIES = libomega.a + +basic_src =../../basic/src/ConstString.cc +basic_src +=../../basic/src/Link.cc + +oc_src =../src/omega_core/oc.cc +oc_src +=../src/omega_core/oc_eq.cc +oc_src +=../src/omega_core/oc_exp_kill.cc +oc_src +=../src/omega_core/oc_global.cc +oc_src +=../src/omega_core/oc_print.cc +oc_src +=../src/omega_core/oc_problems.cc +oc_src +=../src/omega_core/oc_simple.cc +oc_src +=../src/omega_core/oc_solve.cc +oc_src +=../src/omega_core/oc_query.cc +oc_src +=../src/omega_core/oc_quick_kill.cc +oc_src +=../src/omega_core/oc_util.cc + +pres_src =../src/pres_beaut.cc +pres_src +=../src/pres_cnstr.cc +pres_src +=../src/pres_col.cc +pres_src +=../src/pres_conj.cc +pres_src +=../src/pres_decl.cc +pres_src +=../src/pres_dnf.cc +pres_src +=../src/pres_form.cc +pres_src +=../src/pres_gen.cc +pres_src +=../src/pres_logic.cc +pres_src +=../src/pres_print.cc +pres_src +=../src/pres_rear.cc +pres_src +=../src/pres_quant.cc +pres_src +=../src/pres_subs.cc +pres_src +=../src/pres_var.cc + +rel_src =../src/evac.cc +rel_src +=../src/farkas.cc +rel_src +=../src/hull_legacy.cc +rel_src +=../src/hull_simple.cc +rel_src +=../src/Relation.cc +rel_src +=../src/Relations.cc +rel_src +=../src/RelBody.cc +rel_src +=../src/RelVar.cc + +fancy_src =../src/closure.cc +fancy_src +=../src/reach.cc + + +libomega_a_SOURCES =$(basic_src) $(oc_src) $(pres_src) $(rel_src) $(fancy_src) +libomega_a_CPPFLAGS =-I../include -I../../basic/include diff --git a/omega/omega_lib/src/omega_core/oc.cc b/omega/omega_lib/src/omega_core/oc.cc index ec60a11..0dc9b49 100644 --- a/omega/omega_lib/src/omega_core/oc.cc +++ b/omega/omega_lib/src/omega_core/oc.cc @@ -749,27 +749,6 @@ void Problem::checkGistInvariant() const { fprintf(outputFile,"] Done checking gist invariant on\n"); } #endif -} - -inline void eqnncpy(eqn *dest, eqn *src, int nVars) { - dest->key = src->key; - dest->touched = src->touched; - dest->color = src->color; - dest->essential = src->essential; - dest->varCount = src->varCount; - for (int i = 0; i <= nVars; i++) - dest->coef[i] = src->coef[i]; -} - - -inline void eqnnzero(eqn *e, int nVars) { - e->key = 0; - e->touched = 0; - e->color = EQ_BLACK; - e->essential = 0; - e->varCount = 0; - for (int i = 0; i <= nVars; i++) - e->coef[i] = 0; } } // namespace |