2011年4月24日日曜日

16 pgRouting in Debian6 2 - インストール

Step 2: Compiling the pgRouting library を参考に pgRouting をインストールします。

1. Get pgRouting source リンクをクリックしてダウンロードします。
Source Packages の pgrouting-1.05.tar.gz をダウンロードしました。

2. Change to pgRouting directory
解凍して pgRouting ディレクトリに移動します。

user@deb6-vmw:~ダウンロード/gaul-devel-0.1850-0# exit
user@deb6-vmw:~ダウンロード/gaul-devel-0.1850-0$ cd ../
user@deb6-vmw:~ダウンロード$ ls
---
pgrouting-1.05.tar.gz
---
user@deb6-vmw:~ダウンロード$ tar xvzf pgrouting-1.05.tar.gz
user@deb6-vmw:~ダウンロード$ cd pgrouting-1.05

3. Compile and install pgRouting の For pgRouting extras (optional) にしたがってコンパイルとインストールをしました。
(cmake がインストールされていなかったので Synaptic パッケージマネージャでインストールしました。)

user@deb6-vmw:~ダウンロード/pgrouting-1.05$ cmake -DWITH_TSP=ON -DWITH_DD=ON .

次のようなエラーが表示されました。

CMake Warning (dev) at CMakeLists.txt:12 (add_subdirectory):
The source directory

/home/user/ダウンロード/pgrouting-1.05/cmake

does not contain a CMakeLists.txt file.

CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.

Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.


-- PostgreSQL not found.
FATALERROR Please check your PostgreSQL installation.
Boost headers were found here: /usr/include
Output directory for libraries is set to sh: pg_config: not found
Installation directory for libraries is set to sh: pg_config: not found and for SQL files is set to /usr/share/postlbs
Installation directory for libraries is set to sh: pg_config: not found
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
POSTGRESQL_INCLUDE_DIR (ADVANCED)


■ CMake Warning (dev) at CMakeLists.txt:12 (add_subdirectory): は、

user@deb6-vmw:~ダウンロード/pgrouting-1.05$ cmake --help-policy CMP0014
cmake version 2.8.2
CMP0014
Input directories must have CMakeLists.txt.

CMake versions before 2.8 silently ignored missing CMakeLists.txt
files in directories referenced by add_subdirectory() or subdirs(),
treating them as if present but empty. In CMake 2.8.0 and above this
policy determines whether or not the case is an error. The OLD
behavior for this policy is to silently ignore the problem. The NEW
behavior for this policy is to report an error.

This policy was introduced in CMake version 2.8.0. CMake version
2.8.2 warns when the policy is not set and uses OLD behavior. Use the
cmake_policy command to set it to OLD or NEW explicitly.

とあり、CMakeLists.txt がない場合に表示される警告です。バージョンが 2.8 以前ではこの警告は無視されます。
実際には、pgrouting-1.05/CMakeLists.txt がありますが、エラーが表示されるようです。
このままにしておきます。


■ -- PostgreSQL not found. に対応して
postgresql-server-dev-8.4 をインストールしました。
再度、cmake を実行しました。

-- Found PostgreSQL: /usr/include/postgresql/8.4/server, /usr/lib/libpq.so
Boost headers were found here: /usr/include
Output directory for libraries is set to /usr/lib/postgresql/8.4/lib
Installation directory for libraries is set to /usr/lib/postgresql/8.4/lib and for SQL files is set to /usr/share/postlbs
Installation directory for libraries is set to /usr/lib/postgresql/8.4/lib
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/pgrouting-1.05

成功しました。
次に、make を実行します。

