Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
5d21fc8
allow division UniTensor / scalar for Block[Fermionic]UniTensor
manuschneider Sep 16, 2025
28b86ff
implemented Div_ for Block[Fermionic]UniTensor
manuschneider Sep 16, 2025
72917d8
-improved error messages
manuschneider Sep 16, 2025
6706900
added UniTests for Div Div_ and Pow
manuschneider Sep 19, 2025
2e7d5cc
fixed bugs in Inv for float and double
manuschneider Sep 19, 2025
4704655
fixed types of constants to avoid type casts
manuschneider Sep 19, 2025
7c5db0c
implemented UniTensor.Inv(clip) and .Inv_(clip)
manuschneider Sep 20, 2025
ce07fbc
added unit tests for UniTensor.Inv
manuschneider Sep 20, 2025
419680a
made AreNearlyEqUniTensor print out the elements if two DenseUniTenso…
manuschneider Sep 20, 2025
af4f554
made clipping value included in cutof: |elem| <= clip ? 0 : 1/elem
manuschneider Sep 20, 2025
86e4c4c
-added linalg::Inv and Inv_ for UniTensor
manuschneider Sep 24, 2025
fe5fbfe
made UniTensor.Inv and .Inv_ use linalg implementation (just like Pow…
manuschneider Sep 24, 2025
6a13bd0
removed Pow for dense UniTensors and build in a sensible type check
manuschneider Sep 24, 2025
f2eabc8
-updated comments for Pow(_)
manuschneider Sep 24, 2025
c496789
updated doxygen documentation for Inv and Pow
manuschneider Sep 24, 2025
e8c071c
new unittests
manuschneider Sep 24, 2025
f10bd9a
using sqrt(Re^2 + Im^2) for the pseudoinverse of a complex number, to…
manuschneider Sep 24, 2025
0f15dae
accelerated inverse by checking if clip < 0.
manuschneider Sep 24, 2025
fd89469
-updated GPU implementation of Inv to use norm of elements for the cl…
manuschneider Sep 25, 2025
0139fc1
TDVP: increased maxiteration for Lanczos_Exp because no convergence i…
manuschneider Sep 25, 2025
81d3d54
fixed bug with Pow on GPU
manuschneider Sep 25, 2025
48fdebe
fixed bug
manuschneider Sep 25, 2025
8f143c4
removed Inv test which should not be part of this branch
manuschneider Sep 25, 2025
191214c
-removed unnecessary opening and closing of namespaces
manuschneider Sep 25, 2025
0d6da15
disabled Pow unit test to see if it interferes with the TDVP test
manuschneider Oct 31, 2025
2d0b401
this was not the cause of the breaking tdsvp test; the breaking code …
manuschneider Oct 31, 2025
d722c1e
removed using namespace cytnx in tensor_py.cpp
manuschneider Oct 31, 2025
955a870
fixed bug in ExpH when a == 0 and b != 0
manuschneider Oct 31, 2025
ab51bf7
added pybind for numpy type scalars
manuschneider Nov 1, 2025
b3ffb83
added numpy scalars for UniTensors
manuschneider Nov 1, 2025
bf4099f
added numpy scalars for linalg and linop
manuschneider Nov 1, 2025
fc95f40
fixed wrong namings for UniTensor
manuschneider Nov 1, 2025
596f11c
added pybind for scalar
manuschneider Nov 1, 2025
b2c9e7f
clang formatting
manuschneider Nov 1, 2025
8edee83
change rowrank accordingly when bonds are combined
manuschneider Nov 2, 2025
d515052
clang, error messages fixed
manuschneider Nov 2, 2025
41e57ac
Fix pytest tdvp.
hunghaoti Nov 9, 2025
808ba2d
Update checkout action in PR workflows
IvanaGyro Nov 10, 2025
2ca179c
Remove unused GitHub workflow files
IvanaGyro Nov 10, 2025
960b42d
Upgrade GitHub Actions to latest versions
IvanaGyro Nov 10, 2025
14c1c3d
Merge branch 'master' into fix_exph
IvanaGyro Nov 10, 2025
c6c1726
Merge pull request #686 from Cytnx-dev/fix_Pow
manuschneider Nov 10, 2025
7435a94
added right dtype, device
manuschneider Nov 10, 2025
584a517
replaced C-type casts (type) by static_cast<type>()
manuschneider Nov 10, 2025
b6dfcf2
clang
manuschneider Nov 10, 2025
cc12e63
Fix and update coverity workflow
IvanaGyro Nov 11, 2025
068801c
Merge pull request #698 from Cytnx-dev/fix_exph
manuschneider Nov 11, 2025
ee3a71c
Merge pull request #706 from Cytnx-dev/ci-pr-latest
IvanaGyro Nov 13, 2025
eb3e3be
Add HPTT as BUILD_BYPRODUCTS
ultimatile Nov 16, 2025
e6b1800
Merge pull request #708 from ultimatile/fix-hptt-build-byprodct
IvanaGyro Nov 17, 2025
4a23aa9
removed ../ in include
manuschneider Nov 20, 2025
dbfc9bd
Merge remote-tracking branch 'master' into Inv
manuschneider Nov 20, 2025
4d95705
Refine Mod CPU implement
jysh1214 Nov 3, 2025
14ad688
updated developers list
manuschneider Nov 24, 2025
aab740b
improved API documentation
manuschneider Nov 24, 2025
acf4366
updated create UniTensor and print_diagram to include new generators …
manuschneider Nov 24, 2025
a60c799
updated code examples to include UniTensor generators
manuschneider Nov 24, 2025
ce9e440
fixed broken reference
manuschneider Nov 24, 2025
0189195
changed relabels to relabel
manuschneider Nov 24, 2025
f1ed932
added arange to the UniTensor generators
manuschneider Nov 24, 2025
8e56071
clang format
manuschneider Nov 24, 2025
443a0e8
replaced relabels by relabel everywhere
manuschneider Nov 24, 2025
85ece18
updated UniTensor manipulations
manuschneider Nov 24, 2025
c0466e9
Merge pull request #704 from Cytnx-dev/dev/alexchiang/refine-cpu-mod
jysh1214 Nov 24, 2025
f2e9345
feat: Update default install prefix, add OpenBLAS presets for Apple, …
yingjerkao Nov 24, 2025
7b69f35
Merge branch 'master' of github.com:Cytnx-dev/Cytnx
yingjerkao Nov 24, 2025
a640816
fixed elementwise arithmetics between diagonal and non-diagonal Dense…
manuschneider Nov 25, 2025
8999f45
added operator-() for UniTensor and fixed unwanted type conversion fo…
manuschneider Nov 25, 2025
30642e7
added unit tests for Add(_), Sub(_), Mul(_), Div(_) between diagonal …
manuschneider Nov 25, 2025
d48f06f
removed changes to operator-(), since this is a different topic
manuschneider Nov 25, 2025
4181138
unit test does not depend on UniTensor.operator-() anymore
manuschneider Nov 25, 2025
7fa6d91
clang
manuschneider Nov 25, 2025
8cc2b16
avoids taking (inefficient) Tensor.operator-() and uses change of sig…
manuschneider Nov 27, 2025
6409754
Merge pull request #705 from Cytnx-dev/haoti/fix_pytest_tdvp
hunghaoti Nov 27, 2025
506c360
added applysigns(_) to apply the fermionic signflips
manuschneider Nov 27, 2025
bf49ef3
most UniTensor methods return a pointer to itself, such that method c…
manuschneider Nov 27, 2025
b21d7e0
Merge remote-tracking branch 'origin/master' into chaining
manuschneider Nov 27, 2025
d32e7d3
fixed bug
manuschneider Nov 27, 2025
edd5e1d
changed the method name applysigns(_) to apply(_). This way, other op…
manuschneider Nov 27, 2025
67b6a58
upadted doxygen string
manuschneider Nov 27, 2025
98cf329
added unit tests
manuschneider Nov 27, 2025
a964231
fixed typo
manuschneider Nov 27, 2025
2732110
Merge pull request #674 from Cytnx-dev/DivBlockScalar
manuschneider Nov 27, 2025
be1cfcf
removed unused code
manuschneider Nov 27, 2025
29af7f3
pybind11 3.0.0 required.
hunghaoti Nov 27, 2025
254322e
Merge pull request #699 from Cytnx-dev/add_numpy_scalar_bindings
manuschneider Nov 28, 2025
dc4d21c
replaced Tio as argument by Tin
manuschneider Nov 28, 2025
989c3c5
Merge branch 'master' into Inv
manuschneider Nov 28, 2025
c54e777
added default argument clip = -1. for linalg::Inv(clip)
manuschneider Nov 28, 2025
22f340d
Merge remote-tracking branch 'origin/Inv' into Inv
manuschneider Nov 28, 2025
282f955
Refine Div CPU implementation
jysh1214 Nov 25, 2025
3883771
Merge pull request #700 from Cytnx-dev/fix_combineBonds_rowrank
manuschneider Nov 28, 2025
240990e
Merge pull request #718 from Cytnx-dev/chaining
manuschneider Nov 28, 2025
e2bba84
Merge branch 'master' into fermionic_efficient_neg
manuschneider Nov 28, 2025
e839fa8
minor change
manuschneider Nov 28, 2025
f9bb7f3
Merge pull request #680 from Cytnx-dev/Inv
manuschneider Nov 28, 2025
fb2fa90
Merge branch 'master' into fermionic_efficient_neg
manuschneider Nov 28, 2025
e87c3a2
clang
manuschneider Nov 28, 2025
c5e79bf
Merge pull request #719 from Cytnx-dev/fermionic_efficient_neg
manuschneider Nov 29, 2025
c5dd9c4
Merge pull request #715 from Cytnx-dev/dev/alexchiang/refine-div-cpu
jysh1214 Nov 30, 2025
9ab00e2
changed behaviour of UniTensor.Transpose to exchange the roles of lef…
manuschneider Dec 4, 2025
a8f447a
fixed unit tests
manuschneider Dec 4, 2025
623f884
cleaned up unused functions in the unit tests that would fail with th…
manuschneider Dec 4, 2025
b0503a4
fixed bug
manuschneider Dec 4, 2025
cf82d5f
added unit test to cover the bug
manuschneider Dec 5, 2025
557d6e1
some cleaning of GPU-test
manuschneider Dec 5, 2025
f680c31
updated behaviour of Transpose and Dagger, added (dummy) chapter on f…
manuschneider Dec 5, 2025
86b5d07
some cleanup in the Lanczos files, avoids function names starting wit…
manuschneider Dec 5, 2025
016deea
fixed DMRG for BlockUniTensor to account for the new index order afte…
manuschneider Dec 5, 2025
dec28fa
Merge remote-tracking branch 'origin/master' into manuel/doc_update
manuschneider Dec 5, 2025
73a7931
Merge remote-tracking branch 'origin/master' into fix_diag_nodiag
manuschneider Dec 5, 2025
033ece3
replaced A.Dagger() by Dagger().permute_(A.labels())
manuschneider Dec 5, 2025
fcbb71e
use .set_rowrank_() instead of initializer argument (rowrank=...)
manuschneider Dec 5, 2025
91dd9ac
file extensions in Save() and Load() methods are optional
manuschneider Dec 5, 2025
f460da4
added pybind for UniTensor.apply() and apply_()
manuschneider Dec 11, 2025
9ae0c21
updates in UniTensor section
manuschneider Dec 11, 2025
ce9f442
updated userguide
manuschneider Dec 11, 2025
cd99f8f
added test for tagged DenseUniTensor
manuschneider Feb 23, 2026
ba011f8
dmrg_two_sites: fixed bug in network, added labels to UniTensors
manuschneider Feb 23, 2026
8642e78
replaced static functions by functions in unnamed namespace
manuschneider Feb 23, 2026
432eaaa
fixed typo in function name
manuschneider Feb 23, 2026
f4befdf
deprecated linalg::Make_uniform and linalg::Make_normal
manuschneider Mar 16, 2026
150d2b6
added [[deprecated]] marker and updated docstrings for deprecations
manuschneider Mar 16, 2026
4080739
replaced deprecated marker for trace by indices by warning in documen…
manuschneider Mar 17, 2026
ff0b024
Merge pull request #748 from Cytnx-dev/deprecated
manuschneider Mar 18, 2026
92dcecb
Merge pull request #726 from Cytnx-dev/Lanczos_cleanup
manuschneider Mar 18, 2026
147aa79
fix tests: restore Sub_diag_diag and fix Div__diag_ndiag divisor range
pcchen Mar 19, 2026
9e675bd
fix Add_/Sub_/Mul_/Div_: shape check for untagged and Div_ dead code
pcchen Mar 19, 2026
12d4f07
style: clang-format DenseUniTensor.cpp
pcchen Mar 19, 2026
810abf1
fix Add_/Sub_/Mul_/Div_: exception safety and avoid N×N temporary in …
pcchen Mar 19, 2026
18091c1
fix test Div_diag_ndiag: avoid 0/0 NaN masking in cross-check assertion
pcchen Mar 19, 2026
8ee661a
fix Add_/Sub_/Mul_ dense+diag: reject non-square dense lhs before mut…
pcchen Mar 19, 2026
ff8e987
fix Add_/Sub_/Mul_ dense+diag: keep GPU on tensor kernels, CPU uses s…
pcchen Mar 19, 2026
fa015d4
test diag_ndiag: add ComplexDouble dtype coverage and postcondition c…
pcchen Mar 19, 2026
06f3f82
Merge pull request #716 from Cytnx-dev/fix_diag_nodiag
pcchen Mar 20, 2026
1dfbeee
fix apply_() return type and add Python pybind tests for apply/apply_
pcchen Mar 20, 2026
89965ef
add docstrings to apply() and apply_() pybind bindings
pcchen Mar 20, 2026
1aecfa4
Merge pull request #733 from Cytnx-dev/apply_pybind
pcchen Mar 20, 2026
397ecbc
cmake: require pybind11 >= 3.0, fall back to FetchContent v3.0.0
pcchen Mar 27, 2026
f03293e
Merge pull request #747 from Cytnx-dev/deprecate_Make_functions
manuschneider Mar 30, 2026
93552ee
made missing file extensions deprecated
manuschneider Apr 1, 2026
e9d90ff
fixed unit tests
manuschneider Apr 1, 2026
42e86b1
Merge remote-tracking branch 'master' into file_extension
manuschneider Apr 1, 2026
22aab5f
Merge pull request #728 from Cytnx-dev/file_extension
manuschneider Apr 1, 2026
0a7812e
Merge pull request #720 from Cytnx-dev/haotipybind11_3
pcchen Apr 3, 2026
c52e8e3
Modify `Add_test.cpp` to use mixed types
jysh1214 Dec 27, 2025
0d017d8
cmake/cuda: fix build failures with CUDA 12+/13
pcchen Mar 27, 2026
f34237f
cmake/cuda: robust CCCL include path detection
yingjerkao Mar 31, 2026
3d7ca70
style: clang-format cutensornet CUDA13 guard
yingjerkao Mar 31, 2026
750e15d
cmake: merge conflict resolution - require pybind11 3.0.0 with FetchC…
pcchen Apr 3, 2026
a22dd1e
cmake: remove redundant PYBIND11_FINDPYTHON setting
pcchen Apr 3, 2026
5b9c10c
Merge pull request #755 from Cytnx-dev/require-pybind11-v3
pcchen Apr 3, 2026
c05b1e5
replaced .relabels(_) by .relabel(_)
manuschneider Dec 5, 2025
301ebec
replaced .set_label( by .relabel(
manuschneider Dec 5, 2025
acc0ac3
replaced .set_label( by .relabel(
manuschneider Dec 5, 2025
ede1dfc
fixed missing underscore
manuschneider Feb 23, 2026
acc2a49
minor style fix
manuschneider Feb 23, 2026
9ff1bdb
fix relabels_(new_labels) deprecated message: point to 1-param relabel_
pcchen Mar 20, 2026
f12da93
mark set_labels() overloads as [[deprecated]] in public UniTensor API
pcchen Mar 20, 2026
4573d03
mark set_labels and relabels_ as [[deprecated]] in UniTensor_base
pcchen Mar 20, 2026
7948b7b
restore deprecated-function tests with pragma suppression
pcchen Mar 20, 2026
f9983e4
emit DeprecationWarning from deprecated Python pybind bindings
pcchen Mar 20, 2026
9142d24
fixed clang
manuschneider Mar 30, 2026
f55128c
improved tdvp1_dense function to not alter its input, renamed files w…
manuschneider Apr 1, 2026
940992f
checks if idx != 0 for dense UniTensors when get_block(_) or put_bloc…
manuschneider Nov 2, 2025
b137803
dense get_block(_): replaced standard argument by a method not taking…
manuschneider Nov 2, 2025
5270cc5
fix DenseUniTensor put_block/put_block_ error message and format spec…
pcchen Mar 20, 2026
37f865d
ci: replace macos-13 runner label
yingjerkao Apr 3, 2026
026b321
fix issues from PR #725 review: tests, docs, and example comments
pcchen Apr 3, 2026
b9429db
merge master: resolve conflicts from Transpose/Dagger changes
pcchen Apr 4, 2026
4f7612f
clang-format: fix line wrapping in gpu/BlockUniTensor_test.cpp
pcchen Apr 4, 2026
d20477a
Merge pull request #770 from Cytnx-dev/fix/769-macos15-intel
yingjerkao Apr 7, 2026
550a5ed
Bump requests from 2.32.3 to 2.33.0 in /docs
dependabot[bot] Apr 7, 2026
b3da6f1
Merge pull request #775 from Cytnx-dev/dependabot/uv/docs/requests-2.…
yingjerkao Apr 9, 2026
c0320b5
Bump setuptools from 75.8.2 to 78.1.1 in /docs
dependabot[bot] Apr 9, 2026
a804f79
Bump pygments from 2.19.1 to 2.20.0 in /docs
dependabot[bot] Apr 9, 2026
17a0b26
Bump urllib3 from 2.3.0 to 2.6.3 in /docs
dependabot[bot] Apr 9, 2026
3374ca4
Merge pull request #772 from Cytnx-dev/dependabot/uv/docs/setuptools-…
yingjerkao Apr 9, 2026
d646429
Merge pull request #773 from Cytnx-dev/dependabot/uv/docs/urllib3-2.6.3
yingjerkao Apr 9, 2026
d23a236
Merge pull request #774 from Cytnx-dev/dependabot/uv/docs/pygments-2.…
yingjerkao Apr 9, 2026
7aa7862
Transpose inverts the index order for all UniTensor types
manuschneider Apr 9, 2026
58f985b
Updated doc: Transpose inverts the order of the indices
manuschneider Apr 9, 2026
5edeede
Merge pull request #725 from Cytnx-dev/transpose_left_right
manuschneider Apr 9, 2026
07ba4c5
removed docs/uv.lock from repo
manuschneider Apr 9, 2026
da8be6d
Merge branch 'master' into manuel/doc_update
manuschneider Apr 10, 2026
ae00a31
updated install instructions to include boost-cpp
manuschneider Apr 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 0 additions & 101 deletions .github/workflows/ci-cmake_pytests.yml

This file was deleted.

16 changes: 14 additions & 2 deletions .github/workflows/ci-cmake_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,20 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

# When re-running a PR job, GitHub Actions uses the merge commit created at
# the time of the original run, not a fresh merge with the latest target branch.
# This step ensures we always test against the most recent target branch.
- name: Merge with latest target branch (pull_request only)
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
git merge --no-edit origin/${{ github.event.pull_request.base.ref }}
Comment on lines +24 to +25
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Configure git identity before merging in CI jobs

This step runs git merge --no-edit, and git merge performs a commit by default (--[no-]commit perform a commit if the merge succeeds), so on runners without a preconfigured user.name/user.email it aborts with “Committer identity unknown” whenever the merge is non-fast-forward. That causes pull_request workflows to fail before tests even start; add an explicit git config user.name/user.email (or avoid creating a merge commit) before this command.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is taken over from the current master branch, which was merged into this branch. Can someone comment?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is from 808ba2d

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IvanaGyro could you check this?


- uses: conda-incubator/setup-miniconda@v3
with:
# Specify python version your environment will have. Remember to quote this, or
# YAML will think you want python 3.1 not 3.10
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ jobs:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

# When re-running a PR job, GitHub Actions uses the merge commit created at
# the time of the original run, not a fresh merge with the latest target branch.
# This step ensures we always test against the most recent target branch.
- name: Merge with latest target branch (pull_request only)
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
git merge --no-edit origin/${{ github.event.pull_request.base.ref }}

- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/clang-format-action@v4.11.0
uses: jidicula/clang-format-action@v4.16.0
with:
clang-format-version: '14'
check-path: '.'
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/conda_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,24 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, macos-latest]
os: [ubuntu-latest, macos-15-intel, macos-latest]
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

# When re-running a PR job, GitHub Actions uses the merge commit created at
# the time of the original run, not a fresh merge with the latest target branch.
# This step ensures we always test against the most recent target branch.
- name: Merge with latest target branch (pull_request only)
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
git merge --no-edit origin/${{ github.event.pull_request.base.ref }}

- uses: conda-incubator/setup-miniconda@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/conda_build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-latest]
os: [ubuntu-latest, macos-15-intel, macos-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
# Specify python version your environment will have. Remember to quote this, or
# YAML will think you want python 3.1 not 3.10
Expand All @@ -33,9 +33,9 @@ jobs:
- name: Install dependencies
shell: bash -l {0}
run: |
mamba install _openmp_mutex=*=*_llvm cmake make boost git compilers numpy mkl mkl-include mkl-service pybind11 libblas=*=*mkl gtest
mamba install cmake make boost compilers blas=*=mkl pybind11 arpack

cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_INSTALL_PREFIX=/home/runner/works/Cytnx_lib -DUSE_MKL=on -DUSE_HPTT=on -DHPTT_ENABLE_FINE_TUNE=on -DHPTT_ENABLE_AVX=on -DBUILD_PYTHON=on -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DRUN_TESTS=on
cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_INSTALL_PREFIX=/home/runner/works/Cytnx_lib --preset=mkl-cpu

- name: Download Coverity Build Tool
shell: bash -l {0}
Expand Down
66 changes: 0 additions & 66 deletions .github/workflows/coverity-scan_old

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
publish_branch: gh-pages
personal_token: ${{ secrets.PAGES_PAT }}
external_repository: Cytnx-dev/Cytnx_doc
publish_dir: docs/build/
Expand Down
34 changes: 26 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ endfunction()

include(CMakeDependentOption)

set(CMAKE_INSTALL_PREFIX "/usr/local/cytnx" CACHE PATH "Destination path for installation")
set(CMAKE_INSTALL_PREFIX "~/.local/cytnx" CACHE PATH "Destination path for installation")
option(BUILD_PYTHON "Build Python API. Requires Python and pybind11 installed." ON)
option(BACKEND_TORCH "Use PyTorch as a backend container for tensors." OFF)
cmake_dependent_option(USE_MKL "Use MKL as a BLAS provider otherwise use OpenBLAS." OFF "NOT BACKEND_TORCH" OFF)
Expand Down Expand Up @@ -317,14 +317,14 @@ endif()
# #######
IF(BUILD_PYTHON)
find_package (Python COMPONENTS Interpreter Development)
find_package(pybind11 REQUIRED)
find_package(pybind11 3.0.0 QUIET)

if(NOT pybind11_FOUND)
include(FetchContent)
FetchContent_Declare(
pybind11_sources
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.11.1
GIT_TAG v3.0.1
)

FetchContent_GetProperties(pybind11_sources)
Expand All @@ -339,7 +339,7 @@ IF(BUILD_PYTHON)
endif()
endif()

pybind11_add_module(pycytnx SHARED pybind/cytnx.cpp
pybind11_add_module(pycytnx MODULE pybind/cytnx.cpp
pybind/generator_py.cpp
pybind/storage_py.cpp
pybind/tensor_py.cpp
Expand All @@ -357,13 +357,31 @@ IF(BUILD_PYTHON)
pybind/ncon_py.cpp
)
target_link_libraries(pycytnx PUBLIC cytnx)

# On macOS, Python extensions should NOT link to libpython
# Use -undefined dynamic_lookup to resolve symbols from the running interpreter
if(APPLE)
target_link_options(pycytnx PRIVATE "-undefined" "dynamic_lookup")
endif()
set_target_properties(pycytnx PROPERTIES OUTPUT_NAME cytnx)
message(STATUS "pybind11 include dir: ${CUTENSOR_LIBRARY_DIRS}")
message(STATUS "pybind11 include dir: ${CUQUANTUM_LIBRARY_DIRS}")
set_target_properties(pycytnx
PROPERTIES
INSTALL_RPATH "${CUTENSOR_LIBRARY_DIRS};${CUQUANTUM_LIBRARY_DIRS}"
)
message(STATUS "pybind11 include dir: ${LAPACK_LIBRARY_DIRS}")
message(STATUS "pybind11 include dir: ${LAPACKE_LIBRARY_DIRS}")
# Configure RPATH for macOS to make the Python extension relocatable
if(APPLE)
set_target_properties(pycytnx
PROPERTIES
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH_USE_LINK_PATH TRUE
INSTALL_RPATH "@loader_path;@loader_path/../../../lib;${CMAKE_INSTALL_PREFIX}/lib"
)
else()
set_target_properties(pycytnx
PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/lib"
)
Comment on lines +380 to +383
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve CUDA dependency paths in pycytnx RPATH

On non-macOS installs, pycytnx now only gets ${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}/lib, which drops the previously included ${CUTENSOR_LIBRARY_DIRS} and ${CUQUANTUM_LIBRARY_DIRS}. In builds with USE_CUTENSOR/USE_CUQUANTUM, this can leave the installed Python extension unable to locate those shared libraries at import time unless users manually export LD_LIBRARY_PATH, so the CUDA library directories (or equivalent link-path propagation) should be retained in the install RPATH.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is taken over from the current master branch, which was merged into this branch. Can someone comment?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from f2e9345

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yingjerkao could you check this?

endif()

message(STATUS " Build Python Wrapper: YES")
message(STATUS " - Python Excutable : ${PYTHON_EXECUTABLE}")
Expand Down
Loading
Loading