Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to install pgrouting in my ubuntu 12.04 machine using the instructions of this link. However, when I try to execute the following command based on step 3, it generates some error.

command

psql -U postgres -f /media/resource/pgrouting/pgrouting/core/sql/routing_core.sql routing

Output:

psql:routing_core.sql:21: ERROR: type "path_result" already exists

psql:routing_core.sql:22: ERROR: type "vertex_result" already exists

psql:routing_core.sql:32: ERROR: could not access file "$libdir/librouting": No such file or directory

psql:routing_core.sql:43: ERROR: could not access file "$libdir/librouting": No such file or directory

psql:routing_core.sql:53: ERROR: could not access file "$libdir/librouting": No such file or directory

CREATE FUNCTION

How can I solve this problem?

share|improve this question

2 Answers 2

In case you don't need to make changes to the pgRouting source and compile yourself, why don't you use the Ubuntu packages? See: http://workshop.pgrouting.org/chapters/installation.html

Otherwise the errors above might occur because your build failed. Have you checked, that there was no build error?

share|improve this answer
    
I have changed '$libdir/librouting' to hard coded path and its working fine now. –  Quazi Marufur Rahman Feb 21 '13 at 6:33

I had the same problem and used the same solution. For completeness' sake I have included the fix I made to the routing_core.sql file in Ubuntu 12.10/Linux Mint 14. Below is an exceprt from the file showing the three changes I made replacing '$libdir/librouting' with '/usr/lib/postgresql/9.1/lib/librouting.so':

CREATE OR REPLACE FUNCTION shortest_path(sql text, source_id integer, 
    target_id integer, directed boolean, has_reverse_cost boolean)
    RETURNS SETOF path_result
    AS '/usr/lib/postgresql/9.1/lib/librouting.so'
    LANGUAGE C IMMUTABLE STRICT;

-----------------------------------------------------------------------
-- Core function for shortest_path_astar computation
-- Simillar to shortest_path in usage but uses the A* algorithm
-- instead of Dijkstra's.
-----------------------------------------------------------------------
CREATE OR REPLACE FUNCTION shortest_path_astar(sql text, source_id integer, 
        target_id integer,directed boolean, has_reverse_cost boolean)
         RETURNS SETOF path_result
         AS '/usr/lib/postgresql/9.1/lib/librouting.so'
         LANGUAGE C IMMUTABLE STRICT; 

-----------------------------------------------------------------------
-- Core function for shortest_path_astar computation
-- Simillar to shortest_path in usage but uses the Shooting* algorithm
-----------------------------------------------------------------------
CREATE OR REPLACE FUNCTION shortest_path_shooting_star(sql text, source_id integer, 
        target_id integer,directed boolean, has_reverse_cost boolean)
         RETURNS SETOF path_result
         AS '/usr/lib/postgresql/9.1/lib/librouting.so'
         LANGUAGE C IMMUTABLE STRICT; 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.