Skip to content

Commit

Permalink
issue #31 change to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ion committed Dec 11, 2024
1 parent c43b664 commit 1b27da6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
push:
branches:
- main
# Alternative: only build for tags.
tags:
tags-ignore:
- '*'

# security: restrict permissions for CI jobs.
Expand Down
2 changes: 1 addition & 1 deletion cpp/define.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <array>
#include <iostream>
#include <chrono>
#include "BLAS.h"
// #include "BLAS.h"

// torch::NoGradGuard no_grad;

Expand Down
4 changes: 2 additions & 2 deletions cpp/gmres.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void gmres(at::Tensor &solution, int &flag, int &nit, AMENsolveMV<T> &Op, at::Te
}
}


/*
void gmres_double_cpu(double *solution,
int &flag,
int &nit,
Expand Down Expand Up @@ -307,4 +307,4 @@ void gmres_double_cpu(double *solution,
delete [] work1;
delete [] H;
delete [] piv_tmp;
}
}*/
4 changes: 2 additions & 2 deletions cpp/matvecs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "define.h"



/*
template <typename T>
class AMENsolveMV_cpu{
Expand Down Expand Up @@ -126,7 +126,7 @@ class AMENsolveMV_cpu{
}
};

*/
template <typename T> class AMENsolveMV{

private:
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
requires = ["setuptools>=61", "setuptools-scm>=8.0", "wheel", "torch>=1.7", "numpy>=1.18", "opt_einsum", "ninja", "scipy>=0.16"]
build-backend = "setuptools.build_meta"

[tool.setuptools.package-data]
torchtt = ["cpp/*"]
[tool.setuptools]
packages = ["torchtt"]

[tool.setuptools.packages]
find = {} # Scan the project directory with the default parameters
#[tool.setuptools.package-data]
#torchtt = ["cpp/*"]

[project]
name = "torchTT"
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@
'torchttcpp',
['cpp/cpp_ext.cpp'],
include_dirs=["cpp"],
libraries=["blas", "lapack", "stdc++"],
#libraries=["blas", "lapack", "stdc++"],
extra_compile_args=[
#'-lblas', '-llapack',
'-std=c++17',
'-Wno-c++11-narrowing', '-w', '-O3',
],
Expand All @@ -59,7 +60,7 @@
except Exception as e:
warn("\x1B[33m\nC++ implementation not available. Falling back to pure Python.\n\033[0m")
print(f"Error: {e}")
#setup()
setup()
else:
warn("\x1B[33m\nC++ implementation not supported on this OS. Falling back to pure Python.\n\033[0m")
#setup()
setup()

0 comments on commit 1b27da6

Please sign in to comment.