Skip to content

Commit

Permalink
setup.py updated (reported issue)
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-g-ion committed Jan 22, 2024
1 parent b529efc commit fdd7cf0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: Continuous Integration
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python all python version
Expand Down
56 changes: 32 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,9 @@
print()
print(logo_ascii)
print()
if os_name == 'Linux' or os_name == 'Darwin':
setup(name='torchTT',
version='2.0',
description='Tensor-Train decomposition in pytorch',
url='https://github.com/ion-g-ion/torchTT',
author='Ion Gabriel Ion',
author_email='ion.ion.gabriel@gmail.com',
license='MIT',
packages=['torchtt'],
install_requires=['pytest', 'numpy>=1.18','torch>=1.7','opt_einsum'],
ext_modules=[
CppExtension('torchttcpp', ['cpp/cpp_ext.cpp'], extra_compile_args=['-lblas', '-llapack', '-std=c++14', '-Wno-c++11-narrowing', '-g', '-w', '-O3']),
],
cmdclass={
'build_ext': BuildExtension
},
test_suite='tests',
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
])
else:

def python_install():

import warnings
warnings.warn("\x1B[33m\nC++ implementation not available. Using pure Python.\n\033[0m")

Expand All @@ -60,4 +39,33 @@
zip_safe=False)


if os_name == 'Linux' or os_name == 'Darwin':
try:
setup(name='torchTT',
version='2.0',
description='Tensor-Train decomposition in pytorch',
url='https://github.com/ion-g-ion/torchTT',
author='Ion Gabriel Ion',
author_email='ion.ion.gabriel@gmail.com',
license='MIT',
packages=['torchtt'],
install_requires=['pytest', 'numpy>=1.18','torch>=1.7','opt_einsum'],
ext_modules=[
CppExtension('torchttcpp', ['cpp/cpp_ext.cpp'], extra_compile_args=['-lblas', '-llapack', '-std=c++17', '-Wno-c++11-narrowing', '-g', '-w', '-O3']),
],
cmdclass={
'build_ext': BuildExtension
},
test_suite='tests',
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
])
except:
python_install()
else:
python_install()


0 comments on commit fdd7cf0

Please sign in to comment.