[GRASS-dev] G65/7 ctypes compilation problem on Enterprise Linux

Hi,

since Helena mentioned a problem on enterprise Linux, I tried to compile 6.5 on
Scientific Linux, a RHEL derivate.

Indeed, I get this problem:

make[1]: Entering directory
`/home/neteler/software/grass65_release/lib/python/ctypes'
GISRC=/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/demolocation/.grassrc65
GISBASE=/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu
PATH="/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/bin:$PATH"
PYTHONPATH="" LD_LIBRARY_PATH="/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/bin:/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/lib::/home/neteler/binaries/lib/"
LC_ALL=C ./ctypesgen.py --cpp "gcc -E -DPACKAGE=\""grasslibs"\"
-DPACKAGE=\""grasslibs"\"
-I/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/include"
-lgrass_datetime
/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/include/grass/datetime.h
/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/include/grass/P_datetime.h
-o date.py
Traceback (most recent call last):
  File "./ctypesgen.py", line 36, in ?
    import ctypesgencore
  File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/__init__.py",
line 51, in ?
    import parser
  File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/__init__.py",
line 17, in ?
    from datacollectingparser import DataCollectingParser
  File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/datacollectingparser.py",
line 10, in ?
    import ctypesparser
  File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/ctypesparser.py",
line 15, in ?
    from cparser import *
  File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/cparser.py",
line 19, in ?
    import preprocessor
  File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/preprocessor.py",
line 14, in ?
    import ctypes
ImportError: No module named ctypes
make[1]: *** [date.py] Error 1
make[1]: Leaving directory
`/home/neteler/software/grass65_release/lib/python/ctypes'
make: *** [default] Error 2

I also tried on GRASS 7, same thing.

SciLin 5.2 provides python2.4.

A fix would be appreciated.

Markus

Markus,

this is the same problem here - the problem is with python2.4 that is used as default
and that does not include ctypes so you need to make symlink in grass to make sure
it looks for python2.6 (which I have also installed) or there may be some other solution -
You cannot remove python2.4 because it is used for system management.
I did not have time to get it fully resolved yet.

The problem should go away with the next release of RHEL which is in beta and
should use python 2.6 (I think),

Helena

On Aug 18, 2010, at 3:40 PM, Markus Neteler wrote:

Hi,

since Helena mentioned a problem on enterprise Linux, I tried to compile 6.5 on
Scientific Linux, a RHEL derivate.

Indeed, I get this problem:

make[1]: Entering directory
`/home/neteler/software/grass65_release/lib/python/ctypes'
GISRC=/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/demolocation/.grassrc65
GISBASE=/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu
PATH="/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/bin:$PATH"
PYTHONPATH="" LD_LIBRARY_PATH="/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/bin:/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/lib::/home/neteler/binaries/lib/"
LC_ALL=C ./ctypesgen.py --cpp "gcc -E -DPACKAGE=\""grasslibs"\"
-DPACKAGE=\""grasslibs"\"
-I/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/include"
-lgrass_datetime
/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/include/grass/datetime.h
/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/include/grass/P_datetime.h
-o date.py
Traceback (most recent call last):
File "./ctypesgen.py", line 36, in ?
   import ctypesgencore
File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/__init__.py",
line 51, in ?
   import parser
File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/__init__.py",
line 17, in ?
   from datacollectingparser import DataCollectingParser
File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/datacollectingparser.py",
line 10, in ?
   import ctypesparser
File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/ctypesparser.py",
line 15, in ?
   from cparser import *
File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/cparser.py",
line 19, in ?
   import preprocessor
File "/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/preprocessor.py",
line 14, in ?
   import ctypes
ImportError: No module named ctypes
make[1]: *** [date.py] Error 1
make[1]: Leaving directory
`/home/neteler/software/grass65_release/lib/python/ctypes'
make: *** [default] Error 2

I also tried on GRASS 7, same thing.

SciLin 5.2 provides python2.4.

A fix would be appreciated.

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

Helena Mitasova wrote:

this is the same problem here - the problem is with python2.4 that is used as default
and that does not include ctypes so you need to make symlink in grass to make sure
it looks for python2.6 (which I have also installed) or there may be some other solution -
You cannot remove python2.4 because it is used for system management.
I did not have time to get it fully resolved yet.

ctypes can be added as a third-party module in Python 2.3 and 2.4 (it
doesn't work on versions prior to 2.3, and it's part of the standard
library in 2.5 onwards).

  http://pypi.python.org/pypi/ctypes/1.0.2

Note: it requires libffi.

However, installing Python >= 2.5 is likely to be easier, and will
also help if there are other compatibility issues (I don't know how
much testing gets done with 2.4 nowadays).

