File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 77import versioneer
88import sysconfig
99
10- # Get the Python include path dynamically
10+ # Get the Python include and library paths dynamically
1111python_include_path = sysconfig .get_path ('include' )
1212python_lib_path = sysconfig .get_config_var ('LIBDIR' )
1313
@@ -86,10 +86,16 @@ def finalize_options(self):
8686grpo_module = Extension (
8787 'optimrl.c_src.libgrpo' ,
8888 sources = ['optimrl/c_src/grpo.c' ],
89- include_dirs = ['optimrl/c_src' ,python_include_path ],
89+ include_dirs = [
90+ 'optimrl/c_src' ,
91+ python_include_path
92+ ],
93+ library_dirs = [
94+ python_lib_path # Include the Python library path dynamically
95+ ],
9096 libraries = ['m' ] if platform .system () != 'Windows' else [],
9197 extra_compile_args = ['-O3' , '-fPIC' ] if platform .system () != 'Windows' else ['/O2' ],
92- extra_link_args = [] if platform .system () != 'Windows' else ['/EXPORT:PyInit_libgrpo' ]
98+ extra_link_args = ['-L' + python_lib_path ] if platform .system () != 'Windows' else ['/EXPORT:PyInit_libgrpo' ]
9399)
94100
95101# Read the README file
You can’t perform that action at this time.
0 commit comments