lines 251-512 of file: old_setup.py # {xrst_begin_parent old_setup.py} # {xrst_spell # bdist # cholmod # cmake # config # cp # cygpath # cygwin # devel # eval # fortran # gcc # grep # gsl # lapack # libdir # libopenblas # mingw # msys # os # pacman # pkg # pkgconfig # rm # scipy # sed # setuptools # suitesparse # sys # unix # wget # } # {xrst_comment_ch #} # # # Old Configure and Build the cppad_py Python Module # ################################################## # # See Also # ******** # :ref:`setup.py-name` # # Errors # ****** # If you encounter an error during this process, # see :ref:`old_setup.py.error-name` . # # # Syntax # ****** # # | ``python3 old_setup.py install --prefix=``\ *prefix* # # External Requirements # ********************* # #. `bash `_ # #. `cmake `_ # #. `swig `_ # #. `c++ `_ # #. `git `_ # #. `pkg-config `_ # #. `python `_ version 3 # #. `python-numpy `_ # #. `python-scipy `_ # #. `python-setuptools `_ # # Include Mixed Effects Modeling # ============================== # If :ref:`install_settings.py@include_mixed` is true, # the external packages listed below are also required. # Note that, for most cases, ``get_cppad_mixed.sh`` # will get all the required packages. # # #. The `wget `_ program. # #. A fortran compiler. # #. The `gsl `_ library # including its development headers. # #. `suitesparse `_ # package. Note that only cholmod is really required from suitesparse. # # Download # ******** # Use the following command to download the current version of cppad_py:: # # git clone https://github.com/bradbell/cppad_py.git cppad_py.git # # Configure # ********* # Before running ``old_setup_py`` or ``bin/get_cppad.sh`` , # you should check and possibly change the settings in # :ref:`install_settings.py-name` . # # Get cppad # ********* # The next step is to get a copy of cppad using # :ref:`get_cppad.sh-name`. # If you want to use the :ref:`mixed-title` class, you will have to set # :ref:`include_mixed` to true # and use ``bin/get_cppad_mixed.sh`` to install cppad and other # non-standard requirements. # # prefix # ****** # We use *prefix* to denote the prefix where cppad_py will be installed. # This is the same as the value of # :ref:`install_settings.py@cmake_install_prefix` . # You can create a variable with this value using the command # # | |tab| ``eval $(bin/install_settings.py)`` # | |tab| ``prefix="$cmake_install_prefix"`` # # libdir # ****** # The value *libdir* is the suffix (after the prefix) # where the libraries will be installed. # This can be determined by running the command: # {xrst_code sh} # bin/libdir.py ; echo # {xrst_code} # You can create a variable with this value using the command # # | |tab| ``libdir=$(bin/libdir.py)`` # # LD_LIBRARY_PATH # *************** # Make sure the directory *prefix/libdir* # is in your ``LD_LIBRARY_PATH`` # For example, if you set *prefix* and *libdir* as above, # # | |tab| ``export LD_LIBRARY_PATH=$prefix/$libdir`` # # In mac OS ``LD_LIBRARY_PATH`` should be replaced by ``DYLD_LIBRARY_PATH`` . # For example, # # | |tab| ``export DYLD_LIBRARY_PATH=$prefix/$libdir`` # # In msys2 and cygwin you do not need to set ``LD_LIBRARY_PATH`` because # static, instead of dynamic, libraries are used. # # PKG_CONFIG_PATH # *************** # Make sure the directory *prefix/libdir/*\ ``pkgconfig`` # is in your ``PKG_CONFIG_PATH``. # For example, # # | |tab| ``export PKG_CONFIG_PATH=$prefix/$libdir/pkgconfig`` # # Local Build # *********** # You should first remove any previous local copy of the Python cppad_py # module (that might exist) using the command # # | |tab| ``rm -r build/lib.*`` # # You can build a local copy of the Python cppad_py module using the # following command in the cppad_py.git directory: # # | |tab| ``python3 old_setup.py bdist`` # # This will create the directory # # | |tab| ``build/lib.``\ *name*\ ``/cppad_py`` # # where *name* identifies your system and version of python. # For example, you can set a variable equal to the value of *name* # by executing the command # # | |tab| ``name=$(ls build | grep '^lib\.' | sed -e 's|^lib\.||')`` # # The next step is to copy the ``cppad_py`` directory to the # cppad_py.git directory. For example, # # | |tab| ``cp -r build/lib.$name/cppad_py cppad_py`` # # Local Test # ********** # You can test the local copy by executing the following commands in the # cppad_py.git directory: # # | |tab| ``PYTHONPATH=""`` # | |tab| ``python3 example/python/check_all.py`` # # This test will use the local copy of ``cppad_py.git/cppad_py`` # create by the local build instructions directly above. # # PYTHONPATH # ********** # In order to use the installed version of cppad_py, # you must add the directory # # | |tab| *prefix/libdir*\ ``/python3.``\ *minor*\ ``/site-packages`` # # to your ``PYTHONPATH`` # where *minor* is the minor version corresponding to ``python3``. # For example, # # | |tab| ``minor=$(echo "import sys;print(sys.version_info.minor)" | python3)`` # | |tab| ``export PYTHONPATH=$prefix/$libdir/python3.$minor/site-packages`` # # # Install # ******* # Use the following command to build and install cppad_py: # # | |tab| ``python3 old_setup.py install --prefix=$prefix`` # # (see :ref:`prefix` above for how to set this shell # variable). # # This will install cppad_py in the directory # # | |tab| *prefix/libdir*\ ``/python3.``\ *minor* ``/site-packages/cppad_py`` # # # Test Install # ************ # You can test the installed version by executing the command # # | |tab| ``python3 example/python/check_all.py`` # # If the directory ``cppad_py.git/cppad_py`` exists, # you will be testing the local version, instead of the installed version. # If this directory exists when the install command is run, # it is removed by the install command. # # Mac Os # ****** # The Mac Os system has only been tested using # `brew `_ and # `port `_ # to install packages not included with the system. # # Cygwin # ****** # A cygwin install, on 2021-05-06 and with # :ref:`include_mixed` false, # completed successfully by doing the following: # First the following packages were added to the default set installed by the # cygwin ``setup-x86_64`` program: # gcc-core, gcc-g++, gcc-fortran, # python3-devel, python-pip-wheel, python-setuptools-wheel, # lapack-devel, libopenblas, # git, vim, cmake, make, swig. # Then the ``pip3`` program was used to install numpy and scipy. # Then the install instructions above were used to install and test # cppad_py. # # Msys2 # ***** # A msys2 install with, # :ref:`include_mixed` false, # was attempted on 2021-05-09. # First the following packages were installed using pacman: # vim, git, make, cmake, swig. # Next the mingw-w64-x86_64 version of following packages were installed using # pacman: python, python-scipy, python-setuptools, gcc # The problem is that old_setup.py is mixing windows and unix paths. # An attempt was made to fix the environment variables using ``cygpath`` # utility, but other related problems still persisted. # # {xrst_end old_setup.py}