Ticket #7 (closed feature request: fixed)

Opened 3 years ago

Last modified 2 years ago

Patch for Win32 for PgRouting 1.0.0.a

Reported by: davidtecher Owned by: anton
Priority: major Milestone: Version 1.0
Component: pgRouting package Version: 1.0.0a
Keywords: win32 Cc:

Description

Hi

I did a little patch in order to support Win32 for "Makefile.in" and "Makefile". Actually only "Makefile.in" should be support! But since pgrouting's doc tells to modify the "Makefile", I did it both.

I should by interesing if pgrouting could support automake --> config.guess and config.sub in order to knowing the variable "host"

So you could do something like and have

case "$host" in

*ming*) ...

;;

?) ... ;;

esac

It should be my idea for the "Wihs List" ;)

Since it is not the case to have config.guess/config.sub, so my test relies on the variable MSYSTEM that could tell me, if I'm on Win32 ---> MSYSTEM=MINGW

ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW)

! TSP_LIBS_ARGS=-lgaul -lgaul_util -lm ! TSP_SOLVER_ARGS=-DBUILDING_DLL ! ALPHADRIVELIST_ARGS=-I$(BOOST_PATH) ! else ! TSP_LIBS_ARGS=-lgaul_util -lgaul ! TSP_SOLVER_ARGS= ! ALPHADRIVELIST_ARGS= ! endif

Not really good as test, let me know.

Hope this help

Only in routing/: .svn diff -cr routing/Makefile routing-win32/Makefile *** routing/Makefile Sun May 27 03:13:00 2007 --- routing-win32/Makefile Fri May 25 23:20:44 2007 *************** *** 1,9 **** ! CGAL_MAKEFILE = /usr/make/makefile_x86-64_Linux-2.6_g++-3.4.4 ! BOOST_PATH=/usr/include/boost/graph

GAUL_PATH =/usr/local/include/gaul

! GAUL_LIB =/usr/local/lib64 ! CGAL_PATH =/usr/include ! CGAL_LIB =/usr/lib64

CXXFLAGS = \

-I../../include \

--- 1,9 ---- ! CGAL_MAKEFILE = /usr/local/cgal/make/makefile_i686_MINGW32NT-5.1_g++-3.4.2 ! BOOST_PATH=/usr/local/include/boost/graph

GAUL_PATH =/usr/local/include/gaul

! GAUL_LIB =/usr/local/lib ! CGAL_PATH =/usr/local/cgal/include ! CGAL_LIB =/usr/local/cgal/lib

CXXFLAGS = \

-I../../include \

*************** *** 11,17 ****

$(LONG_NAME_PROBLEM_CXXFLAGS)

EXTRA_FLAGS = -O2 -g -fpic

!

#---------------------------------------------------------------------# # linker flags #---------------------------------------------------------------------#

--- 11,30 ----

$(LONG_NAME_PROBLEM_CXXFLAGS)

EXTRA_FLAGS = -O2 -g -fpic

! ! ! #---------------------------------------------------------------------# ! # MinGW Win32 Specific ! #---------------------------------------------------------------------# ! ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW) ! TSP_LIBS_ARGS=-lgaul -lgaul_util -lm ! TSP_SOLVER_ARGS=-DBUILDING_DLL ! ALPHADRIVELIST_ARGS=-I$(BOOST_PATH) ! else ! TSP_LIBS_ARGS=-lgaul_util -lgaul ! TSP_SOLVER_ARGS= ! ALPHADRIVELIST_ARGS= ! endif

#---------------------------------------------------------------------# # linker flags #---------------------------------------------------------------------#

*************** *** 30,36 ****

TSP_LIBS=

else

TSP_OBJS= tsp.o tsp_solver.o

! TSP_LIBS= -L$(GAUL_LIB) -lgaul_util -lgaul

endif

ifeq ($(CGAL_MAKEFILE),)

--- 43,49 ----

TSP_LIBS=

else

TSP_OBJS= tsp.o tsp_solver.o

! TSP_LIBS= -L$(GAUL_LIB) $(TSP_LIBS_ARGS)

endif

ifeq ($(CGAL_MAKEFILE),)

*************** *** 71,77 ****

