wolfv / pyjet

JET is a different approach to make numeric python substantially faster
Other
67 stars 5 forks source link

Standard installation instructions with conda #7

Open rth opened 7 years ago

rth commented 7 years ago

This is a quite nice project! A significant chalenge for testing it is that the current installation instructions are not very standard for the Python ecosystem and require to compile a number of dependencies.

As far as I could tell, all the dependencies could be installed with conda (into a separate virtual environement) using,

conda config --append channels conda-forge  # just once
conda create -n pyjet-env armadillo clangdev numpy networkx graphviz python=2.7
source activate pyjet-env
conda install python-graphviz  # for some reason adding this package during the virtualenv
                               # creation pulls python 3.6 instead of 2.7

cd pyjet/
python setup.py develop

which should work on Linux and MacOS. Maybe these would be simpler?

The first code snippet in the readme is not runnable since it requires the non included simulation_model package..

Then I tried to run the decorator example (it should be from jet.jit import jit BTW) but the compilation failed,

In [2]: from jet.jit import jit
   ...: import numpy as np
   ...: 
   ...: @jit((2,), ()) # or @jit, @jit()
   ...: def calc(a, b):
   ...:     c = a + b
   ...:     return c
   ...: 
   ...: print(calc(np.array([1, 2]), 2))
   ...: 
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/tmp/tmpRbEBuV/_ipython_input_2_5e1a62156496___module__calc.cpp:5:21: fatal error: armadillo: No such file or directory
compilation terminated.
An exception has occurred, use %tb to see the full traceback.

SystemExit: error: command 'gcc' failed with exit status 1

/home/rth/.miniconda3/envs/pyjet-env/lib/python2.7/site-packages/IPython/core/interactiveshell.py:2889: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)

I imagine it's not able to find the armadillo headers, which in this case should be in ${HOME}/miniconda3/pkgs/armadillo-7.800.1-blas_openblas_200/ (or some similar folder)?

wolfv commented 7 years ago

Hi @rth, thanks for the nice words!

You're right, we should be working on making the installation process smoother. A conda-forge package seems to be a good idea.

In the meantime, did you python setup.py install and jet --install-dependencies? With the second command, armadillo should be installed in the correct location.

Cheers,

Wolf

rth commented 7 years ago

You're right, we should be working on making the installation process smoother. A conda-forge package seems to be a good idea.

Well even, before creating a conda-forge package, specifying a the commands to install the dependencies in a platform independent way would help.

In the meantime, did you python setup.py install and jet --install-dependencies? With the second command, armadillo should be installed in the correct location.

Aww, right I didn't see that you are bundling Armadillo under third party packages. Tried that, but I'm not using a Debian based Linux so all the apt-get commands fail in my case..

However, installing the dependencies in the conda virtualenv then running

python jet/post_install/install_armadillo.py

does work for me..