Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
0d88630
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Oct 18, 2023
d91171b
Merge branch 'master' into Diegom_spectral_function_multiprocessing
diegomartinez2 Oct 19, 2023
d2f8e6d
Merge branch 'master' of github.com:diegomartinez2/CellConstructor
diegomartinez2 Oct 19, 2023
63bc915
Merge branch 'master' into Diegom_spectral_function_multiprocessing
diegomartinez2 Oct 19, 2023
33f7388
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Oct 30, 2023
ca298a0
Merge branch 'master' into Diegom_spectral_function_multiprocessing
diegomartinez2 Oct 30, 2023
251df58
Added title to function
diegomartinez2 Nov 22, 2023
bf60173
Added documentation to subfunction
diegomartinez2 Nov 22, 2023
f9b0d5d
OMP loop for big number of atoms.
diegomartinez2 Nov 27, 2023
07f3518
Undo, too many proccesess at the same time
diegomartinez2 Nov 27, 2023
ebf3571
Removed unused nu
diegomartinez2 Nov 27, 2023
b235490
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Dec 13, 2023
06269f7
Merge branch 'master' into Diegom_spectral_function_multiprocessing
diegomartinez2 Dec 13, 2023
5f0a916
Fix bug
diegomartinez2 Dec 14, 2023
9504f9d
Fix "output_file_sort_function" filename input
diegomartinez2 Dec 14, 2023
7e0e3f6
Fix bug
diegomartinez2 Dec 15, 2023
a153ac7
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Dec 18, 2023
cea2c1f
Update
diegomartinez2 Jan 8, 2024
eb62a51
Quickfix to the spglib/ASE problem
diegomartinez2 Feb 2, 2024
a804ed4
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Feb 6, 2024
33fd222
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Feb 12, 2024
508aeb0
Merge branch 'master' into Diegom_spectral_function_multiprocessing
diegomartinez2 Feb 12, 2024
a6c2173
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Feb 14, 2024
c6985ce
Merge branch 'master' into Diegom_spectral_function_multiprocessing
diegomartinez2 Feb 14, 2024
f5a6990
Just fix a typo
diegomartinez2 Feb 28, 2024
9281353
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Apr 15, 2024
9131e99
Djordje update
diegomartinez2 Apr 17, 2024
10c09e0
Merge branch 'master' of github.com:diegomartinez2/CellConstructor
diegomartinez2 Apr 17, 2024
1f4bc64
Merge branch 'Diegom_spectral_function_multiprocessing'
diegomartinez2 Apr 17, 2024
7037718
Merge branch 'master' of github.com:diegomartinez2/CellConstructor
diegomartinez2 Aug 4, 2025
608948e
Test Meson compilation
diegomartinez2 Aug 4, 2025
82aa5de
Set a build.yml for automatic github compilation and testing (first try)
diegomartinez2 Aug 4, 2025
5d66e4f
Change README.md to show how to make a basic compilation.
diegomartinez2 Aug 4, 2025
1092794
Removing 'python' from meson compilation and use as a imported module.
diegomartinez2 Aug 4, 2025
abdeb0e
Python libraries must be declared in Meson as modules.
diegomartinez2 Aug 4, 2025
959f7ba
Eliminating numpy_dep = python_installation.dependency(...)
diegomartinez2 Aug 4, 2025
2e85838
Changed 'build.yml' to install lapack, etc.
diegomartinez2 Aug 4, 2025
2c941d8
I did remove the numpy from the dependencies, so this goes out too.
diegomartinez2 Aug 4, 2025
009001f
Removing also the other cases of numpy dependency on FORTRAN and C.
diegomartinez2 Aug 4, 2025
ed32d5c
Set install = True instead of "install_extmod()".
diegomartinez2 Aug 4, 2025
4ca0ad7
Test to manually set the python scripts to install.
diegomartinez2 Aug 4, 2025
9e2f4f9
Another manual list to install.
diegomartinez2 Aug 4, 2025
7772e40
Again, I use manual installation of the python scripts.
diegomartinez2 Aug 4, 2025
1160c24
Including numpy subdirectories in compilation. May be excesive...
diegomartinez2 Aug 4, 2025
e2acfda
Fix typo
diegomartinez2 Aug 4, 2025
ad62009
Lets see if this removes some warnings and errors.
diegomartinez2 Aug 5, 2025
89cecc4
Comment this part as it fails on github,
diegomartinez2 Aug 5, 2025
cd2c36d
Adding the tests (with pytest)
diegomartinez2 Aug 30, 2025
6b84d46
Trying to fix the "Program 'pytest' not found or not executable" error.
diegomartinez2 Aug 30, 2025
122c61c
github doesn't have pytest in the bin path by default
diegomartinez2 Aug 30, 2025
f9727b0
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Sep 1, 2025
902d2f3
Merge branch 'SSCHAcode:master' into Meson_compiler_test
diegomartinez2 Sep 1, 2025
3a395c0
For the test to work it needs pytest installed.
diegomartinez2 Sep 1, 2025
83e9085
Meson compilation and installation instructions
diegomartinez2 Sep 1, 2025
1f75f56
Merge branch 'Meson_compiler_test' of github.com:diegomartinez2/CellC…
diegomartinez2 Sep 1, 2025
ad67683
Added meson-python to implement the Python build system hooks
diegomartinez2 Sep 2, 2025
b60252e
Update 'README.md' with the instructions for running the tests.
diegomartinez2 Sep 3, 2025
5028fdf
Automatic check for pytest
diegomartinez2 Sep 3, 2025
d903a38
If no pytest installed, no test done.
diegomartinez2 Sep 3, 2025
e207150
Update README.md
diegomartinez2 Sep 3, 2025
aadc327
(Commented) method for installing python sources by Meson.
diegomartinez2 Sep 4, 2025
4f170c0
Test 'python.install_sources()'
diegomartinez2 Sep 5, 2025
8718fb1
Test everything, including full installation.
diegomartinez2 Sep 5, 2025
bff9e30
Test CellConstructor installation
diegomartinez2 Sep 5, 2025
63836d0
Test the tests with pytest.
diegomartinez2 Sep 5, 2025
1f8897c
Full tests (pytest)
diegomartinez2 Sep 5, 2025
8703a92
Testing with pytest from Meson builddir.
diegomartinez2 Sep 5, 2025
cd71226
Using join_paths.source_root() because pytest do not find any test.
diegomartinez2 Sep 5, 2025
b019a47
I made an 'error' by both changing the workdir and using join_paths. …
diegomartinez2 Sep 5, 2025
a60e0f9
Test with join_paths from builddir.
diegomartinez2 Sep 5, 2025
bc829e4
Removing "-m 'not release'" from the pytest call.
diegomartinez2 Sep 5, 2025
6a545dc
Test the tests with "pytest -v" from Meson.
diegomartinez2 Sep 5, 2025
998688b
Github "PermissionError: [Errno 13] Permission denied: '/usr/local/li…
diegomartinez2 Sep 5, 2025
ce695e9
Forcing the RPATH
diegomartinez2 Sep 5, 2025
de5d195
Automatic install RPATH
diegomartinez2 Sep 5, 2025
09ed518
Fix typo
diegomartinez2 Sep 5, 2025
a7761ab
No boolean here
diegomartinez2 Sep 5, 2025
3bbb003
Adding 1 more dependence to 'symph' library
diegomartinez2 Sep 8, 2025
8cbcc29
Try with f2py C wrapper
diegomartinez2 Sep 8, 2025
3f0c369
Added "Fortran Package Manager" into the pip install list
diegomartinez2 Sep 8, 2025
d3b6a61
Fix error
diegomartinez2 Sep 8, 2025
a978ac8
Fix error
diegomartinez2 Sep 8, 2025
6bf1bf5
Test f2py way
diegomartinez2 Sep 8, 2025
b9e47bb
Manually set fpm output name
diegomartinez2 Sep 8, 2025
e555976
Trying to fix the FORTRAN to python lib.
diegomartinez2 Sep 8, 2025
10c6ea7
Fixing error and looking for alternatives
diegomartinez2 Sep 8, 2025
9a4e571
Test with "fpm.toml"
diegomartinez2 Sep 8, 2025
c258522
Fix and another try with f2py wrapper (with fpm).
diegomartinez2 Sep 9, 2025
d0df90a
New way of solving the FORTRAN library with Meson
diegomartinez2 Sep 9, 2025
35d19f3
Fix the "meson.build:27:21: ERROR: custom_target keyword argument "ou…
diegomartinez2 Sep 9, 2025
eb44651
Fix "meson.build:78:52: ERROR: Unknown method "outputs" in object <Cu…
diegomartinez2 Sep 9, 2025
8703b03
Fix "meson.build:78:59: ERROR: Expecting lparen got lbracket.
diegomartinez2 Sep 9, 2025
8893c66
Fix "meson.build:75:71: ERROR: Expecting lparen got lbracket.
diegomartinez2 Sep 9, 2025
056baee
Fix "meson.build:52:40: ERROR: Expecting lparen got eol.
diegomartinez2 Sep 9, 2025
f5ff56d
This is a error from fpm, not Meson: "meson.build:52:33: ERROR: Unkno…
diegomartinez2 Sep 9, 2025
527adf1
The most robust way to handle this is to use a dedicated custom_targe…
diegomartinez2 Sep 9, 2025
d482536
Clean code
diegomartinez2 Sep 9, 2025
b4e7b9a
Setting 'link_with:' in the FORTRAN libraries creation scripts.
diegomartinez2 Sep 10, 2025
4d8524c
Fixing "meson.build:70:35: ERROR: Tried to form an absolute path to a…
diegomartinez2 Sep 10, 2025
715069c
Fix another absolute path: "meson.build:48:10: ERROR: Tried to form a…
diegomartinez2 Sep 10, 2025
6ed55a1
I will not use include_directories, I'll use compiler args instead.
diegomartinez2 Sep 10, 2025
a982bd9
Revert to previous fpm_inc definition.
diegomartinez2 Sep 10, 2025
9e2b1eb
Comment out unused code.
diegomartinez2 Sep 10, 2025
d9d5a70
Removing "to_string()" due to the fact that probably fpm_include_dir …
diegomartinez2 Sep 10, 2025
901b9c2
Fix bug
diegomartinez2 Sep 10, 2025
f97adc7
Removing the fpm wrapper and try with all the automatic Meson tricks …
diegomartinez2 Sep 10, 2025
518c531
Setting the '-cpp' explicity to try to force the preprocessiing on FO…
diegomartinez2 Sep 10, 2025
9f26c34
Separating the compilation of the Fortran code from the compilation o…
diegomartinez2 Sep 11, 2025
830bd26
Clear the 'dependencies' for now.
diegomartinez2 Sep 11, 2025
14823e9
Fix small bug
diegomartinez2 Sep 11, 2025
f5ca369
A step back, and set include_directories (I think I'm going in circles).
diegomartinez2 Sep 11, 2025
25f652c
OK lets test using the '.' directory.
diegomartinez2 Sep 11, 2025
4e66e22
Just renaming the files to help meson find the files.
diegomartinez2 Sep 11, 2025
9c2128b
Set the anidated compilation headers
diegomartinez2 Sep 11, 2025
c03fdcd
A simple fix?
diegomartinez2 Sep 11, 2025
bf4a56e
QuickFix
diegomartinez2 Sep 11, 2025
f04a16c
Include directories to have the numpy libs at hand
diegomartinez2 Sep 11, 2025
1232b97
Update, now the problem is with nupmpy?
diegomartinez2 Sep 11, 2025
314b08b
Include f2py directory
diegomartinez2 Sep 11, 2025
4794d6d
Adding python dependency
diegomartinez2 Sep 12, 2025
d2d4cf1
Now it compiles but gives a problem when importing symph on python (b…
diegomartinez2 Sep 12, 2025
4000585
Added some files to work later with meson
diegomartinez2 Sep 12, 2025
0c22d15
A total rebuild and clean.
diegomartinez2 Sep 15, 2025
977b190
Include the mpi dependence and set it as not required
diegomartinez2 Sep 15, 2025
5eab080
Almost forgot to include the lapack and blas dependences in 'meson.bu…
diegomartinez2 Sep 15, 2025
fa5a7c2
Adding the openblas and lapak in the comppilation of the FORTRAN modules
diegomartinez2 Sep 15, 2025
91fdb4b
tests
diegomartinez2 Sep 15, 2025
7773b72
Forgot to add the openblas dependency
diegomartinez2 Sep 15, 2025
c564823
Put the dependecies in a list
diegomartinez2 Sep 15, 2025
658dc9a
Put the 'endif'
diegomartinez2 Sep 15, 2025
bbb75d1
test without openblas
diegomartinez2 Sep 15, 2025
b269270
remove unused 'fpm' code
diegomartinez2 Sep 15, 2025
fb3f377
Removing old configurations
diegomartinez2 Sep 16, 2025
08fbc6f
Merge branch 'SSCHAcode:master' into master
diegomartinez2 Sep 16, 2025
27559c0
Manually adding the f2py wrappers.
diegomartinez2 Sep 16, 2025
f32a40d
update tests
diegomartinez2 Sep 16, 2025
8f11a52
New solution for fortranobject.c
diegomartinez2 Sep 16, 2025
7611e2a
Test fix
diegomartinez2 Sep 17, 2025
ad70c7a
Merge branch 'master' into Meson_compiler_test
diegomartinez2 Sep 17, 2025
76b41e3
Removing manual configuration, lets meson work with all automatically.
diegomartinez2 Sep 17, 2025
94281cb
Remove some unused files
diegomartinez2 Sep 17, 2025
6119921
Removing fpm toml files
diegomartinez2 Sep 17, 2025
8908dc4
Removing file meson.build.test_fpm_toml
diegomartinez2 Sep 17, 2025
0c88e24
Merge branch 'Meson_compiler_test' of github.com:diegomartinez2/CellC…
diegomartinez2 Sep 17, 2025
cd70730
Added openmp dependency for thermal_transport module
diegomartinez2 Sep 17, 2025
db8568f
Set an option to use Intel Math Kernel Library (MKL) in meson. Using …
diegomartinez2 Sep 17, 2025
204a061
Update README.md and setting the file meson.options for the mkl option
diegomartinez2 Sep 17, 2025
d436ac8
Update README.md
diegomartinez2 Sep 17, 2025
9f0ee70
The custom f2py wrapper may be necessary until meson is updated to a …
diegomartinez2 Sep 18, 2025
9eff8db
Set the meson minimun version
diegomartinez2 Sep 18, 2025
5c2ee41
Group things up
diegomartinez2 Sep 18, 2025
a3e080a
For testing...
diegomartinez2 Sep 18, 2025
228d023
Old method to compile the FORTRAN libraries with f2py.
diegomartinez2 Sep 18, 2025
1a6b6e0
Fix f2pywrappers on symph module
diegomartinez2 Sep 18, 2025
fb65a51
Adding an installation guide
diegomartinez2 Sep 18, 2025
e804795
Set installation guide
diegomartinez2 Sep 18, 2025
4a10996
Clean directory
diegomartinez2 Sep 19, 2025
fe27eee
More clean
diegomartinez2 Sep 19, 2025
14ff17c
Cleaning code
diegomartinez2 Sep 19, 2025
ff49eab
Update wrapper3.c to new numpy and python versions
diegomartinez2 Sep 19, 2025
ce20cbb
Translation of comments into English
diegomartinez2 Sep 19, 2025
f521112
From "python setup.py install --user" to "meson install -C builddir"
diegomartinez2 Sep 19, 2025
489f28f
Test by "removing" setup.py (setup.py -> old_setup.py)
diegomartinez2 Sep 19, 2025
8d0a2ed
Test with "pip install -e ."
diegomartinez2 Sep 19, 2025
989c540
It needs numpy for 'pip' installation
diegomartinez2 Sep 19, 2025
ba2a99e
Sorry, typo!!
diegomartinez2 Sep 19, 2025
ccea1ac
Taking out the editable in pip install
diegomartinez2 Sep 19, 2025
da3aecf
Lets see if meson can work with f2py internally without wrappers.
diegomartinez2 Sep 19, 2025
ced59c9
Change the installation method of the python modules.
diegomartinez2 Sep 19, 2025
f4c6727
Maybe it needs fortranobject_c
diegomartinez2 Sep 19, 2025
bb7a7d7
Include omp for thermal_conductivity
diegomartinez2 Sep 19, 2025
4256c7f
Set the correct repository and issues links
diegomartinez2 Sep 22, 2025
f73f58b
Advanced configuration with Meson
diegomartinez2 Sep 25, 2025
849e144
How to Install with a Specific Compiler Path
diegomartinez2 Sep 25, 2025
756705b
New CellConstructor Installation Guide (following 'mesonepigreco' rev…
diegomartinez2 Sep 29, 2025
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
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libblas-dev liblapack-dev gfortran pkg-config

- name: Install Python dependencies
run: |
pip install meson ninja meson-python numpy scipy ase pytest

- name: Setup build directory
run: meson setup builddir

- name: Compile
run: meson compile -C builddir


# - name: Install package
# run: meson install -C builddir

# - name: Run tests
# run: meson test -C builddir
3 changes: 2 additions & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jobs:
sudo apt-get install gfortran libblas-dev liblapack-dev
- name: Install the package
run: |
python setup.py install --user
# python setup.py install --user
pip install .
- name: Test with pytest
run: |
pip install pytest
Expand Down
6 changes: 4 additions & 2 deletions CModules/wrapper3.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ static PyObject * gram_schmidt(PyObject* self, PyObject* args) {
int NewDim;

PyObject * npy_vectors;

// Get the path dir
if (!PyArg_ParseTuple(args, "Oii", &npy_vectors, &N_vectors, &N_dim))
return NULL;

// Get the C pointers to the data of the numpy ndarray
vectors = (double*) PyArray_DATA(npy_vectors);
//vectors = (double*) PyArray_DATA(npy_vectors);
// Fix for new version of numpy and python
vectors = (double*) PyArray_DATA((PyArrayObject*) npy_vectors);

NewDim = GramSchmidt(vectors, N_dim, N_vectors);

Expand Down
126 changes: 126 additions & 0 deletions CellConstructor Installation Guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# CellConstructor Installation Guide

This guide provides step-by-step instructions to compile and install the CellConstructor library. The project uses the Meson build system to compile C and Fortran extensions for Python.

## Recommended Installation: Conda / Mamba

The easiest and most reproducible way to install CellConstructor is by using a Conda environment. We strongly recommend using *micromamba* or *mamba* as they are significantly faster. This method installs all the required compilers, libraries, and Python packages inside an isolated environment, avoiding the need to modify your base system.

### Step 1: Create and Activate the Environment

1. Install Conda/Mamba. If you don't have it, we recommend installing micromamba.

2. Create the environment. Open your terminal and run the following command. It will create a new environment named sscha with all the necessary dependencies.

```bash
micromamba create -n sscha python=3.12 gfortran libblas lapack openmpi openmpi-mpicc pkg-config pip numpy scipy spglib=2.2
```

* Python Version: We use Python 3.12. Newer versions are not yet supported due to a dependency constraint from *spglib <= 2.2.*

* pkg-config: This package is essential. Meson requires it to correctly detect the BLAS and LAPACK libraries provided by Conda.

3. Activate the environment. You must activate the environment before proceeding.

```bash
micromamba activate sscha
```

### Step 2: Clone the Repository (if not done)

If you don't have the source code locally, clone it from the repository.

```bash
git clone https://github.com/SSCHAcode/CellConstructo
cd CellConstructor
```

### Step 3: Install CellConstructor

With the environment active, install the package using *pip*. *pip* will automatically use Meson to compile and install the project.

```bash
pip install .
```

The installation is now complete! You can verify it by running the tests or importing the modules in Python.

## Advanced Installation: Manual Configuration

This section is for users who cannot use Conda or need to configure the build with specific compilers or options.

### Prerequisites

* A C and Fortran compiler.

* Python 3.12 and pip.

* Ninja and Meson: *pip install meson ninja*.

* System libraries for BLAS, LAPACK, and MPI.

### Method 1: Using Environment Variables

You can specify compilers by setting the *CC* (C compiler) and *FC* (Fortran compiler) environment variables before running *pip*.

```bash
# Example using compilers from a specific toolchain
export CC=/usr/local/bin/gcc-11
export FC=/usr/local/bin/gfortran-11

# Install the project
pip install .
```

### Method 2: Using a Meson Cross File

For a reproducible setup, define your compilers in a file (e.g., native-toolchain.ini).
Example *native-toolchain.ini*:

```bash
[binaries]
c = '/path/to/my/custom/gcc'
fortran = '/path/to/my/custom/gfortran'
```

Then, install by passing this file to Meson via pip:

```bash
pip install . --config-settings=meson-args="--native-file=native-toolchain.ini"
```

### Build Options
You can pass options to Meson to customize the build.

* Create a debug build:

```bash
pip install . --config-settings=meson-args="-Dbuildtype=debug"
```

* Enable Intel MKL (requires MKL to be installed and findable by your system):

```bash
pip install . --config-settings=meson-args="-Duse_mkl=true"
```

* Combine multiple options:

```bash
pip install . --config-settings=meson-args="-Dbuildtype=debug,-Duse_mkl=true"
```

#### Reconfiguring a Build

If you need to change build options, it is best to perform a clean installation.

```bash
# 1. Uninstall the package
pip uninstall CellConstructor

# 2. (Optional but recommended) Remove the build directory
rm -rf build/

# 3. Reinstall with the new options
pip install . --config-settings=meson-args="-Dnew_option=value"
```
105 changes: 93 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ To correnctly install and use the package, you need to have
5. A fortran compiler
6. Lapack

The fortran compiler is required to compile the fortran libraries
The fortran compiler is required to compile the fortran libraries
from Quantum ESPRESSO.

Suggested, but not required, is the installation of ASE and spglib.
The presence of a valid ASE installation will enable some more features,
like the possibility to load structures by any ASE supported file format,
Suggested, but not required, is the installation of ASE and spglib.
The presence of a valid ASE installation will enable some more features,
like the possibility to load structures by any ASE supported file format,
or the possibility to export the structures into a valid ASE Atoms class.
This library is able to compute symmetries from the structure,
and inside the symmetry module there is a convertor to let CellConstructure
dealing with symmetries extracted with spglib.
This library is able to compute symmetries from the structure,
and inside the symmetry module there is a convertor to let CellConstructure
dealing with symmetries extracted with spglib.
However, for a more carefull symmetry analisys, we suggest the use of external tools like ISOTROPY.
This package can generate ISOTROPY input files for more advanced symmetry detection.

Please, note that some fortran libraries are needed to be compiled, therefore the Python header files should be localized by the compiling process.
Please, note that some fortran libraries are needed to be compiled, therefore the Python header files should be localized by the compiling process.
This requires the python distutils and developing tools to be properly installed.
On ubuntu this can be achieved by running:
```bash
Expand Down Expand Up @@ -100,15 +100,15 @@ conda install clangxx_osx-64

NOTE:
If you want to install the package into a system python distribution, the
installation commands should be executed as a superuser.
Otherwise, append the --user flag to either the setup.py or the pip installation.
installation commands should be executed as a superuser.
Otherwise, append the --user flag to either the setup.py or the pip installation.
In this way no administrator privileges is required, but the installation will be effective only for the current user.
Note that some python distribution, like anaconda, does not need the superuser, as it has an installation path inside the HOME directory.

You can install also using the intel compiler.
In this case, you must edit the setup.py script so that:
- remove the lapack and blas as extra library for the SCHAModules extension.
- add a new flag: 'extra_link_args = ["-mkl"]' to the extension.
- add a new flag: 'extra_link_args = ["-mkl"]' to the extension.

Remember to specify the intel compiler both to the compilation and for the running:
CC="icc"
Expand All @@ -118,7 +118,7 @@ otherwise the C module will give an error when loaded reguarding some "_fast_mem

## GO!

To test if the installation runned properly, run the examples reported
To test if the installation runned properly, run the examples reported
in the test directory. The python code in these tests should be
almost self explaining and introduce you to the potentiality of this library.

Expand All @@ -142,3 +142,84 @@ For example, if you want the html version run:
make html
```
inside the UserGuide directory. It will generate a build directory that contains the html version of the full documentation.

## Installation using 'Meson'

### Compiling with Meson

To compile and install CellConstructor with Meson, follow these typical steps:

### 1. Change to the Source Directory

First, open a terminal and navigate to the root directory of the project source code. This is where the `meson.build` file is located.

```bash
cd /path/to/source/root/cellconstructor
```


### 2. Configure the Build Directory

Create and configure a build directory by running:

```bash
meson setup builddir
```

or if you are in a conda env (the best option for a local installation):
```bash
meson setup builddir --prefix=$CONDA_PREFIX
```

if you want to use Intel MKL:
```bash
setup builddir -Duse_mkl=true
```

This command sets up a separate build directory (`builddir`) where all compiled files and build artifacts will be placed, keeping the source directory clean. After this, change into the build directory:

```bash
cd builddir
```


### 3. Compile the Project

Once inside the build directory, compile the project using:

```bash
meson compile
```

This will compile the source code according to the configuration from the previous step.

### 4. Run Tests (Optional)

The project includes tests, you need to install pytest to work. You can run them with:

```bash
meson test
```

This step helps verify that the build works correctly.

### 5. Install the Project (Optional)

To install the compiled binaries, libraries, and other files system-wide (or to a custom location), run:


```bash
meson install
```

or

```bash
sudo meson install
```

You may need superuser privileges (hence `sudo`) to install to system directories.

***

Following these steps will help you successfully compile, test, and install SSCHA with Meson as their build system.
2 changes: 1 addition & 1 deletion cellconstructor/Phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -2875,7 +2875,7 @@ def InterpolateMesh(self, mesh_dim, lo_to_splitting = False):
INTERPOLATE THE DYNAMICAL MATRIX IN A FINER Q MESH
==================================================

This method employs the Tensor2 interpolateion functions
This method employs the Tensor2 interpolation functions
from the ForceTensor module to perform the interpolation.

Parameters
Expand Down
14 changes: 10 additions & 4 deletions cellconstructor/Spectral.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,11 @@ def get_static_correction_interpolated(dyn, tensor3, T, new_supercell, k_grid):
dynq = get_static_correction(dyn, tensor3, k_grid, q_tot, T)

# Add all the new computed dynamical matrix
new_dyn.dynmats[0] = dynq[0, :, :]
for iq in range(1,len(q_tot)):
new_dyn.dynmats.append(dynq[iq, :, :])
all_dynmats = []
for iq in range(len(q_tot)):
all_dynmats.append(dynq[iq, :, :])

new_dyn.dynmats = all_dynmats

# Adjust the dynamical matrix q points and the stars
new_dyn.AdjustQStar()
Expand Down Expand Up @@ -3714,10 +3715,12 @@ def get_os_perturb_dynamic_correction_along_path(dyn, tensor3,
#-------------------------------------------------------------------------------
def get_dielectric_function(dyn, k_grid, T, e0 ,e1, de, ie, ismear
, sm0, sm0_id
, diag_approx=False, nsm=1, static_limit=False): #skeleton function for TESTING...
, diag_approx=False, nsm=1, static_limit=False): #Function for TESTING...
# ( tensor3,omega,N,nu,q, d_bubble_cart, ener, epsilon_inf,atom_a, atom_b, ne,frequency,dielectric_tensor,tensor2,effective_charges,energies,spectralf,N,Big_omega)

"""
This function computes the dielectric function.

Input data:
epsilon_inf = dielctric constant of vacuum ---> Phonon.Phonon.dielectric_tensor(3x3)
a = atom a -> M(a) mass of atom a ---> tensor2 = CC.ForceTensor.Tensor2(dyn.structure, dyn_gemnerate_supwercell(dyn.GetSupercell()),dyn_GetSupercell()); tensor2.SetupFromPhonons(dyn); tensor2.center() ---> structure = tensor2.unitcell_structure ---> structure.get_masses_array()
Expand Down Expand Up @@ -3779,6 +3782,9 @@ def get_dielectric_function(dyn, k_grid, T, e0 ,e1, de, ie, ismear
# ==========================================================================================
#----------------------------------------------------------------
def compute_k(k):
"""
This function computes the k value.
"""
# phi3 in q, k, -q - k
t1 = time.time()
phi3=tensor3.Interpolate(k,-q-k, asr = False)
Expand Down
Loading