user@deb6-vmw:~/pgrouting-1.05$ make
Scanning dependencies of target routing_tsp
[ 8%] Building C object extra/tsp/src/CMakeFiles/routing_tsp.dir/tsp.o
[ 16%] Building CXX object extra/tsp/src/CMakeFiles/routing_tsp.dir/tsp_solver.o
Linking CXX shared library ../../../lib/librouting_tsp.so
[ 16%] Built target routing_tsp
Scanning dependencies of target routing_dd
[ 25%] Building C object extra/driving_distance/src/CMakeFiles/routing_dd.dir/alpha.o
[ 33%] Building CXX object extra/driving_distance/src/CMakeFiles/routing_dd.dir/alpha_drivedist.o
[ 41%] Building CXX object extra/driving_distance/src/CMakeFiles/routing_dd.dir/boost_drivedist.o
In file included from /usr/include/c++/4.4/backward/hash_set:60,
from /usr/include/boost/pending/container_traits.hpp:23,
from /usr/include/boost/graph/detail/adjacency_list.hpp:31,
from /usr/include/boost/graph/adjacency_list.hpp:324,
from /home/user/pgrouting-1.05/extra/driving_distance/src/boost_drivedist.cpp:25:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
[ 50%] Building C object extra/driving_distance/src/CMakeFiles/routing_dd.dir/drivedist.o
Linking CXX shared library ../../../lib/librouting_dd.so
[ 50%] Built target routing_dd
Scanning dependencies of target routing
[ 58%] Building C object core/src/CMakeFiles/routing.dir/dijkstra.o
[ 66%] Building C object core/src/CMakeFiles/routing.dir/astar.o
[ 75%] Building C object core/src/CMakeFiles/routing.dir/shooting_star.o
[ 83%] Building CXX object core/src/CMakeFiles/routing.dir/boost_wrapper.o
In file included from /usr/include/c++/4.4/backward/hash_set:60,
from /usr/include/boost/pending/container_traits.hpp:23,
from /usr/include/boost/graph/detail/adjacency_list.hpp:31,
from /usr/include/boost/graph/adjacency_list.hpp:324,
from /home/user/pgrouting-1.05/core/src/boost_wrapper.cpp:25:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
[ 91%] Building CXX object core/src/CMakeFiles/routing.dir/astar_boost_wrapper.o
In file included from /usr/include/c++/4.4/backward/hash_set:60,
from /usr/include/boost/pending/container_traits.hpp:23,
from /usr/include/boost/graph/detail/adjacency_list.hpp:31,
from /usr/include/boost/graph/adjacency_list.hpp:324,
from /home/user/pgrouting-1.05/core/src/astar_boost_wrapper.cpp:25:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
[100%] Building CXX object core/src/CMakeFiles/routing.dir/shooting_star_boost_wrapper.o
In file included from /usr/include/c++/4.4/backward/hash_set:60,
from /usr/include/boost/pending/container_traits.hpp:23,
from /usr/include/boost/graph/detail/adjacency_list.hpp:31,
from /usr/include/boost/graph/adjacency_list.hpp:324,
from /home/user/pgrouting-1.05/core/src/shooting_star_boost_wrapper.cpp:25:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
/home/user/pgrouting-1.05/core/src/shooting_star_boost_wrapper.cpp:26:41: error: boost/vector_property_map.hpp: そのようなファイルやディレクトリはありません
In file included from /home/user/pgrouting-1.05/core/src/shooting_star_search.hpp:22,
from /home/user/pgrouting-1.05/core/src/shooting_star_boost_wrapper.cpp:27:
/home/user/pgrouting-1.05/core/src/shooting_star_relax.hpp:18:34: error: boost/property_map.hpp: そのようなファイルやディレクトリはありません
In file included from /home/user/pgrouting-1.05/core/src/edge_visitors.hpp:9,
from /home/user/pgrouting-1.05/core/src/shooting_star_search.hpp:28,
from /home/user/pgrouting-1.05/core/src/shooting_star_boost_wrapper.cpp:27:
/usr/include/boost/graph/detail/is_same.hpp:17:4: warning: #warning "This header is deprecated. Please use: boost/type_traits/is_same.hpp"
make[2]: *** [core/src/CMakeFiles/routing.dir/shooting_star_boost_wrapper.o] エラー 1
make[1]: *** [core/src/CMakeFiles/routing.dir/all] エラー 2
make: *** [all] エラー 2

