libcasm-clexulator 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. libcasm_clexulator-2.0.0/CHANGELOG.md +122 -0
  2. libcasm_clexulator-2.0.0/CMakeLists.txt +245 -0
  3. libcasm_clexulator-2.0.0/CMakeLists.txt.in +202 -0
  4. libcasm_clexulator-2.0.0/LICENSE +484 -0
  5. libcasm_clexulator-2.0.0/MANIFEST.in +19 -0
  6. libcasm_clexulator-2.0.0/PKG-INFO +58 -0
  7. libcasm_clexulator-2.0.0/README.md +38 -0
  8. libcasm_clexulator-2.0.0/build_requirements.txt +8 -0
  9. libcasm_clexulator-2.0.0/cmake/CASMcode_clexulatorConfig.cmake.in +3 -0
  10. libcasm_clexulator-2.0.0/dev_requirements.txt +4 -0
  11. libcasm_clexulator-2.0.0/doc_requirements.txt +7 -0
  12. libcasm_clexulator-2.0.0/include/casm/clexulator/BaseClexulator.hh +436 -0
  13. libcasm_clexulator-2.0.0/include/casm/clexulator/BasicClexParamPack.hh +243 -0
  14. libcasm_clexulator-2.0.0/include/casm/clexulator/ClexParamPack.hh +347 -0
  15. libcasm_clexulator-2.0.0/include/casm/clexulator/Clexulator.hh +530 -0
  16. libcasm_clexulator-2.0.0/include/casm/clexulator/ClusterExpansion.hh +137 -0
  17. libcasm_clexulator-2.0.0/include/casm/clexulator/ConfigDoFValues.hh +75 -0
  18. libcasm_clexulator-2.0.0/include/casm/clexulator/ConfigDoFValuesTools.hh +498 -0
  19. libcasm_clexulator-2.0.0/include/casm/clexulator/ConfigDoFValuesTools_impl.hh +46 -0
  20. libcasm_clexulator-2.0.0/include/casm/clexulator/Correlations.hh +187 -0
  21. libcasm_clexulator-2.0.0/include/casm/clexulator/DiffClexParamPack.hh +719 -0
  22. libcasm_clexulator-2.0.0/include/casm/clexulator/DoFSpace.hh +249 -0
  23. libcasm_clexulator-2.0.0/include/casm/clexulator/DoFSpaceAxisInfo.hh +62 -0
  24. libcasm_clexulator-2.0.0/include/casm/clexulator/ImpactTable.hh +135 -0
  25. libcasm_clexulator-2.0.0/include/casm/clexulator/LocalClusterExpansion.hh +110 -0
  26. libcasm_clexulator-2.0.0/include/casm/clexulator/LocalCorrelations.hh +91 -0
  27. libcasm_clexulator-2.0.0/include/casm/clexulator/NeighborList.hh +382 -0
  28. libcasm_clexulator-2.0.0/include/casm/clexulator/OrderParameter.hh +137 -0
  29. libcasm_clexulator-2.0.0/include/casm/clexulator/SparseCoefficients.hh +55 -0
  30. libcasm_clexulator-2.0.0/include/casm/clexulator/external/fadbad/COPYRIGHT +28 -0
  31. libcasm_clexulator-2.0.0/include/casm/clexulator/external/fadbad/README +76 -0
  32. libcasm_clexulator-2.0.0/include/casm/clexulator/external/fadbad/badiff.h +1125 -0
  33. libcasm_clexulator-2.0.0/include/casm/clexulator/external/fadbad/fadbad.h +157 -0
  34. libcasm_clexulator-2.0.0/include/casm/clexulator/external/fadbad/fadiff.h +1195 -0
  35. libcasm_clexulator-2.0.0/include/casm/clexulator/external/fadbad/tadiff.h +1283 -0
  36. libcasm_clexulator-2.0.0/include/casm/clexulator/io/json/Clexulator_json_io.hh +28 -0
  37. libcasm_clexulator-2.0.0/include/casm/clexulator/io/json/ConfigDoFValues_json_io.hh +42 -0
  38. libcasm_clexulator-2.0.0/include/casm/clexulator/io/json/DoFSpace_json_io.hh +50 -0
  39. libcasm_clexulator-2.0.0/include/casm/clexulator/io/json/SparseCoefficients_json_io.hh +28 -0
  40. libcasm_clexulator-2.0.0/include/casm/clexulator/version.hh +24 -0
  41. libcasm_clexulator-2.0.0/make_CMakeLists.py +176 -0
  42. libcasm_clexulator-2.0.0/pre-commit +22 -0
  43. libcasm_clexulator-2.0.0/pyproject.toml +87 -0
  44. libcasm_clexulator-2.0.0/python/doc/.gitignore +2 -0
  45. libcasm_clexulator-2.0.0/python/doc/_static/apple-touch-icon.png +0 -0
  46. libcasm_clexulator-2.0.0/python/doc/_static/css/custom.css +116 -0
  47. libcasm_clexulator-2.0.0/python/doc/_static/favicon-16x16.png +0 -0
  48. libcasm_clexulator-2.0.0/python/doc/_static/favicon-32x32.png +0 -0
  49. libcasm_clexulator-2.0.0/python/doc/_static/logo.pdf +1477 -4
  50. libcasm_clexulator-2.0.0/python/doc/_static/logo.svg +1 -0
  51. libcasm_clexulator-2.0.0/python/doc/_static/logo_dark.svg +91 -0
  52. libcasm_clexulator-2.0.0/python/doc/_static/logo_dark_outline.svg +283 -0
  53. libcasm_clexulator-2.0.0/python/doc/_static/logo_outline.svg +275 -0
  54. libcasm_clexulator-2.0.0/python/doc/_static/small_logo.pdf +1351 -4
  55. libcasm_clexulator-2.0.0/python/doc/_static/small_logo.svg +48 -0
  56. libcasm_clexulator-2.0.0/python/doc/_static/small_logo_dark.svg +49 -0
  57. libcasm_clexulator-2.0.0/python/doc/_templates/base.rst +5 -0
  58. libcasm_clexulator-2.0.0/python/doc/_templates/custom-attr-template.rst +5 -0
  59. libcasm_clexulator-2.0.0/python/doc/_templates/custom-class-template.rst +36 -0
  60. libcasm_clexulator-2.0.0/python/doc/_templates/custom-function-template.rst +5 -0
  61. libcasm_clexulator-2.0.0/python/doc/_templates/custom-module-template.rst +71 -0
  62. libcasm_clexulator-2.0.0/python/doc/bibliography.rst +4 -0
  63. libcasm_clexulator-2.0.0/python/doc/conf.py +259 -0
  64. libcasm_clexulator-2.0.0/python/doc/examples/make_neighbor_lists.py +82 -0
  65. libcasm_clexulator-2.0.0/python/doc/index.rst +55 -0
  66. libcasm_clexulator-2.0.0/python/doc/installation.rst +29 -0
  67. libcasm_clexulator-2.0.0/python/doc/reference/libcasm/index.rst +12 -0
  68. libcasm_clexulator-2.0.0/python/doc/refs.bib +24 -0
  69. libcasm_clexulator-2.0.0/python/doc/usage/cluster_expansion.rst +234 -0
  70. libcasm_clexulator-2.0.0/python/doc/usage/cluster_expansion_details.rst +115 -0
  71. libcasm_clexulator-2.0.0/python/doc/usage/config_dof_values.rst +130 -0
  72. libcasm_clexulator-2.0.0/python/doc/usage/local_cluster_expansion.rst +61 -0
  73. libcasm_clexulator-2.0.0/python/doc/usage/neighbor_lists.rst +152 -0
  74. libcasm_clexulator-2.0.0/python/doc/usage/order_parameters.rst +221 -0
  75. libcasm_clexulator-2.0.0/python/doc/usage.rst +13 -0
  76. libcasm_clexulator-2.0.0/python/libcasm/clexulator/__init__.py +33 -0
  77. libcasm_clexulator-2.0.0/python/libcasm/clexulator/_functions.py +311 -0
  78. libcasm_clexulator-2.0.0/python/libcasm_clexulator.egg-info/PKG-INFO +58 -0
  79. libcasm_clexulator-2.0.0/python/libcasm_clexulator.egg-info/SOURCES.txt +176 -0
  80. libcasm_clexulator-2.0.0/python/libcasm_clexulator.egg-info/dependency_links.txt +1 -0
  81. libcasm_clexulator-2.0.0/python/libcasm_clexulator.egg-info/requires.txt +3 -0
  82. libcasm_clexulator-2.0.0/python/libcasm_clexulator.egg-info/top_level.txt +1 -0
  83. libcasm_clexulator-2.0.0/python/pyproject.toml +10 -0
  84. libcasm_clexulator-2.0.0/python/setup.py +90 -0
  85. libcasm_clexulator-2.0.0/python/src/clexulator.cpp +2748 -0
  86. libcasm_clexulator-2.0.0/python/tests/clexulator/__init__.py +0 -0
  87. libcasm_clexulator-2.0.0/python/tests/clexulator/conftest.py +215 -0
  88. libcasm_clexulator-2.0.0/python/tests/clexulator/functions.py +11 -0
  89. libcasm_clexulator-2.0.0/python/tests/clexulator/test_OrderParameter.py +214 -0
  90. libcasm_clexulator-2.0.0/python/tests/clexulator/test_SparseCoefficients.py +99 -0
  91. libcasm_clexulator-2.0.0/python/tests/clexulator/test_clexulator.py +94 -0
  92. libcasm_clexulator-2.0.0/python/tests/clexulator/test_config_dof_values.py +530 -0
  93. libcasm_clexulator-2.0.0/python/tests/clexulator/test_correlations.py +146 -0
  94. libcasm_clexulator-2.0.0/python/tests/clexulator/test_diff_clex.py +168 -0
  95. libcasm_clexulator-2.0.0/python/tests/clexulator/test_neighbor_list.py +132 -0
  96. libcasm_clexulator-2.0.0/setup.cfg +4 -0
  97. libcasm_clexulator-2.0.0/setup.py +10 -0
  98. libcasm_clexulator-2.0.0/src/casm/clexulator/BaseClexulator.cc +31 -0
  99. libcasm_clexulator-2.0.0/src/casm/clexulator/Clexulator.cc +230 -0
  100. libcasm_clexulator-2.0.0/src/casm/clexulator/ClusterExpansion.cc +200 -0
  101. libcasm_clexulator-2.0.0/src/casm/clexulator/Correlations.cc +704 -0
  102. libcasm_clexulator-2.0.0/src/casm/clexulator/DoFSpace.cc +895 -0
  103. libcasm_clexulator-2.0.0/src/casm/clexulator/DoFSpaceAxisInfo.cc +88 -0
  104. libcasm_clexulator-2.0.0/src/casm/clexulator/ImpactTable.cc +112 -0
  105. libcasm_clexulator-2.0.0/src/casm/clexulator/LocalClusterExpansion.cc +142 -0
  106. libcasm_clexulator-2.0.0/src/casm/clexulator/LocalCorrelations.cc +177 -0
  107. libcasm_clexulator-2.0.0/src/casm/clexulator/NeighborList.cc +366 -0
  108. libcasm_clexulator-2.0.0/src/casm/clexulator/OrderParameter.cc +430 -0
  109. libcasm_clexulator-2.0.0/src/casm/clexulator/io/json/Clexulator_json_io.cc +229 -0
  110. libcasm_clexulator-2.0.0/src/casm/clexulator/io/json/ConfigDoFValues_json_io.cc +198 -0
  111. libcasm_clexulator-2.0.0/src/casm/clexulator/io/json/DoFSpace_json_io.cc +78 -0
  112. libcasm_clexulator-2.0.0/src/casm/clexulator/io/json/SparseCoefficients_json_io.cc +158 -0
  113. libcasm_clexulator-2.0.0/src/casm/clexulator/version.cc +13 -0
  114. libcasm_clexulator-2.0.0/stylize.sh +18 -0
  115. libcasm_clexulator-2.0.0/test_requirements.txt +2 -0
  116. libcasm_clexulator-2.0.0/tests/CMakeLists.txt +159 -0
  117. libcasm_clexulator-2.0.0/tests/CMakeLists.txt.in +141 -0
  118. libcasm_clexulator-2.0.0/tests/unit/TestClexulatorBase.hh +99 -0
  119. libcasm_clexulator-2.0.0/tests/unit/TestConfiguration.hh +61 -0
  120. libcasm_clexulator-2.0.0/tests/unit/TestLocalClexulatorBase.hh +172 -0
  121. libcasm_clexulator-2.0.0/tests/unit/autotools.cc +28 -0
  122. libcasm_clexulator-2.0.0/tests/unit/autotools.hh +25 -0
  123. libcasm_clexulator-2.0.0/tests/unit/clexulator/Clexulator_json_io_test.cpp +118 -0
  124. libcasm_clexulator-2.0.0/tests/unit/clexulator/ClusterExpansion_test.cpp +225 -0
  125. libcasm_clexulator-2.0.0/tests/unit/clexulator/ConfigDoFValuesTools_test.cpp +27 -0
  126. libcasm_clexulator-2.0.0/tests/unit/clexulator/ConfigDoFValues_json_io_test.cpp +54 -0
  127. libcasm_clexulator-2.0.0/tests/unit/clexulator/ConfigDoFValues_test.cpp +37 -0
  128. libcasm_clexulator-2.0.0/tests/unit/clexulator/DoFSpace_json_io_test.cpp +93 -0
  129. libcasm_clexulator-2.0.0/tests/unit/clexulator/DoFSpace_test.cpp +921 -0
  130. libcasm_clexulator-2.0.0/tests/unit/clexulator/DoFSpace_values_test.cpp +582 -0
  131. libcasm_clexulator-2.0.0/tests/unit/clexulator/LocalClusterExpansion_test.cpp +171 -0
  132. libcasm_clexulator-2.0.0/tests/unit/clexulator/LocalOccClexulator_test.cpp +133 -0
  133. libcasm_clexulator-2.0.0/tests/unit/clexulator/OccClexulator_test.cpp +296 -0
  134. libcasm_clexulator-2.0.0/tests/unit/clexulator/OrderParameter_test.cpp +470 -0
  135. libcasm_clexulator-2.0.0/tests/unit/clexulator/SparseCoefficients_json_io_test.cpp +57 -0
  136. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/0/ZrO_Clexulator_hop0_0.cc +2336 -0
  137. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/1/ZrO_Clexulator_hop0_1.cc +1730 -0
  138. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/ZrO_Clexulator_hop0.cc +2336 -0
  139. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/basis.json +257 -0
  140. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/bspecs.json +39 -0
  141. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/clust.json +181 -0
  142. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/coeff.json +6 -0
  143. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/coeff_0.json +6 -0
  144. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/coeff_1.json +10 -0
  145. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/equivalents_info.json +2141 -0
  146. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/event.json +54 -0
  147. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/0/ZrO_Clexulator_hop1_0.cc +2460 -0
  148. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/1/ZrO_Clexulator_hop1_1.cc +2362 -0
  149. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/2/ZrO_Clexulator_hop1_2.cc +2402 -0
  150. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/3/ZrO_Clexulator_hop1_3.cc +2422 -0
  151. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/4/ZrO_Clexulator_hop1_4.cc +2382 -0
  152. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/5/ZrO_Clexulator_hop1_5.cc +2440 -0
  153. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/ZrO_Clexulator_hop1.cc +2460 -0
  154. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/basis.json +286 -0
  155. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/bspecs.json +39 -0
  156. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/clust.json +198 -0
  157. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/equivalents_info.json +3237 -0
  158. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/event.json +54 -0
  159. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/meta.json +56 -0
  160. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorFCCTernaryTest/basis_sets/bset.default/OccClexulatorTest_Clexulator_default.cc +15847 -0
  161. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorFCCTernaryTest/meta.json +79 -0
  162. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest/basis_sets/bset.default/OccClexulatorZrOTest_Clexulator_default.cc +3253 -0
  163. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest/coeff.json +134 -0
  164. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest/eci.json +2653 -0
  165. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest/meta.json +56 -0
  166. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest_2/basis_sets/bset.default/ZrO_Clexulator_default.cc +16178 -0
  167. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest_2/coeff.json +134 -0
  168. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest_2/coeff_0.json +6 -0
  169. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest_2/coeff_1.json +10 -0
  170. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest_2/eci.json +2653 -0
  171. libcasm_clexulator-2.0.0/tests/unit/clexulator/data/OccClexulatorZrOTest_2/meta.json +56 -0
  172. libcasm_clexulator-2.0.0/tests/unit/clexulator/fadbad_test.cpp +163 -0
  173. libcasm_clexulator-2.0.0/tests/unit/clexulator/version_test.cpp +62 -0
  174. libcasm_clexulator-2.0.0/tests/unit/gtest_main_run_all.cpp +6 -0
  175. libcasm_clexulator-2.0.0/tests/unit/testdir.cc +48 -0
  176. libcasm_clexulator-2.0.0/tests/unit/testdir.hh +46 -0
  177. libcasm_clexulator-2.0.0/tests/unit/testfunctions.hh +26 -0
  178. libcasm_clexulator-2.0.0/tests/unit/teststructures.hh +192 -0
