libcasm-clexulator 2.0a1__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 (155) hide show
  1. libcasm-clexulator-2.0a1/CHANGELOG.md +25 -0
  2. libcasm-clexulator-2.0a1/CMakeLists.txt +241 -0
  3. libcasm-clexulator-2.0a1/CMakeLists.txt.in +202 -0
  4. libcasm-clexulator-2.0a1/LICENSE +484 -0
  5. libcasm-clexulator-2.0a1/MANIFEST.in +19 -0
  6. libcasm-clexulator-2.0a1/PKG-INFO +55 -0
  7. libcasm-clexulator-2.0a1/README.md +38 -0
  8. libcasm-clexulator-2.0a1/build_requirements.txt +8 -0
  9. libcasm-clexulator-2.0a1/cmake/CASMcode_clexulatorConfig.cmake.in +3 -0
  10. libcasm-clexulator-2.0a1/dev_requirements.txt +4 -0
  11. libcasm-clexulator-2.0a1/doc_requirements.txt +7 -0
  12. libcasm-clexulator-2.0a1/include/casm/clexulator/BaseClexulator.hh +386 -0
  13. libcasm-clexulator-2.0a1/include/casm/clexulator/BasicClexParamPack.hh +243 -0
  14. libcasm-clexulator-2.0a1/include/casm/clexulator/ClexParamPack.hh +347 -0
  15. libcasm-clexulator-2.0a1/include/casm/clexulator/Clexulator.hh +494 -0
  16. libcasm-clexulator-2.0a1/include/casm/clexulator/ClusterExpansion.hh +137 -0
  17. libcasm-clexulator-2.0a1/include/casm/clexulator/ConfigDoFValues.hh +45 -0
  18. libcasm-clexulator-2.0a1/include/casm/clexulator/ConfigDoFValuesTools.hh +344 -0
  19. libcasm-clexulator-2.0a1/include/casm/clexulator/ConfigDoFValuesTools_impl.hh +46 -0
  20. libcasm-clexulator-2.0a1/include/casm/clexulator/Correlations.hh +175 -0
  21. libcasm-clexulator-2.0a1/include/casm/clexulator/DiffClexParamPack.hh +719 -0
  22. libcasm-clexulator-2.0a1/include/casm/clexulator/DoFSpace.hh +235 -0
  23. libcasm-clexulator-2.0a1/include/casm/clexulator/DoFSpaceAxisInfo.hh +62 -0
  24. libcasm-clexulator-2.0a1/include/casm/clexulator/ImpactTable.hh +135 -0
  25. libcasm-clexulator-2.0a1/include/casm/clexulator/LocalClusterExpansion.hh +110 -0
  26. libcasm-clexulator-2.0a1/include/casm/clexulator/LocalCorrelations.hh +91 -0
  27. libcasm-clexulator-2.0a1/include/casm/clexulator/NeighborList.hh +359 -0
  28. libcasm-clexulator-2.0a1/include/casm/clexulator/OrderParameter.hh +137 -0
  29. libcasm-clexulator-2.0a1/include/casm/clexulator/SparseCoefficients.hh +55 -0
  30. libcasm-clexulator-2.0a1/include/casm/clexulator/io/json/Clexulator_json_io.hh +28 -0
  31. libcasm-clexulator-2.0a1/include/casm/clexulator/io/json/ConfigDoFValues_json_io.hh +42 -0
  32. libcasm-clexulator-2.0a1/include/casm/clexulator/io/json/DoFSpace_json_io.hh +50 -0
  33. libcasm-clexulator-2.0a1/include/casm/clexulator/io/json/SparseCoefficients_json_io.hh +28 -0
  34. libcasm-clexulator-2.0a1/include/casm/clexulator/version.hh +24 -0
  35. libcasm-clexulator-2.0a1/make_CMakeLists.py +176 -0
  36. libcasm-clexulator-2.0a1/pre-commit +22 -0
  37. libcasm-clexulator-2.0a1/pyproject.toml +88 -0
  38. libcasm-clexulator-2.0a1/python/doc/.gitignore +2 -0
  39. libcasm-clexulator-2.0a1/python/doc/_static/css/custom.css +7 -0
  40. libcasm-clexulator-2.0a1/python/doc/_static/logo.pdf +1477 -4
  41. libcasm-clexulator-2.0a1/python/doc/_static/logo.svg +1 -0
  42. libcasm-clexulator-2.0a1/python/doc/_static/small_logo.pdf +1351 -4
  43. libcasm-clexulator-2.0a1/python/doc/_static/small_logo.svg +1 -0
  44. libcasm-clexulator-2.0a1/python/doc/_templates/base.rst +5 -0
  45. libcasm-clexulator-2.0a1/python/doc/_templates/custom-attr-template.rst +5 -0
  46. libcasm-clexulator-2.0a1/python/doc/_templates/custom-class-template.rst +36 -0
  47. libcasm-clexulator-2.0a1/python/doc/_templates/custom-function-template.rst +5 -0
  48. libcasm-clexulator-2.0a1/python/doc/_templates/custom-module-template.rst +71 -0
  49. libcasm-clexulator-2.0a1/python/doc/bibliography.rst +4 -0
  50. libcasm-clexulator-2.0a1/python/doc/conf.py +224 -0
  51. libcasm-clexulator-2.0a1/python/doc/index.rst +49 -0
  52. libcasm-clexulator-2.0a1/python/doc/installation.rst +29 -0
  53. libcasm-clexulator-2.0a1/python/doc/reference/libcasm/index.rst +12 -0
  54. libcasm-clexulator-2.0a1/python/doc/refs.bib +24 -0
  55. libcasm-clexulator-2.0a1/python/doc/usage/cluster_expansion.rst +231 -0
  56. libcasm-clexulator-2.0a1/python/doc/usage/cluster_expansion_details.rst +111 -0
  57. libcasm-clexulator-2.0a1/python/doc/usage/config_dof_values.rst +130 -0
  58. libcasm-clexulator-2.0a1/python/doc/usage/local_cluster_expansion.rst +61 -0
  59. libcasm-clexulator-2.0a1/python/doc/usage/order_parameters.rst +234 -0
  60. libcasm-clexulator-2.0a1/python/doc/usage.rst +12 -0
  61. libcasm-clexulator-2.0a1/python/libcasm/clexulator/__init__.py +31 -0
  62. libcasm-clexulator-2.0a1/python/libcasm/clexulator/_functions.py +301 -0
  63. libcasm-clexulator-2.0a1/python/libcasm_clexulator.egg-info/PKG-INFO +55 -0
  64. libcasm-clexulator-2.0a1/python/libcasm_clexulator.egg-info/SOURCES.txt +153 -0
  65. libcasm-clexulator-2.0a1/python/libcasm_clexulator.egg-info/dependency_links.txt +1 -0
  66. libcasm-clexulator-2.0a1/python/libcasm_clexulator.egg-info/requires.txt +3 -0
  67. libcasm-clexulator-2.0a1/python/libcasm_clexulator.egg-info/top_level.txt +1 -0
  68. libcasm-clexulator-2.0a1/python/pyproject.toml +10 -0
  69. libcasm-clexulator-2.0a1/python/setup.py +90 -0
  70. libcasm-clexulator-2.0a1/python/src/clexulator.cpp +2242 -0
  71. libcasm-clexulator-2.0a1/python/tests/clexulator/__init__.py +0 -0
  72. libcasm-clexulator-2.0a1/python/tests/clexulator/conftest.py +33 -0
  73. libcasm-clexulator-2.0a1/python/tests/clexulator/functions.py +11 -0
  74. libcasm-clexulator-2.0a1/python/tests/clexulator/test_OrderParameter.py +214 -0
  75. libcasm-clexulator-2.0a1/python/tests/clexulator/test_SparseCoefficients.py +99 -0
  76. libcasm-clexulator-2.0a1/python/tests/clexulator/test_clexulator.py +63 -0
  77. libcasm-clexulator-2.0a1/python/tests/clexulator/test_config_dof_values.py +91 -0
  78. libcasm-clexulator-2.0a1/python/tests/clexulator/test_correlations.py +65 -0
  79. libcasm-clexulator-2.0a1/python/tests/clexulator/test_neighbor_list.py +30 -0
  80. libcasm-clexulator-2.0a1/setup.cfg +4 -0
  81. libcasm-clexulator-2.0a1/setup.py +10 -0
  82. libcasm-clexulator-2.0a1/src/casm/clexulator/BaseClexulator.cc +31 -0
  83. libcasm-clexulator-2.0a1/src/casm/clexulator/Clexulator.cc +230 -0
  84. libcasm-clexulator-2.0a1/src/casm/clexulator/ClusterExpansion.cc +200 -0
  85. libcasm-clexulator-2.0a1/src/casm/clexulator/Correlations.cc +617 -0
  86. libcasm-clexulator-2.0a1/src/casm/clexulator/DoFSpace.cc +850 -0
  87. libcasm-clexulator-2.0a1/src/casm/clexulator/DoFSpaceAxisInfo.cc +88 -0
  88. libcasm-clexulator-2.0a1/src/casm/clexulator/ImpactTable.cc +112 -0
  89. libcasm-clexulator-2.0a1/src/casm/clexulator/LocalClusterExpansion.cc +142 -0
  90. libcasm-clexulator-2.0a1/src/casm/clexulator/LocalCorrelations.cc +177 -0
  91. libcasm-clexulator-2.0a1/src/casm/clexulator/NeighborList.cc +311 -0
  92. libcasm-clexulator-2.0a1/src/casm/clexulator/OrderParameter.cc +430 -0
  93. libcasm-clexulator-2.0a1/src/casm/clexulator/io/json/Clexulator_json_io.cc +229 -0
  94. libcasm-clexulator-2.0a1/src/casm/clexulator/io/json/ConfigDoFValues_json_io.cc +198 -0
  95. libcasm-clexulator-2.0a1/src/casm/clexulator/io/json/DoFSpace_json_io.cc +78 -0
  96. libcasm-clexulator-2.0a1/src/casm/clexulator/io/json/SparseCoefficients_json_io.cc +158 -0
  97. libcasm-clexulator-2.0a1/src/casm/clexulator/version.cc +13 -0
  98. libcasm-clexulator-2.0a1/stylize.sh +18 -0
  99. libcasm-clexulator-2.0a1/test_requirements.txt +2 -0
  100. libcasm-clexulator-2.0a1/tests/CMakeLists.txt +158 -0
  101. libcasm-clexulator-2.0a1/tests/CMakeLists.txt.in +141 -0
  102. libcasm-clexulator-2.0a1/tests/unit/TestClexulatorBase.hh +99 -0
  103. libcasm-clexulator-2.0a1/tests/unit/TestConfiguration.hh +61 -0
  104. libcasm-clexulator-2.0a1/tests/unit/TestLocalClexulatorBase.hh +172 -0
  105. libcasm-clexulator-2.0a1/tests/unit/autotools.cc +28 -0
  106. libcasm-clexulator-2.0a1/tests/unit/autotools.hh +25 -0
  107. libcasm-clexulator-2.0a1/tests/unit/clexulator/Clexulator_json_io_test.cpp +93 -0
  108. libcasm-clexulator-2.0a1/tests/unit/clexulator/ClusterExpansion_test.cpp +224 -0
  109. libcasm-clexulator-2.0a1/tests/unit/clexulator/ConfigDoFValuesTools_test.cpp +27 -0
  110. libcasm-clexulator-2.0a1/tests/unit/clexulator/ConfigDoFValues_json_io_test.cpp +54 -0
  111. libcasm-clexulator-2.0a1/tests/unit/clexulator/ConfigDoFValues_test.cpp +37 -0
  112. libcasm-clexulator-2.0a1/tests/unit/clexulator/DoFSpace_json_io_test.cpp +93 -0
  113. libcasm-clexulator-2.0a1/tests/unit/clexulator/DoFSpace_test.cpp +843 -0
  114. libcasm-clexulator-2.0a1/tests/unit/clexulator/DoFSpace_values_test.cpp +582 -0
  115. libcasm-clexulator-2.0a1/tests/unit/clexulator/LocalClusterExpansion_test.cpp +171 -0
  116. libcasm-clexulator-2.0a1/tests/unit/clexulator/LocalOccClexulator_test.cpp +113 -0
  117. libcasm-clexulator-2.0a1/tests/unit/clexulator/OccClexulator_test.cpp +296 -0
  118. libcasm-clexulator-2.0a1/tests/unit/clexulator/OrderParameter_test.cpp +470 -0
  119. libcasm-clexulator-2.0a1/tests/unit/clexulator/SparseCoefficients_json_io_test.cpp +57 -0
  120. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/0/LocalOccClexulatorZrOTest_Clexulator_hop0_0.cc +18328 -0
  121. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/1/LocalOccClexulatorZrOTest_Clexulator_hop0_1.cc +18328 -0
  122. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/LocalOccClexulatorZrOTest_Clexulator_hop0.cc +14358 -0
  123. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/basis.json +869 -0
  124. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/bspecs.json +40 -0
  125. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/clust.json +631 -0
  126. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/coeff.json +6 -0
  127. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/coeff_0.json +6 -0
  128. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/coeff_1.json +10 -0
  129. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop0/equivalents_info.json +9185 -0
  130. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/0/LocalOccClexulatorZrOTest_Clexulator_hop1_0.cc +18328 -0
  131. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/1/LocalOccClexulatorZrOTest_Clexulator_hop1_1.cc +18328 -0
  132. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/LocalOccClexulatorZrOTest_Clexulator_hop1.cc +14358 -0
  133. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/basis.json +869 -0
  134. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/bspecs.json +40 -0
  135. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/clust.json +631 -0
  136. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/basis_sets/bset.hop1/equivalents_info.json +9185 -0
  137. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/LocalOccClexulatorZrOTest/meta.json +56 -0
  138. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorFCCTernaryTest/basis_sets/bset.default/OccClexulatorTest_Clexulator_default.cc +15847 -0
  139. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorFCCTernaryTest/meta.json +79 -0
  140. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest/basis_sets/bset.default/OccClexulatorZrOTest_Clexulator_default.cc +3253 -0
  141. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest/coeff.json +134 -0
  142. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest/eci.json +2653 -0
  143. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest/meta.json +56 -0
  144. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest_2/basis_sets/bset.default/ZrO_Clexulator_default.cc +16178 -0
  145. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest_2/coeff.json +134 -0
  146. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest_2/coeff_0.json +6 -0
  147. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest_2/coeff_1.json +10 -0
  148. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest_2/eci.json +2653 -0
  149. libcasm-clexulator-2.0a1/tests/unit/clexulator/data/OccClexulatorZrOTest_2/meta.json +56 -0
  150. libcasm-clexulator-2.0a1/tests/unit/clexulator/version_test.cpp +62 -0
  151. libcasm-clexulator-2.0a1/tests/unit/gtest_main_run_all.cpp +6 -0
  152. libcasm-clexulator-2.0a1/tests/unit/testdir.cc +48 -0
  153. libcasm-clexulator-2.0a1/tests/unit/testdir.hh +46 -0
  154. libcasm-clexulator-2.0a1/tests/unit/testfunctions.hh +26 -0
  155. libcasm-clexulator-2.0a1/tests/unit/teststructures.hh +192 -0
