sysconfig.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. import os
  15. __all__ = ['get_include', 'get_lib']
  16. def get_include():
  17. """
  18. Get the directory containing the PaddlePaddle C++ header files.
  19. Returns:
  20. The directory as string.
  21. Examples:
  22. .. code-block:: python
  23. >>> import paddle
  24. >>> include_dir = paddle.sysconfig.get_include()
  25. """
  26. import paddle
  27. return os.path.join(os.path.dirname(paddle.__file__), 'include')
  28. def get_lib():
  29. """
  30. Get the directory containing the libpaddle_framework.
  31. Returns:
  32. The directory as string.
  33. Examples:
  34. .. code-block:: python
  35. >>> import paddle
  36. >>> include_dir = paddle.sysconfig.get_lib()
  37. """
  38. import paddle
  39. return os.path.join(os.path.dirname(paddle.__file__), 'libs')