@@ -43,7 +43,7 @@ def check_path(header):
4343
4444def decide_lib_name (ext_name ):
4545 # TODO: move the record of the supported lib list elsewhere?
46- for lib in ("cublas" , "cusolver" , "cufft" , "cusparse" , "curand" , "nvpl" ):
46+ for lib in ("cublas" , "cusolver" , "cufftMp" , " cufft" , "cusparse" , "curand" , "nvpl" , "nvshmem" , "mathdx " ):
4747 if lib in ext_name :
4848 return lib
4949 else :
@@ -92,18 +92,23 @@ def _prep_includes_libs_rpaths(self, lib_name):
9292 extra_linker_flags = ["-Wl,--strip-all" ]
9393 if lib_name is not None :
9494 ldflag = "-Wl,--disable-new-dtags"
95- if lib_name == "nvpl" :
96- # 1. the nvpl bindings land in
97- # site-packages/nvmath/bindings/nvpl/_internal/ as opposed to other
98- # packages that have their bindings in
99- # site-packages/nvmath/bindings/_internal/, so we need one extra `..` to
100- # get into `site-packages` and then the lib_name=nvpl is not in nvidia
101- # dir but directly in the site-packages.
102- # 2. mkl lib is placed directly in the python `lib` directory, not in
103- # python{ver}/site-packages
104- ldflag += f",-rpath,$ORIGIN/../../../../{ lib_name } /lib:$ORIGIN/../../../../../../"
105- else :
106- ldflag += f",-rpath,$ORIGIN/../../../nvidia/{ lib_name } /lib"
95+ match lib_name :
96+ case "nvpl" :
97+ # 1. the nvpl bindings land in
98+ # site-packages/nvmath/bindings/nvpl/_internal/ as opposed to other
99+ # packages that have their bindings in
100+ # site-packages/nvmath/bindings/_internal/, so we need one extra
101+ # `..` to get into `site-packages` and then the lib_name=nvpl is not
102+ # in nvidia dir but directly in the site-packages.
103+ # 2. mkl lib is placed directly in the python `lib` directory, not
104+ # in python{ver}/site-packages
105+ ldflag += f",-rpath,$ORIGIN/../../../../{ lib_name } /lib:$ORIGIN/../../../../../../"
106+ case "cufftMp" :
107+ ldflag += ",-rpath,$ORIGIN/../../../nvidia/cufftmp/cu12/lib"
108+ case "mathdx" :
109+ ldflag += ",-rpath,$ORIGIN/../../../nvidia/cu12/lib"
110+ case _:
111+ ldflag += f",-rpath,$ORIGIN/../../../nvidia/{ lib_name } /lib"
107112 extra_linker_flags .append (ldflag )
108113
109114 return cuda_incl_dir , extra_linker_flags
0 commit comments