# Import dolfinx Illegal instruction

**URL:** <https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627>\
**Category:** dolfinx\
**Created:** [March 12, 2020, 8:53am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627 "2020-03-12T08:53:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwshunan](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/wwshunan/32/852_2.png) [@wwshunan](https://fenicsproject.discourse.group/u/wwshunan)\
**Post date:** [March 12, 2020, 8:53am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/1 "2020-03-12T08:53:10Z")

</div>

Hi all, I pulled dolfinx in WSL2 and tried to import dolfinx. It reported “IIIegal instruction”.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [March 12, 2020, 8:57am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/2 "2020-03-12T08:57:23Z")

</div>

To be able to help you with this, I would have to have some more information. First, could you start the newly pulled docker image?  
Secondly, could you give me the full terminal print out of what you called to get this error, for instance, what happens if you call:  
`python3 -c "import dolfinx"`

---

<div class="post-metadata">

**Author:** ![wwshunan](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/wwshunan/32/852_2.png) [@wwshunan](https://fenicsproject.discourse.group/u/wwshunan)\
**Post date:** [March 12, 2020, 9:18am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/3 "2020-03-12T09:18:54Z")

</div>

Hi dokken, the output is:

```
 Windows Terminal

wws@wws-PC:/mnt/e/Worksapce/fenics$ sudo docker run -ti -v $(pwd):/home/fenics/shared -w /home/fenics/shared/ --rm dolfi
nx/complex
root@49a0f1ba5470:/home/fenics/shared# python3
Python 3.7.5 (default, Nov 20 2019, 09:21:52)
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dolfinx
Illegal instruction
root@49a0f1ba5470:/home/fenics/shared# ipython
Python 3.7.5 (default, Nov 20 2019, 09:21:52)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.
```

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [March 12, 2020, 9:40am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/4 "2020-03-12T09:40:47Z")

</div>

Before today, when was the last time you pulled the docker image? There hasnt been many changes to the [Dockerfile](https://github.com/FEniCS/dolfinx/commits/master/docker/Dockerfile) in the last weeks, so Im having issues pointing to a specific change that can have caused this.

---

<div class="post-metadata">

**Author:** ![wwshunan](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/wwshunan/32/852_2.png) [@wwshunan](https://fenicsproject.discourse.group/u/wwshunan)\
**Post date:** [March 12, 2020, 9:49am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/5 "2020-03-12T09:49:33Z")

</div>

Hi, dokken. I pulled the image today in another computer under linux subsystem on windows. I never pulled images on this computer before.

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [March 12, 2020, 10:03am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/6 "2020-03-12T10:03:59Z")

</div>

To me it seems like an issue with the computer you are using. See for instance: [https://discuss.mxnet.io/t/illegal-instruction-python3-6-and-mxnet-1-4/3418/9](https://discuss.mxnet.io/t/illegal-instruction-python3-6-and-mxnet-1-4/3418/9).

---

<div class="post-metadata">

**Author:** ![wwshunan](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/wwshunan/32/852_2.png) [@wwshunan](https://fenicsproject.discourse.group/u/wwshunan)\
**Post date:** [March 12, 2020, 11:01am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/7 "2020-03-12T11:01:33Z")

</div>

dokken, is there a detailed specification on how to compile the dolfinx complex version from source under Ubuntu 18.04?

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [March 12, 2020, 11:24am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/8 "2020-03-12T11:24:26Z")

</div>

The [Dockerfile](https://github.com/FEniCS/dolfinx/blob/master/docker/Dockerfile) is a line by line instruction on how to install dolfinx on ubuntu 19.04 (with sudo privileges).  
So in theory you could follow this line by line.

However, I would first test if you can run the old docker images in your docker container (like [quay.io/repository/fenicsproject/stable](http://quay.io/repository/fenicsproject/stable)) to see if there is an issue with docker or dolfinx.

---

<div class="post-metadata">

**Author:** ![wwshunan](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/wwshunan/32/852_2.png) [@wwshunan](https://fenicsproject.discourse.group/u/wwshunan)\
**Post date:** [March 12, 2020, 11:43am UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/9 "2020-03-12T11:43:18Z")

</div>

dokken, your last link is dolfin and I can import it

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [March 12, 2020, 12:14pm UTC](https://fenicsproject.discourse.group/t/import-dolfinx-illegal-instruction/2627/10 "2020-03-12T12:14:41Z")

</div>

What I can then suggest is that you use the Dockerfile link above, build the image on your computer using `docker build`, and go backwards in the docker history until you hit the commit that doesnt work for you. Then we can look at the changes in between the images and see if there is an easy fix.
