pgRouting

Ticket #85 (assigned bug report)

Opened 1 year ago

Last modified 1 year ago

cmake build problem

Reported by: rodj59 Assigned to: anton (accepted)
Priority: major Milestone: Version 1.1
Component: pgRouting package Version: 1.0
Keywords: Cc:

Description

During build can't find headers, after build can't locate libraries. Think it was the "extras" having trouble. In some places the includes would be properly set, in others they wouldn't.

Attachments

cmakeout1.txt (124 bytes) - added by rodj59 on 11/16/07 16:06:53.
cmakout2.txt (224 bytes) - added by rodj59 on 11/16/07 16:07:54.
makeout1.txt (68 bytes) - added by rodj59 on 11/16/07 16:08:34.
makeout2.txt (21.9 kB) - added by rodj59 on 11/16/07 16:09:10.
routing_diff.txt (59.7 kB) - added by rodj59 on 11/16/07 17:14:34.
Diff on build directories, one with both DD & TSP flags set, other with just TSP flag.

Change History

11/16/07 16:06:53 changed by rodj59

  • attachment cmakeout1.txt added.

11/16/07 16:07:54 changed by rodj59

  • attachment cmakout2.txt added.

11/16/07 16:08:34 changed by rodj59

  • attachment makeout1.txt added.

11/16/07 16:09:10 changed by rodj59

  • attachment makeout2.txt added.

11/16/07 16:26:30 changed by rodj59

Discovered the system builds OK without the driving distance -DWITH_DD=ON flag turned on.

11/16/07 16:37:58 changed by rodj59

As a further twist, even though it crashes the rest of the build, the DrivingDistance directory will actually compile on its own.

11/16/07 16:53:05 changed by anton

  • owner changed from somebody to anton.
  • status changed from new to assigned.
  • component changed from A* to pgRouting package.
  • milestone set to Version 1.1.

11/16/07 17:14:34 changed by rodj59

  • attachment routing_diff.txt added.

Diff on build directories, one with both DD & TSP flags set, other with just TSP flag.

11/16/07 17:17:14 changed by rodj59

Noticed same symptom occurs after cmake is run twice in the same directory.

11/16/07 18:59:00 changed by rodj59

Looks like problem is failure to locate the c++ header files which are in /usr/include/c++/4.1.2/ . Can't find any way to force cmake to feed this to the makefiles.

11/18/07 14:39:43 changed by rodj59

'$libdir/routing_tsp' in librouting_tsp.sql should be changed to $libdir/librouting_tsp or vice-versa.

Script installs librouting_tsp.so into /usr/lib ; should go into /usr/lib/postgresql since that's where it expects to find it. When moved & renamed crashes with the following message:- sql:/usr/share/postgresql/routing_tsp.sql:28: ERROR: could not load library "/usr/lib/postgresql/librouting_tsp.so": /usr/lib/postgresql/librouting_tsp.so: undefined symbol: ga_select_one_randomrank

Here is the ldd output:-

transport@rod1:~$ ldd /usr/lib/postgresql/librouting_tsp.so

linux-gate.so.1 => (0xffffe000) /lib/libsafe.so.2 (0xb7f67000) libstdc++.so.6 => /usr/X11R6/lib/libstdc++.so.6 (0xb7e56000) libm.so.6 => /lib/libm.so.6 (0xb7e2f000) libgcc_s.so.1 => /usr/X11R6/lib/libgcc_s.so.1 (0xb7e24000) libc.so.6 => /lib/libc.so.6 (0xb7ce2000) libdl.so.2 => /lib/libdl.so.2 (0xb7cde000) /lib/ld-linux.so.2 (0x80000000)

11/18/07 19:35:27 changed by rodj59

What needs to end up in link.txt under routing_tsp.dir is something like this :-

/usr/bin/gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fpic -shared -Wl,-soname,librouting.so.0 -L/usr/lib -Wl,-rpath,'/usr/lib' -lstdc++ -L/usr/local/lib -lgaul_util -lgaul -L/usr/src/disks/DB/GPS/PostgresRouting/CGAL-3.3.1/lib/i686_Linux-2.6_g++-4.1.2 -lCGAL -o /usr/lib/librouting_tsp.so "CMakeFiles/routing_tsp.dir/tsp.o" "CMakeFiles/routing_tsp.dir/tsp_solver.o"

12/21/07 11:08:57 changed by kyngchaos

I ran into similar (same?) problems on OSX. Here is what I came up with to get the include and link options where they need to be. It's a quick hack, and there may be better ways to do this in cmake. And on OSX, there are some additional problems (tickets: #89, #90, #91).

extra/driving_distance/src/CMakeLists.txt: replace the ADD_LIBRARY() with

INCLUDE_DIRECTORIES(${CGAL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${CGAL_LIBRARIES})

ADD_LIBRARY(routing_dd MODULE alpha.c alpha_drivedist.cpp alpha.h boost_drivedist.cpp drivedist.c drivedist.h)

TARGET_LINK_LIBRARIES(routing_dd CGAL)

extra/tsp/src/CMakeLists.txt: replace the ADD_LIBRARY() with

INCLUDE_DIRECTORIES(${GAUL_LIBRARIES}/../include)
LINK_DIRECTORIES(${GAUL_LIBRARIES})

ADD_LIBRARY(routing_tsp MODULE tsp.c tsp.h tsp_solver.cpp)

TARGET_LINK_LIBRARIES(routing_tsp gaul gaul_util)

The Gaul include dir would be more elegant if there was a GAUL_INCLUDE_DIR variable.