-
Notifications
You must be signed in to change notification settings - Fork 72
Distributing self contained versions of dolo
This page is currently about the two following usecases
- Mr G. wants to distribute dolo's compiler inside is own software so that users don't have any extra-installation to perform or a completely automatic one.
- Mr G. publishes a paper using dolo's compiler and wants to distribute dolo with the matlab code.
- Mr Z. uses the command-line verions
In the future, we also want to have some granularity w.r.t. to what is included in the archive. For instance we may need to some solution routine (implying linear algebra) or a simple GUI (pull qt)
There are three python software to distribute a compiled archive with everything inside: py2exe, cx_freeze and pyinstaller.
Quick comparison: ...TBD
py2exe has another advantage: it integrates itself with the distutils system (setup.py) that we are already using for package management
Currently, there is a setup_windows.py file included in dolo. There are still 3 more minor issues to solve:
- the selection of packages to include doesn't work very well (we would like to include only sympy/yaml). A variant of dolo (solo) was created with the sole target of avoiding this problem.
- the way we incorporate the windows dll that are used in the python environment is still computer specific
- for some reason the creation of a single archive doesn't work
Christophe has also used pyinstaller to create its own versions of dolo's compiler. Pyinstaller creates one executable file that runs perfectly on most Windows (Windows XP to Windows 8, in 32 and 64 bits). It includes all the packages and creates a large binary file (~11Mo).
cx_Freeze and Pyinstaller claim to have working solutions in that case. py2exe doesn't cover this case at all. Christophe uses Pyinstaller in RECS, but was not able to make it work on several machines. Question: is python supposed to be on the target machine ?
Here are some other options for the hosting project
- include dolo source tree and assume that people have sympy and yaml installed on their system. With a recent version of dolo there shouldn't be any big issue with that approach. End-users need to be friendly with their sysadmin. It is also possible to include sympy and pyyaml as the part we use in these libraries is implemented in pure python (no need to build files)
- use python package management to install all dependencies in the python environment. Not easy since there can potentially be many python environments and we need to deal with potential conflicts.
- use python's interpreter on the target to : 1/ create a virtualenv 2/ install dolo inside. This would be as simple as calling from an empty directory:
create_dolo_environment
and would create a full python environment with dolo installed. It looks very easy to implement and can probably be done in a cross platform way. Like the py2exe option above it requires to create an installation option in dolo to pull only the dependencies needed by the compiler. - assume wine is installed on the system and simply use the windows option. It works very well but it is not realistic that linux users will install wine for that purpose.
Comments: - option 1. is very easy and works now (nothing to be done). Using git submodule it is possible to include a specific commit of dolo. However end-users are required to install manually two dependencies: sympy and yaml . The manager of the hosting project needs to keep track of dolo development. (cf the new/old sympy story) - option 2. is quite easy for us and extremely easy for the end-user (except he needs to wait for the installation to proceed) - 2. and 4. look unrealistic to me - option 0. (pyinstaller of cx_freeze) : we can't say unless we have tested it on many linux platforms . On my computer [pablo], it never worked...
- We need to organize a testsuites to see that we don't introduce regressions in the generated matlab files.
- It should be easy to call dolo's preprocessor from matlab/octave or julia. This involves finding the good dolo executable (.py or not), dealing with file separator and so on, ensuring that environment variables point to the right virtualenv (maybe tricky under matlab).
- We probably want to distribute matlab files that simplify this invocation and matlab files to install dolo from within matlab (consider porting them from RECS)