Prev Next install

@(@\newcommand{\B}[1]{{\bf #1}} \newcommand{\R}[1]{{\rm #1}}@)@
Installing pycppad

Other Instructions
If you are using WinPython , see building pycppad in Windows

This package requires the following other packages:
  1. The Boost Python (development version) must be installed.
  2. The python numpy library must be installed.
  3. The CppAD package.

Download the file pycppad-20140710.tar.gz and store it on your machine.

On unix, you could use the command
     tar -xvzf  pycppad-20140710.tar.gz
which would create the directory pycppad-20140710.

Required Setup Information
The value of the following setup variables, in the file
must be set to agree with your system:
     # Directory where CppAD include files are located
     # cppad_include_dir        = [ '/usr/include' ]
     cppad_include_dir        = [ os.environ['HOME'] + '/prefix/cppad/include' ]
     # Directory where Boost Python include files are located
     boost_python_include_dir = [ '/usr/include' ]
     # Director whre Boost Python library is located
     # boost_python_lib_dir     = [ '/usr/lib' ] 
     boost_python_lib_dir     = [ '/usr/lib64' ] 
     # Name of the Boost Python library in boost_python_lib_dir.
     # boost_python_lib         = [ 'boost_python-mt' ]
     boost_python_lib         = [ 'boost_python' ]
Note that Boost Python and CppAD must be installed before you can properly set this information.


With Debugging
Change into the directory pycppad-20140710 and execute the command
     ./ build_ext --inplace --debug --undef NDEBUG
to compile and link a version of the CppAD extension module with debugging (improved error messaging).

You can compile and link an optimized version of the CppAD extension module with the command
     ./ build_ext --inplace
Note that in the optimized version, certain error checking is not done and improper use of pycppad.cpp may lead to a segmentation fault.

Bug in Python Distutils
When using the GNU C++ compiler gcc, the warning
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
will be printed. This is not requested by but is rather a bug in the Python distutils package.

If python crashes during the build procedure under cygwin, you may need to run the rebaseall program. For example, execute the following steps:
  1. Check which cygwin processes are running using the ps -e command, and shut them all down.
  2. Open an DOS command window, for example, select Start | Run and then enter cmd in as the program to run.
  3. Change into the cygwin bin directory. If you installed cygwin in the default location, the following command will do this:
         cd c:\cygwin\bin
  4. Start the ash shell by executing the command
  5. The execute the command
    This will take a few minutes to execute. When it is done, you can close the command window by executing the command exit twice.

You can test of all the examples in the pycppad documentation. Change into the directory pycppad-20140710 and execute the command
You can run some more tests with the command
where with_debugging is True or False depending on if you built with debugging .

If you get a message about cppad_ being missing, it is probably because you did not use the --inplace flag when you built pycppad.

Installing pycppad copies it to the standard location for you system. You may or may not preform this step:

Change into the directory pycppad-20140710 and execute the command
     ./ build_ext --debug --undef NDEBUG install --prefix=
     ./ build_ext install --prefix=
where prefix is the prefix for the location where you wish to install pycppad. Note that some common choices for prefix are
$HOME if you are not the system administrator for this machine
/usr/local you're administrator and the system has a package manager (like yum, apt-get).
/usr you're the administrator but the system does not have a package manager.

Unfortunately, python's distutils package does not provide an uninstall command. You can uninstall the pycppad package by removing the entries
where major and minor are the major and minor version numbers printed by the command
     python --version

Python Path
If you have not installed pycppad, you will not be able to use the python command
     import pycppad
unless the distribution directory
is in your python path. If you have installed pycppad, the installation directory
must be in you python path (to use the import pycppad command). You can check your python path with the following commands
     import sys
If the required directory is not yet there, you could add the directory above to your python path using the command
You can avoid having to do this every time you load python by adding the path to your environment variable PYTHONPATH. For example, if you are using the bash shell, you could add the command
     export PYTHONPATH="
to your $HOME/.bashrc file.

pycppad Documentation
The documentation for pycppad starts out in the directory
During the installation process, it is copied to the directory

Input File: omh/install.omh