blitzpp / blitz

Blitz++ Multi-Dimensional Array Library for C++
https://github.com/blitzpp/blitz/wiki
Other
404 stars 83 forks source link

Does not build on Python3 systems #102

Closed ClmnsRck closed 4 years ago

ClmnsRck commented 5 years ago

spack-build.txt Here is the output of spack install blitz.

citibeth commented 5 years ago

@ClmnsRck Looks like Blitz++ has some code generation that relies on Python to run. Since the Spack package for Blitz++ doesn't specify Python as a build-time dependency, it's just using whatever Python is on your system. In the past, the python command provided Python2 as default. Now some Linux systems (notably Ubuntu) have switched to providing only Python3. In your case, the genstencils.py command is clearly being run by some Python3.

Can you share what OS you're using?

The best solution to this problem is to fix the Blitz++ build so it works with Python2 or Python3. I don't expect that will be very hard.

make[4]: Entering directory '/tmp/ruck/spack-stage/spack-stage-g7c_3kzo/blitz-1.0.1/blitz/generate'
python genstencils.py /home/ruck/spack/var/spack/stage/blitz-1.0.1-55uu5roueihntaq7mwviuhzcci2q7eqk/blitz-1.0.1/blitz/array/stencil-classes.cc
  File "genstencils.py", line 9
    print "Generating file %s"%sys.argv[1]
                             ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Generating file %s"%sys.argv[1])?
ClmnsRck commented 5 years ago

Interestingly, it again was because of my installation of anaconda3 and conda ... it now works, after removing the corresponding lines from the ~/.bashrc it worked

citibeth commented 5 years ago

, it again was because of my installation of anaconda3 and conda

Yes, that would do it. BTW... I use Spack for my Python distro. That's in the end easier than maintaining Conda for Python stuff and some other auto-builder (or manual builds) for everything else. Also, throwing random stuff into Spack's environment can mess it up.

I'm glad you found a way beyond your problem. But I'm leaving this Issue open because everyone needs to become Python3 compliant. And that includes Blitz++. We only have 1 year left: https://pythonclock.org/

mehrdad19 commented 4 years ago

Hi, is there a way to keep anaconda and still install Blitz?

citibeth commented 4 years ago

Yes probably, I'm just not familiar at all with anaconda.

slayoo commented 4 years ago

@papadop CMake build should make it easy to specify externally the version of Python to use, I guess a simple change around here should do: https://github.com/blitzpp/blitz/blob/e8ec09f29716ee35cdd3668852704e141f2f7ae3/blitz/array/CMakeLists.txt#L15

?

slayoo commented 4 years ago

Fixed in #144 Thanks @papadop