[pgrouting-dev] Reg: Compile error in KSP with PostgreSQL 8.4

Hi,

I am facing an error while building from source. This is that issue: https://github.com/pgRouting/pgrouting/issues/109

How to resolve that? Changing Pg version to 9.1 in CMakeLists.txt is not working. I have 9.1 and 9.4 postgresql versions installed in my system. Help me out in resolving this.

Thanks,
Mani

On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

Hi,

  I am facing an error while building from source. This is that
  issue: https://github.com/pgRouting/pgrouting/issues/109

   How to resolve that? Changing Pg version to 9.1 in CMakeLists.txt is
not working. I have 9.1 and 9.4 postgresql versions installed in my
system. Help me out in resolving this.

Mani,

Sorry, the CMakeLists.txt files built for pgrouting 2.x were not designed for support multiple versions installed on the same system. This is a problem for me because I have 9.2, 9.3, and 9.4 installed and I can only build and install on 9.4.

The solution id to update the CMakeLists.txt and specifically cmake/FindPostgreSQL.cmake which so you can do something like

cd build
cmake -DUSE_PG=9.x ..

I took a quick look at doing this a while back but cmake/FindPostgreSQL.cmake needs to be replaced and other changes are needed and I didn't have time to make the changes and get it working.

tools/test-runner.pl already support options for pg versions and ports so only the build system is broken in this regard.

If you want to read up on CMake and get this working a pull request would be great!

-Steve

Hi Steve,

I’ve tried my best to update cmake/FindPostgreSQL.cmake and CMakeLists.txt, but the build was not successful. I’ve changed all the POSTGRES variables to 9.4, cmake executed properly, but while compiling(make) there is a error saying “Postgres.h” not found. Can you share your CMakeLists.txt and cmake/FindPostgresql…cmake. I am on the version 9.4.

I think this needs to be solved for the next release. We need to the pass the postgresql version to build, like the option you said "DUSE_PG=9.x ". But unfortunately it is not working right now. I’ll try to read about cmake and see what I can do. I will update you.

Thank you,
Mani

···

On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

Hi,

I am facing an error while building from source. This is that
issue: https://github.com/pgRouting/pgrouting/issues/109

How to resolve that? Changing Pg version to 9.1 in CMakeLists.txt is
not working. I have 9.1 and 9.4 postgresql versions installed in my
system. Help me out in resolving this.

Mani,

Sorry, the CMakeLists.txt files built for pgrouting 2.x were not designed for support multiple versions installed on the same system. This is a problem for me because I have 9.2, 9.3, and 9.4 installed and I can only build and install on 9.4.

The solution id to update the CMakeLists.txt and specifically cmake/FindPostgreSQL.cmake which so you can do something like

cd build
cmake -DUSE_PG=9.x …

I took a quick look at doing this a while back but cmake/FindPostgreSQL.cmake needs to be replaced and other changes are needed and I didn’t have time to make the changes and get it working.

tools/test-runner.pl already support options for pg versions and ports so only the build system is broken in this regard.

If you want to read up on CMake and get this working a pull request would be great!

-Steve


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Mani,

You probably want to start with this version of FindPostgreSQL.cmake

https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

It lets you specify PostgreSQL_ADDITIONAL_VERSIONS variable and if this is set to the version you want it will use this version if found.

I think that the return variables that this script sets are different from what we expect in pgrouting so you might need to set the expected variables with the correct values also.

So, I would replace the existing FindPostgreSQL.cmake with this script and then try to make it work with the existing build system, then look at reading a command line version and setting the variable above before calling find postgresql.

-Steve

On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

Hi Steve,

I've tried my best to update cmake/FindPostgreSQL.cmake and
CMakeLists.txt, but the build was not successful. I've changed all the
POSTGRES variables to 9.4, cmake executed properly, but while
compiling(make) there is a error saying "Postgres.h" not found. Can you
share your CMakeLists.txt and cmake/FindPostgresql..cmake. I am on the
version 9.4.

I think this needs to be solved for the next release. We need to the
pass the postgresql version to build, like the option you said
"DUSE_PG=9.x". But unfortunately it is not working right now. I'll try
to read about cmake and see what I can do. I will update you.

Thank you,
Mani

On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge
<woodbri@swoodbridge.com <mailto:woodbri@swoodbridge.com>> wrote:

    On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

        Hi,

           I am facing an error while building from source. This is that
           issue: https://github.com/pgRouting/pgrouting/issues/109

            How to resolve that? Changing Pg version to 9.1 in
        CMakeLists.txt is
        not working. I have 9.1 and 9.4 postgresql versions installed in my
        system. Help me out in resolving this.

    Mani,

    Sorry, the CMakeLists.txt files built for pgrouting 2.x were not
    designed for support multiple versions installed on the same system.
    This is a problem for me because I have 9.2, 9.3, and 9.4 installed
    and I can only build and install on 9.4.

    The solution id to update the CMakeLists.txt and specifically
    cmake/FindPostgreSQL.cmake which so you can do something like

    cd build
    cmake -DUSE_PG=9.x ..

    I took a quick look at doing this a while back but
    cmake/FindPostgreSQL.cmake needs to be replaced and other changes
    are needed and I didn't have time to make the changes and get it
    working.

    tools/test-runner.pl <http://test-runner.pl> already support options
    for pg versions and ports so only the build system is broken in this
    regard.

    If you want to read up on CMake and get this working a pull request
    would be great!

    -Steve

    _______________________________________________
    pgrouting-dev mailing list
    pgrouting-dev@lists.osgeo.org <mailto:pgrouting-dev@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________
pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Steve, Mani:

I think its a feature request, not a bug.
I installed in a different partition the OS, and installed postgres 9.1
and I could install pgrouting on 9.1

So, it installs on 9.4, and 9.1 as long as they are not under the same OS.

While the feature of “supporting multiple postgres versions on the same OS” is not implemented, a work around could be to migrate your databases from 9.1, 9.2 and 9.3 to 9.4.

btw. issue 109 was closed by Steve and with a comment of will not fix.


Date: Mon, 22 Jun 2015 21:20:05 +0530
From: mani.iiit123@gmail.com
To: pgrouting-dev@lists.osgeo.org
Subject: Re: [pgrouting-dev] Reg: Compile error in KSP with PostgreSQL 8.4

Hi Steve,

I’ve tried my best to update cmake/FindPostgreSQL.cmake and CMakeLists.txt, but the build was not successful. I’ve changed all the POSTGRES variables to 9.4, cmake executed properly, but while compiling(make) there is a error saying “Postgres.h” not found. Can you share your CMakeLists.txt and cmake/FindPostgresql…cmake. I am on the version 9.4.

I think this needs to be solved for the next release. We need to the pass the postgresql version to build, like the option you said "DUSE_PG=9.x ". But unfortunately it is not working right now. I’ll try to read about cmake and see what I can do. I will update you.

Thank you,
Mani

On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

Hi,

I am facing an error while building from source. This is that
issue: https://github.com/pgRouting/pgrouting/issues/109

How to resolve that? Changing Pg version to 9.1 in CMakeLists.txt is
not working. I have 9.1 and 9.4 postgresql versions installed in my
system. Help me out in resolving this.

Mani,

Sorry, the CMakeLists.txt files built for pgrouting 2.x were not designed for support multiple versions installed on the same system. This is a problem for me because I have 9.2, 9.3, and 9.4 installed and I can only build and install on 9.4.

The solution id to update the CMakeLists.txt and specifically cmake/FindPostgreSQL.cmake which so you can do something like

cd build
cmake -DUSE_PG=9.x …

I took a quick look at doing this a while back but cmake/FindPostgreSQL.cmake needs to be replaced and other changes are needed and I didn’t have time to make the changes and get it working.

tools/test-runner.pl already support options for pg versions and ports so only the build system is broken in this regard.

If you want to read up on CMake and get this working a pull request would be great!

-Steve


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________ pgrouting-dev mailing list pgrouting-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Ther already is the ticket for this problem:

https://github.com/pgRouting/pgrouting/issues/301

While I'm willing to accept this is an enhancement request, it is a very high priority in my mind because MANY production sites have to support multiple versions of postgres and it is a standard supported feature of postgresql to be able to run a cluster of multiple versions.

