DOLFIN doesn't compile on OS X Lion

Bug #941039 reported by Harish Narayanan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dorsal
Fix Committed
High
Harish Narayanan

Bug Description

I am running into the attached problem when trying to build FEniCS on OS X Lion with Xcode 4.3. Does anyone recognise where I should start looking?

Moving to this latest Xcode updated compilers and moved them around the file system, which I believe must be causing the problem.

Revision history for this message
Harish Narayanan (hnarayanan) wrote :
Revision history for this message
L Olson (l-olson) wrote :

macports does not support XCode 4.3. They suggest using Xcode 4.2 (or 4.1) on Lion:
http://www.macports.org/install.php

That could be the issue.

I did see a possible fix here in the comments:
http://mandogmachine.com/2012/02/xcode-4-3-breaks-macports/

sudo xcode-select -switch /Applications/Xcode.app
sudo ln -s /usr/bin/clang /Applications/Xcode.app/Contents/Developer/usr/bin/clang
sudo ln -s /usr/bin/clang++ /Applications/Xcode.app/Contents/Developer/usr/bin/clang++

But I haven't tried it.

Revision history for this message
L Olson (l-olson) wrote :

Also, I had the same errors that you found when I was at Xcode 4.3. So I reverted (before finding the link above).

Revision history for this message
Harish Narayanan (hnarayanan) wrote :

I had arrived at a similar fix for MacPorts and documented it here: https://plus.google.com/u/0/100382636415340600164/posts/U9mMqX9tGJu

The thing is that MacPorts now works, and all the ports I have tried with it since then build. Something else---perhaps boost or the strictness of the compilers---has been changed.

Revision history for this message
L Olson (l-olson) wrote :

I think it has something to do with python and swig (and boost?). When I went through a fresh macports (no errors, btw) with XCode 4.3 using the latest dorsal pull, the C++ examples worked fine in demos directory. It was the python that kept breaking (with instant.recompile errors).

Revision history for this message
L Olson (l-olson) wrote :
Revision history for this message
L Olson (l-olson) wrote :

Ok, so I did a clean wipe. Xcode 4.2, fresh macports, and the latest dorsal pull. cpp demos are fine, python demos still fail with

 python demo_poisson.py <178>
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling DOLFIN just-in-time (JIT) compiler, this may take some time.
In instant.recompile: The module did not compile, see '/Users/lukeo/.instant/error/dolfin_compile_code_e1943bf019544ac3d18ab9b095c465ab/compile.log'
Traceback (most recent call last):
  File "demo_poisson.py", line 54, in <module>
    f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")
  File "/Users/lukeo/Work/FEniCS/lib/python2.7/site-packages/dolfin/functions/expression.py", line 478, in __new__
    cpp_base, members = compile_expressions([cppcode])
  File "/Users/lukeo/Work/FEniCS/lib/python2.7/site-packages/dolfin/compilemodules/expressions.py", line 188, in compile_expressions
    code_snippets), classnames)
  File "/Users/lukeo/Work/FEniCS/lib/python2.7/site-packages/dolfin/compilemodules/expressions.py", line 126, in compile_expression_code
    dolfin_module_import=["function", "mesh", "common"])
  File "/Users/lukeo/Work/FEniCS/lib/python2.7/site-packages/dolfin/compilemodules/jit.py", line 66, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/Users/lukeo/Work/FEniCS/lib/python2.7/site-packages/dolfin/compilemodules/compilemodule.py", line 474, in compile_extension_module
    **instant_kwargs)
  File "/Users/lukeo/Work/FEniCS/lib/python2.7/site-packages/instant/build.py", line 492, in build_module
    recompile(modulename, module_path, setup_name, new_compilation_checksum)
  File "/Users/lukeo/Work/FEniCS/lib/python2.7/site-packages/instant/build.py", line 115, in recompile
    "compile, see '%s'" % compile_log_filename_dest)
  File "/Users/lukeo/Work/FEniCS/lib/python2.7/site-packages/instant/output.py", line 49, in instant_error
    raise RuntimeError(text)
RuntimeError: In instant.recompile: The module did not compile, see '/Users/lukeo/.instant/error/dolfin_compile_code_e1943bf019544ac3d18ab9b095c465ab/compile.log'

The compile.log file is posted above. Again, it seems that it's boost...

Revision history for this message
Harish Narayanan (hnarayanan) wrote :

I've fixed support for Xcode 4.3. Also, to fix your pydolfin problems, make sure

export CC=/usr/bin/gcc
export CXX=/usr/bin/g++

are set before running the Python demos.

Changed in dorsal:
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → Harish Narayanan (hnarayanan)
Revision history for this message
L Olson (l-olson) wrote :

Ok, that fix worked for me.

One note, when I updated the latest macports, vtk5 is broken on Lion, so I had to follow this hack: https://trac.macports.org/ticket/33465

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.