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

How do I fix "incompatible swig versions detected" error?

+2 votes

I just upgraded ubuntu from 13.10 to 14.04LTS. Now when I try to run fenics I get:

Exception: Incompatible swig versions detected. UFC swig version is not the same as extension module swig version: '2.0.10' != '2.0.11'

I've tried instant-clean to no avail. I dug through the code a little, and ended up hacking it. I changed the /usr/share/pyshared/ufc/ufc.py file and modified the second last statement to

__swigversion__ = "2.0.11" #"%d.%d.%d"%(tuple(map(int, [tmp[-5], tmp[-3], tmp[-2:]])))

but that seems like a less than ideal hack.

Any suggestions?

asked Apr 23, 2014 by ns-do FEniCS Novice (230 points)

3 Answers

+1 vote
 
Best answer

I had the same problem after upgrading to Ubuntu 14.04. Running instant-clean did not help, nor did the more drastic "rm ~/.instant". I therefore removed all the fenics related packages with

sudo dpkg --purge fenics dolfin-bin dolfin-doc libdolfin1.2 libdolfin1.3 libdolfin1.3-dev 
python-dolfin python-ffc python-ufc ufc ufc-doc

and then reinstalled them with

sudo apt-get update
sudo apt-get install fenics

This solved the problem for me.

answered May 23, 2014 by dnarnold FEniCS User (2,360 points)
selected May 26, 2014 by ns-do
+2 votes

I think you'll have to clean instant files:
Assuming you installed the development version:
go to the folder containing your clone of the instant repository and run

instant-clean

answered Apr 23, 2014 by stevenvdk FEniCS User (1,590 points)
0 votes

Run 'instant-clean' and re-install FFC (if you're using the dev version, UFC had been merged into FFC). Make sure you don't have an old version of UFC in your path. If you're using FEniCS 1.3, rebuild UFC.

answered Apr 23, 2014 by Garth N. Wells FEniCS Expert (35,930 points)

I installed fenics using the fenics PPA a described here:
http://fenicsproject.org/download/ubuntu_details.html

I tried removing and reinstalling hoping that ufc would rebuild using the latest swig, but no luck there. Looks like the fenics ppa is still at 1.3. I suppose I'll wait till the ppa gets updated. I suppose I could check out the dev version and build myself as well... but I'll just stick with my hack for now. :)

Thanks for the replies.

...