[GRASS-dev] Re: [GRASS GIS] #308: Compiler error while building
python swig
GRASS GIS
trac at osgeo.org
Wed Sep 17 02:24:10 EDT 2008
#308: Compiler error while building python swig
----------------------------------+-----------------------------------------
Reporter: cgsbob | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: SWIG (all bindings) | Version: svn-develbranch6
Resolution: | Keywords: python swig
Platform: Unspecified | Cpu: Unspecified
----------------------------------+-----------------------------------------
Comment (by glynn):
Replying to [comment:23 hamish]:
> One last thing I'd like to figure out before closing this bug:
>
> "python test.py" should be run by the Makefile. Besides testing that it
all works this compiles the .pyc version while we know we have write
access to the dir. If we wait until after install and let it happen at
runtime, it is likely that the user won't have write permissions to the
dir and it will have to be recompiled in memory every time the user uses
the lib.
>
> For python_grass[67].py the test must be run in a fake grass session
(same as the man pages) but I'm not sure how to do that in the Makefile.
If you just want to compile the python_grass![67].py file, why not run a
minimal script which simply imports that file, i.e.:
{{{
#!/usr/bin/env python
import python_grass7
}}}
This won't require a dummy session.
> For !NumPtr/build/lib.linux-i686-2.4/NumPtr.py I am not sure how to
generalize the $ARCH.
You can specify the directories with:
{{{
python setup.py build --build-lib build/lib.foo --build-temp
build/temp.foo
}}}
Or you can calculate the directories which it will use as:
{{{
plat_specifier = ".%s-%s" % (distutils.util.get_platform(),
sys.version[0:3])
lib_dir = os.path.join('build', 'lib' + plat_specifier)
temp_dir = os.path.join('build', 'temp' + plat_specifier)
}}}
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/308#comment:24>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list