I am using setup tools to build a Python module and I need to add extra links. Parameter extra_link_args is not working.
Asked
Active
Viewed 1,022 times
0
-
More info, please – Dirk Horsten Jul 02 '18 at 20:48
-
Hi. Thanks. It is solved. The problem was that extra_link_args is not a parameter to setup, but a parameter to Extension. – Ratmil Jul 02 '18 at 21:26
-
Then please share it with us. We would reward you with reputation points for improving our knowledge base. – Dirk Horsten Jul 03 '18 at 17:14
-
Yes, I will. Rigth now. – Ratmil Jul 03 '18 at 19:14
1 Answers
2
As I said, extra_link_args is not an argument to setup. It would be like this:
extra_link_args = []
if platform.system() == 'Darwin':
extra_link_args.append('-Wl,-rpath,' + lib_path)
setup(
name='Mymodule',
#extra_link_args = extra_link_args this is wrong
ext_modules = [Extension("_mymodule", ["mycfile.c"],
depends=[],
libraries = [':mylib.a'],
extra_link_args = extra_link_args, #this is right
)],

Ratmil
- 117
- 8