Ticket #85 (assigned bug report)

Opened 3 years ago

Last modified 3 years ago

cmake build problem

Reported by: rodj59 Owned by: anton
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 Download (124 bytes) - added by rodj59 3 years ago.
cmakout2.txt Download (224 bytes) - added by rodj59 3 years ago.
makeout1.txt Download (68 bytes) - added by rodj59 3 years ago.
makeout2.txt Download (21.9 KB) - added by rodj59 3 years ago.
routing_diff.txt Download (59.7 KB) - added by rodj59 3 years ago.
Diff on build directories, one with both DD & TSP flags set, other with just TSP flag.

Change History

Changed 3 years ago by rodj59

Changed 3 years ago by rodj59

Changed 3 years ago by rodj59

Changed 3 years ago by rodj59

Changed 3 years ago by rodj59

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

Changed 3 years ago by rodj59

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

Changed 3 years ago 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

Changed 3 years ago by rodj59

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

Changed 3 years ago by rodj59

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

Changed 3 years ago 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.

Changed 3 years ago 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)

Changed 3 years ago 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"

Changed 3 years ago 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.

Note: See TracTickets for help on using tickets.