Skip to content

Commit

Permalink
move extra link/compile args
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmilten committed Aug 18, 2019
1 parent 13ac80b commit 91f8e36
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
from setuptools import setup, Extension
import os, platform, sys, re

runtime_library_dirs = []
extra_link_args = []

# look for environment variable that specifies path to SCIP
scipoptdir = os.environ.get('SCIPOPTDIR', '').strip('"')

extra_compile_args = []
extra_link_args = []
# set runtime libraries
if platform.system() in ['Linux', 'Darwin']:
extra_link_args.append('-Wl,-rpath,'+libdir)

# enable debug mode if requested
if "--debug" in sys.argv:
extra_compile_args.append('-UNDEBUG')
sys.argv.remove("--debug")

# determine include directory
if os.path.exists(os.path.join(scipoptdir, 'src')):
# SCIP seems to be installed in place
Expand Down Expand Up @@ -51,21 +59,10 @@

ext = '.pyx' if cythonize else '.c'

# set runtime libraries
if platform.system() in ['Linux', 'Darwin']:
extra_link_args.append('-Wl,-rpath,'+libdir)

# enable debug mode if requested
extra_compile_args = []
if "--debug" in sys.argv:
extra_compile_args.append('-UNDEBUG')
sys.argv.remove("--debug")

extensions = [Extension('pyscipopt.scip', [os.path.join(packagedir, 'scip'+ext)],
include_dirs=[includedir],
library_dirs=[libdir],
libraries=[libname],
runtime_library_dirs=runtime_library_dirs,
extra_compile_args = extra_compile_args,
extra_link_args=extra_link_args
)]
Expand Down

0 comments on commit 91f8e36

Please sign in to comment.