dgasmith / gau2grid

Fast computation of a gaussian and its derivative on a grid.
https://gau2grid.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
29 stars 17 forks source link

[regression in 1.3.1] Fails for python-2.7 #40

Closed yurivict closed 5 years ago

yurivict commented 5 years ago
-- Found Python 2.7: /usr/local/bin/python2.7 (found version 2.7.15)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'commonpath'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'commonpath'
CMake Error at CMakeLists.txt:163 (install):
  install DIRECTORY given no DESTINATION!

-- Configuring incomplete, errors occurred!
See also "/usr/ports/math/py-gau2grid/work-py27/gau2grid-1.3.1/build/temp.freebsd-11.2-STABLE-amd64-2.7/CMakeFiles/CMakeOutput.log".
See also "/usr/ports/math/py-gau2grid/work-py27/gau2grid-1.3.1/build/temp.freebsd-11.2-STABLE-amd64-2.7/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 147, in <module>
    zip_safe=False,
  File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 143, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 33, in run
    self.build_extension(ext)
  File "setup.py", line 56, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + internal_cmake_args, cwd=self.build_temp, env=env)
  File "/usr/local/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/usr/ports/math/py-gau2grid/work-py27/gau2grid-1.3.1', '-DPYTHON_EXECUTABLE=/usr/local/bin/python2.7', '-DSPHERICAL_ORDER=gaussian', '-DINSTALL_PYMOD=ON', '-DENABLE_XHOST=ON', '-DBUILD_FPIC=ON', '-DBUILD_SHARED_LIBS=ON', '-DMAX_AM=6', '-DENABLE_GENERIC=OFF', '-DCARTESIAN_ORDER=row', '-DCMAKE_BUILD_TYPE=Release', '-DNATIVE_PYTHON_INSTALL=ON', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1
*** Error code 1

Worked fine in version 1.3.0

FreeBSD 11.2 amd64

loriab commented 5 years ago

Indeed, os.path.commonpath was new in py35. I don't think @dgasmith had any objection to dropping py27 support. You can get around this by using CMAKE_PREFIX_PATH and PYMOD_INSTALL_LIBDIR and avoiding NATIVE_PYTHON_INSTALL.

dgasmith commented 5 years ago

No more Python3 support is fine with me.

yurivict commented 5 years ago

This breaks with setup.py, but works with cmake. With cmake it builds for both python2 and python3, so IMO no need to fix something that isn't broken.