[pgrouting-dev] Regarding the generation of .so file for a postgresql function

Stephen Woodbridge woodbri at swoodbridge.com
Mon Oct 26 07:08:36 PDT 2015


Also we already do this in the build tree for pgrouting v2.0.0 a good 
example of this in the tsp algorithm.

git checkout v2.0.0

and look at the CMakeLists.txt files stating at:

CMakeLists.txt
src/CMakeLists.txt
src/tsp/CMakeLists.txt
src/tsp/src/CMakeLists.txt

and look for tsp related lines.

Then in your branch, create a directory tree similar to tsp for your 
function.

src/myfunc/src etc

and modify the CMakeLists.txt files to deal with your function.

-Steve

On 10/26/2015 9:45 AM, dave.potts at pinan.co.uk wrote:
> Since this is a matter to do with the operating system, it might help if you stated what machine you where using, what operating systems , which version the compile your using etc.
>
> D..
>
>
> October 25 2015 7:37 AM, "Sankepally Rohith Reddy" <rohith.reddy at research.iiit.ac.in> wrote:
>> Hello there,
>>
>> I am working on one of my projects which requires the implementation of a function/query which uses
>> data from a postgresql database. To do so I need to generate a "my_function.so" from
>> "my_function.c",which uses cpp functions.I am facing a problem in linking "my_function.c" with the
>> cpp files(where the cpp functions are defined) and generate a "my_function.so" which is used to
>> create a postgresql function.
>>
>> "my_cpp_header.h":-
>>
>> #ifndef DIJKSTRA_FUNCTION_H_
>> #define DIJKSTRA_FUNCTION_H_
>>
>> #ifdef __cplusplus
>> extern "C" {
>> #endif
>>
>> int compute_dijkstra(int source,int target,Edge *edges,int num_vertices,int num_edges,Edge **path);
>>
>> #ifdef __cplusplus
>> }
>> #endif
>>
>> #endif
>>
>> "my_cpp_function.cpp":-
>>
>> #include "my_cpp_header.h"
>>
>> int compute_dijkstra(int source,int target,Edge *edges,int num_vertices,int num_edges,Edge **path)
>> {
>> definition of the function(in cpp)
>> }
>>
>> I need to generate "my_function.so" from "my_function.c" which uses the above function.
>>
>> Please help me solving this.
>>
>> Thanks in advance.
>>
>> _______________________________________________
>> pgrouting-dev mailing list
>> pgrouting-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/pgrouting-dev
> _______________________________________________
> pgrouting-dev mailing list
> pgrouting-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-dev
>



More information about the pgrouting-dev mailing list