Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Latest commit

 

History

History
73 lines (57 loc) · 5.99 KB

install_Ipopt_CppAD.md

File metadata and controls

73 lines (57 loc) · 5.99 KB

Intalling Ipopt and CppAD

Dependencies

At this point in the curriculum students will have set up their SDC Term 2 environment and dependencies, with the exception of Ipopt, Fortran, and CppAD. If you are setting up a fresh environment please refer to setup instructions starting here.

Installation Process

  1. Clone this repository and navigate to the cloned directory
  2. Download the appropriate version of Ipopt (3.12.7 or higher) from the link below. You may also use wget or a similiar command to download the source from the command line (see Linux instructions).
  3. Follow the instructions for your environment
  • Ipopt

    • Mac:
        brew tap udacity/CarND-MPC-Project https://github.com/udacity/CarND-MPC-Project
        brew install ipopt --with-openblas
      
    • For Linux and Windows Ubuntu BASH installs, please try ./install-ubuntu-MPC.sh. This will install all dependencies and only installation of an Xserver (Windows) should be necessary. The individual steps have been included for reference. Please note that for any particular command, including execution of .sh scripts, it may be necessary to add sudo prior to the command. It is also a good practice to run sudo apt-get update prior to installation of new libraries.
    • Linux:

      • sudo apt-get install gfortran
      • apt-get install unzip
      • wget https://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.7.zip && unzip Ipopt-3.12.7.zip && rm Ipopt-3.12.7.zip
      • Call install_ipopt.sh with the source directory as the first argument, ex: ./install_ipopt.sh Ipopt-3.12.7 or bash install_ipopt.sh Ipopt-3.12.7
    • Windows: For Windows environments there are two main options

      • Follow Linux instructions in the Ubuntu Bash environment. Please not that install instructions should be executed from the repository directory. Changing to a Windows directory (ie cd /mnt/c .....) can result in installation issues, particularly for Windows directories that contain spaces.

      • Use the docker container described here, which comes pre-configured with Ipopt.

  • CppAD

    • Mac: brew install cppad
    • Linux sudo apt-get install cppad or equivalent.
    • Windows: For Windows environments there are two main options
      • Follow Linux instructions in the Ubuntu Bash environment
      • Use the docker container described here, which comes pre-configured with CppAD.

Mind the Line Quiz Dependencies

It may be neccesary to install additional dependencies, especially for Docker and Ubuntu BASH on Windows hosts. A complete list of dependencies can be found here. The mind the line solution uses a matplotlib inspired plotting cpp plotting library, which depends on python components. To enable plotting, most Windows users will need to execute the following commands **note for dockers users, leave out sudo):

  • sudo apt-get update
  • sudo apt-get install python-matplotlib
  • sudo apt-get install python2.7-dev

In addition, to display plots, an X-server must be running on the host and accessible. To accomplish this in Ubuntu BASH for windows, do the following:

  • Download and install Xming
  • Start Xming
  • execute the following in the terminal: export DISPLAY=:0
  • run the code from the build folder ./mpc

Note to Docker Users The Xming solution does not work out of the box since the docker container communicates with the VM and not the host. To run the code without error it is necessary to comment out or remove the plotting code and the bottom of the MPC.cpp solution file. A current work-around to visualizing results is to send the results to a file, transfer the file to the host, then use a visualaztion tool on the host.

Troubleshooting

  • If challenges to installation are encountered (install script fails). Please consult the forums. Please feel free to submit additional tips or forum threads to the issue reports repo, for potential inclusion in this document.
  • Some Mac users have experienced the following error:
    Listening to port 4567
    Connected!!!
    mpc(4561,0x7ffff1eed3c0) malloc: *** error for object 0x7f911e007600: incorrect checksum for freed object
    - object was probably modified after being freed.
    *** set a breakpoint in malloc_error_break to debug
    
    This error has been resolved by updrading ipopt with brew upgrade ipopt --with-openblas per this forum post

** Useful Resources:**