Upgrading the database is not always an option, because some software packages require specific versions of the database and users are not always in a position to upgrade the software dependencies. It might be easy for a developer to do this because they are not running a production environment, but ultimately most users that are running a production environment, do not have this option because they go through an IT department or a service provider and have to rely on them for version support.

And more importantly, because it is all about me :), I can't develop and test in my environment against 9.2, 9.3, 9.4 that I have installed when we need to verify bugs from users, and test against versions locally.

So if Mani can get this working great, and if not I will eventually get to it for the next release, and if we have a fix for this, I'll roll it into develop so others that need it can get it.

-Steve

On 6/22/2015 12:25 PM, Vicky Vergara wrote:

Steve, Mani:

I think its a feature request, not a bug.
I installed in a different partition the OS, and installed postgres 9.1
and I could install pgrouting on 9.1

So, it installs on 9.4, and 9.1 as long as they are not under the same OS.

While the feature of "supporting multiple postgres versions on the same
OS" is not implemented, a work around could be to migrate your databases
from 9.1, 9.2 and 9.3 to 9.4.

btw. issue 109 was closed by Steve and with a comment of will not fix.

------------------------------------------------------------------------
Date: Mon, 22 Jun 2015 21:20:05 +0530
From: mani.iiit123@gmail.com
To: pgrouting-dev@lists.osgeo.org
Subject: Re: [pgrouting-dev] Reg: Compile error in KSP with PostgreSQL 8.4

Hi Steve,

I've tried my best to update cmake/FindPostgreSQL.cmake and
CMakeLists.txt, but the build was not successful. I've changed all the
POSTGRES variables to 9.4, cmake executed properly, but while
compiling(make) there is a error saying "Postgres.h" not found. Can you
share your CMakeLists.txt and cmake/FindPostgresql..cmake. I am on the
version 9.4.

I think this needs to be solved for the next release. We need to the
pass the postgresql version to build, like the option you said
"DUSE_PG=9.x". But unfortunately it is not working right now. I'll try
to read about cmake and see what I can do. I will update you.

Thank you,
Mani

On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge
<woodbri@swoodbridge.com <mailto:woodbri@swoodbridge.com>> wrote:

    On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

        Hi,

           I am facing an error while building from source. This is that
           issue: https://github.com/pgRouting/pgrouting/issues/109

            How to resolve that? Changing Pg version to 9.1 in
        CMakeLists.txt is
        not working. I have 9.1 and 9.4 postgresql versions installed in my
        system. Help me out in resolving this.

    Mani,

    Sorry, the CMakeLists.txt files built for pgrouting 2.x were not
    designed for support multiple versions installed on the same system.
    This is a problem for me because I have 9.2, 9.3, and 9.4 installed
    and I can only build and install on 9.4.

    The solution id to update the CMakeLists.txt and specifically
    cmake/FindPostgreSQL.cmake which so you can do something like

    cd build
    cmake -DUSE_PG=9.x ..

    I took a quick look at doing this a while back but
    cmake/FindPostgreSQL.cmake needs to be replaced and other changes
    are needed and I didn't have time to make the changes and get it
    working.

    tools/test-runner.pl <http://test-runner.pl> already support options
    for pg versions and ports so only the build system is broken in this
    regard.

    If you want to read up on CMake and get this working a pull request
    would be great!

    -Steve

    _______________________________________________
    pgrouting-dev mailing list
    pgrouting-dev@lists.osgeo.org <mailto:pgrouting-dev@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________ pgrouting-dev mailing
list pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________
pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Steve, Vicky:

I’m working on this already. Since this is my first time on cmake and dependencies I might need some help from you guys.

I’ll try my best to make it working.

-Mani

Mani wrote:

I'm working on this already. Since this is my first time on cmake and
dependencies I might need some help from you guys.

I'll try my best to make it working.

Start with the message below and ask where you get stuck. The steps are:

1. copy the FindPostgreSQL.cmake linked below to the pgrouting/cmake

2. this will break the build stuff because this new script sets different variables than the existing build expects.

3. sort this out and get it to build like it did before using the new script

4. when it is building like before, add the variable to set the version in the commandline and and use that to set PostgreSQL_ADDITIONAL_VERSIONS and it should work.

Ask specific questions if you get stuck, check in your code where I can look at it.

There is a ticket for this:
https://github.com/pgRouting/pgrouting/issues/301

-Steve

On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:

Mani,

You probably want to start with this version of FindPostgreSQL.cmake

https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

It lets you specify PostgreSQL_ADDITIONAL_VERSIONS variable and if
this is set to the version you want it will use this version if
found.

I think that the return variables that this script sets are different
from what we expect in pgrouting so you might need to set the
expected variables with the correct values also.

So, I would replace the existing FindPostgreSQL.cmake with this
script and then try to make it work with the existing build system,
then look at reading a command line version and setting the variable
above before calling find postgresql.

-Steve

On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

Hi Steve,

I've tried my best to update cmake/FindPostgreSQL.cmake and
CMakeLists.txt, but the build was not successful. I've changed all
the POSTGRES variables to 9.4, cmake executed properly, but while
compiling(make) there is a error saying "Postgres.h" not found. Can
you share your CMakeLists.txt and cmake/FindPostgresql..cmake. I am
on the version 9.4.

I think this needs to be solved for the next release. We need to
the pass the postgresql version to build, like the option you
said "DUSE_PG=9.x". But unfortunately it is not working right now.
I'll try to read about cmake and see what I can do. I will update
you.

Thank you, Mani

On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge
<woodbri@swoodbridge.com <mailto:woodbri@swoodbridge.com>> wrote:

On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

Hi,

I am facing an error while building from source. This is that
issue: https://github.com/pgRouting/pgrouting/issues/109

How to resolve that? Changing Pg version to 9.1 in CMakeLists.txt
is not working. I have 9.1 and 9.4 postgresql versions installed in
my system. Help me out in resolving this.

Mani,

Sorry, the CMakeLists.txt files built for pgrouting 2.x were not
designed for support multiple versions installed on the same
system. This is a problem for me because I have 9.2, 9.3, and 9.4
installed and I can only build and install on 9.4.

The solution id to update the CMakeLists.txt and specifically
cmake/FindPostgreSQL.cmake which so you can do something like

cd build cmake -DUSE_PG=9.x ..

I took a quick look at doing this a while back but
cmake/FindPostgreSQL.cmake needs to be replaced and other changes
are needed and I didn't have time to make the changes and get it
working.

tools/test-runner.pl <http://test-runner.pl> already support
options for pg versions and ports so only the build system is
broken in this regard.

If you want to read up on CMake and get this working a pull
request would be great!

-Steve

_______________________________________________ pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
<mailto:pgrouting-dev@lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________ pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________ pgrouting-dev mailing
list pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Steve,

Thanks for the steps. I am thinking in a different method. I just pushed a branch cmake-postgres. In File FindPostgreSQL.cmake on line no: 19, PG_VERSION is a argument passed while running cmake. ( cmake -DPG_VERSION=9.* ).

  • Take an argument from command line.
  • Modify the present FindPostgreSQL.cmake, build it until it is working properly.

I am stuck here at this point. See line no: 43 ( COMMAND ${POSTGRESQL_PG_CONFIG} --version) this is giving 8.4 as defaults. Therefore variables after this are set with 8.4, I need to somehow understand and change it.

If you are free now we can discuss this.

  • Mani
···

On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

Mani wrote:

I’m working on this already. Since this is my first time on cmake and
dependencies I might need some help from you guys.

I’ll try my best to make it working.

Start with the message below and ask where you get stuck. The steps are:

  1. copy the FindPostgreSQL.cmake linked below to the pgrouting/cmake

  2. this will break the build stuff because this new script sets different variables than the existing build expects.

  3. sort this out and get it to build like it did before using the new script

  4. when it is building like before, add the variable to set the version in the commandline and and use that to set PostgreSQL_ADDITIONAL_VERSIONS and it should work.

Ask specific questions if you get stuck, check in your code where I can look at it.

There is a ticket for this:
https://github.com/pgRouting/pgrouting/issues/301

-Steve

On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:

