Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ Then, do the following:

pip install --no-build-isolation --editable .

Unlike typical installs, this will leave the build directory in place, so in subsequent builds it is best to clean the build directory first via

.. prompt:: bash

rm -rf build


To run tests, ensure that the testing dependencies specified in the ``pyproject.toml`` file are also installed.

Coding style
Expand Down
22 changes: 6 additions & 16 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Conda packages are available on conda-forge and can be installed via

conda install -c conda-forge pyoptsparse

This would install pyOptSparse with the built-in optimizers.
This would install pyOptSparse with the built-in optimizers, plus IPOPT.
If you wish to use optimizers not packaged by ``conda``, e.g. SNOPT, then you must either build the package from source or use the installation script below.
If you have the SNOPT precompiled library available, it is possible to dynamically link it to pyOptSparse following the instructions on the :ref:`SNOPT installation page<snopt_by_conda>`.

Expand All @@ -29,7 +29,7 @@ Requirements
~~~~~~~~~~~~
pyOptSparse has the following dependencies:

* Python 3.7 or 3.8, though other Python 3 versions will likely work
* Python 3
* C and Fortran compilers.
We recommend ``gcc`` and ``gfortran`` which can be installed via the package manager for your operating system.

Expand All @@ -38,12 +38,8 @@ Python dependencies are automatically handled by ``pip``, so they do not need to

.. note::
* In Linux, the python header files (``python-dev``) are also required.
* **We do not support operating systems other than Linux.**
For macOS users, the conda package may work out of the box if you do not need any non-default optimizers.
Also, the installation script by OpenMDAO likely works on macOS.
For Windows users, a conda package is on the way, if it's not already in the repos.
This comes with the same disclaimer as the macOS conda package.
Alternatively, follow the :ref:`conda build instructions<conda build instruction>` below as this will work on any platform.
* **We do not support operating systems other than Linux** for building from source.
For those on other operating systems, you can try the :ref:`conda build instructions<conda build instruction>` instead.

Installation
~~~~~~~~~~~~
Expand All @@ -61,8 +57,6 @@ For those not using virtual environments, a user install may be needed

pip install . --user

If you plan to modify pyOptSparse, installing with the developer option, i.e. with ``-e``, will save you from re-installing each time you modify the Python code.

.. note::
Some optimizers are proprietary, and their sources are not distributed with pyOptSparse.
To use them, please follow the instructions on specific optimizer pages.
Expand Down Expand Up @@ -122,11 +116,7 @@ The first thing to do is to do a clean install.
This involves the following steps:

#. Uninstall the package via ``pip``
#. If you did a developer install (with ``-e``), check if there are ``.so`` files in the subdirectories, e.g. ``pyoptsparse/pySLSQP``.
If so, manually delete all ``.so`` files.
#. Remove the ``meson_build`` directory if present.
#. Run ``pip install`` again and test the installation.

#. Run ``pip install .`` again and test the installation.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double checking that deleting meson_build is not necessary anymore. Does mesonpy not have a _build folder or just handles the rebuilds better?
I believe I instinctively deleted the folder before each rebuild while testing

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build directory is now a temporary directory so it gets cleaned automatically, unless you are building in editable mode in which case it is by default build. I've added a note on this.


If the issue persists, there is probably a linking or runtime issue.
This can be verified by manually importing the compiled library that's causing the issue, for example with:
Expand All @@ -142,7 +132,7 @@ If, on the other hand, this throws a ``error while loading shared libraries``, t

Update or Uninstall
-------------------
To update pyOptSparse, first delete the ``meson_build`` directory, then update the package using ``git``.
To update pyOptSparse, first update the package using ``git``.
For stability, users are encouraged to stick to tagged releases.
Install the package normally via ``pip``.

Expand Down
2 changes: 2 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
sphinx_mdolab_theme>=1.2
sphinx-codeautolink
# temporary pin from https://github.com/executablebooks/sphinx-tabs/issues/212
docutils==0.21.2
9 changes: 0 additions & 9 deletions meson_options.txt

This file was deleted.

4 changes: 3 additions & 1 deletion pyoptsparse/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.14.5"
__version__ = "2.15.0"

from .pyOpt_history import History
from .pyOpt_variable import Variable
Expand Down Expand Up @@ -41,4 +41,6 @@
"NSGA2",
"ALPSO",
"ParOpt",
"testing",
"list_optimizers",
]
1 change: 0 additions & 1 deletion pyoptsparse/pySNOPT/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ if HAS_SNOPT
dependencies : [fortranobject_dep],
subdir: 'pyoptsparse/pySNOPT',
install: true,
fortran_args: '-ffixed-line-length-80'
)
endif