package (#21) - librouting.so: missing magic block (#254) - Message List

librouting.so: missing magic block

Hejsan,

I'm trying to install pgrouting. It compiles fine but creating the functions in my DB results in the Error

psql:/usr/share/postlbs/routing_core.sql:32: ERROR: incompatible library "/usr/lib/postgresql/8.3/lib/librouting.so": missing magic block
HINT: Extension libraries are required to use the PG_MODULE_MAGIC macro.

The installed versions are as follows:

  • debian 4.0
  • postgresql-8.3 8.3.6-1-bp
  • postgis 1.3.3-1-bp
  • postgresql-8.3-postgis 1.3.3-1-bp

Here is what I did:

  • cd pgroutingSvn2 //no errors here
  • cmake . //no errors here
    Boost headers were found here: /usr/include
    Output directory for libraries is set to /usr/lib/postgresql/8.3/lib
    Installation directory for libraries is set to /usr/lib/postgresql/8.3/lib and for SQL files is set to /usr/share/postlbs
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /var/www/web0/files/pgroutingSvn2
    
  • make //no errors here
    Scanning dependencies of target routing
    [ 16%] Building C object core/src/CMakeFiles/routing.dir/dijkstra.o
    [ 33%] Building C object core/src/CMakeFiles/routing.dir/astar.o
    [ 50%] Building C object core/src/CMakeFiles/routing.dir/shooting_star.o
    [ 66%] Building CXX object core/src/CMakeFiles/routing.dir/boost_wrapper.o
    [ 83%] Building CXX object core/src/CMakeFiles/routing.dir/astar_boost_wrapper.o
    [100%] Building CXX object core/src/CMakeFiles/routing.dir/shooting_star_boost_wrapper.o
    
  • make install //no errors here
    [100%] Built target routing
    Install the project...
    -- Install configuration: ""
    -- Install configuration: ""
    -- Install configuration: ""
    -- Install configuration: ""
    -- Installing /usr/lib/postgresql/8.3/lib/librouting.so
    -- Install configuration: ""
    -- 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
    
  • /etc/init.d/postgresql-8.3 restart //no errors here
  • psql -U web0 -f /usr/share/postlbs/routing_core.sql gis //returned errors
    psql:/usr/share/postlbs/routing_core.sql:21: ERROR:  relation "path_result" already exists
    psql:/usr/share/postlbs/routing_core.sql:22: ERROR:  relation "vertex_result" already exists
    psql:/usr/share/postlbs/routing_core.sql:32: ERROR:  incompatible library "/usr/lib/postgresql/8.3/lib/librouting.so": missing magic block
    HINT:  Extension libraries are required to use the PG_MODULE_MAGIC macro.
    psql:/usr/share/postlbs/routing_core.sql:43: ERROR:  incompatible library "/usr/lib/postgresql/8.3/lib/librouting.so": missing magic block
    HINT:  Extension libraries are required to use the PG_MODULE_MAGIC macro.
    psql:/usr/share/postlbs/routing_core.sql:53: ERROR:  incompatible library "/usr/lib/postgresql/8.3/lib/librouting.so": missing magic block
    HINT:  Extension libraries are required to use the PG_MODULE_MAGIC macro.
    CREATE FUNCTION
    

I tried to google the error message, tried to modify the .c-files (inserting a #ifdef PG_MODULE_MAGIC // PG_MODULE_MAGIC; // #endif) but without any luck.

I would be very happy if someone could look into this problem and give me a hint.

Kind regards from Hamburg,

Christof

  • Message #907

    Hi Christof,

    Oh, so this is strange, because the magic block is in our source code since version 1.01. See it for yourself - http://pgrouting.postlbs.org/browser/trunk/core/src/dijkstra.c#L45

    Where did you try to insert it to?

    • Message #908

      Hej Anton,

      thanks for your reply.

      I saw the magic block in dijkstra.c but as it haven't done the trick I tried to add it in shooting_star.c and astar.c as well. Apparently without any luck.

      I just deleted /usr/lib/postgresql/8.3/lib/librouting.so checked that posgres does not see it any more and "maked install" it again. But routing_core.sql gave the same then above.

      Do you have any idea what I possibly do wrong?

      • Message #930

        Hello,

        would it possibly be an idea to try the librouting.so file someone else has compiled?

        Could someone provide me with a librouting.so that has been compilied on debian 4.0?

        Regards,

        Christof

        • Message #931

          Hejsan,

          I copied the librouting.so from another Suse 11.0 installation to the correspondent directory of my Debian machine. And the error message is gone. :-)

          Cheers!