This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Fwd: Problem in using BDD libraries with GCC Plugin
- From: Nishant Sahni <nishantsahni1994 at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 19 May 2015 16:22:26 +0530
- Subject: Fwd: Problem in using BDD libraries with GCC Plugin
- Authentication-results: sourceware.org; auth=none
- References: <CABcvUZL3R2wdmgu19nm04x06Jb1Uj2W7JuFZatT1jP-AD3H=Wg at mail dot gmail dot com>
I am facing an issue compiling a gcc plugin. I am using the cudd
libraries (binary decision diagram libraries), Ubuntu version 14.04
and gcc version is 4.7.2. While running the Makefile, the compiler
fails to recognize the Cudd & BDD data structures whereas all the
necessary header files have been included and the libraries have been
linked. The error messages "Cudd was not declared in this scope" &
"BDD was not declared in this
scope" are displayed. Please find below the contents of the Makefile.
#------ MAKE CHANGES TO BASE_DIR : Please put the path to base
directory of your pristine gcc-4.7.2 build -----------#
BASE_DIR = /home/nishant/GCC_BUILDS/gcc_4.7
INSTALL = $(BASE_DIR)/install
CC = $(INSTALL)/bin/g++
NEW_PATH = $(BASE_DIR)/gcc-4.7.2/gcc
# include files and library
PDIR = /home/nishant/Code/cudd-2.5.0
INCLUDE1 = $(PDIR)/include
# for c++
LIBS = $(PDIR)/obj/libobj.a $(PDIR)/cudd/libcudd.a $(PDIR)/mtr/libmtr.a \
$(PDIR)/st/libst.a $(PDIR)/util/libutil.a $(PDIR)/epd/libepd.a
#----- MAKE CHANGES TO OBJS : Add the name of your test file with
extension .o (say test as test.o) --------#
#------------------------------- Multiple dependent files maybe also
be added ------------------------------#
#OBJS = test1.o
#OBJS = test2.o
#OBJS = test3.o
#OBJS = test4.o
OBJS = test.o
GCCPLUGINS_DIR:= $(shell $(CC) -print-file-name=plugin)
INCLUDE= -I$(GCCPLUGINS_DIR)/include -I$(NEW_PATH)
FLAGS= -fPIC -O0 -flto -flto-partition=none
%.o : %.c
$(CC) $(FLAGS) $(INCLUDE) -I$(INCLUDE1) -L$(LIBS) -c $<
%.o : %.cpp
$(CC) $(FLAGS) $(INCLUDE) -I$(INCLUDE1) -L$(LIBS) -c $<
plugin.so: plugin.o
$(CC) $(INCLUDE) $(FLAGS) -I$(INCLUDE1) -L$(LIBS) -shared $^ -o $@
run: $(OBJS) plugin.so
$(CC) -o result -flto -flto-partition=none -fplugin=./plugin.so
$(OBJS) -O3 -fdump-ipa-all
clean:
\rm -f plugin.so *~ *.o a.out result* *.cpp.*