Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I keep getting the permission denial error: IOError: [Errno 13] Permission denied, when I try running making a function space.

I think it it something to do with the JIT compiler. Somehow, all the compiling is done in root and when it tries reading the permission is denied.

Here is the log of the error I get:

lento@lento-VPCF11C5E:~/Documents/Thesis/programs/navierstokes$ python 
Traceback (most recent call last):
  File "", line 104, in <module>
  File "/home/lento/Documents/Thesis/programs/navierstokes/", line 145, in __init__
  File "/home/lento/Documents/Thesis/programs/navierstokes/base/", line 129, in __init__
  File "/home/lento/Documents/Thesis/programs/navierstokes/base/", line 68, in __init__
    self.boundary_DOFCoordinates, self.boundary_VectorDOFIndex = boundary.locate_boundaryDOFs(self.mesh,self.boundaryDomains,3)     
  File "/home/lento/Documents/Thesis/programs/navierstokes/base/", line 125, in locate_boundaryDOFs
    V = dolfin.FunctionSpace(mesh, "CG", p)
  File "/usr/lib/python2.7/dist-packages/dolfin/functions/", line 403, in __init__
    FunctionSpaceBase.__init__(self, mesh, element, constrained_domain)
  File "/usr/lib/python2.7/dist-packages/dolfin/functions/", line 84, in __init__
    ufc_element, ufc_dofmap = jit(self._ufl_element)
  File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/", line 60, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/", line 122, in jit
    return jit_compile(form, parameters=p, common_cell=common_cell)
  File "/usr/lib/python2.7/dist-packages/ffc/", line 76, in jit
    return jit_element(ufl_object, parameters)
  File "/usr/lib/python2.7/dist-packages/ffc/", line 252, in jit_element
    compiled_form, module, form_data, prefix = jit_form(form, parameters)
  File "/usr/lib/python2.7/dist-packages/ffc/", line 179, in jit_form
    module = instant.import_module(module_name, cache_dir=cache_dir)
  File "/usr/lib/python2.7/dist-packages/instant/", line 156, in import_module
    return check_disk_cache(modulename, cache_dir, moduleids)
  File "/usr/lib/python2.7/dist-packages/instant/", line 113, in check_disk_cache
    lock = get_lock(cache_dir, modulename)
  File "/usr/lib/python2.7/dist-packages/instant/", line 81, in get_lock
    lock = open(os.path.join(cache_dir, lockname), "w")
IOError: [Errno 13] Permission denied: '/home/lento/.instant/cache/ffc_form_3d305e9085738f267ea73581b5f0769fda1e332d.lock'
share|improve this question

You shouldn't compile stuff as root. Compiling doesn't need root. root is only to install and if you are going to install in your $HOME directory you shouldn't use root since it's your $HOME, not root's. You should just change the permissions of the stuff you compiled as root.

sudo chwon -R $USER:$USER ~/.instant
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.