Mani,

You probably want to start with this version of FindPostgreSQL.cmake

https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

It lets you specify PostgreSQL_ADDITIONAL_VERSIONS variable and if
this is set to the version you want it will use this version if
found.

I think that the return variables that this script sets are different
from what we expect in pgrouting so you might need to set the
expected variables with the correct values also.

So, I would replace the existing FindPostgreSQL.cmake with this
script and then try to make it work with the existing build system,
then look at reading a command line version and setting the variable
above before calling find postgresql.

-Steve

On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

Hi Steve,

I’ve tried my best to update cmake/FindPostgreSQL.cmake and
CMakeLists.txt, but the build was not successful. I’ve changed all
the POSTGRES variables to 9.4, cmake executed properly, but while
compiling(make) there is a error saying “Postgres.h” not found. Can
you share your CMakeLists.txt and cmake/FindPostgresql…cmake. I am
on the version 9.4.

I think this needs to be solved for the next release. We need to
the pass the postgresql version to build, like the option you
said “DUSE_PG=9.x”. But unfortunately it is not working right now.
I’ll try to read about cmake and see what I can do. I will update
you.

Thank you, Mani

On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge
<woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)> wrote:

On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

Hi,

I am facing an error while building from source. This is that
issue: https://github.com/pgRouting/pgrouting/issues/109

How to resolve that? Changing Pg version to 9.1 in CMakeLists.txt
is not working. I have 9.1 and 9.4 postgresql versions installed in
my system. Help me out in resolving this.

Mani,

Sorry, the CMakeLists.txt files built for pgrouting 2.x were not
designed for support multiple versions installed on the same
system. This is a problem for me because I have 9.2, 9.3, and 9.4
installed and I can only build and install on 9.4.

The solution id to update the CMakeLists.txt and specifically
cmake/FindPostgreSQL.cmake which so you can do something like

cd build cmake -DUSE_PG=9.x …

I took a quick look at doing this a while back but
cmake/FindPostgreSQL.cmake needs to be replaced and other changes
are needed and I didn’t have time to make the changes and get it
working.

tools/test-runner.pl <http://test-runner.pl> already support
options for pg versions and ports so only the build system is
broken in this regard.

If you want to read up on CMake and get this working a pull
request would be great!

-Steve

_______________________________________________ pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________ pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________ pgrouting-dev mailing
list pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Try changing it to this:

# Checking POSTGRESQL_PG_CONFIG
     find_program(POSTGRESQL_PG_CONFIG NAMES pg_config
         PATHS
         /usr/lib/postgresql/${PG_VERSION}/bin/
         NO_DEFAULT_PATH
         )

also read this:

cmake --help-command FIND_PROGRAM

-Steve

On 6/22/2015 4:43 PM, Manikanta Kondeti wrote:

Steve,

Thanks for the steps. I am thinking in a different method. I just
pushed a branch cmake-postgres. In File FindPostgreSQL.cmake on line no:
19, PG_VERSION is a argument passed while running cmake. ( cmake
-DPG_VERSION=9.* ).

* Take an argument from command line.
* Modify the present FindPostgreSQL.cmake, build it until it is working
properly.

I am stuck here at this point. See line no: 43 (
COMMAND${POSTGRESQL_PG_CONFIG}--version) this is giving 8.4 as
defaults. Therefore variables after this are set with 8.4, I need to
somehow understand and change it.

If you are free now we can discuss this.
- Mani

On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge
<woodbri@swoodbridge.com <mailto:woodbri@swoodbridge.com>> wrote:

    Mani wrote:

        I'm working on this already. Since this is my first time on
        cmake and
        dependencies I might need some help from you guys.

        I'll try my best to make it working.

    Start with the message below and ask where you get stuck. The steps are:

    1. copy the FindPostgreSQL.cmake linked below to the pgrouting/cmake

    2. this will break the build stuff because this new script sets
    different variables than the existing build expects.

    3. sort this out and get it to build like it did before using the
    new script

    4. when it is building like before, add the variable to set the
    version in the commandline and and use that to set
    PostgreSQL_ADDITIONAL_VERSIONS and it should work.

    Ask specific questions if you get stuck, check in your code where I
    can look at it.

    There is a ticket for this:
    https://github.com/pgRouting/pgrouting/issues/301

    -Steve

    On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:

        Mani,

        You probably want to start with this version of FindPostgreSQL.cmake

        https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

          It lets you specify PostgreSQL_ADDITIONAL_VERSIONS variable
        and if
        this is set to the version you want it will use this version if
        found.

        I think that the return variables that this script sets are
        different
          from what we expect in pgrouting so you might need to set the
        expected variables with the correct values also.

        So, I would replace the existing FindPostgreSQL.cmake with this
        script and then try to make it work with the existing build system,
        then look at reading a command line version and setting the variable
        above before calling find postgresql.

        -Steve

        On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

            Hi Steve,

            I've tried my best to update cmake/FindPostgreSQL.cmake and
            CMakeLists.txt, but the build was not successful. I've
            changed all
            the POSTGRES variables to 9.4, cmake executed properly, but
            while
            compiling(make) there is a error saying "Postgres.h" not
            found. Can
            you share your CMakeLists.txt and
            cmake/FindPostgresql..cmake. I am
            on the version 9.4.

            I think this needs to be solved for the next release. We need to
            the pass the postgresql version to build, like the option you
            said "DUSE_PG=9.x". But unfortunately it is not working
            right now.
            I'll try to read about cmake and see what I can do. I will
            update
            you.

            Thank you, Mani

            On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge
            <woodbri@swoodbridge.com <mailto:woodbri@swoodbridge.com>
            <mailto:woodbri@swoodbridge.com
            <mailto:woodbri@swoodbridge.com>>> wrote:

            On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

            Hi,

            I am facing an error while building from source. This is that
            issue: https://github.com/pgRouting/pgrouting/issues/109

            How to resolve that? Changing Pg version to 9.1 in
            CMakeLists.txt
            is not working. I have 9.1 and 9.4 postgresql versions
            installed in
            my system. Help me out in resolving this.

            Mani,

            Sorry, the CMakeLists.txt files built for pgrouting 2.x were not
            designed for support multiple versions installed on the same
            system. This is a problem for me because I have 9.2, 9.3,
            and 9.4
            installed and I can only build and install on 9.4.

            The solution id to update the CMakeLists.txt and specifically
            cmake/FindPostgreSQL.cmake which so you can do something like

            cd build cmake -DUSE_PG=9.x ..

            I took a quick look at doing this a while back but
            cmake/FindPostgreSQL.cmake needs to be replaced and other
            changes
            are needed and I didn't have time to make the changes and get it
            working.

            tools/test-runner.pl <http://test-runner.pl>
            <http://test-runner.pl> already support
            options for pg versions and ports so only the build system is
            broken in this regard.

            If you want to read up on CMake and get this working a pull
            request would be great!

            -Steve

            _______________________________________________ pgrouting-dev
            mailing list pgrouting-dev@lists.osgeo.org
            <mailto:pgrouting-dev@lists.osgeo.org>
            <mailto:pgrouting-dev@lists.osgeo.org
            <mailto:pgrouting-dev@lists.osgeo.org>>
            http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

            _______________________________________________ pgrouting-dev
            mailing list pgrouting-dev@lists.osgeo.org
            <mailto:pgrouting-dev@lists.osgeo.org>
            http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

        _______________________________________________ pgrouting-dev
        mailing
        list pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

    _______________________________________________
    pgrouting-dev mailing list
    pgrouting-dev@lists.osgeo.org <mailto:pgrouting-dev@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________
pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Steve,

That’s giving me an error. I understood the workflow, Here is the main thing that I’ve to look at :[line 36] POSTGRESQL_PG_CONFIG = “/usr/bin/pg_config” and that is of version 8.4.22. From this the variable POSTGRESQL_VERSION_STRING is set which makes all the variables in CMakeLists.txt to 8.4. This makes the whole POSTGRESQL variables in CMakeLists.txt to 8.4. We can see that from cmake log.

So if we can control this line 36 to the PG_VERSION we specify, then everything works fine. I will let you know if I got something interesting. I’d be highly thankful if you suggest something at this point.

  • Mani
