[pgrouting-dev] pgRouting 2.0 Update - Build outside src tree

Stephen Woodbridge woodbri at swoodbridge.com
Mon Mar 25 18:16:27 PDT 2013


On 3/25/2013 9:10 PM, Daniel Kastl wrote:
>
>      >
>      > cmake -H. -Bmybuild -DWITH_TSP=ON -DWITH_DD=ON -DWITH_DOC=ON
>      > cd mybuild && make
>      >
>      > Where -B <dir>  - where the build tree will be created (build)
>      >       -H <dir>  - where the project source tree is located (home)
>
>     Could the -B switch be optional, defaulting to $PWD, and the source
>     tree be possibly specified without a switch ? That'd make the cmake
>     interface similar to the standard ./configure line:
>
>
> If you don't specify -B then the current directory is assumed.
> I tried to set a default build directory, but this seems to be
> impossible with CMake. It seems CMake already performs several tasks
> already before looking at CMakeLists.txt

mkdir build
cd build
cmake .. && make

Works great with the current setup.

> So if you don't pay attention and run cmake in the project source, you
> mess up the source tree.
> (though you can do a cleanup with "make distclean")

Your last pushed broke a few things:

1. make distclean - is now gone
2. something is missing related to sphinx (see below)
3. MinGW cmake can not find any of dependencies. I'm trying to figure 
this out, but its seriously broke at the moment.

-Steve

Build error:

woodbri at maps:~/work/pgrouting$ rm -rf build
woodbri at maps:~/work/pgrouting$ mkdir build
woodbri at maps:~/work/pgrouting$ cd build
woodbri at maps:~/work/pgrouting/build$ cmake -DWITH_TSP=ON -DWITH_DD=ON 
-DWITH_DOC=ON ..
-- The C compiler identification is GNU 4.4.5
-- The CXX compiler identification is GNU 4.4.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Git: /usr/bin/git
-- POSTGRESQL_EXECUTABLE is /usr/lib/postgresql/8.4/bin/postgres
-- POSTGRESQL_PG_CONFIG is /usr/bin/pg_config
-- Found PostgreSQL: /usr/include/postgresql/8.4/server, /usr/lib
-- Boost version: 1.42.0
Boost headers were found here: /usr/include
POSTGRESQL_VERSION_STRING is PostgreSQL 8.4.16
POSTGRESQL_VERSION is 8.4.16
Install directory for libraries is set to /usr/lib/postgresql/8.4/lib
Install directory for SQL files is set to /usr/share/pgrouting
-- Found Sphinx: /usr/bin/sphinx-build
Installation directory for libraries is set to 
/usr/lib/postgresql/8.4/lib and for SQL files is set to /usr/share/pgrouting
-- Found GAUL: /usr/local/lib/libgaul.so, /usr/local/lib/libgaul_util.so
Installation directory for libraries is set to /usr/lib/postgresql/8.4/lib
-- Found CGAL: /usr/include, /usr/lib/libCGAL.so, 
/usr/lib/libboost_thread.so, /usr/lib/libgmp.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/woodbri/work/pgrouting/build
woodbri at maps:~/work/pgrouting/build$ make
Scanning dependencies of target trsp
[  6%] Building C object core/trsp/src/CMakeFiles/trsp.dir/trsp.c.o
[ 12%] Building CXX object core/trsp/src/CMakeFiles/trsp.dir/trsp_core.cpp.o
[ 18%] Building CXX object 
core/trsp/src/CMakeFiles/trsp.dir/GraphDefinition.cpp.o
[ 18%] Built target trsp
Scanning dependencies of target astar
[ 25%] Building C object core/astar/src/CMakeFiles/astar.dir/astar.c.o
[ 31%] Building CXX object 
core/astar/src/CMakeFiles/astar.dir/astar_boost_wrapper.cpp.o
[ 31%] Built target astar
Scanning dependencies of target dijkstra
[ 37%] Building C object 
core/dijkstra/src/CMakeFiles/dijkstra.dir/dijkstra.c.o
[ 43%] Building CXX object 
core/dijkstra/src/CMakeFiles/dijkstra.dir/boost_wrapper.cpp.o
[ 43%] Built target dijkstra
Scanning dependencies of target shooting_star
[ 50%] Building C object 
core/shooting_star/src/CMakeFiles/shooting_star.dir/shooting_star.c.o
[ 56%] Building CXX object 
core/shooting_star/src/CMakeFiles/shooting_star.dir/shooting_star_boost_wrapper.cpp.o
[ 56%] Built target shooting_star
Scanning dependencies of target routing
Linking CXX shared library lib/librouting.so
[ 56%] Built target routing
Scanning dependencies of target pgRoutingDocumentationdoc
[ 62%] Building HTML documentation with Sphinx
Making output directory...

