[pgrouting-dev] Problems linking on mingw64 between boost, cgal and threads

Stephen Woodbridge woodbri at swoodbridge.com
Wed Mar 20 14:51:05 PDT 2013


Hi sanak,

I figured out a nice trick for scripting the bjam.exe bootstrap. You can 
change your instructions like this:


Boost
-------------------------------------------------------------
  Use old version(1.46.1) because of boost/graph/detail/is_same.hpp issue

  $ cd /c/build
  $ wget 
http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.zip
  $ unzip boost_1_46_1.zip
  $ cd boost_1_46_1/tools/build/v2
  $ # the following will run the bootstrap.bat in cmd.exe and exit
  $ cmd //c bootstrap.bat gcc
  $ cp bjam.exe /c/build/boost_1_46_1/
  $ cd /c/build/boost_1_46_1
  $ bjam toolset=gcc address-model=32 define=BOOST_USE_WINDOWS_H 
link=static threading=multi --with-thread --prefix=/usr/local install

  * Above bjam build instruction is quoted from the following site.
    [Unable to build Boost libraries with GCC - Stack Overflow]
 
http://stackoverflow.com/questions/5299468/unable-to-build-boost-libraries-with-gcc


Also for gaul I created a gaul.path file so instead of having the used 
edit the includes I run:

  $ ./configure --enable-slang=no --enable-pthread=no --enable-shared=yes
  $ cat /c/build/gaul.patch | patch -p1

My patch file is:

$ cat /c/build/gaul.patch
--- gaul-devel-0.1849-0/util/gaul/gaul_config.h 2005-04-20 12:09:49 -0400
+++ gaul-devel-0.1849-0a/util/gaul/gaul_config.h 2013-03-11 13:47:33 -0400

@@ -53,9 +53,9 @@

  #ifdef WIN32
  #  ifdef BUILDING_DLL
-#    define FUNCPROTO __declspec (dllexport)
+#    define FUNCPROTO
  #  else
-#    define FUNCPROTO __declspec (dllimport)
+#    define FUNCPROTO
  #  endif
  #else
  #  define FUNCPROTO

--- gaul-devel-0.1849-0/util/gaul/gaul_config_win.h     2005-04-14 
11:08:56 -0400
+++ gaul-devel-0.1849-0a/util/gaul/gaul_config_win.h    2013-03-11 
13:48:12 -0400
@@ -39,9 +39,9 @@
   **********************************************************************/

  #ifdef BUILDING_DLL
-#  define FUNCPROTO __declspec (dllexport)
+#  define FUNCPROTO
  #else
-#  define FUNCPROTO __declspec (dllimport)
+#  define FUNCPROTO
  #endif

  #  if defined __CYGWIN32__ && !defined __CYGWIN__
---

You might want to add these to your process.

Thanks,
   -Steve

