Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conda recipe #261

Closed
wants to merge 5 commits into from
Closed
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
9 changes: 9 additions & 0 deletions conda.recipe/build.sh
Original file line number Diff line number Diff line change
@@ -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
53 changes: 53 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -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 .
13 changes: 13 additions & 0 deletions conda.recipe/patch-IPOPT-setup-for-conda.patch
Original file line number Diff line number Diff line change
@@ -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],
)