Skip to content

Commit 508fbb9

Browse files
committed
Remove 'defaults' channel from environment.yaml and add libint2 symlink workaround to CI
1 parent e241d9d commit 508fbb9

4 files changed

Lines changed: 31 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ jobs:
5151
environment-file: environment.yaml
5252
auto-activate-base: false
5353

54+
- name: Fix libint2 soname (horton compiled against libint2.so.2 / libint2.2.dylib)
55+
run: |
56+
if [ -f "$CONDA_PREFIX/lib/libint2.so" ] && [ ! -f "$CONDA_PREFIX/lib/libint2.so.2" ]; then
57+
ln -sf "$CONDA_PREFIX/lib/libint2.so" "$CONDA_PREFIX/lib/libint2.so.2"
58+
fi
59+
if [ -f "$CONDA_PREFIX/lib/libint2.dylib" ] && [ ! -f "$CONDA_PREFIX/lib/libint2.2.dylib" ]; then
60+
ln -sf "$CONDA_PREFIX/lib/libint2.dylib" "$CONDA_PREFIX/lib/libint2.2.dylib"
61+
fi
62+
5463
- name: Install package + test dependencies
5564
run: pip install -e ".[test]"
5665

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,26 @@ xdm_results = session.calculator.calculate_xdm_moments(
9393
)
9494
```
9595

96+
## Troubleshooting
97+
98+
### `ImportError` when importing HORTON (`libint2` not found)
99+
100+
On some systems, HORTON is compiled against a versioned `libint2` (e.g. `libint2.so.2` on Linux, `libint2.2.dylib` on macOS), but conda-forge only installs the unversioned library. If you see an error like:
101+
102+
```
103+
ImportError: libint2.so.2: cannot open shared object file: No such file or directory
104+
```
105+
106+
Create the missing symlink manually:
107+
108+
```bash
109+
# Linux
110+
ln -sf "$CONDA_PREFIX/lib/libint2.so" "$CONDA_PREFIX/lib/libint2.so.2"
111+
112+
# macOS
113+
ln -sf "$CONDA_PREFIX/lib/libint2.dylib" "$CONDA_PREFIX/lib/libint2.2.dylib"
114+
```
115+
96116
## Acknowledgments
97117

98118
Some implementations in this package, such as the Newton-Raphson algorithm for the Becke-Roussel (BR) exchange model, are based on [postg](https://github.com/aoterodelaroza/postg). As a state-of-the-art package for XDM calculations, postg serves as an essential reference for accuracy and methodology. The aim of this package is mainly to provide easy-to-use access to a broader range of partitioning schemes beyond Hirshfeld.

environment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: pyxdm
22
channels:
33
- conda-forge
4-
- defaults
54
dependencies:
65
- python>=3.10
76
- pip

pyxdm/core/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
try:
1515
import horton as ht
16-
except ImportError:
17-
logger.error("horton package is required for XDM calculations")
16+
except ImportError as e:
17+
logger.error("horton package is required for XDM calculations.")
1818
sys.exit(1)
1919

2020

0 commit comments

Comments
 (0)