···

On Tue, Jun 23, 2015 at 3:16 AM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

Try changing it to this:

Checking POSTGRESQL_PG_CONFIG

find_program(POSTGRESQL_PG_CONFIG NAMES pg_config
PATHS
/usr/lib/postgresql/${PG_VERSION}/bin/
NO_DEFAULT_PATH
)

also read this:

cmake --help-command FIND_PROGRAM

-Steve

On 6/22/2015 4:43 PM, Manikanta Kondeti wrote:

Steve,

Thanks for the steps. I am thinking in a different method. I just
pushed a branch cmake-postgres. In File FindPostgreSQL.cmake on line no:
19, PG_VERSION is a argument passed while running cmake. ( cmake
-DPG_VERSION=9.* ).

  • Take an argument from command line.
  • Modify the present FindPostgreSQL.cmake, build it until it is working
    properly.

I am stuck here at this point. See line no: 43 (
COMMAND${POSTGRESQL_PG_CONFIG}–version) this is giving 8.4 as
defaults. Therefore variables after this are set with 8.4, I need to
somehow understand and change it.

If you are free now we can discuss this.

  • Mani

On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge

<woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)> wrote:

Mani wrote:

I’m working on this already. Since this is my first time on
cmake and
dependencies I might need some help from you guys.

I’ll try my best to make it working.

Start with the message below and ask where you get stuck. The steps are:

  1. copy the FindPostgreSQL.cmake linked below to the pgrouting/cmake

  2. this will break the build stuff because this new script sets
    different variables than the existing build expects.

  3. sort this out and get it to build like it did before using the
    new script

  4. when it is building like before, add the variable to set the
    version in the commandline and and use that to set
    PostgreSQL_ADDITIONAL_VERSIONS and it should work.

Ask specific questions if you get stuck, check in your code where I
can look at it.

There is a ticket for this:
https://github.com/pgRouting/pgrouting/issues/301

-Steve

On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:

Mani,

You probably want to start with this version of FindPostgreSQL.cmake

https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

It lets you specify PostgreSQL_ADDITIONAL_VERSIONS variable
and if
this is set to the version you want it will use this version if
found.

I think that the return variables that this script sets are
different
from what we expect in pgrouting so you might need to set the
expected variables with the correct values also.

So, I would replace the existing FindPostgreSQL.cmake with this
script and then try to make it work with the existing build system,
then look at reading a command line version and setting the variable
above before calling find postgresql.

-Steve

On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

Hi Steve,

I’ve tried my best to update cmake/FindPostgreSQL.cmake and
CMakeLists.txt, but the build was not successful. I’ve
changed all
the POSTGRES variables to 9.4, cmake executed properly, but
while
compiling(make) there is a error saying “Postgres.h” not
found. Can
you share your CMakeLists.txt and
cmake/FindPostgresql…cmake. I am
on the version 9.4.

I think this needs to be solved for the next release. We need to
the pass the postgresql version to build, like the option you
said “DUSE_PG=9.x”. But unfortunately it is not working
right now.
I’ll try to read about cmake and see what I can do. I will
update
you.

Thank you, Mani

On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge
<woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)

<mailto:woodbri@swoodbridge.com

mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>> wrote:

On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

Hi,

I am facing an error while building from source. This is that
issue: https://github.com/pgRouting/pgrouting/issues/109

How to resolve that? Changing Pg version to 9.1 in
CMakeLists.txt
is not working. I have 9.1 and 9.4 postgresql versions
installed in
my system. Help me out in resolving this.

Mani,

Sorry, the CMakeLists.txt files built for pgrouting 2.x were not
designed for support multiple versions installed on the same
system. This is a problem for me because I have 9.2, 9.3,
and 9.4
installed and I can only build and install on 9.4.

The solution id to update the CMakeLists.txt and specifically
cmake/FindPostgreSQL.cmake which so you can do something like

cd build cmake -DUSE_PG=9.x …

I took a quick look at doing this a while back but
cmake/FindPostgreSQL.cmake needs to be replaced and other
changes
are needed and I didn’t have time to make the changes and get it
working.

tools/test-runner.pl <http://test-runner.pl>
<http://test-runner.pl> already support
options for pg versions and ports so only the build system is
broken in this regard.

If you want to read up on CMake and get this working a pull
request would be great!

-Steve

_______________________________________________ pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)

<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________ pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________ pgrouting-dev
mailing
list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

On 6/22/2015 6:14 PM, Manikanta Kondeti wrote:

Steve,

That's giving me an error. I understood the workflow, Here is the main
thing that I've to look at :[line 36] POSTGRESQL_PG_CONFIG =
"/usr/bin/pg_config" and that is of version 8.4.22. From this the

The point is that cmake is search the PATh variable and which is why it is finding /usr/bin/pg_config instead of /usr/lib/postgresql/9.1/bin/pg_config

The point of NO_DEFAULT_PATH argument is to prevent it from search the default paths and to only look at the ones you are specifying.

variable POSTGRESQL_VERSION_STRING is set which makes all the variables
in CMakeLists.txt to 8.4. This makes the whole POSTGRESQL variables in
CMakeLists.txt to 8.4. We can see that from cmake log.

So if we can control this line 36 to the PG_VERSION we specify, then
everything works fine. I will let you know if I got something
interesting. I'd be highly thankful if you suggest something at this point.

The code below works on my system. I'm using cmake version 2.8.12.2

cmake --version

I don't know when that variable was added, you probably have an older version. ALSO, rm -rf build/* so you clean out the cmake cache. It didn't work until I cleared it.

-Steve

- Mani

