Windows installation

194 views
Skip to first unread message

dmorafftransit

unread,
Jul 8, 2009, 10:08:40 AM7/8/09
to Graphserver
Does anyone have a basic guide to windows installation/uploading GTFS/
uploading OpenStreets data?

Thanks.

Nino Walker

unread,
Jul 8, 2009, 12:21:45 PM7/8/09
to graph...@googlegroups.com
No known effort has been made to run graphserver on windows. Presumably it wouldn't be too hard with cygwin/ming and the existing make. After you've figured out how to build the .so, everything *should* be the same vis-à-vis python. A less painful route: linux EC2 instances are cheap @ $0.10/hour.

and...@fastmail.net

unread,
Jul 10, 2009, 11:32:15 AM7/10/09
to graph...@googlegroups.com
On Wed, 08 Jul 2009 07:21 -0500, "Nino Walker" <ni...@urbanmapping.com>
wrote:

>
> No known effort has been made to run graphserver on windows. Presumably
> it wouldn't be too hard with cygwin/ming and the existing make.

A few months ago at work, I installed Graphserver under Cygwin and got
it working. I just re-installed it to refresh my memory and document the
experience. Seems fairly painless. There is one tricky bit: pygs doesn't
correctly find the standard C library.

The culprit is the following line in pygs/graphserver/gsdll.py:
libc = cdll.LoadLibrary(find_library('c'))

A more general solution is to replace the above line with:

