<div dir="ltr"><br><div>I forgot to add the screenshot in the last mail. </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 23, 2015 at 5:00 AM, Manikanta Kondeti <span dir="ltr"><<a href="mailto:mani.iiit123@gmail.com" target="_blank">mani.iiit123@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"> I am on version 3.3.0-rc2. I've installed the latest verion yesterday. <div><br></div><div>Adding that NO_DEFAULT_PATH sets NULL to POSTGRESQL_PG_CONFIG and gives an error. I've added the screenshot.</div><div><br></div><div>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.</div><div><br></div><div>- Mani</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 23, 2015 at 4:37 AM, Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 6/22/2015 6:14 PM, Manikanta Kondeti wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Steve,<br>
<br><span>
That's giving me an error. I understood the workflow, Here is the main<br>
thing that I've to look at :[line 36] POSTGRESQL_PG_CONFIG =<br>
"/usr/bin/pg_config" and that is of version 8.4.22. From this the<br>
</span></blockquote>
<br>
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<br>
<br>
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.<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
variable POSTGRESQL_VERSION_STRING is set which makes all the variables<br>
in CMakeLists.txt to 8.4. This makes the whole POSTGRESQL variables in<br>
CMakeLists.txt to 8.4. We can see that from cmake log.<br>
<br>
So if we can control this line 36 to the PG_VERSION we specify, then<br>
everything works fine. I will let you know if I got something<br>
interesting. I'd be highly thankful if you suggest something at this point.<br>
</blockquote>
<br></span>
The code below works on my system. I'm using cmake version 2.8.12.2<br>
<br>
cmake --version<br>
<br>
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.<br>
<br>
-Steve<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
- Mani<br>
<br>
On Tue, Jun 23, 2015 at 3:16 AM, Stephen Woodbridge<br></span><div><div>
<<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a> <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>>> wrote:<br>
<br>
Try changing it to this:<br>
<br>
# Checking POSTGRESQL_PG_CONFIG<br>
find_program(POSTGRESQL_PG_CONFIG NAMES pg_config<br>
PATHS<br>
/usr/lib/postgresql/${PG_VERSION}/bin/<br>
NO_DEFAULT_PATH<br>
)<br>
<br>
also read this:<br>
<br>
cmake --help-command FIND_PROGRAM<br>
<br>
-Steve<br>
<br>
On 6/22/2015 4:43 PM, Manikanta Kondeti wrote:<br>
<br>
Steve,<br>
<br>
Thanks for the steps. I am thinking in a different method. I just<br>
pushed a branch cmake-postgres. In File FindPostgreSQL.cmake on<br>
line no:<br>
19, PG_VERSION is a argument passed while running cmake. ( cmake<br>
-DPG_VERSION=9.* ).<br>
<br>
* Take an argument from command line.<br>
* Modify the present FindPostgreSQL.cmake, build it until it is<br>
working<br>
properly.<br>
<br>
I am stuck here at this point. See line no: 43 (<br>
COMMAND${POSTGRESQL_PG_CONFIG}--version) this is giving 8.4 as<br>
defaults. Therefore variables after this are set with 8.4, I need to<br>
somehow understand and change it.<br>
<br>
If you are free now we can discuss this.<br>
- Mani<br>
<br>
On Tue, Jun 23, 2015 at 1:18 AM, Stephen Woodbridge<br>
<<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a> <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>><br></div></div><div><div>
<mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a><br>
<mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>>>> wrote:<br>
<br>
Mani wrote:<br>
<br>
I'm working on this already. Since this is my first time on<br>
cmake and<br>
dependencies I might need some help from you guys.<br>
<br>
I'll try my best to make it working.<br>
<br>
<br>
Start with the message below and ask where you get stuck.<br>
The steps are:<br>
<br>
1. copy the FindPostgreSQL.cmake linked below to the<br>
pgrouting/cmake<br>
<br>
2. this will break the build stuff because this new script sets<br>
different variables than the existing build expects.<br>
<br>
3. sort this out and get it to build like it did before<br>
using the<br>
new script<br>
<br>
4. when it is building like before, add the variable to set the<br>
version in the commandline and and use that to set<br>
PostgreSQL_ADDITIONAL_VERSIONS and it should work.<br>
<br>
Ask specific questions if you get stuck, check in your code<br>
where I<br>
can look at it.<br>
<br>
There is a ticket for this:<br>
<a href="https://github.com/pgRouting/pgrouting/issues/301" rel="noreferrer" target="_blank">https://github.com/pgRouting/pgrouting/issues/301</a><br>
<br>
-Steve<br>
<br>
<br>
On 6/22/2015 12:15 PM, Stephen Woodbridge wrote:<br>
<br>
Mani,<br>
<br>
You probably want to start with this version of<br>
FindPostgreSQL.cmake<br>
<br>
<a href="https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake" rel="noreferrer" target="_blank">https://github.com/Kitware/CMake/blob/master/Modules/FindPostgreSQL.cmake</a><br>
<br>
It lets you specify PostgreSQL_ADDITIONAL_VERSIONS<br>
variable<br>
and if<br>
this is set to the version you want it will use this<br>
version if<br>
found.<br>
<br>
I think that the return variables that this script sets are<br>
different<br>
from what we expect in pgrouting so you might need to<br>
set the<br>
expected variables with the correct values also.<br>
<br>
So, I would replace the existing FindPostgreSQL.cmake<br>
with this<br>
script and then try to make it work with the existing<br>
build system,<br>
then look at reading a command line version and setting<br>
the variable<br>
above before calling find postgresql.<br>
<br>
-Steve<br>
<br>
On 6/22/2015 11:50 AM, Manikanta Kondeti wrote:<br>
<br>
Hi Steve,<br>
<br>
I've tried my best to update<br>
cmake/FindPostgreSQL.cmake and<br>
CMakeLists.txt, but the build was not successful. I've<br>
changed all<br>
the POSTGRES variables to 9.4, cmake executed<br>
properly, but<br>
while<br>
compiling(make) there is a error saying<br>
"Postgres.h" not<br>
found. Can<br>
you share your CMakeLists.txt and<br>
cmake/FindPostgresql..cmake. I am<br>
on the version 9.4.<br>
<br>
I think this needs to be solved for the next<br>
release. We need to<br>
the pass the postgresql version to build, like the<br>
option you<br>
said "DUSE_PG=9.x". But unfortunately it is not working<br>
right now.<br>
I'll try to read about cmake and see what I can do.<br>
I will<br>
update<br>
you.<br>
<br>
Thank you, Mani<br>
<br>
On Mon, Jun 22, 2015 at 8:20 PM, Stephen Woodbridge<br>
<<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a><br>
<mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>> <mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a><br>
<mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>>><br>
<mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a><br>
<mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>><br>
<br>
<mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a><br>
<mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>>>>> wrote:<br>
<br>
On 6/22/2015 10:37 AM, Manikanta Kondeti wrote:<br>
<br>
Hi,<br>
<br>
I am facing an error while building from source.<br>
This is that<br>
issue:<br>
<a href="https://github.com/pgRouting/pgrouting/issues/109" rel="noreferrer" target="_blank">https://github.com/pgRouting/pgrouting/issues/109</a><br>
<br>
How to resolve that? Changing Pg version to 9.1 in<br>
CMakeLists.txt<br>
is not working. I have 9.1 and 9.4 postgresql versions<br>
installed in<br>
my system. Help me out in resolving this.<br>
<br>
<br>
Mani,<br>
<br>
Sorry, the CMakeLists.txt files built for pgrouting<br>
2.x were not<br>
designed for support multiple versions installed on<br>
the same<br>
system. This is a problem for me because I have<br>
9.2, 9.3,<br>
and 9.4<br>
installed and I can only build and install on 9.4.<br>
<br>
The solution id to update the CMakeLists.txt and<br>
specifically<br>
cmake/FindPostgreSQL.cmake which so you can do<br>
something like<br>
<br>
cd build cmake -DUSE_PG=9.x ..<br>
<br>
I took a quick look at doing this a while back but<br>
cmake/FindPostgreSQL.cmake needs to be replaced and<br>
other<br>
changes<br>
are needed and I didn't have time to make the<br>
changes and get it<br>
working.<br>
<br>
tools/<a href="http://test-runner.pl" rel="noreferrer" target="_blank">test-runner.pl</a> <<a href="http://test-runner.pl" rel="noreferrer" target="_blank">http://test-runner.pl</a>><br>
<<a href="http://test-runner.pl" rel="noreferrer" target="_blank">http://test-runner.pl</a>><br>
<<a href="http://test-runner.pl" rel="noreferrer" target="_blank">http://test-runner.pl</a>> already support<br>
options for pg versions and ports so only the build<br>
system is<br>
broken in this regard.<br>
<br>
If you want to read up on CMake and get this<br>
working a pull<br>
request would be great!<br>
<br>
-Steve<br>
<br>
_______________________________________________<br>
pgrouting-dev<br>
mailing list <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>>><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>>>><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
pgrouting-dev<br>
mailing list <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>>><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
_______________________________________________<br>
pgrouting-dev<br>
mailing<br>
list <a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>>><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
_______________________________________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>>><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a> <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
_______________________________________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a> <mailto:<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a>><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
</div></div><a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
<br>
</blockquote><div><div>
<br>
_______________________________________________<br>
pgrouting-dev mailing list<br>
<a href="mailto:pgrouting-dev@lists.osgeo.org" target="_blank">pgrouting-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-dev</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>