This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Compilation fails after installing FEniCS on Anaconda

0 votes

Hi All,

I want to use FEniCS on my Mac (MacOS Sierra Version 10.12.4).

I installed Anaconda (Python 2.7) and then used

conda create -n fenicsproject -c conda-forge fenics

to install fenics as suggested on https://fenicsproject.org/download/

I then tried a the follwing code as a test:

from dolfin import *
# geometry
xlength=500.0 #[mm]
ylength=100.0 #[mm]
zlength=100.0 #[mm]
mesh=BoxMesh(Point(0.0, 0.0, 0.0),Point(xlength, ylength, zlength), 50, 10, 10)
# vector space with polynomial degree 1
V = VectorFunctionSpace(mesh,'P',1)
# element surfaces
cells = CellFunction('size_t',mesh)
facets = FacetFunction('size_t',mesh)
dA = Measure('ds', domain=mesh, subdomain_data=facets)
dV = Measure('dx', domain=mesh, subdomain_data=cells)
# surface for bc
left = CompiledSubDomain('near(x[0],0) && on_boundary')
right = CompiledSubDomain('near(x[0],length) && on_boundary',length=xlength)
# marking the parts of the surface
facets.set_all(0)
# integrating over dA(1) shall mean a surface integral over the domain 'right'
right.mark(facets,1)
# traction vector
tr = Expression(('A+B*x[1]+C*x[2]','0','0'), A=2.0, B=0.5, C=0.5)# in Mpa
null = Constant((0.0,0.0,0.0))
# boundary conditions
bc = [DirichletBC(V,null,left)]
# definitions for the variational formulation
u = TrialFunction(V)
del_u = TestFunction(V)
# material parameters
nu = 0.3
E = 210000.0 # MPa
G = E/(2.0*(1.0+nu))
# lame parameters
l = 2.0*G*nu / (1.0 - 2.0* nu)
mu = G
# kronecker delta in 3D
delta = Identity(3)
# indices
i,j,k=indices(3)
# strain tensor
eps = as_tensor(1.0/2.0*(u[i].dx(j)+u[j].dx(i)),(i,j))
# Cauchy stress tensor
sigma = as_tensor(l*eps[k,k]*delta[i,j]+2.0*mu*eps[i,j],(i,j))
# variational form
a = sigma[j,i]*del_u[i].dx(j)*dV
L = tr[i]*del_u[i]*dA(1)
disp = Function(V)
solve(a==L, disp, bcs=bc)
# write out
file_u = File('beam.pvd')
file_u << disp

The problem is that the Compilation fails. I get the following information.

*** Error:   Unable to perform just-in-time compilation of form.
*** Reason:  ffc.jit failed with message:
Traceback (most recent call last):
  File "/Users/philippdiercks/anaconda2/envs/fenicsproject/lib/python2.7/site-packages/dolfin/compilemodules/jit.py", line 128, in jit
    result = ffc.jit(ufl_object, parameters=p)
  File "/Users/philippdiercks/anaconda2/envs/fenicsproject/lib/python2.7/site-packages/ffc/jitcompiler.py", line 198, in jit
    module = jit_build(ufl_object, module_name, parameters)
  File "/Users/philippdiercks/anaconda2/envs/fenicsproject/lib/python2.7/site-packages/ffc/jitcompiler.py", line 120, in jit_build
    generate=jit_generate)
  File "/Users/philippdiercks/anaconda2/envs/fenicsproject/lib/python2.7/site-packages/dijitso/jit.py", line 160, in jit
    header, source, dependencies = generate(jitable, name, signature, params["generator"])
  File "/Users/philippdiercks/anaconda2/envs/fenicsproject/lib/python2.7/site-packages/ffc/jitcompiler.py", line 76, in jit_generate
    dep_module_name = jit(dep, parameters, indirect=True)
  File "/Users/philippdiercks/anaconda2/envs/fenicsproject/lib/python2.7/site-packages/ffc/jitcompiler.py", line 204, in jit
    raise FFCJitError("A directory with files to reproduce the jit build failure has been created.")
FFCJitError: A directory with files to reproduce the jit build failure has been created.
.
*** Where:   This error was encountered inside jit.py.
*** Process: 0
*** 
*** DOLFIN version: 2016.2.0
*** Git changeset:  
*** -------------------------------------------------------------------------

Abort trap: 6

Apparently the jitcompiler in the FFC fails. As I think the FFC is automatically installed with FEniCS and I don't see why there should be a problem, since I just followed the instructions and didn't change anything...

It also said that

FFCJitError: A directory with files to reproduce the jit build failure has been created.

but I don't know what to do with that...(sorry)

Thanks in advance,
Philipp

asked May 5, 2017 by philippdiercks FEniCS Novice (230 points)

1 Answer

0 votes

Hi I solved the problem. There may be people having the same issue, so here is the solution:

In the directory with files to reproduce the jit build failure was an error.log saying:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing 
xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Apparently this was a problem caused by a previous update to MacOSX "El Capitan".
see
https://www.sebastian-widmann.de/blog/invalid-active-developer-path-beheben/

just type

xcode-select --install

in the terminal

Cheers,
Philipp

answered May 6, 2017 by philippdiercks FEniCS Novice (230 points)
...