--
Glynn Clements <glynn@gclements.plus.com>

On Thu, Aug 19, 2010 at 3:35 AM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Helena Mitasova wrote:

this is the same problem here - the problem is with python2.4 that is used as default
and that does not include ctypes so you need to make symlink in grass to make sure
it looks for python2.6 (which I have also installed) or there may be some other solution -
You cannot remove python2.4 because it is used for system management.
I did not have time to get it fully resolved yet.

ctypes can be added as a third-party module in Python 2.3 and 2.4 (it
doesn't work on versions prior to 2.3, and it's part of the standard
library in 2.5 onwards).

   http://pypi.python.org/pypi/ctypes/1.0.2

Note: it requires libffi.

Indeed, it was as easy as this:

   root> easy_install ctypes

Now it compiles also with Python2.4.

However, installing Python >= 2.5 is likely to be easier, and will
also help if there are other compatibility issues (I don't know how
much testing gets done with 2.4 nowadays).

Well, I hesitate to break the existing installation on our cluster.

Markus

According to Distrowatch ,
[http://distrowatch.com/table.php?distribution=redhat](http://distrowatch.com/table.php?distribution=redhat) , Red Hat 6 has Python 2.6.2.

Doug

Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb@fws.gov
---------------------------------------------------------------------------------------------------------
The opinions I express are my own and are not representative of the official policy of the U.S.Fish and Wildlife Service or Dept. of the Interior. Life is too short for undocumented, proprietary data formats.

-----grass-dev-bounces@lists.osgeo.org wrote: -----

To: Markus Neteler <neteler@osgeo.org>
From: Helena Mitasova <hmitaso@unity.ncsu.edu>
Sent by: grass-dev-bounces@lists.osgeo.org
Date: 08/18/2010 04:11PM
cc: GRASS developers list <grass-dev@lists.osgeo.org>
Subject: Re: [GRASS-dev] G65/7 ctypes compilation problem on Enterprise Linux

Markus,

this is the same problem here - the problem is with python2.4 that is used as default
and that does not include ctypes so you need to make symlink in grass to make sure
it looks for python2.6 (which I have also installed) or there may be some other solution -
You cannot remove python2.4 because it is used for system management.
I did not have time to get it fully resolved yet.

The problem should go away with the next release of RHEL which is in beta and
should use python 2.6 (I think),

Helena

On Aug 18, 2010, at 3:40 PM, Markus Neteler wrote:

> Hi,
>
> since Helena mentioned a problem on enterprise Linux, I tried to compile 6.5 on
> Scientific Linux, a RHEL derivate.
>
> Indeed, I get this problem:
>
> make[1]: Entering directory
> /home/neteler/software/grass65_release/lib/python/ctypes’ > GISRC=/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/demolocation/.grassrc65 > GISBASE=/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu > PATH=“/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/bin:$PATH” > PYTHONPATH=“” LD_LIBRARY_PATH=“/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/bin:/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/lib::/home/neteler/binaries/lib/” > LC_ALL=C ./ctypesgen.py --cpp “gcc -E -DPACKAGE="“grasslibs”" > -DPACKAGE="“grasslibs”" > -I/home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/include” > -lgrass_datetime > /home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/include/grass/datetime.h > /home/neteler/software/grass65_release/dist.x86_64-unknown-linux-gnu/include/grass/P_datetime.h > -o date.py > Traceback (most recent call last): > File “./ctypesgen.py”, line 36, in ? > import ctypesgencore > File “/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/init.py”, > line 51, in ? > import parser > File “/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/init.py”, > line 17, in ? > from datacollectingparser import DataCollectingParser > File “/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/datacollectingparser.py”, > line 10, in ? > import ctypesparser > File “/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/ctypesparser.py”, > line 15, in ? > from cparser import * > File “/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/cparser.py”, > line 19, in ? > import preprocessor > File “/home/neteler/software/grass65_release/lib/python/ctypes/ctypesgencore/parser/preprocessor.py”, > line 14, in ? > import ctypes > ImportError: No module named ctypes > make[1]: *** [date.py] Error 1 > make[1]: Leaving directory > /home/neteler/software/grass65_release/lib/python/ctypes'
> make: *** [default] Error 2
>
> I also tried on GRASS 7, same thing.
>
> SciLin 5.2 provides python2.4.
>
> A fix would be appreciated.
>
> Markus
> _______________________________________________
> grass-dev mailing list
> grass-dev@lists.osgeo.org
> [http://lists.osgeo.org/mailman/listinfo/grass-dev](http://lists.osgeo.org/mailman/listinfo/grass-dev)

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