|
3 | 3 | Welcome to the CellConstructor python package! |
4 | 4 |
|
5 | 5 | ## What is CellConstructor? |
6 | | -CellConstructor is a python library that allows to easily manipulate crystal structures and phonon dynamical matrices. |
7 | | -It is based on quantum espresso, and wraps in python many of the utilities available in the PHonon package as post-processing tools. |
8 | | -It is also interfaced with ASE for I/O of common file formats (.cif, input of common calculators, etc.) and to SPGLIB for a more stable tool for symmetry identification (also the Quantum Espresso symmetry library is available). |
| 6 | +CellConstructor is a Python library that allows for easy manipulation of crystal structures and phonon dynamical matrices. |
| 7 | +It is based on Quantum Espresso and wraps many of the utilities available in the Phonon package in Python for post-processing tools. |
| 8 | +It is also interfaced with ASE for I/O of standard file formats (.cif, input for common calculators, etc.) and with SPGLIB for a more stable tool for symmetry identification (the Quantum Espresso symmetry library is also available). |
9 | 9 |
|
10 | 10 |
|
11 | 11 | ## What can I do with CellConstructor? |
12 | | -CellConstructor is a general purpouse library. Some of the things you can do with one single command: |
| 12 | +CellConstructor is a general-purpose library. Some of the things you can do with one single command: |
13 | 13 |
|
14 | 14 | 1. Compute Quasi-Harmonic free energies from a dynamical matrix at any temperature. |
15 | 15 | 2. Impose symmetries on a structure, or on a dynamical matrix. |
16 | 16 | 3. Impose the acoustic sum rule on a dynamical matrix |
17 | 17 | 4. Compute the phonon dispersion along high-symmetry paths |
18 | | -5. Extract harmonic randomly displaced configurations according to the dynamical matrix. |
| 18 | +5. Extract harmonic, randomly displaced configurations according to the dynamical matrix. |
19 | 19 |
|
20 | | -And also many others cool features! |
| 20 | +And also many other cool features! |
21 | 21 |
|
22 | 22 | ## Requirements |
23 | 23 |
|
24 | | -To correnctly install and use the package, you need to have |
25 | | -1. python >= 2.7 |
26 | | -2. ASE : Atomic Simulation Environment (suggested but not mandatory) |
| 24 | +To correctly install and use the package, you need to have |
| 25 | +1. python >= 3.8 |
| 26 | +2. ASE: Atomic Simulation Environment (suggested but not mandatory) |
27 | 27 | 3. numpy |
28 | 28 | 4. scipy |
29 | | -5. A fortran compiler |
30 | | -6. Lapack |
31 | | - |
32 | | -The fortran compiler is required to compile the fortran libraries |
33 | | -from Quantum ESPRESSO. |
| 29 | +5. A FORTRAN compiler |
| 30 | +6. Lapack and BLAS |
34 | 31 |
|
35 | 32 | Suggested, but not required, is the installation of ASE and spglib. |
36 | 33 | The presence of a valid ASE installation will enable some more features, |
37 | | -like the possibility to load structures by any ASE supported file format, |
| 34 | +like the possibility to load structures by any ASE-supported file format, |
38 | 35 | or the possibility to export the structures into a valid ASE Atoms class. |
39 | | -This library is able to compute symmetries from the structure, |
40 | | -and inside the symmetry module there is a convertor to let CellConstructure |
41 | | -dealing with symmetries extracted with spglib. |
42 | | -However, for a more carefull symmetry analisys, we suggest the use of external tools like ISOTROPY. |
43 | | -This package can generate ISOTROPY input files for more advanced symmetry detection. |
44 | | - |
45 | | -Please, note that some fortran libraries are needed to be compiled, therefore the Python header files should be localized by the compiling process. |
46 | | -This requires the python distutils and developing tools to be properly installed. |
47 | | -On ubuntu this can be achieved by running: |
48 | | -```bash |
49 | | -sudo apt-get install python-dev |
50 | | -``` |
51 | 36 |
|
52 | | -If you are using anaconda or pip, it should be automatically installed. |
| 37 | +Please note that some Fortran libraries require compilation; therefore, the Python header files should be localized during the compilation process. Starting from version 1.5, the compilation is handled by meson and can be performed automatically using `pip`. |
53 | 38 |
|
| 39 | +For example, using mamba (or conda), you can install all the binary dependencies with: |
54 | 40 |
|
55 | | -## Installation |
56 | | - |
57 | | -To install prerequisites you can use the pip installation: |
58 | | -```bash |
59 | | -pip install -r requirements.txt |
60 | 41 | ``` |
61 | | -If you are running python2, then ase will fail the installation probably (as it requires python3). |
62 | | -To solve the issue, you can replace the ase line inside requirements.txt with: |
63 | | -ase==3.16.0 |
64 | | -This will make it work also with python2. |
65 | | - |
66 | | -Be sure you have also python-dev package, otherwise you will experience error while importing Python.h. |
67 | | -Also, you need gfortran and lapack, blas libraries installed. |
68 | | - |
69 | | -Once you make sure to have all the required packages installed on your system |
70 | | -and working, just type on the terminal |
71 | | - |
72 | | -```bash |
73 | | -python setup.py install |
| 42 | +mamba install -c conda-forge python=3.12 ase spglib=2.2 gfortran libblas lapack openmpi openmpi-mpicc pip numpy scipy |
74 | 43 | ``` |
| 44 | +To use conda, just replace `mamba` with `conda`. Note that `conda` may take a long time to resolve the environment; therefore, mamba or micromamba are recommended. |
75 | 45 |
|
76 | | -while you are located in the same directory as the setup.py script is. |
| 46 | +## Installation |
77 | 47 |
|
78 | | -This program is also distributed upon PyPI. You can install it by typing |
| 48 | +The code can be compiled and installed from the PyPi repository with |
79 | 49 |
|
80 | | -```bash |
| 50 | +``` |
81 | 51 | pip install CellConstructor |
82 | 52 | ``` |
83 | | -In this way you will not install the last developing version. |
84 | | - |
85 | | -<!-- |
86 | 53 |
|
87 | | -If the compilation of the modules fails and you are using |
88 | | -an anaconda module on a 64bit machine, you have to install the conda gcc version. |
89 | | -You can do this by typing (on Linux): |
| 54 | +Or, alternatively, directly by downloading the GitHub repository and running the following command in the directory containing the code |
90 | 55 |
|
91 | | -```bash |
92 | | -conda install gxx_linux-64 |
93 | 56 | ``` |
94 | | -or (on MacOS): |
95 | | -```bash |
96 | | -conda install clangxx_osx-64 |
| 57 | +pip install . |
97 | 58 | ``` |
98 | | ---> |
99 | | - |
100 | 59 |
|
101 | | -NOTE: |
102 | | -If you want to install the package into a system python distribution, the |
103 | | -installation commands should be executed as a superuser. |
104 | | -Otherwise, append the --user flag to either the setup.py or the pip installation. |
105 | | -In this way no administrator privileges is required, but the installation will be effective only for the current user. |
106 | | -Note that some python distribution, like anaconda, does not need the superuser, as it has an installation path inside the HOME directory. |
| 60 | +This will start the automatic compilation. If some libraries or compilers aren't found, please take a look at the next section. |
107 | 61 |
|
108 | | -You can install also using the intel compiler. |
109 | | -In this case, you must edit the setup.py script so that: |
110 | | -- remove the lapack and blas as extra library for the SCHAModules extension. |
111 | | -- add a new flag: 'extra_link_args = ["-mkl"]' to the extension. |
| 62 | +To test if the installation runs properly, you can just run the examples reported |
| 63 | +in the test directory. The Python code in these tests should be |
| 64 | +almost self-explanatory and introduce you to the potential of this library. |
112 | 65 |
|
113 | | -Remember to specify the intel compiler both to the compilation and for the running: |
114 | | -CC="icc" |
115 | | -LDSHARED="icc -shared" |
116 | | -otherwise the C module will give an error when loaded reguarding some "_fast_memcpy_" linking. |
117 | | - |
118 | | - |
119 | | -## GO! |
120 | | - |
121 | | -To test if the installation runned properly, run the examples reported |
122 | | -in the test directory. The python code in these tests should be |
123 | | -almost self explaining and introduce you to the potentiality of this library. |
124 | | - |
125 | | -Please, note that all the functions of the library have a proper numpy style |
| 66 | +Please note that all the functions of the library have a proper numpy style |
126 | 67 | docstring. |
127 | 68 |
|
128 | 69 | You can test the installation using the script: |
129 | 70 | ```bash |
130 | 71 | cellconstructor_test.py |
131 | 72 | ``` |
132 | 73 |
|
133 | | -To run the complete testsuite, you can use the pytest, running the following command: |
| 74 | +To run the complete testsuite, you can use pytest, running the following command: |
134 | 75 | ```bash |
135 | 76 | pytest |
136 | 77 | ``` |
137 | 78 |
|
138 | | -For a full API documentation, you can compile the documentation inside the UserGuide directory. |
139 | | -To compile it simply use the make utility followed by the frontend. |
140 | | -For example, if you want the html version run: |
| 79 | +For a complete API documentation, you can compile the documentation inside the UserGuide directory. |
| 80 | +To compile it, use the make utility followed by the frontend. |
| 81 | +For example, if you want the HTML version, run: |
141 | 82 | ```bash |
142 | 83 | make html |
143 | 84 | ``` |
144 | | -inside the UserGuide directory. It will generate a build directory that contains the html version of the full documentation. |
| 85 | +Inside the UserGuide directory. It will generate a build directory that contains the HTML version of the complete documentation. |
145 | 86 |
|
146 | 87 | ## Installation using 'Meson' |
147 | 88 |
|
| 89 | +Here, we follow the manual step to compile the code using `meson`. These steps are required if you |
| 90 | +want to compute the code on an HPC by exploiting the fast optimized libraries of the HPC nodes. |
| 91 | + |
148 | 92 | ### Compiling with Meson |
149 | 93 |
|
150 | 94 | To compile and install CellConstructor with Meson, follow these typical steps: |
|
218 | 162 | sudo meson install |
219 | 163 | ``` |
220 | 164 |
|
221 | | -You may need superuser privileges (hence `sudo`) to install to system directories. |
| 165 | +You may need superuser privileges (hence `sudo`) to install into system directories. |
222 | 166 |
|
223 | 167 | *** |
224 | 168 |
|
225 | | -Following these steps will help you successfully compile, test, and install SSCHA with Meson as their build system. |
| 169 | +Following these steps will help you successfully compile, test, and install SSCHA with Meson as its build system. |
0 commit comments