codeplaysoftware / portBLAS

An implementation of BLAS using the SYCL open standard.
Apache License 2.0
250 stars 48 forks source link

Build fails: cannot import name 'generate_file' from 'py_gen' #496

Closed chsasank closed 6 months ago

chsasank commented 7 months ago

Hi,

Followed the instructions from Readme to build portblas for Intel DPCPP compiler and here are my exact steps:

export CC=/opt/intel/oneapi/2024.0/bin/compiler/clang
export CXX=/opt/intel/oneapi/2024.0/bin/compiler/clang++
mkdir build
cd build
cmake -GNinja ../ -DSYCL_COMPILER=dpcpp
ninja

This throws the following errors:

(base) sasank@arc-reactor:~/code/portBLAS/build$ ninja
[1/579] Generating ../../../generated_src/blas1/axpy/axpy_float_int_float_int.cpp
FAILED: generated_src/blas1/axpy/axpy_float_int_float_int.cpp /home/sasank/code/portBLAS/build/generated_src/blas1/axpy/axpy_float_int_float_int.cpp 
cd /home/sasank/code/portBLAS/build && /usr/bin/python3 /home/sasank/code/portBLAS/python_generator/py_gen_blas_ops.py /home/sasank/code/portBLAS/external/ /home/sasank/code/portBLAS/python_generator/gen blas1 a
xpy /home/sasank/code/portBLAS/src/interface/blas1/axpy.cpp.in float int int axpy_float_int_float_int.cpp 
Traceback (most recent call last):
  File "/home/sasank/code/portBLAS/python_generator/py_gen_blas_ops.py", line 34, in <module>
    from py_gen import generate_file
ImportError: cannot import name 'generate_file' from 'py_gen' (unknown location)

...
[14/579] Generating ../../../generated_src/blas1/iamax_return/iamax_return_float_int_float_int.cpp
FAILED: generated_src/blas1/iamax_return/iamax_return_float_int_float_int.cpp /home/sasank/code/portBLAS/build/generated_src/blas1/iamax_return/iamax_return_float_int_float_int.cpp 
cd /home/sasank/code/portBLAS/build && /usr/bin/python3 /home/sasank/code/portBLAS/python_generator/py_gen_blas_ops.py /home/sasank/code/portBLAS/external/ /home/sasank/code/portBLAS/python_generator/gen blas1 iamax_return /home/sasank/code/portBLAS/src/interface/blas1/iamax_return.cpp.in float int int iamax_return_float_int_float_int.cpp
Traceback (most recent call last):
  File "/home/sasank/code/portBLAS/python_generator/py_gen_blas_ops.py", line 34, in <module>
    from py_gen import generate_file
ImportError: cannot import name 'generate_file' from 'py_gen' (unknown location)
ninja: build stopped: subcommand failed.

Happy to help to fix this.

chsasank commented 6 months ago

Recursive clone fixes this!