This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: Problem in using BDD libraries with GCC Plugin


I am facing an issue compiling a gcc plugin. I am using the cudd
libraries (binary decision diagram libraries) and my 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.*


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]