Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
使用 --genop命令创建算子模板时会修改仓中的CMakeLists.txt导致在CMakeLists.txt阶段报错
💡 备注(选填)目前已知情况是在使用!bash build.sh --genop=experimental/math/sigmoid命令模板自动创建时修改了experimental文件夹下的CMakeLists.txt。具体操作为在该文件加下新增了add_subdirectory(math)语句。 AI给出的解释如下: foreach 循环遍历到 math 时,执行了 add_subdirectory(math),此时 CMake 默认将构建目录设为 ${CMAKE_CURRENT_BINARY_DIR}/math。 循环结束后,又显式执行了一次 add_subdirectory(math),CMake 再次尝试使用同一个默认构建目录 ${CMAKE_CURRENT_BINARY_DIR}/math。 触发报错:同一个 binary directory 被用于构建同一个 source directory 两次。 删除 experimental文件夹下的CMakeLists.txt末尾的add_subdirectory(math)语句后报错消失。
/assign @chensi79
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
一、问题描述 (必填)
使用 --genop命令创建算子模板时会修改仓中的CMakeLists.txt导致在CMakeLists.txt阶段报错
二、环境信息 (可选)
三、重现步骤 (可选)
四、预期结果 (可选)
💡 备注(选填)目前已知情况是在使用!bash build.sh --genop=experimental/math/sigmoid命令模板自动创建时修改了experimental文件夹下的CMakeLists.txt。具体操作为在该文件加下新增了add_subdirectory(math)语句。
AI给出的解释如下:
foreach 循环遍历到 math 时,执行了 add_subdirectory(math),此时 CMake 默认将构建目录设为 ${CMAKE_CURRENT_BINARY_DIR}/math。
循环结束后,又显式执行了一次 add_subdirectory(math),CMake 再次尝试使用同一个默认构建目录 ${CMAKE_CURRENT_BINARY_DIR}/math。
触发报错:同一个 binary directory 被用于构建同一个 source directory 两次。
删除 experimental文件夹下的CMakeLists.txt末尾的add_subdirectory(math)语句后报错消失。