epiqc / ScaffCC

Compilation, analysis and optimization framework for the Scaffold quantum programming language.
BSD 2-Clause "Simplified" License
188 stars 53 forks source link

ScaffCC does not compile with Python 3.4, but does with Python 2.7 #33

Closed teaguetomesh closed 4 years ago

teaguetomesh commented 5 years ago

ScaffCC's README states that a version of Python 2.7 or greater is required.

But when compiling with Python version 3.4

(my_py34_venv) ttomesh@cafe:[~/scrap/ScaffCC]: python --version
Python 3.4.9

Compilation will fail with a fatal error:

/home/ttomesh/scrap/ScaffCC/llvm/tools/llvm-config/llvm-config.cpp:45:10: fatal error: 'LibraryDependencies.inc' file
      not found
#include "LibraryDependencies.inc"
         ^
1 error generated.

But probably more concerning are these ImportErrors found throughout the compilation output:

llvm[2]: Constructing LLVMBuild project information.
Traceback (most recent call last):
  File "/home/ttomesh/scrap/ScaffCC/llvm/utils/llvm-build/llvm-build", line 3, in <module>
    import llvmbuild
  File "/home/ttomesh/scrap/ScaffCC/llvm/utils/llvm-build/llvmbuild/__init__.py", line 1, in <module>
    from main import main
ImportError: No module named 'main'

I then tried switching to Python 2.7 and ScaffCC compiled just fine.

singular-value commented 5 years ago

Ah I see. The ScaffCC code was written before Python3 was starting to gain traction, so I think "Python 2.7 or greater" was meant to mean: use Python 2.7

The "fix" will just be to update the documentation to indicate that ScaffCC requires Python 2.7. Can you do that?

Hopefully someone can look into upgrading to Python3 later...

AndrewLitteken commented 4 years ago

I think with the new version of LLVM this is no longer the case, closing.