-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: updated installing.rst and various files it points to. #128
Conversation
…ify instructions for Fortran users
I read through and have some thoughts. I think the only one that I am particularly concerned about is instaling using the
|
Some responses to @mandli's list:
|
If our attitude is "pip install is broken", then the package shouldn't be on pypi. If the default install method "sometimes doesn't work", we should fix it. If the f2py compilation is taking more than a minute or two, then something is wrong. What I have seen is people running into trouble because the compiled code is in their site-packages and then they set PYTHONPATH to a directory where they cloned things (but didn't compile). In fact, it seems to me that the new instructions will actually leave users in this (BROKEN) state! Has anyone checked? I find the phrase "PyClaw Python interface" confusing; let's just say "PyClaw solvers". It should also be pointed out that the PyClaw-only installs does install visclaw; can we change the title to "Install PyClaw and VisClaw"? Also, it does let you run the classic algorithms, whereas the new wording seems to imply that it does not. Since PyClaw also consists of Fortran and Python, it may be clearer to change "Install Fortran packages and Python tools" to "Install Classic, AMRClaw, GeoClaw, and VisClaw" |
We really need to sort out the PYTHONPATH / pip issues. It's clear PyClaw users and GeoClaw users run into somewhat orthogonal sets of problems. I've been working with several people who need to (a) easily download and install GeoClaw without ever planning to use PyClaw and (b) update to a more recent version while keeping the old one(s) around for validation comparisons, with the ability to run the code (and use Python tools) from either one. What's the recommended way to do this if you've done a pip install? I don't think I'd be very happy to get rid of setting PYTHONPATH if there's a better mechanism for switching environments. Should we suggest that everyone use conda environments, for example? (And use conda install instead of pip install?) |
You can pip install any version you wish; you can even pip install a specific commit from Github. Does that solve the problem? If not, can you explain why not? Ah, I forgot that you want to run different versions simultaneously in different terminals. Is that really a good idea, from the point of view of provenance and reproducibility? And do we want the default install instructions to be altered to accommodate that? It seems like something we might want to discourage except in the case of expert users, since it could lead to a lot of difficulty in troubleshooting problems. I think virtualenv is considered the proper way to accomplish what you're looking for, but I've found virtualenv to be hard to work with in the past. Another possibility is the use of conda environments, but I haven't tried that. |
@ketch: That's great, wish I'd known about it years ago! Or more likely someone told me this and it went in one ear and out the other. At any rate, it's not documented at all in our installation instructions, but we can rectify that. Here's what I've figured out playing around with it a bit. Does this sound right?
will create a directory Fortran users should set Installing a different version, e.g. via:
will simply check out a different commit in that same directory and run To switch to my own clone where I do development work, I can do, e.g:
which resets This seems pretty clean and avoids the need for setting What this doesn't allow, as @ketch points out, is running different versions in different shells simultaneously for dual-debugging. But that's perhaps a special case we should deal with in other ways, e.g. by using conda environments. Here's a little bash function that may be handy to figure out where things point:
Of course it's easy to write functions to simplify switching versions too. |
I don’t understand much of this, but it’s not just for dual debugging that 2 versions are needed. I do production runs using one version of clawpack, develop in another, at the same time. Sometimes two different version are running and I”m testing a third. Will this permit that? — Marsha On Jul 5, 2016, at 4:49 PM, Randall J. LeVeque notifications@github.com wrote:
|
@berger: For such things it might be best to use conda environments or virtualenv, or just stick with setting CLAW and PYTHONPATH as we do now. Changing what we recommend to users wouldn't preclude doing this. |
@mjberger FWIW I have for awhile used virtualenv to do testing with different environments at the same time and it should be straightforward to do what you need. In the background |
Once I tried this on another computer I noticed a mistake in my notes above -- the
I've also been experimenting with this in notebooks served via binder. It seems to work as a way to run the Fortran code on a cloud server, since installing with Binder is pretty cool in general. I've also used it successfully with some other non-clawpack repositories, e.g. and it seems like a good way to distribute experiments people can run without having to install anything. Note: The
|
The gfortran problem on binder is due to an incompatibility in numpy, and the notebooks work fine if you install an earlier version via the following command in a notebook cell as a temporary hack:
|
Which version of gfortran is causing the problem and which does this switch it to? |
It installs version 1.x in place of 3.x. See |
Wow, this is a much more complex issue than I was imagining! Hopefully something concrete will happen. |
On Tuesday, @rjleveque and I went through some installation tests and found a procedure that seemed to work well (both the Fortran codes and PyClaw work fine) with no need to set PYTHONPATH. We both felt that it would make sense to give that as the default install instructions for everyone and avoid having different instructions for pyclaw versus fortran users. If I remember correctly, the install command is
(the version tag will have to be updated whenever there is a release). Then PyClaw users are done and Fortran code users simply need to set their CLAW variable, unless I'm forgetting something. |
Yes, I think that's correct. The The one thing we didn't figure out is how to specify where this source code should be left. In an earlier comment I said it ends up in |
Did you try the |
Great, that seems to work!
It looks like you can also add the flag I found the documentation at https://pip.pypa.io/en/stable/reference/pip_install/#description |
On my brand new machine running 10.11.6 the following steps produced a successful Clawpack installation with all nose tests passing all packages (checking out master as is today). This would be for a developer's build.
|
@mandli Thanks; but I think the step where you clone clawpack is missing? |
@ketch No wonder the tests all worked before :) Fixed it. |
Probably a stupid question, but here goes: for the Fortran package tests to pass, don't you also need to set CLAW and compile other things? In any case, for the generic install instructions we probably want to suggest what you worked out earlier:
as the clone+install command. |
Thanks, missed that one too. |
Note that my latest attempt at instructions can be viewed at |
I think it looks pretty good although I have some comments:
|
…her than ssh version
@mandli: what do you recommend for gfortran on the Mac? Is just pointing to https://gcc.gnu.org/wiki/GFortran sufficient for these instructions, without recommending anything different for Mac? |
The largest drawback to installing this way is that it is very difficult to upgrade if you would ever like to. I would say we suggest this over the old HPC page though. |
For now I'm going to merge this in since it's already showing up live in our webpages and I want to merge in some other things. We can tweak further on a new PR if needed. |
Tried to simplify instructions for Fortran users.
This draft version now appears at
http://www.clawpack.org/installing.html
For comparison, the old is at
http://www.clawpack.org/installing_old.html
Suggestions welcome.
Are the PyClaw instructions still ok?