matthewd139 / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

installation instructions for OSX (homebrew) incomplete #254

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Follow installation instructions on 
http://cantera.github.io/docs/sphinx/html/install.html without prior exposure 
to cantera and a fresh install of homebrew (e.g. students in a combustion class)

What is the expected output? What do you see instead?

- Expected behavior would be flawless installation. Instead, neither 
installation for python 2.7 nor python 3.4 works 'out of the box'.

What version of the product are you using? On what operating system?

- Cantera 2.1.2 on OSX (Yosemite)

Please provide any additional information below.

- for python 2.7 instructions, there is a critical line missing: "easy_install 
pip" before pip is usable

- an attempt to use python3 instead fails at the installation of cantera, where 
it is not clear what flags need to be provided to force usage of python3. If 
one attempts to just run "brew install cantera", the following error appears:

$ brew install cantera

==> Installing cantera from homebrew/homebrew-science

cantera: Unsatisfied dependency: cython

Homebrew does not provide Python dependencies; install with:

  pip install cython

Error: An unsatisfied requirement failed this build.

As an aside for windows installation: there is a stumbling block in the numpy 
installation, where executables are no longer provided. Instead, it requires 
installation of "wheels". It would be helpful if instructions for Cantera would 
include the following after downloading the .whl file:

cd C:\Python34\Scripts
pip install "C:\Users\<yourname>\Downloads\numpy-<appropriate_version>.whl"

Original issue reported on code.google.com by ischo...@gmail.com on 25 Feb 2015 at 4:06

GoogleCodeExporter commented 8 years ago
"easy_install pip" should not be necessary, as the version of Python installed 
by Homebrew comes with pip. Running 'easy_install pip' will install pip for the 
system Python, which is not what these build instructions are for.

I realize that there is a formatting error in the instructions -- the step 
after installing Homebrew should be to run the following three commands:

      brew tap homebrew/science
      brew update
      brew install python scons sundials

But these are not displayed with the correct formatting. Did you run these 
commands? Does running these before trying to install Cantera fix the problems?

What error do you get trying to install the Cantera for Python 3? It should 
install automatically if you have the necessary prerequisites installed 
(python3 and the python3 versions of Numpy and Cython).

Original comment by yarmond on 25 Feb 2015 at 7:47

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I was able to install everything correctly, but this required the stated 
'easy_install pip'. Cantera did load from the python prompt when I stated 
'import cantera' so I assume I was successful. I did change the path as 
indicated so I believe I'm using homebrew's python, not the native one.
Apart from that, the cantera installation with python3 fails entirely.
Note: I usually don't use OSX, but was trouble-shooting for my students. 

Original comment by ischo...@gmail.com on 25 Feb 2015 at 7:57

GoogleCodeExporter commented 8 years ago
I tested this again on a Mac with a clean copy of OS X 10.10.2 and found that 
the following steps were sufficient to install Cantera for both Python 2 and 
Python 3:

    <install XCode from the app store>
    sudo xcode-select --install
    sudo xcodebuild -license
    <install homebrew>
    brew tap homebrew/science
    brew update
    brew install python scons sundials
    pip install cython numpy
    brew install python3
    pip3 install numpy cython
    brew install -v cantera

The only step not in the directions already is the extra step for the XCode 
EULA that Apple added at some point (and which the Homebrew installer will 
direct you to do anyway). 

The Homebrew installer for Python specifically mentions that it installs pip, 
so installing it with easy_install should not be required.

I did not find modifications to the path necessary, as apparently between 10.9 
and 10.10 Apple changed the default path order to list /usr/local/bin ahead of 
/usr/bin. You can confirm this by looking at the file /etc/paths. If your $PATH 
does not have the directories in /etc/paths in that order, then you may need to 
check your user-specific configuration files to see if they are modifying $PATH.

If you still find this set of steps to be inadequate, I would appreciate seeing 
the output from running all of these (up to the failure) on a clean OS X 
machine.

Original comment by yarmond on 25 Feb 2015 at 10:40

GoogleCodeExporter commented 8 years ago
Ray,

Thanks for looking into this. I was able to get a clean copy of OS X 10.10.2 
myself, and can verify that the updated instructions are mostly ok. The only 
issue I ran into was right before the last step (cantera), when I had to 'brew 
link --overwrite scons'.