$(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(BOOST_PATH) -c boost_drivedist.cpp

tsp_solver.o: tsp_solver.cpp

! $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(GAUL_PATH) -c tsp_solver.cpp

alpha_drivedist.o: alpha_drivedist.cpp

! $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(CGAL_PATH) -I$(CGAL_INCL_CONF_DIR) -c alpha_drivedist.cpp --- 84,90 ----

$(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(BOOST_PATH) -c boost_drivedist.cpp

tsp_solver.o: tsp_solver.cpp

! $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(GAUL_PATH) $(TSP_SOLVER_ARGS) -c tsp_solver.cpp

alpha_drivedist.o: alpha_drivedist.cpp

! $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) $(ALPHADRIVELIST_ARGS) -I$(CGAL_PATH) -I$(CGAL_INCL_CONF_DIR) -c alpha_drivedist.cpp diff -cr routing/Makefile.in routing-win32/Makefile.in *** routing/Makefile.in Sun May 27 03:12:58 2007 --- routing-win32/Makefile.in Fri May 25 23:19:48 2007 *************** *** 11,17 ****

$(LONG_NAME_PROBLEM_CXXFLAGS)

EXTRA_FLAGS = -O2 -g -fpic

!

#---------------------------------------------------------------------# # linker flags #---------------------------------------------------------------------#

--- 11,30 ----

$(LONG_NAME_PROBLEM_CXXFLAGS)

EXTRA_FLAGS = -O2 -g -fpic

! ! ! #---------------------------------------------------------------------# ! # MinGW Win32 Specific ! #---------------------------------------------------------------------# ! ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW) ! TSP_LIBS_ARGS=-lgaul -lgaul_util -lm ! TSP_SOLVER_ARGS=-DBUILDING_DLL ! ALPHADRIVELIST_ARGS=-I$(BOOST_PATH) ! else ! TSP_LIBS_ARGS=-lgaul_util -lgaul ! TSP_SOLVER_ARGS= ! ALPHADRIVELIST_ARGS= ! endif

#---------------------------------------------------------------------# # linker flags #---------------------------------------------------------------------#

*************** *** 30,36 ****

TSP_LIBS=

else

TSP_OBJS= tsp.o tsp_solver.o

! TSP_LIBS= -L$(GAUL_LIB) -lgaul_util -lgaul

endif

ifeq ($(CGAL_MAKEFILE),)

--- 43,49 ----

TSP_LIBS=

else

TSP_OBJS= tsp.o tsp_solver.o

! TSP_LIBS= -L$(GAUL_LIB) $(TSP_LIBS_ARGS)

endif

ifeq ($(CGAL_MAKEFILE),)

*************** *** 71,77 ****

$(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(BOOST_PATH) -c boost_drivedist.cpp

tsp_solver.o: tsp_solver.cpp

! $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(GAUL_PATH) -c tsp_solver.cpp

alpha_drivedist.o: alpha_drivedist.cpp

! $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(CGAL_PATH) -I$(CGAL_INCL_CONF_DIR) -c alpha_drivedist.cpp --- 84,90 ----

$(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(BOOST_PATH) -c boost_drivedist.cpp

tsp_solver.o: tsp_solver.cpp

! $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) -I$(GAUL_PATH) $(TSP_SOLVER_ARGS) -c tsp_solver.cpp

alpha_drivedist.o: alpha_drivedist.cpp

! $(CXX) $(CPPFLAGS) $(EXTRA_FLAGS) $(ALPHADRIVELIST_ARGS) -I$(CGAL_PATH) -I$(CGAL_INCL_CONF_DIR) -c alpha_drivedist.cpp

Attachments

patch-routing-1.0.0.a-win32-r1.patch Download (4.9 KB) - added by davidtecher 3 years ago.
patch for win32 - pgrouting 1.0.0.a

Change History

Changed 3 years ago by davidtecher

patch for win32 - pgrouting 1.0.0.a

follow-up: ↓ 2   Changed 3 years ago by anton

  • owner set to anton
  • status changed from new to assigned

David,

Thank you for the patch!

Well, I don't know what to do - to make a branch for win32 version or just to rearrange directory structure to separate your makefiles from ones for Linux...

Do you have any ideas what will be the best way?

in reply to: ↑ 1 ; follow-up: ↓ 3   Changed 3 years ago by daniel

The ticket #8 has been added to create a new directory structure.

in reply to: ↑ 2 ; follow-up: ↓ 4   Changed 3 years ago by davidtecher

Hi

AFAI I think the best should be to make a branch for win32...I don't know what will be the future development for pgrouting. So I think the pgrouting's team will made modification on files for linux=> the general branch.

So later, if win32 contributors wanted to test the win32's branch they could suggetst their own patch without modifying the general branch. That's a better organization

in reply to: ↑ 3   Changed 3 years ago by davidtecher

Replying to davidtecher:

Hi AFAI I think the best should be to make a branch for win32...I don't know what will be the future development for pgrouting. So I think the pgrouting's team will made modification on files for linux=> the general branch. So later, if win32 contributors wanted to test the win32's branch they could suggetst their own patch without modifying the general branch. That's a better organization An other idea should be to support automake and so on. So we will not have the problem of host detection....=> linux, win32, os x

  Changed 3 years ago by anton

  • status changed from assigned to closed
  • resolution set to fixed

Win32 patch was temporary included into the trunk.

Note: See TracTickets for help on using tickets.