|
|
|
@ -30,8 +30,10 @@ is_lin = (system == 'linux')
|
|
|
|
|
# The extra links will passed from COMAKE
|
|
|
|
|
# because generate paddle LDFLAGS is too complicated to do in setup.py
|
|
|
|
|
# it just read COMAKE generated LDFLAGS.
|
|
|
|
|
extra_comps = []
|
|
|
|
|
extra_links = []
|
|
|
|
|
obj = api.paddle_ld_flags.PaddleLDFlag()
|
|
|
|
|
extra_comps = obj.c_flag()
|
|
|
|
|
ldflags = obj.ldflag_str()
|
|
|
|
|
if ldflags is not None:
|
|
|
|
|
extra_links.extend(ldflags.split(" "))
|
|
|
|
@ -51,20 +53,15 @@ elif is_osx == True:
|
|
|
|
|
|
|
|
|
|
include_dirs = [np.get_include(), "../"] # include numpy and paddle.
|
|
|
|
|
|
|
|
|
|
extra_c = obj.c_flag()
|
|
|
|
|
|
|
|
|
|
attr=dict()
|
|
|
|
|
if extra_c is not None:
|
|
|
|
|
attr["extra_compile_args"] = extra_c
|
|
|
|
|
|
|
|
|
|
setup(name="py_paddle",
|
|
|
|
|
version="@PADDLE_VERSION@",
|
|
|
|
|
ext_modules=[
|
|
|
|
|
Extension('py_paddle._swig_paddle', # Build SWIG Extension.
|
|
|
|
|
['Paddle_wrap.cxx'],
|
|
|
|
|
language = "c++",
|
|
|
|
|
include_dirs = include_dirs,
|
|
|
|
|
extra_link_args = extra_links,
|
|
|
|
|
**attr
|
|
|
|
|
extra_compile_args = extra_comps
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
packages=['py_paddle'],
|
|
|
|
|