Subject: [UFC-dev] installation without root privileges

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 01 Feb 2007 14:49:24 +0100

It isn't possible to install UFC without root privileges as it wants to 
install under /usr/local.

Garth

---

From: Anders Logg <[email-masked]>
Date: Thu, 1 Feb 2007 16:22:51 +0100

> install under /usr/local.

You can install it anywhere you like if you just edit the first line
in the Makefile.

There is no fancy --prefix=<> for the installation of UFC. The
motivation is that it is so simple (just a single header file that
needs to be copied to prefix/include) so using a build system like
scons or the like would be overkill.

/Anders

---

From: "Garth N. Wells" <[email-masked]>
Date: Thu, 01 Feb 2007 16:38:31 +0100

> You can install it anywhere you like if you just edit the first line

Sure, but it this what you want?

> scons or the like would be overkill.

Why use the make then? Why not just a Python script/installer with an 
established mechanism for specifying the path? It's important that all 
the FEniCS components install easily.

Garth

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

---

From: Anders Logg <[email-masked]>
Date: Thu, 1 Feb 2007 16:51:46 +0100

> the FEniCS components install easily.

The motivation here was that UFC should not depend on Python.
(It still does since the Makefile calls distutils.)

I could live with a Python dependency, and then we could use distutils.

Other opinions?

/Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Fri, 2 Feb 2007 08:53:56 +0100

> I could live with a Python dependency, and then we could use distutils.

An alternative is allowing "make PREFIX=/opt/myplace".
Just two more lines in the makefile.

martin

---

From: Anders Logg <[email-masked]>
Date: Fri, 2 Feb 2007 09:21:18 +0100

> Just two more lines in the makefile.

The problem with the Makefile approach is that we use a Makefile so
that we don't need to depend on Python for the installation, but we
still depend on Python in the Makefile...

There seem to be two options:

1. Use a Makefile but then we need to separate the targets in the
Makefile so we have something like

    make install
    make python_install

which seems unecessary complicated.

2. Depend on Python and use distutils for installing everything:

    python setup.py install

We can do (2) and still not depend on Python by adding installation
instructions for a non-Python installation in the README file. The
instructions would be very simple:

    cp src/ufc/ufc.h /usr/local/include

Would that work?

/Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Fri, 2 Feb 2007 09:28:29 +0100

>     cp src/ufc/ufc.h /usr/local/include

Can't the makefile just check if python/distutils exists?

martin

---

From: Anders Logg <[email-masked]>
Date: Fri, 2 Feb 2007 11:03:09 +0100

> Can't the makefile just check if python/distutils exists?

Yes, it would work. But wouldn't it be better to add a single line (I
guess) to setup.py and let distutils handle the installation of ufc.h?

The advantage would be to rely on a standard portable tool (distutils)
rather than a hand-made Makefile which is essentially a bash script.

The disadvantage would be that the 0.00001% (?) of the population that
don't have Python on their systems would need to copy the file
manually.

/Anders

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Fri, 2 Feb 2007 11:09:20 +0100

> don't have Python on their systems would need to copy the file

Fine by me. And I think those 0.00001% would be windows users :)

martin

---

From: Ola Skavhaug <[email-masked]>
Date: Fri, 2 Feb 2007 12:29:27 +0100

> Fine by me. And I think those 0.00001% would be windows users :)

It could also be a Python without distutils (then you need python-dev in
Ubuntu). But I still agree, skip Makefile and use distutils. We should put the
instruction for copying the header file early in the README, I think.

Ola

---

From: Anders Logg <[email-masked]>
Date: Fri, 2 Feb 2007 12:45:55 +0100

> instruction for copying the header file early in the README, I think.

Very good. So we just need to move the setup.py to the top level and
add ufc.h.

/Anders

---

From: Åsmund Ødegård <[email-masked]>
Date: Fri, 2 Feb 2007 17:33:25 +0100

> Just two more lines in the makefile.

You can already do that, that's the whole point of the PREFIX  
variable in the Makefile for ufc. No need to add anything in the file  
for that.

mvh,
-- 
[simula.research laboratory]
                  Åsmund Ødegård
                  IT-Manager
                  phone: +4767828291 /+4790069915
                  http://www.simula.no/

---

From: Anders Logg <[email-masked]>
Date: Fri, 2 Feb 2007 22:36:01 +0100

> Very good. So we just need to move the setup.py to the top level and

But how?

I've tried with install_headers and ext_modules, but I can't get
distutils to install ufc.h under prefix/include. It only wants to
install under prefix/include/python/UFC/ufc.h.

/Anders

---

From: [email-masked]
Date: Sat, 3 Feb 2007 21:57:33 +0100 (CET)

> Sure, but it this what you want?

I've added a few simple lines in the Makefile,

ifndef PREFIX
  PREFIX = /usr/local
endif

Hence default is /usr/local

but one can install another place with

make install PREFIX=/some/where