Windows Installation¶
Note
Windows is not officially supported at this time.
This is a complete guide to installing the IDAES framework on Windows. The Extras section includes additional information which may be useful. This guide includes compiling C++ components. In the future precompiled versions of these libraries will be made available, simplifying the installation process.
Tools¶
Before installing the IDAES software there are a few development tools that need to be installed. There are alternatives, but an attempt was made to provide the easiest path here.
Install a git client from https://git-scm.com/download/win. A git client is not necessary for all users, but if you are a developer or advanced user, you will likely want it.
Install MSYS2. MSYS2 provides a shell which will allow use of Linux style build tools. It also provides a convenient package manager (pacman) which allows for easy installation of build tools.
Go to https://www.msys2.org/
Download the x86_64 installer
Run the installer (the default options should be okay)
Open the MSYS2 MinGW 64-bit terminal (go to: start menu/MSYS2 64Bit/MSYS2 MinGW 64Bit).
Update the MSYS2 software:
pacman -Syu
Repeat the previous step until there are no more updates.
Install the build tools and libraries. Some packages installed are group packages, and pacman will prompt to select which packages you would like to install. Press “enter” for the default, which is all.:
pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-boost unzip patch make
While MinGW does produce Windows native binaries, depending on linking options, some DLLs may be required. Add the MinWG/MSYS2 DLLs to your path. For example if MSYS2 was installed in the default location you would probably want to add
C:\msys64\mingw64\bin
. See Modifying the Path Environment Variable.
Note
In the MSYS2 terminal the directory structure looks different than the
regular Windows directory structure.
The Windows C: drive is located at /c
.
Install Miniconda¶
- Download Miniconda (https://docs.conda.io/en/latest/miniconda.html)
- Run the Miniconda installer (default options should be fine)
Get IDAES¶
The two main options for getting IDAES are to download the files or to clone the repository. Cloning the repository requires a git client. For core IDAES developers or users who need to track the latest developments and have access to the idaes-dev repo, replace “idaes-pse” with “idaes-dev.”
Option 1: Download from Github¶
Most users can download the release files from https://github.com/IDAES/idaes-pse/releases. The latest development version can be downloaded by going to https://github.com/IDAES/idaes-pse and clicking the “Clone or Download” button then clicking on “Download Zip.” Unzip the files to a convenient location.
Option 2: Fork and Clone the Repository¶
For people who are not IDAES core developers but potentially would like to make contributions to the IDAES project or closely follow IDAES development, the best way to get the IDAES files is to fork the IDAES repo on Github, then clone the new fork. To fork the repository sign into your Github account, and go to https://github.com/IDAES/idaes-pse. Then, click the “Fork” button in the upper righthand corner of the page.
To clone a repository:
Open a command window.
Go to the directory where you want to create the local repo.
Enter the command (replace “Github_Account” with the Github account of the fork you wish to clone):
git clone https://github.com/Githhub_Account/idaes-pse
The clone command should create a new idaes-pse subdirectory with a local repository.
IDAES Location¶
In the instructions that follow idaes_dir
will refer to the directory containing the IDAES files.
Compiling ASL¶
The AMPL Solver Library (ASL) is required to compile some user-defined functions used in parts of the IDAES framework (mainly some property packages).
Open the MSYS2 MinGW 64-bit terminal (go to: start menu/MSYS2 64Bit/MSYS2 MinGW 64Bit).
Create a directory for complied source code in a convenient location, which will be referred to as
src
in these instructions. For example (obviously change the user name and/c
is the location of the C: drive in Windows)mkdir /c/Users/jeslick/src
.Go to the source directory (again replace src with the actual directory):
cd src
Download the ASL and compile the ASL:
wget https://ampl.com/netlib/ampl/solvers.tgz tar -zxvf solvers.tgz cd solvers ./configure make
Compiling IDAES AMPL Function Extensions¶
IDAES uses some additional user defined AMPL functions for various purposes, but mainly for physical properties. Before installing IDAES these functions must be compiled.
Open the MSYS2 MinGW 64-bit terminal.
Set the ASL_BUILD environment variable (the directory may differ depending on the architecture and replace
.../src
with the actual location of your src directory):export ASL_BUILD=/c/.../src/solvers/sys.`uname -m`.`uname -s`
Go to the IDAES directory (replace
/c/idaes_dir
with the location of the IDAES files):cd /c/idaes_dir/idaes_pse/
Run:
make
If the compile finishes without errors you can proceed to installing IDAES.
Install IDAES¶
Open the Anaconda Command prompt
Create an
idaes
environment and activate it (optional):conda create -n idaes "python>=3.6" pip conda activate idaes
Note
If you are using a version of conda older than 4.4 the command on Windows to
activate a conda environment (for example idaes) is activate idaes
.
Install requirements:
pip install -r requirements.txt
Install IDAES:
python setup.py develop
(Optional) Install IPOPT:
conda install -c conda-forge ipopt
Extras¶
Building Documentation¶
Most users do not need to build this documentation, but if necessary you can. The instructions here use make
from the MSYS2 installed above.
Open the Anaconda Command prompt, and activate the IDAES environment
Go to the IDAES directory
Go to the docs subdirectory
Add the MSYS2 bin directory to your path temporarily. For example, if MSYS2 is installed in the default location:
set Path=%Path%;C:\msys64\usr\binRun make (from MSYS2):
make html
The HTML documentation will be in the “build” subdirectory.
Compiling IPOPT¶
It’s not required to compile IPOPT yourself, and these are pretty much the standard IPOPT compile instructions. If you have set up MSYS2 as above, you should be able to follow these instructions to compile IPOPT for Windows.
Download IPOPT from https://www.coin-or.org/download/source/Ipopt/, and put the zip file in the
src
directory created above. The Ipopt source is also available from other locations, but source code from other locations may not include the scripts to download third-party libraries.Open the MSYS2 MinGW 64-bit terminal (go to: start menu/MSYS2 64Bit/MSYS2 MinGW 64Bit).
Unzip Ipopt (the
*
here represents the portion of the file name with the Ipopt version information):unzip Ipopt*.zip cd Ipopt*
Get third party libraries:
cd ThirdParty/ASL ./get.ASL cd ../Blas ./get.Blas # and so on for all the other subdirectories except HSL.
(Optional) Get the HSL source code from https://www.hsl.ac.uk/ipopt. You will need to fill out a request from and be emailed a download link. Extract the files. Depending on how you extract the files there may be an extra directory level. Find the directory containing the HSL files and rename it “coinhsl.” Copy the renamed directory to the HSL subdirectory of the Ipop ThirdParty directory. The results of the configure script below should show that the HSL was found. Refer to the Ipopt documentation if necessary.
Go to the IPOPT directory (replace $IPOPT_DIR with the IPOPT directory):
cd $IPOPT_DIR ./configure make
The IPOPT AMPL executable will be in ./Ipopt/src/Apps/AmplSolver/ipopt.exe, you can move the executable to a location in the path (environment variable). See Modifying the Path Environment Variable.
Modifying the Path Environment Variable¶
The Windows Path
environment variable provides a search path for executable code
and dynamically linked libraries (DLLs). You can temporarily modify the path in a
command window session or permanently modify it for the whole system.
Changing Path Via the Control Panel
This method will modify the path for the whole system. Running programs especially open command windows will need to be restarted for this change to take effect.
Any version of Windows
- Press the “Windows Key.”
- Start to type “Control Panel”
- Click on “Control Panel” in the start menu.
- Click “System and Security.”
- Click “System.”
- Click “Advanced system settings.”
- Click “Environment Variables.”
In Windows 10
- Press the “Windows Key.”
- Start to type “Environment”
- Click on “Edit the system environment” in the start menu.
- Click “Environment Variables.”
Temporary Change in Command Window
This method temporarily changes the path in just the active command window. Once the command window is closed the change will be lost.
Set the Path variable to include any additional directories you want to add to the path. Replace “added_directory” with the directory you want to add:
set Path=%Path%;added_directory