Retracing my previous installation steps, I believe that it wasn't sufficiently 
clear to me that cantera on OSX *requires* python 2, even if you're just 
intending to use python 3 (this explains the original error I reported, as I 
had skipped the python 2 packages). This is different from the windows version 
(that I had just tested before), where you need to choose which one. Linux is a 
different matter, but I guess it has the same dependencies as OSX (for legacy 
reasons, I'm still mostly on python 2 there, so I never realized this 
dependency).

I'd still ask you to update the current instructions, as I can report that a 
'field test' of having students just follow the online steps failed (and not 
being used to homebrew, it even threw me for a loop despite having installed 
cantera dozens of times on linux over the past ten years). As a personal 
opinion, I'd recommend omitting all flags (including -v) from a default 'brew 
install cantera' and explain options separately. There will always be people 
that are new to command line tools and keeping it simple is a plus.

Finally, as pointed out in my initial report, even the windows installation 
changed: there is no longer an 'installer' (executable) for numpy. So the 
instructions should be updated here as well. Now, it requires installation of 
"wheels". It would be helpful if instructions for Cantera windows installation 
would include the following after downloading the .whl file:

cd C:\Python34\Scripts
pip install "C:\Users\<yourname>\Downloads\numpy-<appropriate_version>.whl" 

As always, thanks for all the work you're putting into maintaining cantera. 

Original comment by ischo...@gmail.com on 26 Feb 2015 at 1:28

GoogleCodeExporter commented 8 years ago
The need to run 'brew link --overwrite scons' suggests that a copy of SCons had 
already been installed in /usr/local, so perhaps that was not a totally clean 
installation. I think users will have to consult the Homebrew documentation if 
any issues arise in installing the prerequisites.

The difference with OS X and Windows is that on OS X you are compiling Cantera 
from source, so you need all the build dependencies, which include Python 2, 
Scons, and Cython. I don't think there's anything in the instructions that 
suggests that any of these are optional, but further clarifying this in the 
instructions wouldn't hurt.

I included '-v' in the list above just because if there was an error in Cantera 
installation, the verbose logs would be helpful in diagnosing the cause. Are 
there any other options which are not adequately described in the instructions?

Thank you for pointing out the change in how the pre-compiled Windows packages 
are being distributed from Christoph Gohlke's repository. I haven't had to 
reinstall Python on a Windows system recently, so I was unaware of this 
packaging change, and an update to the instructions is certainly warranted.

Original comment by yarmond on 26 Feb 2015 at 2:29

GoogleCodeExporter commented 8 years ago
Ray,

... the OSX was a 'fresh' update from 10.9, so it could be that scons had 
persisted from there. However, I am positive that homebrew hadn't touched the 
system before.

The difference between windows installer and OSX makes sense, but it's not 
entirely obvious why the cantera compilation toolchain requires both versions 
of python (other than perhaps for historic reasons). 

Please take this feedback with a grain of salt: I usually can work around these 
issues, but facing a class with 15+ students, most of which had trouble 
installing cantera, points out that instructions aren't clear in their current 
form.

Original comment by ischo...@gmail.com on 26 Feb 2015 at 2:55

GoogleCodeExporter commented 8 years ago
Homebrew may not have touched the system before, but SCons could have been 
manually installed in /usr/local (i.e. from previously attempting to build 
Cantera).

Python 2 is required because SCons uses Python 2 and has not yet been updated 
to work with Python 3. When SCons is eventually updated to work with Python 3, 
it should be possible to update the Cantera build scripts to work with either.

Suggestions for improvements to the installation instructions are always 
welcome.

Original comment by yarmond on 26 Feb 2015 at 3:08

GoogleCodeExporter commented 8 years ago
Thanks for your explanations: I wasn't aware of scons not supporting python 3 
yet. Based on my observations, most students were ok with the Windows 
installation after I provided instructions on how to deal with the .whl files. 
Everyone got stumped with the OSX installation, hence my report.

Original comment by ischo...@gmail.com on 26 Feb 2015 at 3:21

GoogleCodeExporter commented 8 years ago
Here is a draft of some updates to the instructions for installing on OS X and 
Windows:

    https://github.com/Cantera/cantera/blob/doc-work/doc/sphinx/install.rst

Please let me know if these address the issues or whether there are any 
modifications you would suggest.

Original comment by yarmond on 26 Feb 2015 at 7:13

GoogleCodeExporter commented 8 years ago
Thank you, it is definitely improved. To further enhance, I'd suggest to add 
some explanations and number installation steps. I am attaching what I just 
posted for my class.

Original comment by ischo...@gmail.com on 26 Feb 2015 at 10:21

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r3414.

Original comment by yarmond on 28 Feb 2015 at 12:24