diff --git a/conda.recipe/build.sh b/conda.recipe/build.sh new file mode 100644 index 00000000..44b94726 --- /dev/null +++ b/conda.recipe/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -euo pipefail + +cd ${SRC_DIR} +IPOPT_DIR=${CONDA_PREFIX} ${PYTHON} -m pip install . -vv + +cd ${SRC_DIR}/baseclasses +${PYTHON} -m pip install . -vv diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml new file mode 100644 index 00000000..58f42843 --- /dev/null +++ b/conda.recipe/meta.yaml @@ -0,0 +1,53 @@ +package: + name: pyoptsparse + version: "{{ load_setup_py_data().version }}" + + +source: + - path: ../ + - patches: + - patch-IPOPT-setup-for-conda.patch + + # Embed mdolab-baseclasses package. + # This is sub-optimal, baseclasses should be provided as a conda package as + # well. This may cause problems if the pyoptsparse is installed into an + # environment which requires other, incompatible versions of baseclasses. + - git_url: https://github.com/mdolab/baseclasses.git + git_rev: v1.5.2 + folder: baseclasses + + +requirements: + build: + - python + - numpy + - swig + - ipopt + - {{ compiler('c')}} + - {{ compiler('cxx')}} + - {{ compiler('fortran') }} + + host: + - python + - numpy + + run: + - python + - numpy + - ipopt + - sqlitedict >=1.6 + - scipy >1.2 + +test: + imports: + - pyoptsparse + + source_files: + - test + + requires: + - testflo + - parameterized + + commands: + - testflo --verbose . \ No newline at end of file diff --git a/conda.recipe/patch-IPOPT-setup-for-conda.patch b/conda.recipe/patch-IPOPT-setup-for-conda.patch new file mode 100644 index 00000000..69f94934 --- /dev/null +++ b/conda.recipe/patch-IPOPT-setup-for-conda.patch @@ -0,0 +1,13 @@ +diff --git a/pyoptsparse/pyIPOPT/setup.py b/pyoptsparse/pyIPOPT/setup.py +index f875ca2..c2ebf0d 100644 +--- a/pyoptsparse/pyIPOPT/setup.py ++++ b/pyoptsparse/pyIPOPT/setup.py +@@ -51,7 +51,7 @@ def configuration(parent_package="", top_path=None): + "pyipoptcore", + FILES, + library_dirs=[IPOPT_LIB], +- libraries=["ipopt", "coinmumps", "coinmetis", "dl", "m", "blas", "lapack"], ++ libraries=["ipopt", "mumps_common_seq", "scotchmetis", "dl", "m", "blas", "lapack"], + extra_link_args=["-Wl,-rpath,%s -L%s" % (IPOPT_LIB, IPOPT_LIB)], + include_dirs=[numpy_include, IPOPT_INC], + )