■/home/user/pgrouting-1.05/core/src/shooting_star_boost_wrapper.cpp:26:41: error: boost/vector_property_map.hpp: そのようなファイルやディレクトリはありません

の対処は、次のように、実際のファイルの場所に pgrouting-1.05/core/src/shooting_star_boost_wrapper.cpp の内容修正をしました。

---
/* #include <boost/vector_property_map.hpp> */
#include <boost/property_map/vector_property_map.hpp>
---

■/home/user/pgrouting-1.05/core/src/shooting_star_relax.hpp:18:34: error: boost/property_map.hpp: そのようなファイルやディレクトリはありません

の対処は、次のように、実際のファイルの場所に pgrouting-1.05/core/src/shooting_star_relax.hpp の内容修正をしました。

---
/* #include <boost/property_map.hpp> */
#include <boost/property_map/property_map.hpp>
---

■/home/user/pgrouting-1.05/core/src/edge_visitors.hpp:6:34: error: boost/property_map.hpp: そのようなファイルやディレクトリはありません

の対処は、次のように、実際のファイルの場所に pgrouting-1.05/core/src/edge_visitors.hpp の修正をしました。

---
/* #include <boost/property_map.hpp> */
#include <boost/property_map/property_map.hpp>
---

再度、make を実行しました。

user@deb6-vmw:~/pgrouting-1.05$ make
[ 58%] Built target routing_tsp
[ 58%] Built target routing_dd
[ 58%] Building CXX object core/src/CMakeFiles/routing.dir/shooting_star_boost_wrapper.o
In file included from /usr/include/c++/4.4/backward/hash_set:60,
from /usr/include/boost/pending/container_traits.hpp:23,
from /usr/include/boost/graph/detail/adjacency_list.hpp:31,
from /usr/include/boost/graph/adjacency_list.hpp:324,
from /home/user/pgrouting-1.05/core/src/shooting_star_boost_wrapper.cpp:25:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
In file included from /home/user/pgrouting-1.05/core/src/edge_visitors.hpp:10,
from /home/user/pgrouting-1.05/core/src/shooting_star_search.hpp:28,
from /home/user/pgrouting-1.05/core/src/shooting_star_boost_wrapper.cpp:28:
/usr/include/boost/graph/detail/is_same.hpp:17:4: warning: #warning "This header is deprecated. Please use: boost/type_traits/is_same.hpp"
Linking CXX shared library ../../lib/librouting.so
[ 58%] Built target routing
(成功したみたいです。)

user@deb6-vmw:~/pgrouting-1.05$ su
パスワード:
root@deb6-vmw:/home/user/pgrouting-1.05# make install
[ 16%] Built target routing_tsp
[ 50%] Built target routing_dd
[100%] Built target routing
Install the project...
-- Install configuration: ""
-- Installing: /usr/lib/postgresql/8.4/lib/librouting.so
-- Installing: /usr/share/postlbs/routing_core.sql
-- Installing: /usr/share/postlbs/routing_core_wrappers.sql
-- Installing: /usr/share/postlbs/routing_topology.sql
-- Installing: /usr/share/postlbs/matching.sql
-- Installing: /usr/lib/postgresql/8.4/lib/librouting_tsp.so
-- Removed runtime path from "/usr/lib/postgresql/8.4/lib/librouting_tsp.so"
-- Installing: /usr/share/postlbs/routing_tsp.sql
-- Installing: /usr/share/postlbs/routing_tsp_wrappers.sql
-- Installing: /usr/lib/postgresql/8.4/lib/librouting_dd.so
-- Installing: /usr/share/postlbs/routing_dd.sql
-- Installing: /usr/share/postlbs/routing_dd_wrappers.sql

続く ...

0 件のコメント: