    def _gen_ck_lib_pkg(self):
        """Build composable kernel python library.

        Raises
        ------
        RuntimeError
            Failed to create ck library.
        """
        self.lib_folder = None
        try:
            import ck_lib  # noqa: F401
        except BaseException:
            try:
                cur_path = os.path.dirname(os.path.realpath(__file__))
                ck_lib_path = os.path.normpath(
                    os.path.join(cur_path, "..", "..", "utils", "mk_ck_lib")
                )
                f_make_lib = registry.get("rocm.make_ck_lib")
                dst_path = f_make_lib(ck_lib_path)
                sys.path.insert(1, dst_path)
            except BaseException as err:
                raise RuntimeError("Failed to create ck library") from err
            self.lib_folder = dst_path
Build composable kernel python library.

Raises
------
RuntimeError
Failed to create ck library.
python/aitemplate/backend/rocm/target_def.py