On 3/13/2013 10:44 AM, sanak wrote:
> Hi Stephen,
> I have updated the MinGW32/64 build instruction,
> so, could you retry from boost build?
> (Sorry, gcc PATH settings is not necessary, because msys.bat path
> settings seems to be inherited by command prompt.)
> https://github.com/sanak/pgrouting4w/commit/e5ae697b3cb545b002702eda62c2909382ae4521
> Regards,
>
> 2013/3/13 sanak <geosanak at gmail.com <mailto:geosanak at gmail.com>>
>
>     Hi Stephen,
>     Oops, sorry, my boost_1_46_1/tools/build/bjam.log shows "msvc10"
>     which I have installed...
>
>     I will check after returning from work. (about 12 hour later)
>     Regards,
>     2013/3/13 Stephen Woodbridge <woodbri at swoodbridge.com
>     <mailto:woodbri at swoodbridge.com>>
>
>         OK, it looks like I have solved ISSUE 2, I think this was caused
>         because I built boost with the 32 bit model in the 64 bit
>         environment. I still can not not get ISSUE 1 to resolve and I
>         had to rebuild it using the bjam I built under 1_51.
>
>         To fix ISSUE to:
>
>         1. rebuilt boost_1_46_1 as 64 bit model using bjam from 1_51
>         2. rebuild CGAL
>         3. rebuild pgrouting
>
>         So I have at least on cuild of pgRouting
>
>         So making progress in small steps :)
>
>         If you have any additional thoughts on getting boost to build
>         they would be appreciated.
>
>         In my msys.bat shell, I have:
>
>         PATH=/c/ming64/mingw64/bin/:/__home/woodbri/bin:.:/usr/local/__bin:/mingw/bin:/bin:/c/oracle/__product/10.2.0/db_1/bin:/c/__Windows/system32:/c/Windows:/__c/Windows/System32/Wbem:/c/__Windows/System32/__WindowsPowerShell/v1.0/:/c/__Program
>         Files (x86)/QuickTime/QTSystem/
>
>         Thanks,
>            -Steve
>
>
>         On 3/12/2013 11:34 AM, Stephen Woodbridge wrote:
>
>             Hi Sanak,
>
>             I'm still have an issue with this. Hopefully I followed your
>             changes
>             correctly:
>
>             In my msys.bat shell I added the to the path:
>             /c/ming64/mingw64/bin/, I
>             have /c/ming64/ and /c/ming32/ trees setup so I can build on
>             either.
>
>             start cmd
>             gcc -v               # is found and run
>             bootstrap.bat gcc    # fails
>             bootstrap.bat mingw  # fails
>
>             exit
>
>             $ cat tools/build/bjam.log
>             ###
>             ### Using 'msvc' toolset.
>             ###
>
>             c:\ming64\projects\boost_1_46___1\tools\build\v2\engine\src>if
>             exist
>             bootstrap rd /S /Q bootstrap
>
>             c:\ming64\projects\boost_1_46___1\tools\build\v2\engine\src>md
>             bootstrap
>
>             c:\ming64\projects\boost_1_46___1\tools\build\v2\engine\src>cl
>             /nologo /GZ
>             /Zi /MLd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG kernel32.lib
>             advapi32.lib user32.lib /Febootstrap\jam0  command.c
>             compile.c debug.c
>             execnt.c expand.c filent.c glob.c hash.c hdrmacro.c
>             headers.c jam.c
>             jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c
>             output.c
>             parse.c pathunix.c regexp.c rules.c scan.c search.c subst.c
>             timestamp.c
>             variable.c modules.c strings.c filesys.c builtins.c md5.c
>             pwd.c class.c
>             w32_getreg.c native.c modules/set.c modules/path.c
>             modules/regex.c
>             modules/property-set.c modules/sequence.c modules/order.c
>
>             I looked at tools/build/v2/engine/src/__build.bat but I'm
>             not very
>             familiar with windows bat files.
>
>             -Steve
>
>             On 3/12/2013 9:15 AM, sanak wrote:
>
>                 Hi Stephen,
>                 I updated MinGW32/64 build instruction to my "mingw" branch,
>                 and checked that MinGW64-bit build successed. (but not
>                 tested)
>                 https://github.com/sanak/__pgrouting4w/commit/__2a660524b53bcd80005e52917af5b3__2b31749559
>                 <https://github.com/sanak/pgrouting4w/commit/2a660524b53bcd80005e52917af5b32b31749559>
>
>                 so, retry from boost build about ISSUE1. (Thanks Pieter!)
>                 Regards,
>                 2013/3/12 Stephen Woodbridge <woodbri at swoodbridge.com
>                 <mailto:woodbri at swoodbridge.com>
>                 <mailto:woodbri at swoodbridge.__com
>                 <mailto:woodbri at swoodbridge.com>>>
>
>                      Hi all,
>
>                      I'm stuck at the moment trying to link the
>                 pgrouting driving
>                      directions module using mingw 64 bit. See the
>                 issues below. So if
>                      anyone has any thoughts on this it would be
>                 appreciated. I will
>                      check the current state of the files into my branch
>                 in the morning
>                      here (GMT-5) if you are setup to reproduce this. It
>                 is too late to
>                      do it with a clear head tonight. I'll also move it
>                 back to Linux and
>                      try again there as I have changed a lot of files.
>
>                      Thanks,
>                         -Steve
>
>                      I have followed Sanak's directions from:
>                 https://github.com/sanak/____pgrouting4w/blob/master/BUILD.____mingw64
>                 <https://github.com/sanak/__pgrouting4w/blob/master/BUILD.__mingw64>
>
>                 <https://github.com/sanak/__pgrouting4w/blob/master/BUILD.__mingw64
>                 <https://github.com/sanak/pgrouting4w/blob/master/BUILD.mingw64>>
>
>                      ISSUE 1:
>
>                      I first installed boost_1_51.zip but ran into
>                 problems compiling so
>                      installed boost_1_46_1.zip as he suggested. I was
>                 able to bootstrap
>                      1_51 and get a bjam.exe without a problem. But I
>                 could not get
>                      1_46_1 to bootstrap :(
>
>                      Microsoft Windows [Version 6.1.7601]
>                      Copyright (c) 2009 Microsoft Corporation.  All
>                 rights reserved.
>
>                      c:\ming64\projects\boost_1_46_____1>bootstrap.bat mingw
>                      Building Boost.Jam build engine
>                      'cl' is not recognized as an internal or external
>                 command,
>                      operable program or batch file.
>
>                      Failed to build Boost.Jam build engine.
>                      Please consult bjam.log for furter diagnostics.
>
>                      You can try to obtain a prebuilt binary from
>
>
>                 http://sf.net/project/____showfiles.php?group_id=7586&____package_id=72941
>                 <http://sf.net/project/__showfiles.php?group_id=7586&__package_id=72941>
>
>                 <http://sf.net/project/__showfiles.php?group_id=7586&__package_id=72941
>                 <http://sf.net/project/showfiles.php?group_id=7586&package_id=72941>>
>
>                      Also, you can file an issue at http://svn.boost.org
>                      Please attach bjam.log in that case.
>
>                      c:\ming64\projects\boost_1_46_____1>
>
>                      So I built 1_46_1 using the bjam.exe that I built
>                 in 1_51 and it
>                      seems to have worked ok, but maybe that is part of
>                 the problem.
>
>                      ISSUE 2:
>
>                      Is the follow mess from the linker
>
>                      Scanning dependencies of target routing_dd
>                      [ 80%] Building C object
>
>                 core/driving_distance/src/____CMakeFiles/routing_dd.dir/____alpha.c.obj
>                      [ 86%] Building CXX object
>
>                 core/driving_distance/src/____CMakeFiles/routing_dd.dir/____alpha_drivedist.cpp.obj
>
>                      In file included from
>
>                 c:/ming64/projects/pgx64/pg92/____include/postgresql/server/__pg___config_os.h:37:0,
>
>                                        from
>
>                 c:/ming64/projects/pgx64/pg92/____include/postgresql/server/c.__h:__87,
>                                        from
>
>                 c:/ming64/projects/pgx64/pg92/____include/postgresql/server/____postgres.h:47,
>
>                                        from
>
>                 c:/ming64/projects/pgrouting/____core/driving_distance/src/____alpha.h:27,
>                                        from
>
>                 c:/ming64/projects/pgrouting/____core/driving_distance/src/____alpha_drivedist.cpp:46:
>
>
>                 c:\ming64\mingw64\bin\../lib/____gcc/x86_64-w64-mingw32/4.5.4/__.__./../../../x86_64-w64-__mingw32/__include/winsock2.h:__13:2:
>
>                      warning: #warning Please include winsock2.h before
>                 windows.h
>                      [ 93%] Building CXX object
>
>                 core/driving_distance/src/____CMakeFiles/routing_dd.dir/____boost_drivedist.cpp.obj
>
>                      [100%] Building C object
>
>                 core/driving_distance/src/____CMakeFiles/routing_dd.dir/____drivedist.c.obj
>                      Linking CXX shared library
>                 ../../../lib/librouting_dd.dll
>                      Creating library file:
>                 ../../../lib/librouting_dd.____dll.a
>
>                 c:/ming64/msys/local/lib/____libboost_thread-mgw45-mt-1_46_____1.a(thread.o):
>                      duplicate section
>
>                 `.data$_ZTVN5boost16exception_____detail10clone_implINS0_____19error_info_injectorISt9bad_____allocEEEE[vtable
>
>                      for
>
>                 boost::exception_detail::____clone_impl<boost::exception_____detail::error_info_injector<____std::bad_alloc>
>
>                       >]' has different size
>
>                 c:/ming64/msys/local/lib/____libCGAL.a(all_files.cpp.obj):____all_files.cpp:(.text+0xf898):
>
>                      undefined reference to
>                   `boost::system::generic_____category()'
>
>                 c:/ming64/msys/local/lib/____libCGAL.a(all_files.cpp.obj):____all_files.cpp:(.text+0xf8a4):
>
>                      undefined reference to
>                 `boost::system::generic_____category()'
>
>                 c:/ming64/msys/local/lib/____libCGAL.a(all_files.cpp.obj):____all_files.cpp:(.text+0xf8b0):
>
>                      undefined reference to
>                 `boost::system::system_____category()'
>                      collect2: ld returned 1 exit status
>                      make[2]: *** [lib/librouting_dd.dll] Error 1
>                      make[1]: ***
>
>                 [core/driving_distance/src/____CMakeFiles/routing_dd.dir/all]
>                 Error 2
>                      make: *** [all] Error 2
>                      ___________________________________________________
>                      pgrouting-dev mailing list
>                 pgrouting-dev at lists.osgeo.org
>                 <mailto:pgrouting-dev at lists.osgeo.org>
>                 <mailto:pgrouting-dev at lists.__osgeo.org
>                 <mailto:pgrouting-dev at lists.osgeo.org>>
>                 http://lists.osgeo.org/____mailman/listinfo/pgrouting-dev <http://lists.osgeo.org/__mailman/listinfo/pgrouting-dev>
>
>                 <http://lists.osgeo.org/__mailman/listinfo/pgrouting-dev
>                 <http://lists.osgeo.org/mailman/listinfo/pgrouting-dev>__>
>
>
>
>
>                 _________________________________________________
>                 pgrouting-dev mailing list
>                 pgrouting-dev at lists.osgeo.org
>                 <mailto:pgrouting-dev at lists.osgeo.org>
>                 http://lists.osgeo.org/__mailman/listinfo/pgrouting-dev
>                 <http://lists.osgeo.org/mailman/listinfo/pgrouting-dev>
>
>
>             _________________________________________________
>             pgrouting-dev mailing list
>             pgrouting-dev at lists.osgeo.org
>             <mailto:pgrouting-dev at lists.osgeo.org>
>             http://lists.osgeo.org/__mailman/listinfo/pgrouting-dev
>             <http://lists.osgeo.org/mailman/listinfo/pgrouting-dev>
>
>
>         _________________________________________________
>         pgrouting-dev mailing list
>         pgrouting-dev at lists.osgeo.org <mailto:pgrouting-dev at lists.osgeo.org>
>         http://lists.osgeo.org/__mailman/listinfo/pgrouting-dev
>         <http://lists.osgeo.org/mailman/listinfo/pgrouting-dev>
>
>
>
>
>
> _______________________________________________
> pgrouting-dev mailing list
> pgrouting-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-dev
>



More information about the pgrouting-dev mailing list