@@ -0,0 +1,25 @@
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.0a1] - 2023-08-20
10
+
11
+ 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.
12
+
13
+ ### Added
14
+
15
+ - Added Python package libcasm.clexulator
16
+ - Added scikit-build, CMake, and pybind11 build process
17
+ - Added GitHub Actions for unit testing
18
+ - Added GitHub Action build_wheels.yml for Python x86_64 wheel building using cibuildwheel
19
+ - Added Cirrus-CI .cirrus.yml for Python aarch64 and arm64 wheel building using cibuildwheel
20
+ - Added Python documentation
21
+
22
+ ### Removed
23
+
24
+ - Removed autotools build process
25
+ - Removed boost dependencies
@@ -0,0 +1,241 @@
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/ConfigDoFValues.hh
82
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/NeighborList.hh
83
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/LocalClusterExpansion.hh
84
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ConfigDoFValuesTools.hh
85
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ClusterExpansion.hh
86
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/OrderParameter.hh
87
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/DoFSpace.hh
88
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/DoFSpaceAxisInfo.hh
89
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/Clexulator.hh
90
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/SparseCoefficients.hh
91
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/LocalCorrelations.hh
92
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ConfigDoFValuesTools_impl.hh
93
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ImpactTable.hh
94
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/Correlations.hh
95
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/version.hh
96
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/ClexParamPack.hh
97
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/BasicClexParamPack.hh
98
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/BaseClexulator.hh
99
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/DiffClexParamPack.hh
100
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/io/json/SparseCoefficients_json_io.hh
101
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/io/json/Clexulator_json_io.hh
102
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/io/json/DoFSpace_json_io.hh
103
+ ${PROJECT_SOURCE_DIR}/include/casm/clexulator/io/json/ConfigDoFValues_json_io.hh
104
+ )
105
+ set(
106
+ libcasm_clexulator_SOURCES
107
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/LocalCorrelations.cc
108
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/ImpactTable.cc
109
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/Correlations.cc
110
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/ClusterExpansion.cc
111
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/OrderParameter.cc
112
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/DoFSpace.cc
113
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/DoFSpaceAxisInfo.cc
114
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/Clexulator.cc
115
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/LocalClusterExpansion.cc
116
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/NeighborList.cc
117
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/BaseClexulator.cc
118
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/version.cc
119
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/io/json/SparseCoefficients_json_io.cc
120
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/io/json/ConfigDoFValues_json_io.cc
121
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/io/json/DoFSpace_json_io.cc
122
+ ${PROJECT_SOURCE_DIR}/src/casm/clexulator/io/json/Clexulator_json_io.cc
123
+ )
124
+ add_library(casm_clexulator SHARED ${libcasm_clexulator_SOURCES})
125
+ target_include_directories(casm_clexulator
126
+ PUBLIC
127
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
128
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/casm/external>
129
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/casm/external/gzstream>
130
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
131
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/casm/external>
132
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/casm/external/gzstream>
133
+ )
134
+ target_compile_options(casm_clexulator
135
+ PUBLIC
136
+ "-DCASM_CLEXULATOR_TXT_VERSION=\"${CMAKE_PROJECT_VERSION}\""
137
+ -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long
138
+ -DGZSTREAM_NAMESPACE=gz
139
+ )
140
+ target_link_libraries(casm_clexulator
141
+ ZLIB::ZLIB
142
+ ${CMAKE_DL_LIBS}
143
+ CASM::casm_global
144
+ CASM::casm_crystallography
145
+ )
146
+ if(APPLE)
147
+ set_target_properties(
148
+ casm_clexulator PROPERTIES INSTALL_RPATH "@loader_path")
149
+ else()
150
+ set_target_properties(
151
+ casm_clexulator PROPERTIES INSTALL_RPATH "$ORIGIN")
152
+ endif()
153
+
154
+ ##############################################
155
+ ## Install libcasm_clexulator
156
+
157
+ # install header files in <prefix>/libcasm/include/,
158
+ # while preserving directory structure
159
+ foreach ( filevar ${libcasm_clexulator_HEADERS} )
160
+ file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR}/include/ ${filevar})
161
+ get_filename_component( reldir ${relfile} DIRECTORY )
162
+ install( FILES ${filevar} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${reldir} )
163
+ endforeach()
164
+
165
+ # install libcasm_clexulator in <prefix>/libcasm/lib/
166
+ install(
167
+ TARGETS casm_clexulator
168
+ EXPORT CASMcode_clexulatorTargets
169
+ DESTINATION lib)
170
+
171
+ ##############################################
172
+ ## Python extensions
173
+
174
+ # The CMake package config and target files are installed under the Python
175
+ # package root. This is necessary to ensure that all the relative paths in the
176
+ # helloTargets.cmake resolve correctly. It also provides encapsulation.
177
+ #
178
+ # The actual path used must be selected so that consuming projects can locate it
179
+ # via `find_package`. To support finding CMake packages in the Python package
180
+ # prefix, using `find_package`s default search path of
181
+ # `<prefix>/<name>/share/<name>*/cmake/` is reasonable. Adding the Python
182
+ # package installation prefix to CMAKE_PREFIX_PATH in combination with this path
183
+ # will allow `find_package` to find this package and any other package installed
184
+ # via a Python package if the CMake and Python packages are named the same.
185
+ set(CASM_CMAKE_PACKAGE_INSTALL_SUBDIR "share/CASMcode_clexulator/cmake")
186
+
187
+ install(
188
+ EXPORT CASMcode_clexulatorTargets
189
+ NAMESPACE CASM::
190
+ DESTINATION ${CASM_CMAKE_PACKAGE_INSTALL_SUBDIR})
191
+
192
+ include(CMakePackageConfigHelpers)
193
+
194
+ write_basic_package_version_file(
195
+ CASMcode_clexulatorConfigVersion.cmake
196
+ VERSION ${PROJECT_VERSION}
197
+ COMPATIBILITY SameMinorVersion)
198
+
199
+ configure_package_config_file(
200
+ "${PROJECT_SOURCE_DIR}/cmake/CASMcode_clexulatorConfig.cmake.in" CASMcode_clexulatorConfig.cmake
201
+ INSTALL_DESTINATION ${CASM_CMAKE_PACKAGE_INSTALL_SUBDIR})
202
+
203
+ install(FILES "${PROJECT_BINARY_DIR}/CASMcode_clexulatorConfig.cmake"
204
+ "${PROJECT_BINARY_DIR}/CASMcode_clexulatorConfigVersion.cmake"
205
+ DESTINATION ${CASM_CMAKE_PACKAGE_INSTALL_SUBDIR})
206
+
207
+ # We are using the SKBUILD variable, which is defined when scikit-build is
208
+ # running the CMake build, to control building the Python wrapper. This allows
209
+ # the C++ project to be installed, standalone, when using the standard CMake
210
+ # build flow.
211
+ if(DEFINED SKBUILD)
212
+
213
+ # call pybind11-config to obtain the root of the cmake package
214
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pybind11 --cmakedir
215
+ OUTPUT_VARIABLE pybind11_ROOT_RAW)
216
+ string(STRIP ${pybind11_ROOT_RAW} pybind11_ROOT)
217
+ find_package(pybind11)
218
+
219
+ # The extension modules must load:
220
+ # - the casm_global library
221
+ # - the casm_clexulator library
222
+ # They can be found by setting a relative rpath
223
+
224
+ ### libcasm.clexulator._clexulator ###
225
+ pybind11_add_module(_clexulator MODULE
226
+ "${PROJECT_SOURCE_DIR}/python/src/clexulator.cpp")
227
+ target_link_libraries(_clexulator PRIVATE
228
+ CASM::casm_global
229
+ CASM::casm_crystallography
230
+ casm_clexulator
231
+ )
232
+ install(TARGETS _clexulator DESTINATION clexulator)
233
+ if(APPLE)
234
+ set_target_properties(
235
+ _clexulator PROPERTIES INSTALL_RPATH "@loader_path/../lib")
236
+ else()
237
+ set_target_properties(
238
+ _clexulator PROPERTIES INSTALL_RPATH "$ORIGIN/../lib")
239
+ endif()
240
+
241
+ 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()