[gecode-users] std::set to Gecode::IntVar conversion - my quick and dirty solution

Martin Mann mmann at informatik.uni-freiburg.de
Thu May 11 16:11:06 CEST 2006


Grégoire Dooms schrieb:
> Martin Mann wrote:
>> I didnt used the graph package, that already have got the feature 
>> std::iterator -> Gecode::Iterator, because I ve got trouble to compile 
>> the package on my cygwin system with the included boost version. I 
>> gave it up at the moment.
> 
> Could you tell me which version of Cygwin/boost you used ?


I am using cygwin web setup version 2.510.2.2 on windows xp prof.

this includes a boost library version 1.33.1-2

if I try to build the graph package, all went fine until the example 
build up. This crashes and also my code that was using the linked shared 
graph library..

I get this error:

--------------------------------------------------------------------
$ make

Making in directory contribs/graph
make[1]: Entering directory 
`/cygdrive/e/Netzablage/gecode-1.1.0/contribs/graph'
g++ -I. -I. -DNDEBUG -Wall -ggdb -O3 -fno-strict-aliasing 
-finline-limit=3000 -ffast-math -mthreads  -I/usr/include/boos
t-1_33_1 -I../.. -L../..   -I/usr/include/boost-1_33_1 -I../.. -L../..\
-c -o examples/cpgraph-basic.o  examples/cpgraph-basic.cc
In file included from 
/usr/include/boost-1_33_1/boost/graph/dijkstra_shortest_paths.hpp:19,
                  from ./view/outadjsets.icc:33,
                  from ./view.icc:367,
                  from ./graph.hh:45,
                  from ./graphutils.icc:21,
                  from examples/cpgraph-basic.cc:22:
/usr/include/boost-1_33_1/boost/pending/relaxed_heap.hpp:89: error: 
expected `)' before '/' token
make[1]: *** [examples/cpgraph-basic.o] Error 1
make[1]: Leaving directory 
`/cygdrive/e/Netzablage/gecode-1.1.0/contribs/graph'
make: *** [compilesubdirs] Error 2

$

--------------------------------------------------------------------

configure produced the following output

--------------------------------------------------------------------

$ ./configure --enable-graph --with-boost-include=/usr/include/boost-1_33_1

checking for g++... g++
checking for C++ compiler default output file name... a.exe
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for ranlib... ranlib
checking for pkg-config... no
checking whether to generate pkg-config files... no
checking for the host operating system... Windows
checking how to run the C++ preprocessor... g++ -E
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking the C++ compiler vendor... gnu
checking whether to build static libraries... no
checking whether to build shared libraries... yes
checking whether to build with debug symbols and assertions... no
checking whether to build with profiling information... no
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for int... yes
checking size of int... 4
checking if int has at least 32 bit... yes
checking if doubles have a big enough mantissa... yes
checking whether g++ accepts -fPIC... no
checking whether g++ accepts -Wall... yes
checking whether g++ accepts -ggdb... yes
checking whether g++ accepts -O3... yes
checking whether g++ accepts -fno-strict-aliasing... yes
checking whether g++ accepts -finline-limit=3000... yes
checking whether g++ accepts -ffast-math... yes
checking whether g++ accepts -mthreads... yes
checking for dot... no
checking whether to enable graphs in the documentation... no
checking whether to enable the documentation search engine... no
checking whether to generate a doxygen tagfile... no
checking whether to build compressed html documentation... yes
checking whether to build the graph contrib library... yes
checking whether to build the set variables library... yes
checking whether to build the int variables library... yes
checking whether to build examples... yes
checking whether to build minimodel... yes
checking whether to build search... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doxygen.conf
config.status: creating doxygen.hh
config.status: creating misc/gecode.pc
config.status: creating misc/gecode-search.pc
config.status: creating misc/gecode-minimodel.pc
config.status: creating config.icc
config.status: config.icc is unchanged
config.status: executing vti.icc commands
configure: configuring in contribs/graph
configure: running /bin/sh './configure' --prefix=/usr/local 
'--enable-graph' '--with-boost-include=/usr/include/boost-
1_33_1' --cache-file=/dev/null --srcdir=.
config.status: creating Makefile.in
configure: creating ./config.status
config.status: creating Makefile
config.status: executing Makefile.in commands

$

--------------------------------------------------------------------

the graph Makefile looks like that:

--------------------------------------------------------------------

# Author Grégoire Dooms
# Copied from Gecode Makefile.in
# The gecode configure script makes the Makefile.in from this Makefile.in.in
# Then the cp(Graph) configure script makes the Makefile from the 
Makefile.in

# get variables from top Makefile
#
gecode_top_srcdir = $(top_srcdir)
cpgraph_top_srcdir = $(curdir)


KERNELDLL := $(KERNELDLL:%=../../%)
SETDLL := $(SETDLL:%=../../%)
INTDLL := $(INTDLL:%=../../%)
SUPPORTOBJ := $(SUPPORTOBJ:%=../../%)

ifeq "$(LIBPREFIX)" "$(LINKPREFIX)"
LINKSET:=../../$(LINKSET)
LINKKERNEL:=../../$(LINKKERNEL)
LINKINT:=../../$(LINKINT)
LINKMM:=../../$(LINKMM)
LINKSEARCH:=../../$(LINKSEARCH)
LINKALL := $(LINKMM) $(LINKSET) $(LINKINT) $(LINKSEARCH) $(LINKKERNEL)
else
EXTRALINKFLAGS := -L../..
endif

#
# GRAPH COMPONENTS
#

GRAPHSRC0 = view/arcnode.cc
GRAPHHDR0 = view/outadjsets.icc view/constant.icc view/arcnode.hh 
view/nodearcsets.icc graphutils.icc  var.icc view.icc graphutils.h 
view/boundsgraphs.icc view/prop.icc path/path.icc path/pathgraphs.icc 
path.hh path.icc
#GRAPHHDR0 = @GRAPHHDR@


GRAPHSRC		= $(GRAPHSRC0)
GRAPHHDR		= graph.hh $(GRAPHHDR0)
GRAPHOBJ		= $(GRAPHSRC:%.cc=%$(OBJSUFFIX))
GRAPHFLAGS      = -I/usr/include/boost-1_33_1 -I../.. $(EXTRALINKFLAGS)
GRAPHDLL		= $(LIBPREFIX)graph$(DLLSUFFIX)
GRAPHSTATICLIB	= $(LIBPREFIX)graph$(STATICLIBSUFFIX)
GRAPHLIB		= $(LIBPREFIX)graph$(LIBSUFFIX)
LINKGRAPH      	= $(LINKPREFIX)graph$(LINKSUFFIX)
#GRAPHBUILDDIRS	= view

ifeq "$(LIBPREFIX)" "$(LINKPREFIX)"
LINKGRAPH := $(LINKGRAPH)
else
EXTRALINKFLAGS := -L../..
endif

LINKALL := $(LINKALL) $(LINKGRAPH)

#
# GRAPH EXAMPLES
#

GRAPHEXAMPLESRC0 = cpgraph-basic cpgraph-path cpgraph-complement 
cpgraph-path2 cpgraph-instUB cpgraph-pathcost
GRAPHEXAMPLESRC  = $(GRAPHEXAMPLESRC0:%=examples/%.cc)
GRAPHEXAMPLEOBJ  = $(GRAPHEXAMPLESRC:%.cc=%$(OBJSUFFIX))
GRAPHEXAMPLESBJ  = $(GRAPHEXAMPLESRC:%.cc=%$(SBJSUFFIX))
GRAPHEXAMPLEEXE  = $(GRAPHEXAMPLESRC:%.cc=%$(EXESUFFIX))
GRAPHEXAMPLEBUILDDIRS = examples/

GRAPHEXAMPLEHDR0 = $(gecode_top_srcdir)/support.hh 
$(gecode_top_srcdir)/support.icc $(gecode_top_srcdir)/timer.hh
GRAPHEXAMPLEHDR  = $(GRAPHEXAMPLEHDR0:%=../../examples/%) $(GRAPHHDR)

ALLLIB :=  $(ALLLIB) $(GRAPHLIB)


LIBTARGETS = $(GRAPHDLL) $(GRAPHLIB)

all : $(LIBTARGETS) $(GRAPHEXAMPLEEXE)

#
# Object targets
#


examples/%$(OBJSUFFIX): examples/%.cc
	$(CXX) $(CXXFLAGS) $(EXAMPLES_EXTRA_CXXFLAGS) $(GRAPHFLAGS)\
	-c -o $@  $<
examples/%$(SBJSUFFIX): examples/%.cc
	$(CXX) $(CXXFLAGS) $(EXAMPLES_EXTRA_CXXFLAGS) $(GRAPHFLAGS)\
	-S -o $@  $<

%$(OBJSUFFIX): %.cc
	$(CXX) $(CXXFLAGS) -DGECODE_BUILD_GRAPH $(GRAPHFLAGS)\
	-c -o $@  $<
%$(SBJSUFFIX): %.cc
	$(CXX) $(CXXFLAGS) -DGECODE_BUILD_GRAPH  $(GRAPHFLAGS)\
	-S -o $@  $<

#
# DLL Targets
#

ifeq "$(DLLSUFFIX)" "$(LIBSUFFIX)"
#linux
$(GRAPHDLL): $(GRAPHOBJ) $(KERNELDLL) $(INTDLL) $(SETDLL)
	$(CXX) $(DLLFLAGS) $(GRAPHOBJ)  $(GRAPHFLAGS)\
		-L. $(LINKKERNEL) $(LINKINT) \
		-o $(GRAPHDLL)
else
#win
$(GRAPHDLL) $(GRAPHLIB): $(GRAPHOBJ) $(KERNELDLL) $(INTDLL) $(SETDLL)
	$(CXX) $(DLLFLAGS) $(GRAPHOBJ)  $(GRAPHFLAGS)\
		-L. $(LINKKERNEL) $(LINKINT) $(LINKSET) \
		-o $(GRAPHDLL)
endif

#
# EXE targets
#
#


.PRECIOUS: examples/%$(OBJSUFFIX)
examples/%$(EXESUFFIX): examples/%$(OBJSUFFIX) $(SUPPORTOBJ) $(ALLIB)
	$(CXX) -o $@ $< $(SUPPORTOBJ) $(DLLPATH) $(CXXFLAGS) $(GRAPHFLAGS)\
	$(LDFLAGS) $(LINKALL)
CXXFLAGS := $(CXXFLAGS) $(GRAPHFLAGS)


.PHONY: doc
doc: $(GRAPHHDR) $(GRAPHSRC)
	mkdir -p doc/html
	doxygen doxygen.conf

#
# Autoconf
#

configure: configure.ac
	autoconf
config.status: configure
	../../config.status --recheck
	./config.status --recheck
Makefile: Makefile.in config.status
	./config.status
Makefile.in : Makefile.in.in ../../config.status
	../../config.status --file $@:$<


.PHONY: clean veryclean distclean
localclean:
	find  examples -perm +u+x -not -type d -exec rm '{}' ';'
	rm libgecodegraph.so

clean:
	$(RMF) $(GRAPHOBJ) $(GRAPHSBJ)

veryclean: clean
	$(RMF) $(LIBTARGETS)
	$(RMF) $(LIBTARGETS:%$(DLLSUFFIX)=%.exp) $(LIBTARGETS:%$(DLLSUFFIX)=%.lib)
	$(RMF) $(LIBTARGETS:%$(DLLSUFFIX)=%.ilk) $(LIBTARGETS:%$(DLLSUFFIX)=%.pdb)
	$(RMF) $(GRAPHEXAMPLEEXE:%$(EXESUFFIX)=%.pdb)
	$(RMF) $(GRAPHEXAMPLEEXE:%$(EXESUFFIX)=%$(OBJSUFFIX))
	$(RMF) $(GRAPHEXAMPLEEXE:%$(EXESUFFIX)=%$(SBJSUFFIX))
	$(RMF) doc CPGraphReference.chm
	$(RMF) $(GRAPHEXAMPLEEXE)

distclean: veryclean
	$(RMF) config.log config.status Makefile.in

--------------------------------------------------------------------

hope this will help. maybe it's a configuration problem on my system..
but all is working fine so far.

I tried to build the boost library version 1.33.0 but the bjam tool made 
some strange things, threw a lot of errors and so I used the workaround..

Martin




More information about the gecode-users mailing list