@@ -66,9 +66,7 @@ def _read_dir(repository_ctx, src_dir):
6666def _find_file (repository_ctx , filename ):
6767 """Returns a string with a directory path including the filename.
6868
69- Finds all files inside a directory, traversing subfolders and following
70- symlinks. The returned string contains the full path of all files
71- separated by line breaks.
69+ The returned string contains the parent path of the filename.
7270 """
7371 result = repository_ctx .execute (
7472 ["timeout" , "5" , "find" , "/" , "-name" , filename , "-print" , "-quit" , "-not" , "-path" , "'*/.*'" , "-quit" ]).stdout
@@ -121,7 +119,28 @@ def _symlink_genrule_for_dir(
121119 """Returns a genrule to symlink(or copy if on Windows) a set of files.
122120
123121 If src_dir is passed, files will be read from the given directory; otherwise
124- we assume files are in src_files and dest_files.
122+ we assume files are in src_files and dest_files. Here are the examples:
123+
124+ ```
125+ genrule(
126+ name = "cuquantum_header_include",
127+ outs = [
128+ "include/custatevec.h",
129+ "include/cutensornet.h",
130+ "include/cutensornet/types.h",
131+ "include/cutensornet/typesDistributed.h",
132+ ],
133+ cmd = [some copy command lines based on users' local environment],
134+ )
135+
136+ genrule(
137+ name = "libcustatevec.so",
138+ outs = [
139+ "libcustatevec.so",
140+ ],
141+ cmd = [some copy command lines based on users' local environment],
142+ )
143+ ```
125144
126145 Args:
127146 repository_ctx: the repository_ctx object.
@@ -176,7 +195,7 @@ def _symlink_genrule_for_dir(
176195 return genrule
177196
178197
179- def _cuquantum_pip_imple (repository_ctx ):
198+ def _cuquantum_pip_impl (repository_ctx ):
180199 cuquantum_root = repository_ctx .os .environ [_CUQUANTUM_ROOT ]
181200 if cuquantum_root == "" :
182201 cuquantum_header_path = _find_file (repository_ctx , "custatevec.h" )
@@ -213,7 +232,7 @@ def _cuquantum_pip_imple(repository_ctx):
213232
214233
215234cuquantum_configure = repository_rule (
216- implementation = _cuquantum_pip_imple ,
235+ implementation = _cuquantum_pip_impl ,
217236 environ = [
218237 _CUQUANTUM_ROOT ,
219238 ],
0 commit comments