On Tue, Jun 23, 2015 at 3:16 AM, Stephen Woodbridge
<woodbri@swoodbridge.com <mailto:woodbri@swoodbridge.com>> wrote:

    Try changing it to this:

    # Checking POSTGRESQL_PG_CONFIG
         find_program(POSTGRESQL_PG_CONFIG NAMES pg_config
             PATHS
             /usr/lib/postgresql/${PG_VERSION}/bin/
             NO_DEFAULT_PATH
             )

    also read this:

    cmake --help-command FIND_PROGRAM

    -Steve

    On 6/22/2015 4:43 PM, Manikanta Kondeti wrote:

        Steve,

        Thanks for the steps. I am thinking in a different method. I just
        pushed a branch cmake-postgres. In File FindPostgreSQL.cmake on
        line no:
        19, PG_VERSION is a argument passed while running cmake. ( cmake
        -DPG_VERSION=9.* ).

        * Take an argument from command line.
        * Modify the present FindPostgreSQL.cmake, build it until it is
        working
        properly.

        I am stuck here at this point. See line no: 43 (
        COMMAND${POSTGRESQL_PG_CONFIG}--version) this is giving 8.4 as
        defaults. Therefore variables after this are set with 8.4, I need to
        somehow understand and change it.

        If you are free now we can discuss this.
        - Mani

        On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge
        <woodbri@swoodbridge.com <mailto:woodbri@swoodbridge.com>
        <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>> wrote:

             Mani wrote:

                 I'm working on this already. Since this is my first time on
                 cmake and
                 dependencies I might need some help from you guys.

                 I'll try my best to make it working.

             Start with the message below and ask where you get stuck.
        The steps are:

             1. copy the FindPostgreSQL.cmake linked below to the
        pgrouting/cmake

             2. this will break the build stuff because this new script sets
             different variables than the existing build expects.

             3. sort this out and get it to build like it did before
        using the
             new script

             4. when it is building like before, add the variable to set the
             version in the commandline and and use that to set
             PostgreSQL_ADDITIONAL_VERSIONS and it should work.

             Ask specific questions if you get stuck, check in your code
        where I
             can look at it.

             There is a ticket for this:
        https://github.com/pgRouting/pgrouting/issues/301

             -Steve

             On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:

                 Mani,

                 You probably want to start with this version of
        FindPostgreSQL.cmake

        https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

                   It lets you specify PostgreSQL_ADDITIONAL_VERSIONS
        variable
                 and if
                 this is set to the version you want it will use this
        version if
                 found.

                 I think that the return variables that this script sets are
                 different
                   from what we expect in pgrouting so you might need to
        set the
                 expected variables with the correct values also.

                 So, I would replace the existing FindPostgreSQL.cmake
        with this
                 script and then try to make it work with the existing
        build system,
                 then look at reading a command line version and setting
        the variable
                 above before calling find postgresql.

                 -Steve

                 On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

                     Hi Steve,

                     I've tried my best to update
        cmake/FindPostgreSQL.cmake and
                     CMakeLists.txt, but the build was not successful. I've
                     changed all
                     the POSTGRES variables to 9.4, cmake executed
        properly, but
                     while
                     compiling(make) there is a error saying
        "Postgres.h" not
                     found. Can
                     you share your CMakeLists.txt and
                     cmake/FindPostgresql..cmake. I am
                     on the version 9.4.

                     I think this needs to be solved for the next
        release. We need to
                     the pass the postgresql version to build, like the
        option you
                     said "DUSE_PG=9.x". But unfortunately it is not working
                     right now.
                     I'll try to read about cmake and see what I can do.
        I will
                     update
                     you.

                     Thank you, Mani

                     On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge
                     <woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com> <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>
                     <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>

                     <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>>> wrote:

                     On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

                     Hi,

                     I am facing an error while building from source.
        This is that
                     issue:
        https://github.com/pgRouting/pgrouting/issues/109

                     How to resolve that? Changing Pg version to 9.1 in
                     CMakeLists.txt
                     is not working. I have 9.1 and 9.4 postgresql versions
                     installed in
                     my system. Help me out in resolving this.

                     Mani,

                     Sorry, the CMakeLists.txt files built for pgrouting
        2.x were not
                     designed for support multiple versions installed on
        the same
                     system. This is a problem for me because I have
        9.2, 9.3,
                     and 9.4
                     installed and I can only build and install on 9.4.

                     The solution id to update the CMakeLists.txt and
        specifically
                     cmake/FindPostgreSQL.cmake which so you can do
        something like

                     cd build cmake -DUSE_PG=9.x ..

                     I took a quick look at doing this a while back but
                     cmake/FindPostgreSQL.cmake needs to be replaced and
        other
                     changes
                     are needed and I didn't have time to make the
        changes and get it
                     working.

                     tools/test-runner.pl <http://test-runner.pl>
        <http://test-runner.pl>
                     <http://test-runner.pl> already support
                     options for pg versions and ports so only the build
        system is
                     broken in this regard.

                     If you want to read up on CMake and get this
        working a pull
                     request would be great!

                     -Steve

                     _______________________________________________
        pgrouting-dev
                     mailing list pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                     <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
                     <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                     <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

                     _______________________________________________
        pgrouting-dev
                     mailing list pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                     <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

                 _______________________________________________
        pgrouting-dev
                 mailing
                 list pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

             _______________________________________________
             pgrouting-dev mailing list
        pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
        <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

        _______________________________________________
        pgrouting-dev mailing list
        pgrouting-dev@lists.osgeo.org <mailto:pgrouting-dev@lists.osgeo.org>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

    _______________________________________________
    pgrouting-dev mailing list
    pgrouting-dev@lists.osgeo.org <mailto:pgrouting-dev@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________
pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

I am on version 3.3.0-rc2. I’ve installed the latest verion yesterday.

Adding that NO_DEFAULT_PATH sets NULL to POSTGRESQL_PG_CONFIG and gives an error. I’ve added the screenshot.

Why is it working on your system and not working on mine if its the same code…? It should find that config path. So it may be NO_DEFAULT_PATH not present in the latest version, will check that out.

  • Mani
···

On Tue, Jun 23, 2015 at 4:37 AM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

On 6/22/2015 6:14 PM, Manikanta Kondeti wrote:

Steve,

That’s giving me an error. I understood the workflow, Here is the main
thing that I’ve to look at :[line 36] POSTGRESQL_PG_CONFIG =
“/usr/bin/pg_config” and that is of version 8.4.22. From this the

The point is that cmake is search the PATh variable and which is why it is finding /usr/bin/pg_config instead of /usr/lib/postgresql/9.1/bin/pg_config

The point of NO_DEFAULT_PATH argument is to prevent it from search the default paths and to only look at the ones you are specifying.

variable POSTGRESQL_VERSION_STRING is set which makes all the variables
in CMakeLists.txt to 8.4. This makes the whole POSTGRESQL variables in
CMakeLists.txt to 8.4. We can see that from cmake log.

So if we can control this line 36 to the PG_VERSION we specify, then
everything works fine. I will let you know if I got something
interesting. I’d be highly thankful if you suggest something at this point.

The code below works on my system. I’m using cmake version 2.8.12.2

cmake --version