# Adapted from ctypes.test.test_loading
# Find and load the c runtime library
libc_name = None
if sys.platform == "cygwin":
libc_name = "cygwin1.dll"
else:
libc_name = find_library("c")
if not libc_name:
raise ImportError('could not determine which c runtime library to
use')
libc = cdll.LoadLibrary(libc_name)

With the above modification, I just ran the pygs nosetests, and all came
out OK except three:

======================================================================
FAIL: test_load_sample (test.gtfs_test.GTFSTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/Byrd/src/graphserver/pygs/test/gtfs_test.py", line 160, in
test_load_sample
leads_to( "gtfsEMSI", ('gtfsDADAN',) )
File "/home/Byrd/src/graphserver/pygs/test/gtfs_test.py", line 157, in
leads_to
assert vs == list(y), "%s vs %s" % (vs, list(y))
AssertionError: ['gtfsDADAN', 'gtfsDADAN', 'gtfsDADAN', 'gtfsDADAN',
'gtfsDADAN'] vs ['gtfsDADAN']

======================================================================
FAIL: test_spt_performance (test.unit_test.TestGraphPerformance)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/Byrd/src/graphserver/pygs/test/unit_test.py", line 774, in
test_spt_performance
assert average < limit
AssertionError:
-------------------- >> begin captured stdout << ---------------------
average runtime is 0.039100 s; limit 0.031000 s

--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: test_getstate (test.unit_test.TestStreet)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/Byrd/src/graphserver/pygs/test/unit_test.py", line 1008,
in test_getstate
assert s.__getstate__() == ('longstreet', 2, 0, 0)
AssertionError

----------------------------------------------------------------------
Ran 199 tests in 590.548s

FAILED (failures=3)

Failure 1:
If I comment out the assert in leads_to, the rest pass. Maybe this is
not really a problem, just the new graph type. Complains about some
missing commas in the sample feed's stop_times.txt.

Failure 2: Looks like it's just not running very fast.

Failure 3: state of street s at time of assertion is ('longstreet', 2.0,
0.0, 0.0, 1.0)
This is reasonable since the __getstate__ function in the street class
returns 4 elements.
I think the test is just outdated.

Another potential problem is that Cygwin Python is still at version 2.5,
and some Graphserver functions (serializing graphs I think) need the
zipfile module in Python 2.6. Apparently you have to build Python 2.6
without thread support to make it work under Cygwin.

Good luck,
Andrew Byrd

-----------------------------------

Andrew BYRD
165, rue Saint Maur
75011 Paris, France

email : and...@fastmail.net
cell/portable : +33(0)6 50 32 21 29
home/domicile : +33(0)1 71 19 56 66

-----------------------------------

Nino Walker

unread,
Jul 10, 2009, 2:03:21 PM7/10/09
to graph...@googlegroups.com
Thanks Andrew!

Andrew BYRD

unread,
Jul 10, 2009, 3:02:41 PM7/10/09
to graph...@googlegroups.com

On 10 Jul 2009, at 20:03, Nino Walker wrote:
>
> Thanks Andrew!

No problem. If someone can confirm that my 3 failed tests are benign,
may I suggest that we incorporate this change to the C library loading
so future users can avoid this patching step? I will be using
Graphserver regularly over the next months (years?) at the office, so
I should be able to verify out-of-the-box Cygwin compatibility or
provide compatibility notes. I also need to serialize graphs, so I
will develop a workaround for that in the near future.

-Andrew Byrd

Nino Walker

unread,
Jul 10, 2009, 3:11:45 PM7/10/09
to graph...@googlegroups.com
* Comments *

Failure 1:
If I comment out the assert in leads_to, the rest pass. Maybe this is not really a problem, just the new graph type. Complains about some missing commas in the sample feed's stop_times.txt.

*A question for Brandon.*

Failure 2: Looks like it's just not running very fast.

*You're running on a slow machine and/or os.*

Failure 3: state of street s at time of assertion is ('longstreet', 2.0, 0.0, 0.0, 1.0) This is reasonable since the __getstate__ function in the street class returns 4 elements.
I think the test is just outdated.

* Very Probable *

David Hodge

unread,
Jul 10, 2009, 3:12:35 PM7/10/09
to graph...@googlegroups.com
Andrew,

Thanks for sharing that.

on serializing graphs... I wanted to alert you that I'm working on
graph serialization with much help from Nino. I wasn't planning on
sharing with the list until I was further along, but I figured I
should give you a heads up. I think it would be better for us to
collaborate, then for both of us to write our own serialization code
independently, only to discover someone else has already done it!

We already have the de-serialization code mostly written, I'm starting
the other half today. We'd love some extra help implementing / testing
it over the week or two if you're up for it.

David

charles

unread,
Sep 3, 2012, 9:51:34 PM9/3/12
to graph...@googlegroups.com
uhmm.. excuse me. Mr. andrewb. can you guide me on how you install graphserver using cygwin .. i'm completely new to cygwin and linux. as well as graphserver. i just wanna try a working installation of graphserver so i can try things from it. thnx. 

Andrew Byrd

unread,
Sep 10, 2012, 10:28:15 AM9/10/12
to graph...@googlegroups.com
On 09/04/2012 03:51 AM, charles wrote:
> uhmm.. excuse me. Mr. andrewb. can you guide me on how you install
> graphserver using cygwin .. i'm completely new to cygwin and linux. as
> well as graphserver. i just wanna try a working installation of
> graphserver so i can try things from it. thnx.

Hi Charles,

It's been a few years since I did this, but I remember it working
smoothly. Cygwin implements the POSIX API in terms of Windows system
calls and provides packages for all of the GNU tools. This gives you an
environment in which you can compile and run UNIX/Linux software.

Follow the install instructions at http://cygwin.com/install.html, and
install the Cygwin packages for all the software that Graphserver
depends on -- basically just follow the getting started instructions for
Graphserver but use the Cygwin package installer instead of apt-get.

Once you are working under Cygwin, I believe there are very few or no
differences from working under Linux. However, the patch I supplied in
the email you quoted was not applied to the main graphserver repository.
You will have to make that modification to gsdll.py yourself to allow
graphserver to find the C standard library under Cygwin.

Sorry to be somewhat vague but it's been three years since I used Cygwin
in a pinch, and haven't used it since. I realize compiling and
installing software in a UNIX-like environment may be new to you. It may
take a while to adjust, but just search for tutorials on using GCC and
Python to get some practice. There should be a ton of them on the web.

To be honest, if you have a spare hard drive or machine around it is
probably easier to just install Linux. These days it's usually a
completely painless process, and distributions like Ubuntu will
automatically provide you with a familiar windowing interface while you
get accustomed to the command line, build tools etc.

You can get Amazon EC2 or Rackspace instances really cheap as well.

-Andrew

> On Friday, July 10, 2009 11:32:15 PM UTC+8, andrewb wrote:
>
> On Wed, 08 Jul 2009 07:21 -0500, "Nino Walker"
> <ni...@urbanmapping.com <javascript:>>
> email : and...@fastmail.net <javascript:>
> cell/portable : +33(0)6 50 32 21 29
> home/domicile : +33(0)1 71 19 56 66
>
> -----------------------------------
>
> --
> You received this message because you are subscribed to the Google
> Groups "Graphserver" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/graphserver/-/eYENUMlsoQUJ.
> To post to this group, send email to graph...@googlegroups.com.
> To unsubscribe from this group, send email to
> graphserver...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/graphserver?hl=en.

Reply all
Reply to author
Forward
0 new messages