未验证 提交 9f47aac9 编写于 作者: H HongyuJia 提交者: GitHub

fix custom operator testcase CI error (#49270)

上级 1172df96
...@@ -14,21 +14,24 @@ ...@@ -14,21 +14,24 @@
import os import os
import sys import sys
from distutils.sysconfig import get_python_lib from site import getsitepackages
from paddle.utils.cpp_extension.extension_utils import IS_WINDOWS from paddle.utils.cpp_extension.extension_utils import IS_WINDOWS
IS_MAC = sys.platform.startswith('darwin') IS_MAC = sys.platform.startswith('darwin')
site_packages_path = get_python_lib()
# Note(Aurelius84): We use `add_test` in Cmake to config how to run unittest in CI. # Note(Aurelius84): We use `add_test` in Cmake to config how to run unittest in CI.
# `PYTHONPATH` will be set as `build/python/paddle` that will make no way to find # `PYTHONPATH` will be set as `build/python/paddle` that will make no way to find
# paddle include directory. Because the following path is generated after installing # paddle include directory. Because the following path is generated after installing
# PaddlePaddle whl. So here we specific `include_dirs` to avoid errors in CI. # PaddlePaddle whl. So here we specific `include_dirs` to avoid errors in CI.
paddle_includes = [ paddle_includes = []
os.path.join(site_packages_path, 'paddle', 'include'), for site_packages_path in getsitepackages():
os.path.join(site_packages_path, 'paddle', 'include', 'third_party'), paddle_includes.append(
] os.path.join(site_packages_path, 'paddle', 'include')
)
paddle_includes.append(
os.path.join(site_packages_path, 'paddle', 'include', 'third_party')
)
# Test for extra compile args # Test for extra compile args
extra_cc_args = ['-w', '-g'] if not IS_WINDOWS else ['/w'] extra_cc_args = ['-w', '-g'] if not IS_WINDOWS else ['/w']
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册