@@ -0,0 +1,122 @@
1
+ # Changelog
2
+
3
+ All notable changes to `libcasm-clexulator` will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+
9
+ ## [2.0.0] - 2025-05-02
10
+
11
+ ### Fixed
12
+
13
+ - Fixed `SparseCoefficients.value` to return value instead of index
14
+ - Fixed construction of default PrimNeighborList in `make_cluster_expansion`
15
+
16
+ ### Changed
17
+
18
+ - Build for Python 3.13
19
+ - Restrict requires-python to ">=3.9,<3.14"
20
+ - Run CI tests using Python 3.13
21
+ - Build MacOS arm64 wheels using MacOS 15
22
+ - Build Linux wheels using Ubuntu 24.04
23
+
24
+
25
+ ## [2.0a7] - 2024-12-11
26
+
27
+ ### Fixed
28
+
29
+ - Fixed `calc_local_correlations` arguments and docs
30
+
31
+ ### Changed
32
+
33
+ - Build macos x86_64 wheels with macos-13 Github Actions runner
34
+
35
+
36
+ ## [2.0a6] - 2024-07-26
37
+
38
+ ### Fixed
39
+
40
+ - Fixed `required_update_neighborhood` methods, changing the return type to list[IntegralSiteCoordinate].
41
+
42
+
43
+ ## [2.0a5] - 2024-07-12
44
+
45
+ ### Added
46
+
47
+ - Added `libcasm.clexulator.PrimNeighborList.weight_matrix()` to access the weight matrix
48
+
49
+ ### Changed
50
+
51
+ - Wheels compiled with numpy>=2.0.0
52
+
53
+ ### Fixed
54
+
55
+ - Fixed missing include (#19)
56
+
57
+
58
+ ## [2.0a4] - 2024-03-14
59
+
60
+ ### Fixed
61
+
62
+ - Fixed DoFSpace basis pseudoinverse calculation
63
+
64
+ ### Added
65
+
66
+ - Added gradients of correlations functionality in C++, Python functions
67
+ - Added FADBAD library to support compiling of Clexulators capable of calculating gradients
68
+ - Added methods to libcasm.clexulator.PrimNeighborList to construct a PrimNeighborList with default parameters for a libcasm.xtal.Prim and to expand and access the neighbors.
69
+ - Added libcasm.clexulator.make_default_prim_neighbor_list
70
+ - Added methods to libcasm.clexulator.SuperNeighborList to access the neighbor sites and unitcells.
71
+ - Added support in ConfigDoFValues for multiple discrete DoF
72
+ - Added CASM::clexulator::get_dof_vector_value_at and CASM::clexulator::get_mean_dof_vector_value
73
+
74
+
75
+ ### Changed
76
+
77
+ - Updated docs for PyData Sphinx Theme 0.14.3, particularly dark theme colors and logo
78
+ - Changed "intensive_value" methods to "per_unitcell" and "extensive_value" methods to "per_supercell"
79
+ - Changed names of libcasm.clexulator.PrimNeighborList methods default_nlist_weight_matrix to default_lattice_weight_matrix and default_nlist_sublattice_indices to default_sublattice_indices
80
+
81
+ ### Removed
82
+
83
+ - Removed libcasm.clexulator.PrimNeighborList.default_nlist
84
+
85
+
86
+ ## [2.0a3] - 2023-10-25
87
+
88
+ ### Fixed
89
+
90
+ - Fixed error messages for conversion of local DoF to the standard basis
91
+ - Fixed DiffClexParamPack traits namespace
92
+ - Fixed DoFSpace.is_global binding
93
+
94
+ ### Added
95
+
96
+ - Tests for correct treatment of local DoF basis with dim=0 on some sublattices
97
+
98
+
99
+ ## [2.0a2] - 2023-09-28
100
+
101
+ ### Fixed
102
+
103
+ - Fixed calculation of homogeneous mode space when some sites do not include a local DoF
104
+
105
+
106
+ ## [2.0a1] - 2023-08-20
107
+
108
+ This release separates out casm/clexulator from CASM v1. It creates a Python package, libcasm.clexulator, that enables using casm/clexulator and may be installed via pip install, using scikit-build, CMake, and pybind11. This release also includes usage and API documentation for using libcasm.clexulator, built using Sphinx.
109
+
110
+ ### Added
111
+
112
+ - Added Python package libcasm.clexulator
113
+ - Added scikit-build, CMake, and pybind11 build process
114
+ - Added GitHub Actions for unit testing
115
+ - Added GitHub Action build_wheels.yml for Python x86_64 wheel building using cibuildwheel
116
+ - Added Cirrus-CI .cirrus.yml for Python aarch64 and arm64 wheel building using cibuildwheel
117
+ - Added Python documentation
118
+
119
+ ### Removed
120
+
121
+ - Removed autotools build process
122
+ - Removed boost dependencies
@@ -0,0 +1,245 @@
1
+ cmake_minimum_required(VERSION 3.20)
2
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
3
+
4
+ project(CASMcode_clexulator VERSION 2.0.0 LANGUAGES CXX)
5
+
6
+ # set CMAKE_INSTALL_X variables
7
+ include(GNUInstallDirs)
8
+
9
+ # specify the C++ standard
10
+ set(CMAKE_CXX_STANDARD 17)
11
+ set(CMAKE_CXX_STANDARD_REQUIRED True)
12
+
13
+ # try to use ccache
14
+ find_program(CCACHE_PROGRAM ccache)
15
+ if(CCACHE_PROGRAM)
16
+ set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
17
+ endif()
18
+
19
+ ##############################################
20
+ ## Find dependencies
21
+
22
+ # Should find ZLIB::ZLIB
23
+ find_package(ZLIB)
24
+
25
+ # Find CASM
26
+ if(NOT DEFINED CASM_PREFIX)
27
+ message(STATUS "CASM_PREFIX not defined")
28
+ # try to find Python
29
+ find_package (Python COMPONENTS Interpreter Development)
30
+ if(DEFINED Python_EXECUTABLE)
31
+ # if Python found, obtain CASM_PREFIX from the libcasm.casmglobal
32
+ message(STATUS "found Python_EXECUTABLE: ${Python_EXECUTABLE}")
33
+ message(STATUS "checking for libcasm-global")
34
+ execute_process(
35
+ COMMAND pip show libcasm-global
36
+ RESULT_VARIABLE EXIT_CODE
37
+ OUTPUT_QUIET
38
+ )
39
+ if (${EXIT_CODE} EQUAL 0)
40
+ message(STATUS "found libcasm-global")
41
+ execute_process(COMMAND ${Python_EXECUTABLE} -m libcasm.casmglobal --prefix
42
+ OUTPUT_VARIABLE CASM_PREFIX_RAW)
43
+ string(STRIP "${CASM_PREFIX_RAW}" CASM_PREFIX)
44
+ message(STATUS "CASM_PREFIX: ${CASM_PREFIX}")
45
+ else()
46
+ message(STATUS "did not find libcasm-global")
47
+ endif()
48
+ endif()
49
+ endif()
50
+ if(DEFINED CASM_PREFIX)
51
+ set(CASMcode_global_ROOT ${CASM_PREFIX}/share/CASMcode_global/cmake)
52
+ set(CASMcode_crystallography_ROOT ${CASM_PREFIX}/share/CASMcode_crystallography/cmake)
53
+ endif()
54
+ find_package(CASMcode_global)
55
+ if(NOT CASMcode_global_FOUND)
56
+ message(FATAL_ERROR "CMake failed to find CASMcode_global")
57
+ endif()
58
+ # if successful, we have CASM::casm_global
59
+
60
+ find_package(CASMcode_crystallography)
61
+ if(NOT CASMcode_crystallography_FOUND)
62
+ message(FATAL_ERROR "CMake failed to find CASMcode_crystallography")
63
+ endif()
64
+ # if successful, we have CASM::casm_crystallography
65
+
66
+ # if no user CMAKE_INSTALL_PREFIX, use CASM_PREFIX if it exists
67
+ IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
68
+ if(DEFINED CASM_PREFIX)
69
+ message(STATUS "CMAKE_INSTALL_PREFIX initialized to default, so updating CMAKE_INSTALL_PREFIX to CASM_PREFIX")
70
+ set(CMAKE_INSTALL_PREFIX ${CASM_PREFIX} CACHE PATH "set CMAKE_INSTALL_PREFIX to CASM_PREFIX" FORCE)
71
+ message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
72
+ endif()
73
+ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
74
+
75
+ ##############################################
76
+ ## Build libcasm_clexulator
77
+
78
+ # create libcasm_clexulator
79
+ set(
80
+ libcasm_clexulator_HEADERS
81
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/BaseClexulator.hh
82
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/BasicClexParamPack.hh
83
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ClexParamPack.hh
84
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/Clexulator.hh
85
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ClusterExpansion.hh
86
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ConfigDoFValues.hh
87
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ConfigDoFValuesTools.hh
88
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ConfigDoFValuesTools_impl.hh
89
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/Correlations.hh
90
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/DiffClexParamPack.hh
91
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/DoFSpace.hh
92
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/DoFSpaceAxisInfo.hh
93
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ImpactTable.hh
94
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/LocalClusterExpansion.hh
95
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/LocalCorrelations.hh
96
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/NeighborList.hh
97
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/OrderParameter.hh
98
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/SparseCoefficients.hh
99
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/external/fadbad/badiff.h
100
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/external/fadbad/fadbad.h
101
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/external/fadbad/fadiff.h
102
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/external/fadbad/tadiff.h
103
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/io/json/Clexulator_json_io.hh
104
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/io/json/ConfigDoFValues_json_io.hh
105
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/io/json/DoFSpace_json_io.hh
106
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/io/json/SparseCoefficients_json_io.hh
107
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/version.hh
108
+ )
109
+ set(
110
+ libcasm_clexulator_SOURCES
111
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/BaseClexulator.cc
112
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/Clexulator.cc
113
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/ClusterExpansion.cc
114
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/Correlations.cc
115
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/DoFSpace.cc
116
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/DoFSpaceAxisInfo.cc
117
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/ImpactTable.cc
118
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/LocalClusterExpansion.cc
119
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/LocalCorrelations.cc
120
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/NeighborList.cc
121
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/OrderParameter.cc
122
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/io/json/Clexulator_json_io.cc
123
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/io/json/ConfigDoFValues_json_io.cc
124
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/io/json/DoFSpace_json_io.cc
125
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/io/json/SparseCoefficients_json_io.cc
126
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/version.cc
127
+ )
128
+ add_library(casm_clexulator SHARED ${libcasm_clexulator_SOURCES})
129
+ target_include_directories(casm_clexulator
130
+ PUBLIC
131
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
132
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/casm/external>
133
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/casm/external/gzstream>
134
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
135
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/casm/external>
136
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/casm/external/gzstream>
137
+ )
138
+ target_compile_options(casm_clexulator
139
+ PUBLIC
140
+ "-DCASM_CLEXULATOR_TXT_VERSION=\"${CMAKE_PROJECT_VERSION}\""
141
+ -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long
142
+ -DGZSTREAM_NAMESPACE=gz
143
+ )
144
+ target_link_libraries(casm_clexulator
145
+ ZLIB::ZLIB
146
+ ${CMAKE_DL_LIBS}
147
+ CASM::casm_global
148
+ CASM::casm_crystallography
149
+ )
150
+ if(APPLE)
151
+ set_target_properties(
152
+ casm_clexulator PROPERTIES INSTALL_RPATH "@loader_path")
153
+ else()
154
+ set_target_properties(
155
+ casm_clexulator PROPERTIES INSTALL_RPATH "$ORIGIN")
156
+ endif()
157
+
158
+ ##############################################
159
+ ## Install libcasm_clexulator
160
+
161
+ # install header files in <prefix>/libcasm/include/,
162
+ # while preserving directory structure
163
+ foreach ( filevar ${libcasm_clexulator_HEADERS} )
164
+ file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR}/include/ ${filevar})
165
+ get_filename_component( reldir ${relfile} DIRECTORY )
166
+ install( FILES ${filevar} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${reldir} )
167
+ endforeach()
168
+
169
+ # install libcasm_clexulator in <prefix>/libcasm/lib/
170
+ install(
171
+ TARGETS casm_clexulator
172
+ EXPORT CASMcode_clexulatorTargets
173
+ DESTINATION lib)
174
+
175
+ ##############################################
176
+ ## Python extensions
177
+
178
+ # The CMake package config and target files are installed under the Python
179
+ # package root. This is necessary to ensure that all the relative paths in the
180
+ # helloTargets.cmake resolve correctly. It also provides encapsulation.
181
+ #
182
+ # The actual path used must be selected so that consuming projects can locate it
183
+ # via `find_package`. To support finding CMake packages in the Python package
184
+ # prefix, using `find_package`s default search path of
185
+ # `<prefix>/<name>/share/<name>*/cmake/` is reasonable. Adding the Python
186
+ # package installation prefix to CMAKE_PREFIX_PATH in combination with this path
187
+ # will allow `find_package` to find this package and any other package installed
188
+ # via a Python package if the CMake and Python packages are named the same.
189
+ set(CASM_CMAKE_PACKAGE_INSTALL_SUBDIR "share/CASMcode_clexulator/cmake")
190
+
191
+ install(
192
+ EXPORT CASMcode_clexulatorTargets
193
+ NAMESPACE CASM::
194
+ DESTINATION ${CASM_CMAKE_PACKAGE_INSTALL_SUBDIR})
195
+
196
+ include(CMakePackageConfigHelpers)
197
+
198
+ write_basic_package_version_file(
199
+ CASMcode_clexulatorConfigVersion.cmake
200
+ VERSION ${PROJECT_VERSION}
201
+ COMPATIBILITY SameMinorVersion)
202
+
203
+ configure_package_config_file(
204
+ "${PROJECT_SOURCE_DIR}/cmake/CASMcode_clexulatorConfig.cmake.in" CASMcode_clexulatorConfig.cmake
205
+ INSTALL_DESTINATION ${CASM_CMAKE_PACKAGE_INSTALL_SUBDIR})
206
+
207
+ install(FILES "${PROJECT_BINARY_DIR}/CASMcode_clexulatorConfig.cmake"
208
+ "${PROJECT_BINARY_DIR}/CASMcode_clexulatorConfigVersion.cmake"
209
+ DESTINATION ${CASM_CMAKE_PACKAGE_INSTALL_SUBDIR})
210
+
211
+ # We are using the SKBUILD variable, which is defined when scikit-build is
212
+ # running the CMake build, to control building the Python wrapper. This allows
213
+ # the C++ project to be installed, standalone, when using the standard CMake
214
+ # build flow.
215
+ if(DEFINED SKBUILD)
216
+
217
+ # call pybind11-config to obtain the root of the cmake package
218
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pybind11 --cmakedir
219
+ OUTPUT_VARIABLE pybind11_ROOT_RAW)
220
+ string(STRIP "${pybind11_ROOT_RAW}" pybind11_ROOT)
221
+ find_package(pybind11)
222
+
223
+ # The extension modules must load:
224
+ # - the casm_global library
225
+ # - the casm_clexulator library
226
+ # They can be found by setting a relative rpath
227
+
228
+ ### libcasm.clexulator._clexulator ###
229
+ pybind11_add_module(_clexulator MODULE
230
+ "${PROJECT_SOURCE_DIR}/python/src/clexulator.cpp")
231
+ target_link_libraries(_clexulator PRIVATE
232
+ CASM::casm_global
233
+ CASM::casm_crystallography
234
+ casm_clexulator
235
+ )
236
+ install(TARGETS _clexulator DESTINATION clexulator)
237
+ if(APPLE)
238
+ set_target_properties(
239
+ _clexulator PROPERTIES INSTALL_RPATH "@loader_path/../lib")
240
+ else()
241
+ set_target_properties(
242
+ _clexulator PROPERTIES INSTALL_RPATH "$ORIGIN/../lib")
243
+ endif()
244
+
245
+ endif()
@@ -0,0 +1,202 @@
1
+ cmake_minimum_required(VERSION 3.20)
2
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
3
+
4
+ project(CASMcode_clexulator VERSION 2.0.0 LANGUAGES CXX)
5
+
6
+ # set CMAKE_INSTALL_X variables
7
+ include(GNUInstallDirs)
8
+
9
+ # specify the C++ standard
10
+ set(CMAKE_CXX_STANDARD 17)
11
+ set(CMAKE_CXX_STANDARD_REQUIRED True)
12
+
13
+ # try to use ccache
14
+ find_program(CCACHE_PROGRAM ccache)
15
+ if(CCACHE_PROGRAM)
16
+ set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
17
+ endif()
18
+
19
+ ##############################################
20
+ ## Find dependencies
21
+
22
+ # Should find ZLIB::ZLIB
23
+ find_package(ZLIB)
24
+
25
+ # Find CASM
26
+ if(NOT DEFINED CASM_PREFIX)
27
+ message(STATUS "CASM_PREFIX not defined")
28
+ # try to find Python
29
+ find_package (Python COMPONENTS Interpreter Development)
30
+ if(DEFINED Python_EXECUTABLE)
31
+ # if Python found, obtain CASM_PREFIX from the libcasm.casmglobal
32
+ message(STATUS "found Python_EXECUTABLE: ${Python_EXECUTABLE}")
33
+ message(STATUS "checking for libcasm-global")
34
+ execute_process(
35
+ COMMAND pip show libcasm-global
36
+ RESULT_VARIABLE EXIT_CODE
37
+ OUTPUT_QUIET
38
+ )
39
+ if (${EXIT_CODE} EQUAL 0)
40
+ message(STATUS "found libcasm-global")
41
+ execute_process(COMMAND ${Python_EXECUTABLE} -m libcasm.casmglobal --prefix
42
+ OUTPUT_VARIABLE CASM_PREFIX_RAW)
43
+ string(STRIP "${CASM_PREFIX_RAW}" CASM_PREFIX)
44
+ message(STATUS "CASM_PREFIX: ${CASM_PREFIX}")
45
+ else()
46
+ message(STATUS "did not find libcasm-global")
47
+ endif()
48
+ endif()
49
+ endif()
50
+ if(DEFINED CASM_PREFIX)
51
+ set(CASMcode_global_ROOT ${CASM_PREFIX}/share/CASMcode_global/cmake)
52
+ set(CASMcode_crystallography_ROOT ${CASM_PREFIX}/share/CASMcode_crystallography/cmake)
53
+ endif()
54
+ find_package(CASMcode_global)
55
+ if(NOT CASMcode_global_FOUND)
56
+ message(FATAL_ERROR "CMake failed to find CASMcode_global")
57
+ endif()
58
+ # if successful, we have CASM::casm_global
59
+
60
+ find_package(CASMcode_crystallography)
61
+ if(NOT CASMcode_crystallography_FOUND)
62
+ message(FATAL_ERROR "CMake failed to find CASMcode_crystallography")
63
+ endif()
64
+ # if successful, we have CASM::casm_crystallography
65
+
66
+ # if no user CMAKE_INSTALL_PREFIX, use CASM_PREFIX if it exists
67
+ IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
68
+ if(DEFINED CASM_PREFIX)
69
+ message(STATUS "CMAKE_INSTALL_PREFIX initialized to default, so updating CMAKE_INSTALL_PREFIX to CASM_PREFIX")
70
+ set(CMAKE_INSTALL_PREFIX ${CASM_PREFIX} CACHE PATH "set CMAKE_INSTALL_PREFIX to CASM_PREFIX" FORCE)
71
+ message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
72
+ endif()
73
+ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
74
+
75
+ ##############################################
76
+ ## Build libcasm_clexulator
77
+
78
+ # create libcasm_clexulator
79
+ set(
80
+ libcasm_clexulator_HEADERS
81
+ @header_files@)
82
+ set(
83
+ libcasm_clexulator_SOURCES
84
+ @source_files@)
85
+ add_library(casm_clexulator SHARED ${libcasm_clexulator_SOURCES})
86
+ target_include_directories(casm_clexulator
87
+ PUBLIC
88
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
89
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/casm/external>
90
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/casm/external/gzstream>
91
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
92
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/casm/external>
93
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/casm/external/gzstream>
94
+ )
95
+ target_compile_options(casm_clexulator
96
+ PUBLIC
97
+ "-DCASM_CLEXULATOR_TXT_VERSION=\"${CMAKE_PROJECT_VERSION}\""
98
+ -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long
99
+ -DGZSTREAM_NAMESPACE=gz
100
+ )
101
+ target_link_libraries(casm_clexulator
102
+ ZLIB::ZLIB
103
+ ${CMAKE_DL_LIBS}
104
+ CASM::casm_global
105
+ CASM::casm_crystallography
106
+ )
107
+ if(APPLE)
108
+ set_target_properties(
109
+ casm_clexulator PROPERTIES INSTALL_RPATH "@loader_path")
110
+ else()
111
+ set_target_properties(
112
+ casm_clexulator PROPERTIES INSTALL_RPATH "$ORIGIN")
113
+ endif()
114
+
115
+ ##############################################
116
+ ## Install libcasm_clexulator
117
+
118
+ # install header files in <prefix>/libcasm/include/,
119
+ # while preserving directory structure
120
+ foreach ( filevar ${libcasm_clexulator_HEADERS} )
121
+ file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR}/include/ ${filevar})
122
+ get_filename_component( reldir ${relfile} DIRECTORY )
123
+ install( FILES ${filevar} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${reldir} )
124
+ endforeach()
125
+
126
+ # install libcasm_clexulator in <prefix>/libcasm/lib/
127
+ install(
128
+ TARGETS casm_clexulator
129
+ EXPORT CASMcode_clexulatorTargets
130
+ DESTINATION lib)
131
+
132
+ ##############################################
133
+ ## Python extensions
134
+
135
+ # The CMake package config and target files are installed under the Python
136
+ # package root. This is necessary to ensure that all the relative paths in the
137
+ # helloTargets.cmake resolve correctly. It also provides encapsulation.
138
+ #
139
+ # The actual path used must be selected so that consuming projects can locate it
140
+ # via `find_package`. To support finding CMake packages in the Python package
141
+ # prefix, using `find_package`s default search path of
142
+ # `<prefix>/<name>/share/<name>*/cmake/` is reasonable. Adding the Python
143
+ # package installation prefix to CMAKE_PREFIX_PATH in combination with this path
144
+ # will allow `find_package` to find this package and any other package installed
145
+ # via a Python package if the CMake and Python packages are named the same.
146
+ set(CASM_CMAKE_PACKAGE_INSTALL_SUBDIR "share/CASMcode_clexulator/cmake")
147
+
148
+ install(
149
+ EXPORT CASMcode_clexulatorTargets
150
+ NAMESPACE CASM::
151
+ DESTINATION ${CASM_CMAKE_PACKAGE_INSTALL_SUBDIR})
152
+
153
+ include(CMakePackageConfigHelpers)
154
+
155
+ write_basic_package_version_file(
156
+ CASMcode_clexulatorConfigVersion.cmake
157
+ VERSION ${PROJECT_VERSION}
158
+ COMPATIBILITY SameMinorVersion)
159
+
160
+ configure_package_config_file(
161
+ "${PROJECT_SOURCE_DIR}/cmake/CASMcode_clexulatorConfig.cmake.in" CASMcode_clexulatorConfig.cmake
162
+ INSTALL_DESTINATION ${CASM_CMAKE_PACKAGE_INSTALL_SUBDIR})
163
+
164
+ install(FILES "${PROJECT_BINARY_DIR}/CASMcode_clexulatorConfig.cmake"
165
+ "${PROJECT_BINARY_DIR}/CASMcode_clexulatorConfigVersion.cmake"
166
+ DESTINATION ${CASM_CMAKE_PACKAGE_INSTALL_SUBDIR})
167
+
168
+ # We are using the SKBUILD variable, which is defined when scikit-build is
169
+ # running the CMake build, to control building the Python wrapper. This allows
170
+ # the C++ project to be installed, standalone, when using the standard CMake
171
+ # build flow.
172
+ if(DEFINED SKBUILD)
173
+
174
+ # call pybind11-config to obtain the root of the cmake package
175
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pybind11 --cmakedir
176
+ OUTPUT_VARIABLE pybind11_ROOT_RAW)
177
+ string(STRIP "${pybind11_ROOT_RAW}" pybind11_ROOT)
178
+ find_package(pybind11)
179
+
180
+ # The extension modules must load:
181
+ # - the casm_global library
182
+ # - the casm_clexulator library
183
+ # They can be found by setting a relative rpath
184
+
185
+ ### libcasm.clexulator._clexulator ###
186
+ pybind11_add_module(_clexulator MODULE
187
+ "${PROJECT_SOURCE_DIR}/python/src/clexulator.cpp")
188
+ target_link_libraries(_clexulator PRIVATE
189
+ CASM::casm_global
190
+ CASM::casm_crystallography
191
+ casm_clexulator
192
+ )
193
+ install(TARGETS _clexulator DESTINATION clexulator)
194
+ if(APPLE)
195
+ set_target_properties(
196
+ _clexulator PROPERTIES INSTALL_RPATH "@loader_path/../lib")
197
+ else()
198
+ set_target_properties(
199
+ _clexulator PROPERTIES INSTALL_RPATH "$ORIGIN/../lib")
200
+ endif()
201
+
202
+ endif()