Closed francispoulin closed 6 years ago
Let me start by saying that while this library should work, I wouldn't recommend it for your class quite yet since there are some rough edges.
That said, huh. What operating system are you on? Did Pkg.build("FEniCS")
download and install FEniCS correctly?
I triggered CI to run again to see if the installation process through Conda changed at all. We'll see if there's a test failure.
Thanks for the advice. Since I know FEniCS very well I thought this might be an easy way to adapt other code but I will instead focus on the FEM examples that are already there.
I tried adding and building and it seems okay but the using fails.
I suppose that this is not pressing for me so please don't worry about it but maybe someone wants to worry about this, sometime.
julia> Pkg.add("FEniCS")
INFO: Package FEniCS is already installed
julia> Pkg.build("FEniCS")
INFO: Building Conda
INFO: Building PyCall
INFO: PyCall is using /home/fpoulin/.julia/v0.6/Conda/deps/usr/bin/python (Python 2.7.13) at /home/fpoulin/.julia/v0.6/Conda/deps/usr/bin/python, libpython = /home/fpoulin/.julia/v0.6/Conda/deps/usr/lib/libpython2.7
INFO: /home/fpoulin/.julia/v0.6/PyCall/deps/deps.jl has not changed
INFO: /home/fpoulin/.julia/v0.6/PyCall/deps/PYTHON has not changed
INFO: Building FEniCS
Warning: 'conda-forge' already in 'channels' list, moving to the top
julia> using FEniCS
ERROR: LoadError: LoadError: PyError (ccall(@pysym(:PyImport_ImportModule), PyPtr, (Cstring,), name)
The Python package mshr could not be found by pyimport. Usually this means
that you did not install mshr in the Python version being used by PyCall.
PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package. To install the mshr module, you can
use `pyimport_conda("mshr", PKG)`, where PKG is the Anaconda
package the contains the module mshr, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).
Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python. As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.
) <type 'exceptions.ImportError'>
ImportError('No module named mshr',)
Stacktrace:
[1] pyerr_check at /home/fpoulin/.julia/v0.6/PyCall/src/exception.jl:56 [inlined]
[2] pyerr_check at /home/fpoulin/.julia/v0.6/PyCall/src/exception.jl:61 [inlined]
[3] macro expansion at /home/fpoulin/.julia/v0.6/PyCall/src/exception.jl:81 [inlined]
[4] pyimport(::String) at /home/fpoulin/.julia/v0.6/PyCall/src/PyCall.jl:374
[5] include_from_node1(::String) at ./loading.jl:569
[6] include(::String) at ./sysimg.jl:14
[7] include_from_node1(::String) at ./loading.jl:569
[8] eval(::Module, ::Any) at ./boot.jl:235
[9] _require(::Symbol) at ./loading.jl:483
[10] require(::Symbol) at ./loading.jl:398
while loading /home/fpoulin/.julia/v0.6/FEniCS/src/jmesh.jl, in expression starting on line 467
while loading /home/fpoulin/.julia/v0.6/FEniCS/src/FEniCS.jl, in expression starting on line 35
What operating system?
The issue is that it seems FEniCS
never installs, since mshr
is part of FEniCS. Our CI just ran and passed so that's a yes that Ubuntu works, but there might be issues even on other distros (I have some issues on CentOS).
Since I know FEniCS very well I thought this might be an easy way to adapt other code but I will instead focus on the FEM examples that are already there.
I will say that our FEM tools are vastly underdeveloped. We need work before it's ready for wide use. The specific case for Poisson and Heat equations is fine but even that needs an overhaul. The goal is to re-write that with a FEniCS backing, but of course we need to figure out how to make it more robust before doing so.
I am running this on Ubuntu. This is not the one you install using apt-get, since that seemed to be discouraged and only gave version 0.4.0. I downloaded the tar.gz and unpacked that. This gives me 0.6.0. It occurs to me that I should probably have used git since that would make updating easier.
Since I will probably reinstall it please let me know what you suggest and I can go that route.
The fact that there are FEM tools is a pretty great starting point. For my class just using those examples with non-rectangular geometries would be enough. I would be keep to contribute to the FEM part of Julia, assuming that I can figure out how things are set up, and how you would like things to be organized. Maybe a discussion better to have elsewhere?
Maybe a discussion better to have elsewhere?
Feel free to spark up this conversation. There's a lot to discuss in PDE land.
https://discourse.julialang.org/ https://gitter.im/JuliaDiffEq/Lobby
Hi Francis,
I tried your steps on a fresh installation of Ubuntu 16.04 , and came across the exact same errors. (including mshr missing, and upon installation not identifying the function calls to UnitSquareMesh etc). I proceeded to download fenics independently, and everything seems to be fixed, which seems to indicate an error with the Conda distribution of fenics. I do not know why this is. I will investigate further, and try to come up with a fix. In the meantime, if you have another fenics installation on your system, you should be able to use that alongside the package.
Thank you @ysimillides for looking into this.
I do have fenics installed and can run that easily enough. Please let me know if/when you wanted me to do some testing.
FEniCS seems to break their Conda distribution quite often. Could it be smart to pin it to one we know works?
Confirmed not working on latest OS X with 100% clean installation of latest Julia.
@pyimport fenics
also fails, with error ImportError('No module named _common',)
.
And FEniCS installed correctly? It's probably worth trying on the FEniCS docker.
Absolutely no errors during Pkg.build()
. I also tried Conda.add("fenics")
which ran without indicating any kind of errors.
To add: this is directly after downloading latest Julia 0.6.2 from the site, and after running rm -rf .julia
to clear any residual packages from old installation.
'No module named _common'
indicates a problem finding the binary, so I would be surprised if it wasn't an installation issue. It could be a versioning issue: FEniCS silently updated in a breaking way before. We should give this a try on the FEniCS docker where we know it's installed correctly, point to the system Python on there, and see if that works no hassle. I don't think that the FEniCS Conda installation is reliable cross-platform, at least from our tests so far.
The problem may be different: I just tried re-running everything from scratch and @pyimport fenics
works. However, using FEniCS
does not, because @pyimport mshr
fails instead. The error is that the package is not installed, which I can confirm by running Conda.list()
. Running Conda.add("mshr")
causes Conda to downgrade a bunch of fenics
-related packages, and still does not load mshr
, this time complaining that libopenblasp-r0.2.19.dylib
is not loaded. This also breaks @pyimport fenics
once run.
Yeah, that's this whole Conda distribution problem. Instead of using the Conda distribution to give an auto-installation, I am wondering if it's easier to just instruct people to install Julia on the FEniCS Docker. It's a bit inconvenient but I'm curious whether that would give a no-hassle installation, since I'm not sure this FEniCS Conda installation can be trusted.
All we do is call Conda to install, and that broke twice over the last year and now has seemingly stayed broken. There's not much we can do differently with that route (it's literally just calling Conda.add
on their conda-forge distribution), and it doesn't seem to be well-supported enough to be a good target.
Hi @aterenin,
Unfortunately we as chris mentioned, we rely on the Conda distribution for installation, and this doesn't always seem to be the most stable way (eg the build is now passing, whereas with no changes a few days ago it wasn't...) . If you have a different FEniCS installation you should be able to get the package working. I don't have any personal experience on mac OS, but I shall commandeer one soon, and let you know if after the FEniCS installation is managed, whether the wrapper is usable.
The fundamental problem here is that mshr
version 2017.2.0
- which is not included with the fenics
package - is not available on conda-forge
, and that fenics
version 2017.1.0
is broken on Mac.
Does anyone know where to obtain a newer version of mshr
?
I don't think anyone else in the thread is using a Mac. I should try to get my hands on one for this.
Hello,
I've finally got my hands on a mac, and ran the steps from a fresh Julia install. I'm noticing the same errors related to the mshr package. I will alter the source code to take into account this ( it is only needed to create some geometries, so not strictly necessary to solving the FEM problems...) , and then hopefully it should be okay to use.
Regards, Yiannis
I have the same issues as OP. On macOS, Julia 0.6.2, everything up-to-date.
Pkg.build("FEniCS")
didn't show any error.
using FEniCS
fails as in OP.
julia> Pkg.status("FEniCS")
- FEniCS 0.0.2
Oh, we merged the change but didn't release it. I'll go tag it right now.
Do a Pkg.update and try again @cmey . I just merged the new tag with @ysimillides 's fixes.
OK yes using FEniCS
works now!
Thank you 👍
Good to hear!
after even installing fenics 2017.2.1 and with that installing the library mshr 2017.2. I am not able to import the library mshr?? what could be the reason ??
Sorry for asking so many questions is so many different packages of Julia but I have one more to throughout there.
First, I think it's pretty exciting that Julia is trying to run FEniCS, and I am very keen to give this a try and maybe even contribute to it if I can.
I tried to add and build FEniCS, like I think was stated in the tutorial, but when I first tried "using FEniCS" I got an error.
It seemed to me that I should try installing mshr, which I tried but failed with the suggestion that I found in the error message.
Building PyCall seemed to help so that now I can do "using FEniCS" without any error. However, when I go to the next line in the tutorial I get an error.
Again, sorry for all the questions, but can someone maybe point me in the right direction? I realize that the FEM example might make this unnecessary but I thought I might be able to compare them and see which one works better for me.
Any thoughts would be greatly appreciated.