Subject: [UFC-dev] buildbot failure in mac_osx

From: [email-masked]
Date: Wed, 14 Jan 2009 09:38:16 +0100

The Buildbot has detected a new failure of mac_osx.
Full details are available at:
 http://fenics.org:8010/ufc/mac_osx/builds/527

Buildbot URL: http://fenics.org:8010/ufc/

Buildslave for this Build: mac-osx

Build Reason: 
Build Source Stamp: HEAD
Blamelist: Johan Hake

BUILD FAILED: failed compile

sincerely,
 -The Buildbot

---

From: Johan Hake <[email-masked]>
Date: Wed, 14 Jan 2009 09:56:45 +0100

> BUILD FAILED: failed compile

Attached is a patch that will install ufc without shared_ptr support if boost 
is not found, hopefully pleasing the buildbot.

Can someone with better mac skill than me check why the test for boost fails 
in the setup.py file? Currently I just do:

  result, output = get_status_output("pkg-config --exists boost")

and check if the result is 0 or 1.

Johan

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

# HG changeset patch
# User "Johan Hake <[email-masked]>"
# Date 1231923153 -3600
# Node ID 18a1e37cc3d7f54d6ef6aeca26774ed95052ab3a
# Parent  52f3e7878563b1fbc3b68d0e7b10a976fae601cc
Added a NO_SHARED_PTR define in the interface file
 - That is used when boost is not found

diff -r 52f3e7878563 -r 18a1e37cc3d7 src/ufc/ufc.i
--- a/src/ufc/ufc.i	Wed Jan 14 08:37:50 2009 +0100
+++ b/src/ufc/ufc.i	Wed Jan 14 09:52:33 2009 +0100
@@ -2,13 +2,20 @@
 
 %{
 #include <ufc.h>
+%}
+#ifndef NO_SHARED_PTR
+// Handle shared_ptr only available for swig version >= 1.3.34
+#if SWIG_VERSION >= 0x010334
 // If using std::tr1::shared_ptr comment out this line
+%{
 #include <boost/shared_ptr.hpp>
 // Un comment these lines to use std::tr1, only works with swig version  >= 1.3.37
 //#include <tr1/memory>
 %}
+#endif
+#endif
 
-
+#ifndef NO_SHARED_PTR
 // Handle shared_ptr only available for swig version >= 1.3.34
 #if SWIG_VERSION >= 0x010334
 // Un comment these lines to use std::tr1, only works with swig version  >= 1.3.37
@@ -22,7 +29,8 @@
 SWIG_SHARED_PTR(cell_integral,ufc::cell_integral)
 SWIG_SHARED_PTR(exterior_facet_integral,ufc::exterior_facet_integral)
 SWIG_SHARED_PTR(interior_facet_integral,ufc::interior_facet_integral)
+#endif
+#endif
 
 %include ufc.h
 
-#endif

---

From: "Johannes Ring" <[email-masked]>
Date: Wed, 14 Jan 2009 10:08:45 +0100 (CET)

> and check if the result is 0 or 1.

A little side not: You are aware that Boost does not come with a
pkg-config file? Therefore, setup.py should probably look for BOOST_DIR
and generate a pkg-config file for Boost.

Johannes

---

From: Johan Hake <[email-masked]>
Date: Wed, 14 Jan 2009 11:00:42 +0100

> and generate a pkg-config file for Boost.

Well I would say that that was not a _litle_ side note, but quite a big 
one. :)

So what do you suggest? Should I first look for BOOST_DIR for all platforms, 
if this is not set I will assume failure for darwin, and procede with 
pkg-config test for the other platforms? 

I do not intend to create a boost.pc file though. DOLFIN is a large library 
with a complicated build system. It is natural that DOLFIN creates a 
pkg-config file for what it needs. UFC is a small "library" which should just 
install if it finds what it needs.

A setup.py file should preferable be small (or am I wrong here?), but this one 
gets larger and larger. Should I write the boost testing in a seperate 
module?

Johan

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 14 Jan 2009 10:13:45 +0000

> is not found, hopefully pleasing the buildbot.

It might please the buildbot, but it doesn't please me ;). Now I get

*** Warning: Boost was not found. Python extension module compiled 
without shared_ptr support

and I do have Boost.

Garth

> ------------------------------------------------------------------------
>

---

From: Johan Hake <[email-masked]>
Date: Wed, 14 Jan 2009 11:30:05 +0100

On Wednesday 14 January 2009 11:13:45 Garth N. Wells wrote:
> > Attached is a patch that will install ufc without shared_ptr support if
> > boost is not found, hopefully pleasing the buildbot.
>

Ok, I suspect the mac buildbot also have boost and it also should recognize 
it.

I am on to it. Robust cross platform code development is not done in a few 
minutes :P

What system are you on?

Johan

>
> Garth
>
> > Can someone with better mac skill than me check why the test for boost
> > fails in the setup.py file? Currently I just do:
> >

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 14 Jan 2009 10:31:15 +0000

> I am on to it. Robust cross platform code development is not done in a few 

Ubuntu 8.10.

Garth

---

From: "Johannes Ring" <[email-masked]>
Date: Wed, 14 Jan 2009 11:46:41 +0100 (CET)

On Wed, January 14, 2009 11:00, Johan Hake wrote:
>> > boost
>> > fails

I would suggest to not use pkg-config to get information about Boost. What
about something like this:

boost_dir = os.getenv("BOOST_DIR", "/usr")
boost_is_found = False
for inc_dir in ["", "include"]:
    if os.path.isfile(pjoin(boost_dir, inc_dir, "boost", "version.hpp")):
        boost_inc_dir = pjoin(boost_dir, inc_dir)
        boost_is_found = True
        break

if boost_is_found:
   ...
else:
   ...

?

Johannes

---

From: Johan Hake <[email-masked]>
Date: Wed, 14 Jan 2009 11:54:25 +0100

On Wednesday 14 January 2009 11:46:41 Johannes Ring wrote:
> >> > Attached is a patch that will install ufc without shared_ptr support
> >>
> >> if
> >>
> >> > boost

Thanks! I will try that. Should the default include directory be different on 
a mac? Like:

  os.path.join(os.path.sep,"sw")

Johan

---

From: Ilmar Wilbers <[email-masked]>
Date: Wed, 14 Jan 2009 11:57:09 +0100

>   os.path.join(os.path.sep,"sw")
Using /sw/ as default instead of /usr/ for Mac is a good idea, I know 
that we have assumed a Fink installation to be present at this folder 
for some of the package-config generators as well.

ilmar