Subject: [UFC-dev] Installation issue

From: "Garth N. Wells" <[email-masked]>
Date: Mon, 06 Apr 2009 22:46:39 +0800

I've run into an installation issue with UFC + Python 2.6 + Ubuntu 9.04.
The other FEniCS Python packages are installed by default under

    /usr/local/lib/python2.6/dist-packages

which is in my path (by default), but the UFC Python module is being 
installed under

   /usr/local/lib/python2.6/site-packages

which is not in my path. What's strange is that

    sysconfig.get_python_lib()

returns '/usr/lib/python2.6/dist-packages', and

    sysconfig.get_python_lib(prefix="$prefix",plat_specific=True)

returns '$prefix/lib/python2.6/site-packages'. Modules should be 
installed under dist-packages, so is 'python2.6/site-packages' a 
Ubuntu/Python bug?

Garth

---

From: Johan Hake <[email-masked]>
Date: Mon, 6 Apr 2009 20:58:29 +0200

> installed under dist-packages, so is 'python2.6/site-packages' a

Strange, what happens if you skip the plat_specific options?

Does this apply to the dolfin python modules too?

The other fenics packages rely.

Johan

> Garth
>
> _______________________________________________
> UFC-dev mailing list
> [email-masked]
> http://fenics.org/mailman/listinfo/ufc-dev

---

From: "Garth N. Wells" <[email-masked]>
Date: Tue, 07 Apr 2009 07:17:49 +0800

> Strange, what happens if you skip the plat_specific options?

I get

     sysconfig.get_python_lib(prefix="$prefix"

> Does this apply to the dolfin python modules too?

Yes. I don't install DOLFIN globally, and dolfin.conf sets the correct 
path so I didn't initially notice the issue with the DOLFIN Python modules.

> The other fenics packages rely.

The other FEniCS packages, which all work through the standard Python 
installation system, are fine. The modules are installed under 
/usr/local/lib/python2.6/dist-packages.

Garth

---

From: Johan Hake <[email-masked]>
Date: Tue, 7 Apr 2009 08:52:28 +0200

> > Strange, what happens if you skip the plat_specific options?

Could you print the output from:

   sysconfig.get_python_lib(prefix="$prefix")

both from your command prompt and from within the SConstructor file.

> path so I didn't initially notice the issue with the DOLFIN Python modules.

Ok, which version of SCons do you have. We had some problems with sysconfig on 
mac a while ago. In the terminal it gave the correct answer but if called in 
a SCons file it gave incorrect answer.

Could you check which version of sysconfig is running by reporting what:

  print sysconfig.__file__

give you. You need to put it somewhere in your SConstructor file.

Johan

---

From: "Garth N. Wells" <[email-masked]>
Date: Tue, 07 Apr 2009 15:39:52 +0800

Johan Hake wrote:
> both from your command prompt 

     $prefix/lib/python2.6/site-packages

> and from within the SConstructor file.
>

     $prefix/lib/python2.6/site-packages

> Ok, which version of SCons do you have. 

     $ scons -v
     SCons by Steven Knight et al.:
	script: v1.2.0.r3842, 2008/12/20 22:59:52, by scons on scons-dev
	engine: v1.2.0.r3842, 2008/12/20 22:59:52, by scons on scons-dev
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons 
Foundation

We had some problems with sysconfig on
> Could you check which version of sysconfig is running by reporting what:

     /usr/lib/python2.6/distutils/sysconfig.pyc

Garth

---

From: Johan Hake <[email-masked]>
Date: Tue, 7 Apr 2009 09:59:58 +0200

On Tuesday 07 April 2009 09:39:52 Garth N. Wells wrote:
> >>>> I've run into an installation issue with UFC + Python 2.6 + Ubuntu
> >>>> 9.04. The other FEniCS Python packages are installed by default under
> >>>>

Ok. Both show the erronious answer. So there are something fishy with the 
prefix option.

Could try to look into it, and report back. If it is a bug we could 
potentially add a hack to fix it.

> Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons

Ok.

> > mac a while ago. In the terminal it gave the correct answer but if called
> > in a SCons file it gave incorrect answer.
> >

Ok. It uses the version it should.

Johan

---

From: Johan Hake <[email-masked]>
Date: Tue, 7 Apr 2009 11:21:02 +0200

> potentially add a hack to fix it.

I think it is a bug in distutils. 

Disclaimer: I did not try too hard though :P

I have seen some related bug fix reports on this for jaunty (Ubuntu 9.10). 

In the meantime you can always specify the installation path explicitly:

scons pythonExtDir=/usr/local/lib/python2.6/dist-packages \
      pythonModuleDir=/usr/local/lib/python2.6/dist-packages 

Johan

> > > mac a while ago. In the terminal it gave the correct answer but if
> > > called in a SCons file it gave incorrect answer.
> > >

---

From: "Garth N. Wells" <[email-masked]>
Date: Tue, 07 Apr 2009 17:30:51 +0800

> I have seen some related bug fix reports on this for jaunty (Ubuntu 9.10). 

OK. I thought that it may have been a Python bug. I'll keep an eye out 
for updated Python packages.

>       pythonModuleDir=/usr/local/lib/python2.6/dist-packages 

Even easier, for now I've just added 
/usr/local/lib/python2.6/site-packages to PYTHONPATH.

Garth

---

From: Johan Hake <[email-masked]>
Date: Tue, 7 Apr 2009 11:34:24 +0200

On Tuesday 07 April 2009 11:30:51 Garth N. Wells wrote:
> >>>>>>> which is in my path (by default), but the UFC Python module is
> >>>>>>> being installed under
> >>>>>>>
> >> Ok. Both show the erronious answer. So there are something fishy with
> >> the prefix option.
> >>

Good.

> /usr/local/lib/python2.6/site-packages to PYTHONPATH.

Ok :)

Johan

> >>>>> Yes. I don't install DOLFIN globally, and dolfin.conf sets the
> >>>>> correct path so I didn't initially notice the issue with the DOLFIN
> >>>>> Python modules.
> >>>>