I don’t know when that variable was added, you probably have an older version. ALSO, rm -rf build/* so you clean out the cmake cache. It didn’t work until I cleared it.

-Steve

  • Mani

On Tue, Jun 23, 2015 at 3:16 AM, Stephen Woodbridge

<woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)> wrote:

Try changing it to this:

Checking POSTGRESQL_PG_CONFIG

find_program(POSTGRESQL_PG_CONFIG NAMES pg_config
PATHS
/usr/lib/postgresql/${PG_VERSION}/bin/
NO_DEFAULT_PATH
)

also read this:

cmake --help-command FIND_PROGRAM

-Steve

On 6/22/2015 4:43 PM, Manikanta Kondeti wrote:

Steve,

Thanks for the steps. I am thinking in a different method. I just
pushed a branch cmake-postgres. In File FindPostgreSQL.cmake on
line no:
19, PG_VERSION is a argument passed while running cmake. ( cmake
-DPG_VERSION=9.* ).

  • Take an argument from command line.
  • Modify the present FindPostgreSQL.cmake, build it until it is
    working
    properly.

I am stuck here at this point. See line no: 43 (
COMMAND${POSTGRESQL_PG_CONFIG}–version) this is giving 8.4 as
defaults. Therefore variables after this are set with 8.4, I need to
somehow understand and change it.

If you are free now we can discuss this.

  • Mani

On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge
<woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)

<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>> wrote:

Mani wrote:

I’m working on this already. Since this is my first time on
cmake and
dependencies I might need some help from you guys.

I’ll try my best to make it working.

Start with the message below and ask where you get stuck.
The steps are:

  1. copy the FindPostgreSQL.cmake linked below to the
    pgrouting/cmake

  2. this will break the build stuff because this new script sets
    different variables than the existing build expects.

  3. sort this out and get it to build like it did before
    using the
    new script

  4. when it is building like before, add the variable to set the
    version in the commandline and and use that to set
    PostgreSQL_ADDITIONAL_VERSIONS and it should work.

Ask specific questions if you get stuck, check in your code
where I
can look at it.

There is a ticket for this:
https://github.com/pgRouting/pgrouting/issues/301

-Steve

On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:

Mani,

You probably want to start with this version of
FindPostgreSQL.cmake

https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

It lets you specify PostgreSQL_ADDITIONAL_VERSIONS
variable
and if
this is set to the version you want it will use this
version if
found.

I think that the return variables that this script sets are
different
from what we expect in pgrouting so you might need to
set the
expected variables with the correct values also.

So, I would replace the existing FindPostgreSQL.cmake
with this
script and then try to make it work with the existing
build system,
then look at reading a command line version and setting
the variable
above before calling find postgresql.

-Steve

On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

Hi Steve,

I’ve tried my best to update
cmake/FindPostgreSQL.cmake and
CMakeLists.txt, but the build was not successful. I’ve
changed all
the POSTGRES variables to 9.4, cmake executed
properly, but
while
compiling(make) there is a error saying
“Postgres.h” not
found. Can
you share your CMakeLists.txt and
cmake/FindPostgresql…cmake. I am
on the version 9.4.

I think this needs to be solved for the next
release. We need to
the pass the postgresql version to build, like the
option you
said “DUSE_PG=9.x”. But unfortunately it is not working
right now.
I’ll try to read about cmake and see what I can do.
I will
update
you.

Thank you, Mani

On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge
<woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com) <mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>
<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)

<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>>> wrote:

On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

Hi,

I am facing an error while building from source.
This is that
issue:
https://github.com/pgRouting/pgrouting/issues/109

How to resolve that? Changing Pg version to 9.1 in
CMakeLists.txt
is not working. I have 9.1 and 9.4 postgresql versions
installed in
my system. Help me out in resolving this.

Mani,

Sorry, the CMakeLists.txt files built for pgrouting
2.x were not
designed for support multiple versions installed on
the same
system. This is a problem for me because I have
9.2, 9.3,
and 9.4
installed and I can only build and install on 9.4.

The solution id to update the CMakeLists.txt and
specifically
cmake/FindPostgreSQL.cmake which so you can do
something like

cd build cmake -DUSE_PG=9.x …

I took a quick look at doing this a while back but
cmake/FindPostgreSQL.cmake needs to be replaced and
other
changes
are needed and I didn’t have time to make the
changes and get it
working.

tools/test-runner.pl <http://test-runner.pl>
<http://test-runner.pl>
<http://test-runner.pl> already support
options for pg versions and ports so only the build
system is
broken in this regard.

If you want to read up on CMake and get this
working a pull
request would be great!

-Steve


pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev
mailing
list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org

http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

I forgot to add the screenshot in the last mail.

Screen Shot 2015-06-23 at 4.55.38 AM.png

···

On Tue, Jun 23, 2015 at 5:00 AM, Manikanta Kondeti <mani.iiit123@gmail.com> wrote:

I am on version 3.3.0-rc2. I’ve installed the latest verion yesterday.

Adding that NO_DEFAULT_PATH sets NULL to POSTGRESQL_PG_CONFIG and gives an error. I’ve added the screenshot.

Why is it working on your system and not working on mine if its the same code…? It should find that config path. So it may be NO_DEFAULT_PATH not present in the latest version, will check that out.

  • Mani

On Tue, Jun 23, 2015 at 4:37 AM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

On 6/22/2015 6:14 PM, Manikanta Kondeti wrote:

Steve,

That’s giving me an error. I understood the workflow, Here is the main
thing that I’ve to look at :[line 36] POSTGRESQL_PG_CONFIG =
“/usr/bin/pg_config” and that is of version 8.4.22. From this the

The point is that cmake is search the PATh variable and which is why it is finding /usr/bin/pg_config instead of /usr/lib/postgresql/9.1/bin/pg_config

The point of NO_DEFAULT_PATH argument is to prevent it from search the default paths and to only look at the ones you are specifying.

variable POSTGRESQL_VERSION_STRING is set which makes all the variables
in CMakeLists.txt to 8.4. This makes the whole POSTGRESQL variables in
CMakeLists.txt to 8.4. We can see that from cmake log.

So if we can control this line 36 to the PG_VERSION we specify, then
everything works fine. I will let you know if I got something
interesting. I’d be highly thankful if you suggest something at this point.

The code below works on my system. I’m using cmake version 2.8.12.2

cmake --version

I don’t know when that variable was added, you probably have an older version. ALSO, rm -rf build/* so you clean out the cmake cache. It didn’t work until I cleared it.

-Steve

  • Mani

On Tue, Jun 23, 2015 at 3:16 AM, Stephen Woodbridge

<woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)> wrote:

Try changing it to this:

Checking POSTGRESQL_PG_CONFIG

find_program(POSTGRESQL_PG_CONFIG NAMES pg_config
PATHS
/usr/lib/postgresql/${PG_VERSION}/bin/
NO_DEFAULT_PATH
)

also read this:

cmake --help-command FIND_PROGRAM

-Steve

On 6/22/2015 4:43 PM, Manikanta Kondeti wrote:

Steve,

Thanks for the steps. I am thinking in a different method. I just
pushed a branch cmake-postgres. In File FindPostgreSQL.cmake on
line no:
19, PG_VERSION is a argument passed while running cmake. ( cmake
-DPG_VERSION=9.* ).

  • Take an argument from command line.
  • Modify the present FindPostgreSQL.cmake, build it until it is
    working
    properly.

I am stuck here at this point. See line no: 43 (
COMMAND${POSTGRESQL_PG_CONFIG}–version) this is giving 8.4 as
defaults. Therefore variables after this are set with 8.4, I need to
somehow understand and change it.

If you are free now we can discuss this.

  • Mani

On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge
<woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)

<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>> wrote:

Mani wrote:

I’m working on this already. Since this is my first time on
cmake and
dependencies I might need some help from you guys.

I’ll try my best to make it working.

Start with the message below and ask where you get stuck.
The steps are:

  1. copy the FindPostgreSQL.cmake linked below to the
    pgrouting/cmake

  2. this will break the build stuff because this new script sets
    different variables than the existing build expects.

  3. sort this out and get it to build like it did before
    using the
    new script

  4. when it is building like before, add the variable to set the
    version in the commandline and and use that to set
    PostgreSQL_ADDITIONAL_VERSIONS and it should work.

Ask specific questions if you get stuck, check in your code
where I
can look at it.

There is a ticket for this:
https://github.com/pgRouting/pgrouting/issues/301

-Steve

On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:

Mani,

You probably want to start with this version of
FindPostgreSQL.cmake

https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

It lets you specify PostgreSQL_ADDITIONAL_VERSIONS
variable
and if
this is set to the version you want it will use this
version if
found.

I think that the return variables that this script sets are
different
from what we expect in pgrouting so you might need to
set the
expected variables with the correct values also.

So, I would replace the existing FindPostgreSQL.cmake
with this
script and then try to make it work with the existing
build system,
then look at reading a command line version and setting
the variable
above before calling find postgresql.

-Steve

On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

Hi Steve,

I’ve tried my best to update
cmake/FindPostgreSQL.cmake and
CMakeLists.txt, but the build was not successful. I’ve
changed all
the POSTGRES variables to 9.4, cmake executed
properly, but
while
compiling(make) there is a error saying
“Postgres.h” not
found. Can
you share your CMakeLists.txt and
cmake/FindPostgresql…cmake. I am
on the version 9.4.

I think this needs to be solved for the next
release. We need to
the pass the postgresql version to build, like the
option you
said “DUSE_PG=9.x”. But unfortunately it is not working
right now.
I’ll try to read about cmake and see what I can do.
I will
update
you.

Thank you, Mani

On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge
<woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com) <mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>
<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)

<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>>> wrote:

On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:

Hi,

I am facing an error while building from source.
This is that
issue:
https://github.com/pgRouting/pgrouting/issues/109

How to resolve that? Changing Pg version to 9.1 in
CMakeLists.txt
is not working. I have 9.1 and 9.4 postgresql versions
installed in
my system. Help me out in resolving this.

Mani,

Sorry, the CMakeLists.txt files built for pgrouting
2.x were not
designed for support multiple versions installed on
the same
system. This is a problem for me because I have
9.2, 9.3,
and 9.4
installed and I can only build and install on 9.4.

The solution id to update the CMakeLists.txt and
specifically
cmake/FindPostgreSQL.cmake which so you can do
something like

cd build cmake -DUSE_PG=9.x …

I took a quick look at doing this a while back but
cmake/FindPostgreSQL.cmake needs to be replaced and
other
changes
are needed and I didn’t have time to make the
changes and get it
working.

tools/test-runner.pl <http://test-runner.pl>
<http://test-runner.pl>
<http://test-runner.pl> already support
options for pg versions and ports so only the build
system is
broken in this regard.

If you want to read up on CMake and get this
working a pull
request would be great!

-Steve


pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev
mailing
list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org

http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Mani,

do you have the file: /usr/lib/postgresql/9.1/bin/pg_config on you system? If not then you probably need to install the postgresql-server-dev-9.1 package.

did you read "cmake --help find_program" and try other variables?
since we built and only tested on cmake 2.8 you are pretty much on your own as I don't have cmake 3.3 installed and probably will not install it unless we need to change the dependencies for some reason because it is not available on Ubuntu 14.04 LTS

-Steve

On 6/22/2015 7:30 PM, Manikanta Kondeti wrote:

  I am on version 3.3.0-rc2. I've installed the latest verion yesterday.

Adding that NO_DEFAULT_PATH sets NULL to POSTGRESQL_PG_CONFIG and gives
an error. I've added the screenshot.

Why is it working on your system and not working on mine if its the same
code..? It should find that config path. So it may be NO_DEFAULT_PATH
not present in the latest version, will check that out.

- Mani

On Tue, Jun 23, 2015 at 4:37 AM, Stephen Woodbridge
<woodbri@swoodbridge.com <mailto:woodbri@swoodbridge.com>> wrote:

    On 6/22/2015 6:14 PM, Manikanta Kondeti wrote:

        Steve,

        That's giving me an error. I understood the workflow, Here is
        the main
        thing that I've to look at :[line 36] POSTGRESQL_PG_CONFIG =
        "/usr/bin/pg_config" and that is of version 8.4.22. From this the

    The point is that cmake is search the PATh variable and which is why
    it is finding /usr/bin/pg_config instead of
    /usr/lib/postgresql/9.1/bin/pg_config

    The point of NO_DEFAULT_PATH argument is to prevent it from search
    the default paths and to only look at the ones you are specifying.

        variable POSTGRESQL_VERSION_STRING is set which makes all the
        variables
        in CMakeLists.txt to 8.4. This makes the whole POSTGRESQL
        variables in
        CMakeLists.txt to 8.4. We can see that from cmake log.

        So if we can control this line 36 to the PG_VERSION we specify, then
        everything works fine. I will let you know if I got something
        interesting. I'd be highly thankful if you suggest something at
        this point.

    The code below works on my system. I'm using cmake version 2.8.12.2

    cmake --version

    I don't know when that variable was added, you probably have an
    older version. ALSO, rm -rf build/* so you clean out the cmake
    cache. It didn't work until I cleared it.

    -Steve

        - Mani

        On Tue, Jun 23, 2015 at 3:16 AM, Stephen Woodbridge
        <woodbri@swoodbridge.com <mailto:woodbri@swoodbridge.com>
        <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>> wrote:

             Try changing it to this:

             # Checking POSTGRESQL_PG_CONFIG
                  find_program(POSTGRESQL_PG_CONFIG NAMES pg_config
                      PATHS
                      /usr/lib/postgresql/${PG_VERSION}/bin/
                      NO_DEFAULT_PATH
                      )

             also read this:

             cmake --help-command FIND_PROGRAM

             -Steve

             On 6/22/2015 4:43 PM, Manikanta Kondeti wrote:

                 Steve,

                 Thanks for the steps. I am thinking in a different
        method. I just
                 pushed a branch cmake-postgres. In File
        FindPostgreSQL.cmake on
                 line no:
                 19, PG_VERSION is a argument passed while running
        cmake. ( cmake
                 -DPG_VERSION=9.* ).

                 * Take an argument from command line.
                 * Modify the present FindPostgreSQL.cmake, build it
        until it is
                 working
                 properly.

                 I am stuck here at this point. See line no: 43 (
                 COMMAND${POSTGRESQL_PG_CONFIG}--version) this is
        giving 8.4 as
                 defaults. Therefore variables after this are set with
        8.4, I need to
                 somehow understand and change it.

                 If you are free now we can discuss this.
                 - Mani

                 On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge
                 <woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com> <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>
                 <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>
                 <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>>> wrote:

                      Mani wrote:

                          I'm working on this already. Since this is my
        first time on
                          cmake and
                          dependencies I might need some help from you guys.

                          I'll try my best to make it working.

                      Start with the message below and ask where you get
        stuck.
                 The steps are:

                      1. copy the FindPostgreSQL.cmake linked below to the
                 pgrouting/cmake

                      2. this will break the build stuff because this
        new script sets
                      different variables than the existing build expects.

                      3. sort this out and get it to build like it did
        before
                 using the
                      new script

                      4. when it is building like before, add the
        variable to set the
                      version in the commandline and and use that to set
                      PostgreSQL_ADDITIONAL_VERSIONS and it should work.

                      Ask specific questions if you get stuck, check in
        your code
                 where I
                      can look at it.

                      There is a ticket for this:
        https://github.com/pgRouting/pgrouting/issues/301

                      -Steve

                      On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:

                          Mani,

                          You probably want to start with this version of
                 FindPostgreSQL.cmake

        https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

                            It lets you specify
        PostgreSQL_ADDITIONAL_VERSIONS
                 variable
                          and if
                          this is set to the version you want it will
        use this
                 version if
                          found.

                          I think that the return variables that this
        script sets are
                          different
                            from what we expect in pgrouting so you
        might need to
                 set the
                          expected variables with the correct values also.

                          So, I would replace the existing
        FindPostgreSQL.cmake
                 with this
                          script and then try to make it work with the
        existing
                 build system,
                          then look at reading a command line version
        and setting
                 the variable
                          above before calling find postgresql.

                          -Steve

                          On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

                              Hi Steve,

                              I've tried my best to update
                 cmake/FindPostgreSQL.cmake and
                              CMakeLists.txt, but the build was not
        successful. I've
                              changed all
                              the POSTGRES variables to 9.4, cmake executed
                 properly, but
                              while
                              compiling(make) there is a error saying
                 "Postgres.h" not
                              found. Can
                              you share your CMakeLists.txt and
                              cmake/FindPostgresql..cmake. I am
                              on the version 9.4.

                              I think this needs to be solved for the next
                 release. We need to
                              the pass the postgresql version to build,
        like the
                 option you
                              said "DUSE_PG=9.x". But unfortunately it
        is not working
                              right now.
                              I'll try to read about cmake and see what
        I can do.
                 I will
                              update
                              you.

                              Thank you, Mani

                              On Mon, Jun 22, 2015 at 8:20 PM, Stephen
        Woodbridge
                              <woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>
                 <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>
        <mailto:woodbri@swoodbridge.com
                 <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>>
                              <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>
                 <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>

                              <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>
                 <mailto:woodbri@swoodbridge.com
        <mailto:woodbri@swoodbridge.com>>>>> wrote:

                              On 6/22/2015 10:37 AM, Manikanta Kondeti
        wrote:

                              Hi,

                              I am facing an error while building from
        source.
                 This is that
                              issue:
        https://github.com/pgRouting/pgrouting/issues/109

                              How to resolve that? Changing Pg version
        to 9.1 in
                              CMakeLists.txt
                              is not working. I have 9.1 and 9.4
        postgresql versions
                              installed in
                              my system. Help me out in resolving this.

                              Mani,

                              Sorry, the CMakeLists.txt files built for
        pgrouting
                 2.x were not
                              designed for support multiple versions
        installed on
                 the same
                              system. This is a problem for me because I
        have
                 9.2, 9.3,
                              and 9.4
                              installed and I can only build and install
        on 9.4.

                              The solution id to update the
        CMakeLists.txt and
                 specifically
                              cmake/FindPostgreSQL.cmake which so you can do
                 something like

                              cd build cmake -DUSE_PG=9.x ..

                              I took a quick look at doing this a while
        back but
                              cmake/FindPostgreSQL.cmake needs to be
        replaced and
                 other
                              changes
                              are needed and I didn't have time to make the
                 changes and get it
                              working.

                              tools/test-runner.pl
        <http://test-runner.pl> <http://test-runner.pl>
                 <http://test-runner.pl>
                              <http://test-runner.pl> already support
                              options for pg versions and ports so only
        the build
                 system is
                              broken in this regard.

                              If you want to read up on CMake and get this
                 working a pull
                              request would be great!

                              -Steve

          _______________________________________________
                 pgrouting-dev
                              mailing list pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
                              <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>>
                              <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
                              <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

          _______________________________________________
                 pgrouting-dev
                              mailing list pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
                              <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

                          _______________________________________________
                 pgrouting-dev
                          mailing
                          list pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
                          <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

                      _______________________________________________
                      pgrouting-dev mailing list
        pgrouting-dev@lists.osgeo.org <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
                 <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

                 _______________________________________________
                 pgrouting-dev mailing list
        pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
        <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

             _______________________________________________
             pgrouting-dev mailing list
        pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>
        <mailto:pgrouting-dev@lists.osgeo.org
        <mailto:pgrouting-dev@lists.osgeo.org>>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

        _______________________________________________
        pgrouting-dev mailing list
        pgrouting-dev@lists.osgeo.org <mailto:pgrouting-dev@lists.osgeo.org>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

    _______________________________________________
    pgrouting-dev mailing list
    pgrouting-dev@lists.osgeo.org <mailto:pgrouting-dev@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

_______________________________________________
pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev

Steve,

Thanks for pointing that out. I haven’t installed postgresql-server-dev-9.* (bummer). Anyway I pushed the latest code and build is successful. Here is the command to specify a version.

  • cmake -DPG_VERSION=“9.4” -Wno-dev …
    PG_VERSION=[“8.4”,"9.* "], Wno-dev=Ignore warnings.

I think this solves the issue 301? We can specify this details near the issue. I will start reading about “cmake --help find_program”, I totally understand what we did. But is it a simple hack or working solution?

  • Mani
···

On Tue, Jun 23, 2015 at 8:13 AM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

Mani,

do you have the file: /usr/lib/postgresql/9.1/bin/pg_config on you system? If not then you probably need to install the postgresql-server-dev-9.1 package.

did you read “cmake --help find_program” and try other variables?
since we built and only tested on cmake 2.8 you are pretty much on your own as I don’t have cmake 3.3 installed and probably will not install it unless we need to change the dependencies for some reason because it is not available on Ubuntu 14.04 LTS

-Steve

On 6/22/2015 7:30 PM, Manikanta Kondeti wrote:

I am on version 3.3.0-rc2. I’ve installed the latest verion yesterday.

Adding that NO_DEFAULT_PATH sets NULL to POSTGRESQL_PG_CONFIG and gives
an error. I’ve added the screenshot.

Why is it working on your system and not working on mine if its the same
code…? It should find that config path. So it may be NO_DEFAULT_PATH
not present in the latest version, will check that out.

  • Mani

On Tue, Jun 23, 2015 at 4:37 AM, Stephen Woodbridge

<woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)> wrote:

On 6/22/2015 6:14 PM, Manikanta Kondeti wrote:

Steve,

That’s giving me an error. I understood the workflow, Here is
the main
thing that I’ve to look at :[line 36] POSTGRESQL_PG_CONFIG =
“/usr/bin/pg_config” and that is of version 8.4.22. From this the

The point is that cmake is search the PATh variable and which is why
it is finding /usr/bin/pg_config instead of
/usr/lib/postgresql/9.1/bin/pg_config

The point of NO_DEFAULT_PATH argument is to prevent it from search
the default paths and to only look at the ones you are specifying.

variable POSTGRESQL_VERSION_STRING is set which makes all the
variables
in CMakeLists.txt to 8.4. This makes the whole POSTGRESQL
variables in
CMakeLists.txt to 8.4. We can see that from cmake log.

So if we can control this line 36 to the PG_VERSION we specify, then
everything works fine. I will let you know if I got something
interesting. I’d be highly thankful if you suggest something at
this point.

The code below works on my system. I’m using cmake version 2.8.12.2

cmake --version

I don’t know when that variable was added, you probably have an
older version. ALSO, rm -rf build/* so you clean out the cmake
cache. It didn’t work until I cleared it.

-Steve

  • Mani

On Tue, Jun 23, 2015 at 3:16 AM, Stephen Woodbridge
<woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)

<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>> wrote:

Try changing it to this:

Checking POSTGRESQL_PG_CONFIG

find_program(POSTGRESQL_PG_CONFIG NAMES pg_config
PATHS
/usr/lib/postgresql/${PG_VERSION}/bin/
NO_DEFAULT_PATH
)

also read this:

cmake --help-command FIND_PROGRAM

-Steve

On 6/22/2015 4:43 PM, Manikanta Kondeti wrote:

Steve,

Thanks for the steps. I am thinking in a different
method. I just
pushed a branch cmake-postgres. In File
FindPostgreSQL.cmake on
line no:
19, PG_VERSION is a argument passed while running
cmake. ( cmake
-DPG_VERSION=9.* ).

  • Take an argument from command line.
  • Modify the present FindPostgreSQL.cmake, build it
    until it is
    working
    properly.

I am stuck here at this point. See line no: 43 (
COMMAND${POSTGRESQL_PG_CONFIG}–version) this is
giving 8.4 as
defaults. Therefore variables after this are set with
8.4, I need to
somehow understand and change it.

If you are free now we can discuss this.

  • Mani

On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge
<woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com) <mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>

<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)
<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>>> wrote:

Mani wrote:

I’m working on this already. Since this is my
first time on
cmake and
dependencies I might need some help from you guys.

I’ll try my best to make it working.

Start with the message below and ask where you get
stuck.
The steps are:

  1. copy the FindPostgreSQL.cmake linked below to the
    pgrouting/cmake

  2. this will break the build stuff because this
    new script sets
    different variables than the existing build expects.

  3. sort this out and get it to build like it did
    before
    using the
    new script

  4. when it is building like before, add the
    variable to set the
    version in the commandline and and use that to set
    PostgreSQL_ADDITIONAL_VERSIONS and it should work.

Ask specific questions if you get stuck, check in
your code
where I
can look at it.

There is a ticket for this:
https://github.com/pgRouting/pgrouting/issues/301

-Steve

On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:

Mani,

You probably want to start with this version of
FindPostgreSQL.cmake

https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake

It lets you specify
PostgreSQL_ADDITIONAL_VERSIONS
variable
and if
this is set to the version you want it will
use this
version if
found.

I think that the return variables that this
script sets are
different
from what we expect in pgrouting so you
might need to
set the
expected variables with the correct values also.

So, I would replace the existing
FindPostgreSQL.cmake
with this
script and then try to make it work with the
existing
build system,
then look at reading a command line version
and setting
the variable
above before calling find postgresql.

-Steve

On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:

Hi Steve,

I’ve tried my best to update
cmake/FindPostgreSQL.cmake and
CMakeLists.txt, but the build was not
successful. I’ve
changed all
the POSTGRES variables to 9.4, cmake executed
properly, but
while
compiling(make) there is a error saying
“Postgres.h” not
found. Can
you share your CMakeLists.txt and
cmake/FindPostgresql…cmake. I am
on the version 9.4.

I think this needs to be solved for the next
release. We need to
the pass the postgresql version to build,
like the
option you
said “DUSE_PG=9.x”. But unfortunately it
is not working
right now.
I’ll try to read about cmake and see what
I can do.
I will
update
you.

Thank you, Mani

On Mon, Jun 22, 2015 at 8:20 PM, Stephen
Woodbridge
<woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)
<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>
<mailto:woodbri@swoodbridge.com mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)
<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>>
<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)
<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>

<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)
<mailto:woodbri@swoodbridge.com
mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>>>> wrote:

On 6/22/2015 10:37 AM, Manikanta Kondeti
wrote:

Hi,

I am facing an error while building from
source.
This is that
issue:
https://github.com/pgRouting/pgrouting/issues/109

How to resolve that? Changing Pg version
to 9.1 in
CMakeLists.txt
is not working. I have 9.1 and 9.4
postgresql versions
installed in
my system. Help me out in resolving this.

Mani,

Sorry, the CMakeLists.txt files built for
pgrouting
2.x were not
designed for support multiple versions
installed on
the same
system. This is a problem for me because I
have
9.2, 9.3,
and 9.4
installed and I can only build and install
on 9.4.

The solution id to update the
CMakeLists.txt and
specifically
cmake/FindPostgreSQL.cmake which so you can do
something like

cd build cmake -DUSE_PG=9.x …

I took a quick look at doing this a while
back but
cmake/FindPostgreSQL.cmake needs to be
replaced and
other
changes
are needed and I didn’t have time to make the
changes and get it
working.

tools/test-runner.pl
<http://test-runner.pl> <http://test-runner.pl>
<http://test-runner.pl>
<http://test-runner.pl> already support
options for pg versions and ports so only
the build
system is
broken in this regard.

If you want to read up on CMake and get this
working a pull
request would be great!

-Steve


pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>>
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>>>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev
mailing list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev
mailing
list pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
<mailto:pgrouting-dev@lists.osgeo.org
mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)>
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)

http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org mailto:[pgrouting-dev@lists.osgeo.org](mailto:pgrouting-dev@lists.osgeo.org)
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev


pgrouting-dev mailing list
pgrouting-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-dev