xla icon indicating copy to clipboard operation
xla copied to clipboard

PT XLA Build Error during test_ptxla

Open codeislife99 opened this issue 2 years ago • 1 comments

❓ Questions and Help

Hi I get the following error during building pt-xla from source.

make[2]: *** No rule to make target '/home/ubuntu/.conda/envs/py38/lib/libpython3.8.a', needed by 'test_ptxla'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 42%] Building CXX object CMakeFiles/test_ptxla.dir/main.cpp.o
[ 52%] Building CXX object CMakeFiles/test_ptxla.dir/metrics_snapshot.cpp.o
[ 52%] Building CXX object CMakeFiles/test_ptxla.dir/cpp_test_util.cpp.o
[ 57%] Building CXX object CMakeFiles/test_ptxla.dir/test_async_task.cpp.o
[ 61%] Building CXX object CMakeFiles/test_ptxla.dir/test_aten_xla_tensor.cpp.o
[ 66%] Building CXX object CMakeFiles/test_ptxla.dir/test_ir.cpp.o
[ 71%] Building CXX object CMakeFiles/test_ptxla.dir/test_mayberef.cpp.o
[ 76%] Building CXX object CMakeFiles/test_ptxla.dir/test_op_by_op_executor.cpp.o
[ 80%] Building CXX object CMakeFiles/test_ptxla.dir/test_replication.cpp.o
[ 85%] Building CXX object CMakeFiles/test_ptxla.dir/test_xla_util_cache.cpp.o
[ 95%] Building CXX object CMakeFiles/test_ptxla.dir/torch_xla_test.cpp.o
[ 95%] Building CXX object CMakeFiles/test_ptxla.dir/test_tensor.cpp.o
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/test_ptxla.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Failed to build tests: ['/home/ubuntu/pytorch/xla/test/cpp/run_tests.sh', '-B']

I have seen an error like this before but that was because anaconda was lacking and it needed conda. But as you can see its a conda env , but I don't have a file like libpython3.8.a . Is there a solution here other than working around it by setting BUILD_CPP_TESTS=0

codeislife99 avatar Jul 14 '22 02:07 codeislife99

You may want to checkout why these env variables are not returned correctly in you environment here https://github.com/pytorch/xla/blob/371bdf462a6b7576e294ae39e5ba23d8509d7834/test/cpp/run_tests.sh#L55-L56 For my environment, I'm getting PYTHON_INCLUDE_DIR=/home/ubuntu/anaconda3/include/python3.8 PYTHON_LIBRARY=/home/ubuntu/anaconda3/lib/libpython3.8.so

ymwangg avatar Jul 15 '22 19:07 ymwangg