Theme error:
no theme named 'pyramid' found (missing theme.conf?)
make[2]: *** [doc/CMakeFiles/pgRoutingDocumentationdoc] Error 1
make[1]: *** [doc/CMakeFiles/pgRoutingDocumentationdoc.dir/all] Error 2
make: *** [all] Error 2


>
>       mkdir mybuild; cd mybuild; cmake .. && make
>
>     This is how qgis cmake build works, for example.
>
>
> I will try this out and if it's possible to make this default.
>
>
>     Also, does this still require cmake 2.8.10 ?
>
>
> Yes, it would be nice if there wouldn't be a requirement for such a
> recent version of CMake,
> I even had to compile for Ubuntu.
>
> Daniel
>
>
>     --strk;
>
>      >
>      > You can build it "in" a sub-dir in the source tree or put the source
>      > tree elsewhere.
>      >
>      > Thank you for the suggestion.
>      >
>      > -Steve
>      >
>      > On 3/13/2013 10:02 AM, Sandro Santilli wrote:
>      > >On Wed, Mar 13, 2013 at 08:24:52AM -0400, Stephen Woodbridge wrote:
>      > >>Hi strk,
>      > >>
>      > >>On 3/13/2013 3:14 AM, Sandro Santilli wrote:
>      > >>>Hi Stephen,
>      > >>>is the branch supposed to be buildable on linux ?
>      > >>
>      > >>More or less, I have been changing between linux and windows to
>     keep
>      > >>the cmake changes working on both side. It needs me to push some
>      > >>stuff back for linux which will happen later today.
>      > >>
>      > >>BUT - at this point it is only "buildable", it does not install and
>      > >>has not been tested. I also have a lot of changes to make to it for
>      > >>postgis 2.x compatibility.
>      > >
>      > >It's not buildable here, with cmake 2.8.7:
>      > >
>      > >  -- Configuring done
>      > >  CMake Error at CMakeLists.txt:139 (ADD_LIBRARY):
>      > >   Cannot find source file:
>      > >
>      > >     $<TARGET_OBJECTS:astar>
>      > >
>      > >   Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh
>     .h++ .hm .hpp
>      > >   .hxx .in .txx
>      > >
>      > >And the same message repeated for:
>      > >
>      > >   $<TARGET_OBJECTS:dijkstra>
>      > >   $<TARGET_OBJECTS:shooting_star>
>      > >   $<TARGET_OBJECTS:trsp>
>      > >
>      > >Then:
>      > >
>      > >  CMake Error in core/astar/src/CMakeLists.txt:
>      > >   Cannot find source file:
>      > >
>      > >     OBJECT
>      > >
>      > >   Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh
>     .h++ .hm .hpp
>      > >   .hxx .in .txx
>      > >
>      > >and the same message repeated for:
>      > >
>      > >  CMake Error in core/dijkstra/src/CMakeLists.txt:
>      > >  CMake Error in core/shooting_star/src/CMakeLists.txt:
>      > >  CMake Error in core/trsp/src/CMakeLists.txt:
>      > >
>      > >And finally:
>      > >
>      > >  -- Build files have been written to:
>     /usr/src/pgrouting/pgrouting/b
>      > >
>      > >With cmake exit code being 1 and `make` returning:
>      > >
>      > >  make: *** No targets specified and no makefile found.  Stop.
>      > >
>      > >This is invoking cmake from outside the source dir, ie:
>      > >
>      > >  mkdir b; cd b; cmake -DWITH_TSP=ON -DWITH_DD=ON ..
>      > >
>      > >With current seq-devel-2_0 (commit
>     825b40e049e4b21787c27f00aae49b0382279842)
>      > >
>      > >--strk;
>      > >_______________________________________________
>      > >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
>      > >
>      >
>      > _______________________________________________
>      > 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://www.cartodb.com - Map, analyze and build applications with
>     your data
>
>                                             ~~ http://strk.keybit.net
>
>     _______________________________________________
>     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
>
>
>
>
> --
> Georepublic UG & Georepublic Japan
> eMail: daniel.kastl at georepublic.de <mailto:daniel.kastl at georepublic.de>
> Web: http://georepublic.de <http://georepublic.de/>
>
>
> _______________________________________________
> 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