Installation¶
Most users will have the ix modeling platform installed automatically when installing MESSAGEix.
The sections below cover other use cases:
- Installing ixmp to be used alone (i.e., with models or frameworks other than
MESSAGEix):
- see the section Install GAMS,
- then Install ixmp via Anaconda.
- Installing ixmp from source, for development purposes: see Install ixmp from source.
- Installing the R API to ixmp:
- Start with Install GAMS.
- Then install ixmp either via Anaconda, or from source.
- Finally, see Install rixmp.
Contents:
Technical requirements¶
A high-quality desktop computer or laptop is sufficient for most purposes using the ix modeling platform.
Install GAMS¶
ixmp requires GAMS.
Download the latest version of GAMS for your operating system; run the installer.
Add GAMS to the
PATH
environment variable:- on Windows, in the GAMS installer…
- Check the box labeled “Use advanced installation mode.”
- Check the box labeled “Add GAMS directory to PATH environment variable” on the Advanced Options page.
on macOS or Linux, add the following line to your
.bash_profile
(Mac) or.bashrc
(Linux):export PATH=$PATH:/path/to/gams-directory-with-gams-binary
Note
For using GAMS to solve numerical optimisation problems, you need to install the latest version of GAMS (in particular 24.8 or higher). If you only have a license for an older version, install both the older and the latest version of GAMS.
Install ixmp via Anaconda¶
After installing GAMS, we recommend that new users install Anaconda, and then use it to install ixmp. Advanced users may choose to install ixmp from source code (next section).
Install Python via Anaconda. We recommend the latest version, i.e., Python 3.6+.
Open a command prompt. We recommend Windows users use the “Anaconda Prompt” to avoid permissions issues when installing and using ixmp. This program is available in the Windows Start menu after installing Anaconda.
Install the
ixmp
package:$ conda install -c conda-forge ixmp
Install ixmp from source¶
(Optional) If you intend to contribute changes to ixmp, first register a Github account, and fork the ixmp repository. This will create a new repository
<user>/ixmp
.Clone either the main repository, or your fork; using the Github Desktop client, or the command line:
$ git clone git@github.com:iiasa/ixmp.git # or: $ git clone git@github.com:USER/ixmp.git
Open a command prompt in the
ixmp
directory and type:$ pip install --editable .
The
--editable
flag ensures that changes to the source code are picked up every timeimport ixmp
is used in Python code.(Optional) Run the built-in test suite to check that ixmp functions correctly on your system:
$ pip install .[tests] $ py.test
Install rixmp
¶
First, read the rixmp documentation to understand the difference between rixmp
and rixmp.legacy
.
-
Warning
Ensure the the R version installed is either 32 OR 64 bit (and >= 3.3.0), consistently with GAMS and Java. Having both 32 and 64 bit generates error.
Depending on your platform:
(Windows) Run the script
install.bat
included with ixmp.(Linux and macOS) Enter the directory
rixmp/
and use R to build and install the package and its dependencies, including reticulate:$ cd rixmp $ Rscript -e "install.packages(c('knitr', 'reticulate'))" $ R CMD build . $ R CMD INSTALL *.tar.gz
(Optional) Install Rtools and add the path to the environment variables.
(Optional) For working with Jupyter notebooks using R, install the IR kernel.
Install development tools¶
Developers making changes to the ixmp source may need one or more of the following tools. Users developing models using existing ixmp functionality should not need these tools.
Java Development Kit (JDK).
Install the Java Development Kit (JDK) for Java SE version 8 from https://www.oracle.com/technetwork/java/javase/downloads/index.html
Note
At this point, ixmp is not compatible with JAVA SE 9.
Follow the JDK website instructions to set the
JAVA_HOME
environment variable; ifJAVA_HOME
does not exist, add as new system variable.Update your PATH environment variable to point to the JRE binaries and server installation (e.g.,
C:\Program Files\Java\jdk[YOUR JDK VERSION]\jre\bin\
,C:\Program Files\Java\jdk[YOUR JDK VERSION]\jre\bin\server
).Warning
Do not overwrite the existing PATH environment variable, but add to the list of existing paths.
(Windows) C++ compiler.
Git. Use one of:
In addition, set up an account at https://github.com, and familiarize yourself with forking and cloning repositories, as well as pulling, committing and pushing changes.
Troubleshooting¶
For Anaconda users experiencing problems during installation of ixmp,
Anaconda might not have been added to the PATH system variable properly.
So, if install.bat
fails, check if:
C:\[YOUR ANACONDA LOCATION]\Anaconda3;
C:\[YOUR ANACONDA LOCATION]\Anaconda3\Scripts;
C:\[YOUR ANACONDA LOCATION]\Anaconda3\Library\bin;
are all part of the PATH system variable. If they are not there, add them.