nested-fit 5.5.2__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 (207) hide show
  1. nested_fit-5.5.2/.github/workflows/build_wheels.yml +164 -0
  2. nested_fit-5.5.2/.gitignore +63 -0
  3. nested_fit-5.5.2/CMakeLists.txt +428 -0
  4. nested_fit-5.5.2/Dockerfile +8 -0
  5. nested_fit-5.5.2/LICENSE +77 -0
  6. nested_fit-5.5.2/Makefile.am.in +65 -0
  7. nested_fit-5.5.2/Makefile.in +1163 -0
  8. nested_fit-5.5.2/PKG-INFO +23 -0
  9. nested_fit-5.5.2/README.md +512 -0
  10. nested_fit-5.5.2/STEPBYSTEP_INSTALL.md +66 -0
  11. nested_fit-5.5.2/ThirdParty.md +27 -0
  12. nested_fit-5.5.2/build-aux/compile +348 -0
  13. nested_fit-5.5.2/build-aux/depcomp +791 -0
  14. nested_fit-5.5.2/build-aux/install-sh +541 -0
  15. nested_fit-5.5.2/build-aux/install-sh~ +541 -0
  16. nested_fit-5.5.2/build-aux/missing +215 -0
  17. nested_fit-5.5.2/cmake/resman.cmake +91 -0
  18. nested_fit-5.5.2/cmake/write_manifest.cmake +19 -0
  19. nested_fit-5.5.2/configure +7104 -0
  20. nested_fit-5.5.2/configure.ac.in +80 -0
  21. nested_fit-5.5.2/examples/README.md +20 -0
  22. nested_fit-5.5.2/examples/data_analysis/01_simple_example/RANDOM_WALK/he-histo.dat +1024 -0
  23. nested_fit-5.5.2/examples/data_analysis/01_simple_example/RANDOM_WALK/nf_input.yaml +36 -0
  24. nested_fit-5.5.2/examples/data_analysis/01_simple_example/RANDOM_WALK_NO_DB/he-histo.dat +1024 -0
  25. nested_fit-5.5.2/examples/data_analysis/01_simple_example/RANDOM_WALK_NO_DB/nf_input.yaml +36 -0
  26. nested_fit-5.5.2/examples/data_analysis/01_simple_example/RANDOM_WALK_SYN/he-histo.dat +1024 -0
  27. nested_fit-5.5.2/examples/data_analysis/01_simple_example/RANDOM_WALK_SYN/nf_input.yaml +36 -0
  28. nested_fit-5.5.2/examples/data_analysis/01_simple_example/README.txt +19 -0
  29. nested_fit-5.5.2/examples/data_analysis/01_simple_example/internal_func_input/he-histo.dat +1024 -0
  30. nested_fit-5.5.2/examples/data_analysis/01_simple_example/internal_func_input/nf_input.yaml +36 -0
  31. nested_fit-5.5.2/examples/data_analysis/01_simple_example/latex_func_input/he-histo.dat +1024 -0
  32. nested_fit-5.5.2/examples/data_analysis/01_simple_example/latex_func_input/nf_input.yaml +36 -0
  33. nested_fit-5.5.2/examples/data_analysis/01_simple_example/legacy_func_input/he-histo.dat +1024 -0
  34. nested_fit-5.5.2/examples/data_analysis/01_simple_example/legacy_func_input/he-histo_old.dat +1024 -0
  35. nested_fit-5.5.2/examples/data_analysis/01_simple_example/legacy_func_input/nf_input.yaml +36 -0
  36. nested_fit-5.5.2/examples/data_analysis/02_error_bars_data/README.txt +3 -0
  37. nested_fit-5.5.2/examples/data_analysis/02_error_bars_data/eb_gauss_bg-x0_300-sigma_20-A_20000-p_to_bg_0.05-bin_1.dat +600 -0
  38. nested_fit-5.5.2/examples/data_analysis/02_error_bars_data/nf_input.yaml +36 -0
  39. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/DBSCAN-RANDOM_WALK_SYN/he-histo.dat +1024 -0
  40. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/DBSCAN-RANDOM_WALK_SYN/nf_input.yaml +45 -0
  41. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/DBSCAN-SLICE_SAMPLING/he-histo.dat +1024 -0
  42. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/DBSCAN-SLICE_SAMPLING/nf_input.yaml +45 -0
  43. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/KNN-RANDOM_WALK_SYN/he-histo.dat +1024 -0
  44. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/KNN-RANDOM_WALK_SYN/nf_input.yaml +45 -0
  45. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/KNN-SLICE_SAMPLING/he-histo.dat +1024 -0
  46. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/KNN-SLICE_SAMPLING/nf_input.yaml +45 -0
  47. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/README.txt +5 -0
  48. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/agglomerative-RANDOM_WALK_SYN/he-histo.dat +1024 -0
  49. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/agglomerative-RANDOM_WALK_SYN/nf_input.yaml +45 -0
  50. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/agglomerative-SLICE_SAMPLING/he-histo.dat +1024 -0
  51. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/agglomerative-SLICE_SAMPLING/nf_input.yaml +45 -0
  52. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/mean-shift-RANDOM_WALK_SYN/he-histo.dat +1024 -0
  53. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/mean-shift-RANDOM_WALK_SYN/nf_input.yaml +45 -0
  54. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/mean-shift-SLICE_SAMPLING/he-histo.dat +1024 -0
  55. nested_fit-5.5.2/examples/data_analysis/03_with_cluster_analysis/mean-shift-SLICE_SAMPLING/nf_input.yaml +45 -0
  56. nested_fit-5.5.2/examples/data_analysis/04_set_of_datafiles/README.txt +3 -0
  57. nested_fit-5.5.2/examples/data_analysis/04_set_of_datafiles/latex_func_input/gauss_bg-x0_300-sigma_20-A_300-p_to_bg_20-bin_1.dat +600 -0
  58. nested_fit-5.5.2/examples/data_analysis/04_set_of_datafiles/latex_func_input/gauss_bg-x0_310-sigma_20-A_150-p_to_bg_10-bin_1.dat +600 -0
  59. nested_fit-5.5.2/examples/data_analysis/04_set_of_datafiles/latex_func_input/nf_input.yaml +36 -0
  60. nested_fit-5.5.2/examples/data_analysis/04_set_of_datafiles/legacy_func_input/gauss_bg-x0_300-sigma_20-A_300-p_to_bg_20-bin_1.dat +600 -0
  61. nested_fit-5.5.2/examples/data_analysis/04_set_of_datafiles/legacy_func_input/gauss_bg-x0_310-sigma_20-A_150-p_to_bg_10-bin_1.dat +600 -0
  62. nested_fit-5.5.2/examples/data_analysis/04_set_of_datafiles/legacy_func_input/nf_input.yaml +36 -0
  63. nested_fit-5.5.2/examples/data_analysis/05_data_2D/README.txt +14 -0
  64. nested_fit-5.5.2/examples/data_analysis/05_data_2D/nf_input.yaml +38 -0
  65. nested_fit-5.5.2/examples/data_analysis/05_data_2D/test_matrix.dat +14 -0
  66. nested_fit-5.5.2/examples/data_analysis/06_interpolation_function/pynf_interp.ipynb +219 -0
  67. nested_fit-5.5.2/examples/function_integration/07_func_GAUSS/nf_input.yaml +26 -0
  68. nested_fit-5.5.2/examples/function_integration/08_func_EGGBOX/nf_input.yaml +29 -0
  69. nested_fit-5.5.2/examples/jupyter_notebooks/.ipynb_checkpoints/pandas_extended_analysis-checkpoint.ipynb +2288 -0
  70. nested_fit-5.5.2/examples/jupyter_notebooks/.ipynb_checkpoints/simple_analysis_visu-checkpoint.ipynb +546 -0
  71. nested_fit-5.5.2/examples/jupyter_notebooks/.virtual_documents/pandas_extended_analysis.ipynb +63 -0
  72. nested_fit-5.5.2/examples/jupyter_notebooks/.virtual_documents/simple_analysis_visu.ipynb +71 -0
  73. nested_fit-5.5.2/examples/jupyter_notebooks/pandas_extended_analysis.ipynb +1870 -0
  74. nested_fit-5.5.2/examples/jupyter_notebooks/quick_start_with_google_colab.ipynb +1 -0
  75. nested_fit-5.5.2/examples/jupyter_notebooks/res_1gauss_bg/he-histo.dat +1024 -0
  76. nested_fit-5.5.2/examples/jupyter_notebooks/res_1gauss_bg/nf_input.yaml +49 -0
  77. nested_fit-5.5.2/examples/jupyter_notebooks/res_2gauss_bg/he-histo.dat +1024 -0
  78. nested_fit-5.5.2/examples/jupyter_notebooks/res_2gauss_bg/nf_input.yaml +59 -0
  79. nested_fit-5.5.2/examples/jupyter_notebooks/res_3gauss_bg/.ipynb_checkpoints/he-histo-checkpoint.dat +1024 -0
  80. nested_fit-5.5.2/examples/jupyter_notebooks/res_3gauss_bg/.ipynb_checkpoints/nf_input-checkpoint.dat +28 -0
  81. nested_fit-5.5.2/examples/jupyter_notebooks/res_3gauss_bg/.ipynb_checkpoints/nf_input-checkpoint.yaml +91 -0
  82. nested_fit-5.5.2/examples/jupyter_notebooks/res_3gauss_bg/he-histo.dat +1024 -0
  83. nested_fit-5.5.2/examples/jupyter_notebooks/res_3gauss_bg/nf_input.yaml +69 -0
  84. nested_fit-5.5.2/examples/jupyter_notebooks/res_4gauss_bg/he-histo.dat +1024 -0
  85. nested_fit-5.5.2/examples/jupyter_notebooks/res_4gauss_bg/nf_input.yaml +79 -0
  86. nested_fit-5.5.2/examples/jupyter_notebooks/simple_analysis_visu.ipynb +2743 -0
  87. nested_fit-5.5.2/examples/native_functions/example.cpp +119 -0
  88. nested_fit-5.5.2/examples/native_functions/example.f90 +65 -0
  89. nested_fit-5.5.2/examples/potential_exploration/09_ENERGY_HARM_3D/nf_input.yaml +43 -0
  90. nested_fit-5.5.2/exercises/.DS_Store +0 -0
  91. nested_fit-5.5.2/exercises/exercices_ICFO/ICFO2024_nested_fit_tutorial.ipynb +1 -0
  92. nested_fit-5.5.2/exercises/exercices_ICFO/res_1gauss_bg/he-histo.dat +1024 -0
  93. nested_fit-5.5.2/exercises/exercices_ICFO/res_1gauss_bg/nf_input.yaml +49 -0
  94. nested_fit-5.5.2/exercises/exercises_QXRA/exercises_quantitative_xray_spectroscopy.ipynb +688 -0
  95. nested_fit-5.5.2/exercises/exercises_QXRA/with_U_1000_counts/c_U_1000_counts.dat +4096 -0
  96. nested_fit-5.5.2/exercises/exercises_QXRA/with_U_100s/c_U_100s.dat +4096 -0
  97. nested_fit-5.5.2/exercises/exercises_QXRA/with_U_1s/c_U_1s.dat +4096 -0
  98. nested_fit-5.5.2/exercises/exercises_QXRA/with_U_1s/nf_input.dat +43 -0
  99. nested_fit-5.5.2/exercises/exercises_QXRA/without_U_100k_counts/s_U_100000_counts.dat +4096 -0
  100. nested_fit-5.5.2/exercises/exercises_QXRA/without_U_1M_counts/nf_input.dat +43 -0
  101. nested_fit-5.5.2/exercises/exercises_QXRA/without_U_1M_counts/s_U_1000000_counts.dat +4096 -0
  102. nested_fit-5.5.2/exercises/old_exercices/exercise1_piN_sampling/README.txt +1 -0
  103. nested_fit-5.5.2/exercises/old_exercices/exercise1_piN_sampling/nf_input.dat +32 -0
  104. nested_fit-5.5.2/exercises/old_exercices/exercise1_piN_sampling/piN-sum.dat +1206 -0
  105. nested_fit-5.5.2/exercises/old_exercices/exercise2_pN_evidence/README.txt +16 -0
  106. nested_fit-5.5.2/exercises/old_exercices/exercise2_pN_evidence/nf_input.dat +34 -0
  107. nested_fit-5.5.2/exercises/old_exercices/exercise2_pN_evidence/piN-sum.dat +1206 -0
  108. nested_fit-5.5.2/exercises/old_exercices/exercise2_pN_evidence/results_2000lp.txt +4 -0
  109. nested_fit-5.5.2/exercises/old_exercices/exercise3_He-like_U_from_scratch/README.txt +1 -0
  110. nested_fit-5.5.2/exercises/old_exercices/exercise3_He-like_U_from_scratch/he-histo.dat +1024 -0
  111. nested_fit-5.5.2/exercises/old_exercices/exercise4_He-like_U_clusters/README.txt +2 -0
  112. nested_fit-5.5.2/exercises/old_exercices/exercise4_He-like_U_clusters/he-histo.dat +1024 -0
  113. nested_fit-5.5.2/exercises/old_exercices/exercise4_He-like_U_clusters/nf_input.dat +25 -0
  114. nested_fit-5.5.2/exercises/old_exercices/exercise5_He-like_U_search_and_clusters_methods/README.txt +1 -0
  115. nested_fit-5.5.2/exercises/old_exercices/exercise5_He-like_U_search_and_clusters_methods/he-histo.dat +1024 -0
  116. nested_fit-5.5.2/install.sh +127 -0
  117. nested_fit-5.5.2/nested_fit.egg-info/PKG-INFO +23 -0
  118. nested_fit-5.5.2/nested_fit.egg-info/SOURCES.txt +205 -0
  119. nested_fit-5.5.2/nested_fit.egg-info/dependency_links.txt +1 -0
  120. nested_fit-5.5.2/nested_fit.egg-info/entry_points.txt +2 -0
  121. nested_fit-5.5.2/nested_fit.egg-info/requires.txt +10 -0
  122. nested_fit-5.5.2/nested_fit.egg-info/top_level.txt +2 -0
  123. nested_fit-5.5.2/nf_input.yaml +53 -0
  124. nested_fit-5.5.2/pynested_fit/__init__.py +98 -0
  125. nested_fit-5.5.2/pynested_fit/cliw.py +12 -0
  126. nested_fit-5.5.2/pynested_fit/evaluator.py +62 -0
  127. nested_fit-5.5.2/pynested_fit/metadata.py +30 -0
  128. nested_fit-5.5.2/pynested_fit/nested_res.py +1583 -0
  129. nested_fit-5.5.2/pynested_fit/nested_run.py +812 -0
  130. nested_fit-5.5.2/pynested_fit/utils.py +18 -0
  131. nested_fit-5.5.2/pynested_fit/widgets/__init__.py +0 -0
  132. nested_fit-5.5.2/pynested_fit/widgets/bar.py +44 -0
  133. nested_fit-5.5.2/pynested_fit/widgets/errorui.py +14 -0
  134. nested_fit-5.5.2/pynested_fit/widgets/hfinder.py +13 -0
  135. nested_fit-5.5.2/pynested_fit/widgets/plot.py +89 -0
  136. nested_fit-5.5.2/pynested_fit/widgets/timer.py +17 -0
  137. nested_fit-5.5.2/pynested_fit/widgets/var.py +20 -0
  138. nested_fit-5.5.2/pyproject.toml +59 -0
  139. nested_fit-5.5.2/setup.cfg +4 -0
  140. nested_fit-5.5.2/setup.py +152 -0
  141. nested_fit-5.5.2/src/DIERCKX/curfit.f +260 -0
  142. nested_fit-5.5.2/src/DIERCKX/fpback.f +31 -0
  143. nested_fit-5.5.2/src/DIERCKX/fpbspl.f +42 -0
  144. nested_fit-5.5.2/src/DIERCKX/fpchec.f +62 -0
  145. nested_fit-5.5.2/src/DIERCKX/fpcurf.f +359 -0
  146. nested_fit-5.5.2/src/DIERCKX/fpdisc.f +43 -0
  147. nested_fit-5.5.2/src/DIERCKX/fpgivs.f +20 -0
  148. nested_fit-5.5.2/src/DIERCKX/fpknot.f +65 -0
  149. nested_fit-5.5.2/src/DIERCKX/fprati.f +29 -0
  150. nested_fit-5.5.2/src/DIERCKX/fprota.f +14 -0
  151. nested_fit-5.5.2/src/DIERCKX/splev.f +137 -0
  152. nested_fit-5.5.2/src/Makefile +211 -0
  153. nested_fit-5.5.2/src/Mod_cluster_analysis.f90 +1008 -0
  154. nested_fit-5.5.2/src/Mod_covariance_matrix.f90 +234 -0
  155. nested_fit-5.5.2/src/Mod_input_parse.f90 +452 -0
  156. nested_fit-5.5.2/src/Mod_integrated_func.f90 +378 -0
  157. nested_fit-5.5.2/src/Mod_interpolate.f90 +280 -0
  158. nested_fit-5.5.2/src/Mod_jsonio.f90 +332 -0
  159. nested_fit-5.5.2/src/Mod_likelihood.f90 +1427 -0
  160. nested_fit-5.5.2/src/Mod_likelihood_gen.f90 +84 -0
  161. nested_fit-5.5.2/src/Mod_logger.f90 +134 -0
  162. nested_fit-5.5.2/src/Mod_math.f90 +179 -0
  163. nested_fit-5.5.2/src/Mod_metadata.f90.in +165 -0
  164. nested_fit-5.5.2/src/Mod_options.f90 +17 -0
  165. nested_fit-5.5.2/src/Mod_parameters.f90 +58 -0
  166. nested_fit-5.5.2/src/Mod_perfprof.f90 +104 -0
  167. nested_fit-5.5.2/src/Mod_potentials.f90 +185 -0
  168. nested_fit-5.5.2/src/Mod_search_new_point.f90 +1931 -0
  169. nested_fit-5.5.2/src/Mod_timestamp.f90 +17 -0
  170. nested_fit-5.5.2/src/Mod_userfcn.f90 +664 -0
  171. nested_fit-5.5.2/src/SLATEC/dpsort.f +269 -0
  172. nested_fit-5.5.2/src/SLATEC/fdump.f +31 -0
  173. nested_fit-5.5.2/src/SLATEC/i1mach.f +888 -0
  174. nested_fit-5.5.2/src/SLATEC/j4save.f +65 -0
  175. nested_fit-5.5.2/src/SLATEC/xercnt.f +60 -0
  176. nested_fit-5.5.2/src/SLATEC/xerhlt.f +39 -0
  177. nested_fit-5.5.2/src/SLATEC/xermsg.f +364 -0
  178. nested_fit-5.5.2/src/SLATEC/xerprn.f +228 -0
  179. nested_fit-5.5.2/src/SLATEC/xersve.f +155 -0
  180. nested_fit-5.5.2/src/SLATEC/xgetua.f +51 -0
  181. nested_fit-5.5.2/src/USERFCN.f +6346 -0
  182. nested_fit-5.5.2/src/USERFCN_2D.f90 +713 -0
  183. nested_fit-5.5.2/src/USERFCN_SET.f +3258 -0
  184. nested_fit-5.5.2/src/cli/argparse.f90 +241 -0
  185. nested_fit-5.5.2/src/funceval/auto_func.f90 +1029 -0
  186. nested_fit-5.5.2/src/funceval/latex_parser.cpp +935 -0
  187. nested_fit-5.5.2/src/funceval/native_parser.cpp +311 -0
  188. nested_fit-5.5.2/src/functions/WOFZ.f +214 -0
  189. nested_fit-5.5.2/src/functions/internal.tex +11 -0
  190. nested_fit-5.5.2/src/functions/internal_funcs.f90 +108 -0
  191. nested_fit-5.5.2/src/helper/console.cpp +23 -0
  192. nested_fit-5.5.2/src/helper/halt.f90 +4 -0
  193. nested_fit-5.5.2/src/helper/hash.f90 +70 -0
  194. nested_fit-5.5.2/src/helper/int_stack.f90 +71 -0
  195. nested_fit-5.5.2/src/helper/resman.cpp.in +52 -0
  196. nested_fit-5.5.2/src/helper/rmhex.cpp +87 -0
  197. nested_fit-5.5.2/src/helper/strutil.f90 +292 -0
  198. nested_fit-5.5.2/src/helper/utils.cpp +16 -0
  199. nested_fit-5.5.2/src/init_interpolation.f +320 -0
  200. nested_fit-5.5.2/src/nested_fit.f90 +1655 -0
  201. nested_fit-5.5.2/src/nested_sampling.f90 +698 -0
  202. nested_fit-5.5.2/src/rinteg.f +78 -0
  203. nested_fit-5.5.2/src/shirley_fitpack.f90 +121 -0
  204. nested_fit-5.5.2/test/CMakeLists.txt +11 -0
  205. nested_fit-5.5.2/test/README.md +30 -0
  206. nested_fit-5.5.2/test/str.f90 +26 -0
  207. nested_fit-5.5.2/test/test.f90 +65 -0
@@ -0,0 +1,164 @@
1
+ name: Python Build Wheels
2
+
3
+ on:
4
+ push:
5
+ branches: ["master", "dev"] # TODO: (Cesar) To remove dev after a check
6
+
7
+ jobs:
8
+ build_wheels:
9
+ name: Build wheels on ${{ matrix.os }}
10
+ runs-on: ${{ matrix.os }}
11
+ strategy:
12
+ matrix:
13
+ #os: [ubuntu-latest, windows-latest, macos-13, macos-14]
14
+ #os: [ubuntu-latest, macos-13, macos-14]
15
+ os: [ubuntu-latest, macos-13] # For now build for ubuntu and mac-os x64
16
+ #os: [ubuntu-latest]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Install build tools (Linux)
24
+ if: runner.os == 'Linux'
25
+ run: |
26
+ sudo apt-get update
27
+ sudo apt-get install -y gfortran g++ cmake make
28
+
29
+ # - name: Install build tools (Windows)
30
+ # if: runner.os == 'Windows'
31
+ # run: |
32
+ # choco install mingw -y
33
+ # echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" >> $env:GITHUB_PATH
34
+
35
+ - name: Install conda (macOS)
36
+ if: runner.os == 'macOS'
37
+ uses: conda-incubator/setup-miniconda@v2
38
+ with:
39
+ miniforge-version: "latest"
40
+ activate-environment: buildenv
41
+ environment-file: ""
42
+ auto-activate-base: false
43
+
44
+ - name: Install buildtools (macOS)
45
+ if: runner.os == 'macOS'
46
+ run: |
47
+ conda install -n buildenv -c conda-forge gfortran=11 libgfortran=5 cmake clang libgcc libgfortran5 libcxx
48
+ echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV
49
+ echo "$CONDA_PREFIX/bin" >> $GITHUB_PATH
50
+ echo "DYLD_FALLBACK_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV
51
+ shell: bash -l {0}
52
+
53
+ - name: Check build tools
54
+ run: |
55
+ which cmake
56
+ cmake --version
57
+ which gfortran
58
+ gfortran --version
59
+ which clang++
60
+ clang++ --version
61
+ which make
62
+ make --version
63
+ echo $PATH
64
+ echo $PWD
65
+ git rev-parse HEAD
66
+
67
+ - name: Build wheels (macOS)
68
+ if: runner.os == 'macOS'
69
+ uses: pypa/cibuildwheel@v3.0.1
70
+ env:
71
+ MACOSX_DEPLOYMENT_TARGET: "10.15"
72
+ # LD_LIBRARY_PATH: ${{ env.LD_LIBRARY_PATH }}
73
+ #SDKROOT: $(xcrun --sdk macosx --show-sdk-path)
74
+ CIBW_BEFORE_BUILD: |
75
+ SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
76
+ echo "SDKROOT=$SDKROOT"
77
+ export SDKROOT
78
+ echo "Adjusting PATH"
79
+ export PATH="/usr/bin:/usr/local/bin:$PATH"
80
+ which make
81
+ which clang++
82
+ which gfortran
83
+ clang++ --version
84
+ gfortran --version
85
+ DYLD_FALLBACK_LIBRARY_PATH=${{ env.DYLD_FALLBACK_LIBRARY_PATH }}
86
+ export DYLD_FALLBACK_LIBRARY_PATH
87
+ echo "DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH"
88
+ CIBW_ENVIRONMENT: >
89
+ PATH="/usr/bin:/usr/local/bin:$PATH"
90
+ MACOSX_DEPLOYMENT_TARGET=10.15
91
+ SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
92
+ with:
93
+ package-dir: .
94
+ output-dir: wheelhouse
95
+ config-file: "{package}/pyproject.toml"
96
+
97
+ - name: Build wheels (Linux)
98
+ if: runner.os == 'Linux'
99
+ uses: pypa/cibuildwheel@v3.0.1
100
+ with:
101
+ package-dir: .
102
+ output-dir: wheelhouse
103
+ config-file: "{package}/pyproject.toml"
104
+
105
+ # - name: Re-tag wheels for Python3.x
106
+ # run: |
107
+ # pip install wheel-fix
108
+ # for whl in wheelhouse/*.whl; do
109
+ # wheel-fix --python-tag py3 --abi-tag none "$whl"
110
+ # done
111
+
112
+ - uses: actions/upload-artifact@v4
113
+ with:
114
+ name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
115
+ path: ./wheelhouse/*.whl
116
+
117
+ make_sdist:
118
+ name: Make Python sdist
119
+ runs-on: ubuntu-latest
120
+ steps:
121
+ - uses: actions/checkout@v4
122
+ with:
123
+ fetch-depth: 0
124
+
125
+ - name: Build sdist
126
+ run: pipx run build --sdist
127
+
128
+ - uses: actions/upload-artifact@v4
129
+ with:
130
+ name: cibw-sdist
131
+ path: dist/*.tar.gz
132
+
133
+ upload_to_index:
134
+ name: Upload to PyPI index
135
+ needs: [build_wheels, make_sdist]
136
+ environment: pypi
137
+
138
+ permissions:
139
+ id-token: write
140
+ attestations: write
141
+ contents: read
142
+
143
+ runs-on: ubuntu-latest
144
+ # if: github.event_name == 'release' && github.event.action == 'published'
145
+ steps:
146
+ - uses: actions/download-artifact@v4
147
+ with:
148
+ pattern: cibw-*
149
+ path: dist
150
+ merge-multiple: true
151
+
152
+ - name: Generate attestations
153
+ uses: actions/attest-build-provenance@v2
154
+ with:
155
+ subject-path: "dist/*"
156
+
157
+ - uses: pypa/gh-action-pypi-publish@release/v1
158
+ with:
159
+ # password: ${{ secrets.pypi_password }}
160
+ # repository-url: "https://pypi.org/legacy"
161
+ verbose: true
162
+ skip-existing: true
163
+ # attestations: false
164
+
@@ -0,0 +1,63 @@
1
+ # Mac stuff
2
+ **/.DS_Store
3
+ .DS_Store
4
+
5
+ # Build files and objects
6
+ *.o
7
+ *.mod
8
+ build/
9
+ bin/
10
+
11
+ # vscode settings
12
+ .vscode/
13
+
14
+ # ccls cache
15
+ .ccls-cache/
16
+
17
+ # clangd cache
18
+ .cache/
19
+
20
+ # vscode line counter
21
+ .VSCodeCounter/
22
+
23
+ # tests / manual run output files
24
+ nf_output_*
25
+ tests/*/nf_input.dat
26
+
27
+ # Python cache files
28
+ __pycache__/
29
+
30
+ # Python build metadata
31
+ *.egg-info/
32
+
33
+ # Python dist build
34
+ dist/
35
+
36
+ # Python virtual environments
37
+ .venv/
38
+
39
+ # Python wheel building toolkit house
40
+ wheelhouse/
41
+
42
+ # Jupyter cache
43
+ .virtual_documents/
44
+
45
+ # Logfiles
46
+ *.log
47
+
48
+ # Perfprof dotfiles
49
+ *.dot
50
+
51
+ # Ignore autoconf/automake stuff
52
+ autom4te.cache/
53
+ build-aux/
54
+ configure.ac
55
+ Makefile.am
56
+ Makefile.in
57
+ aclocal.m4
58
+
59
+ # Apparently autoconf generates a back configure (???)
60
+ configure~
61
+
62
+ # FBuild config file
63
+ .fbuild.lua
@@ -0,0 +1,428 @@
1
+ cmake_minimum_required(VERSION 3.10)
2
+
3
+ #####################################
4
+ # This CMake file also generates an #
5
+ # autoconf file alongside an auto #
6
+ # make one. This is done to support #
7
+ # backwards compatibility for older #
8
+ # systems. #
9
+ #####################################
10
+ set(AUTO_MAKE_INLINE_CODE "")
11
+ set(AUTO_MAKE_INLINE_CODE_PRE "")
12
+
13
+ macro(ac_dec_obj_dep name deps)
14
+ string(APPEND AUTO_MAKE_INLINE_CODE "${name}.o: ${deps}.o\n")
15
+ endmacro(ac_dec_obj_dep)
16
+
17
+ macro(ac_inline_generic code)
18
+ string(APPEND AUTO_MAKE_INLINE_CODE_PRE "${code}\n")
19
+ endmacro(ac_inline_generic)
20
+ #####################################
21
+ #####################################
22
+
23
+ # NOTE: (César) : If we are on macOS set the minimum supported version to 10.15
24
+ # due to C++17 support.
25
+ if(APPLE)
26
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "" FORCE)
27
+ endif()
28
+
29
+ # The nested_fit version being built -> This gets copied everywhere inside the project code
30
+ # For more info see the 'src/Mod_metadata.f90.in' file
31
+ # Read the version from the .toml file since this is what will be pushed to the repo
32
+ file(READ "pyproject.toml" tomlfile)
33
+ string(REGEX MATCH "version = \"([0-9]+\\.[0-9]+\\.[0-9]+)\"" vn ${tomlfile})
34
+ set(project_version ${CMAKE_MATCH_1})
35
+
36
+ # This is just for the clangd LSP
37
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
38
+
39
+ # Global options
40
+ option(NORNG "Uses the same set seed. Useful for testing." OFF)
41
+ option(OPENMP "Enable/Disable OpenMP." OFF)
42
+ option(LAPACK "Enable/Disable LAPACK." OFF)
43
+ option(LTRACE "Enable trace logging." OFF)
44
+ option(PPROF "Enable performance counter profilling." OFF)
45
+ option(CREATE_AUTOCONF "Builds a 'configure' script for older systems." OFF)
46
+
47
+ if(LTRACE)
48
+ add_definitions(-DLTRACE)
49
+ endif()
50
+
51
+ #####################################
52
+ #####################################
53
+
54
+ set(project_name nested_fit)
55
+ project(${project_name} VERSION ${project_version} LANGUAGES Fortran CXX)
56
+
57
+ # Enforce C++17
58
+ set(CMAKE_CXX_STANDARD 17)
59
+
60
+ # Resman producer
61
+ include(cmake/resman.cmake)
62
+
63
+ # Manifest writing tool
64
+ include(cmake/write_manifest.cmake)
65
+
66
+ # Performance profiling
67
+ add_definitions(-DPPROF)
68
+ include(FetchContent)
69
+ FetchContent_Declare(
70
+ tracy
71
+ GIT_REPOSITORY https://github.com/wolfpld/tracy.git
72
+ GIT_TAG v0.10
73
+ GIT_SHALLOW TRUE
74
+ GIT_PROGRESS TRUE
75
+ )
76
+
77
+ # NOTE: (César) : MakeAvailable only supports EXCLUDE_FROM_ALL after
78
+ # cmake 3.28, so we add this workaround for 3.10 compat
79
+ # FetchContent_MakeAvailable(tracy)
80
+ FetchContent_GetProperties(tracy)
81
+ if(NOT tracy_POPULATED)
82
+ FetchContent_Populate(tracy)
83
+ add_subdirectory(${tracy_SOURCE_DIR} ${tracy_BINARY_DIR} EXCLUDE_FROM_ALL)
84
+ endif()
85
+
86
+ if(PPROF)
87
+ add_definitions(-DTRACY_ENABLE -DTRACY_NO_EXIT)
88
+ endif()
89
+
90
+ # BUG: (César) This is probably a GNU only way of defining macros from the CLI
91
+ add_definitions("-D'PASTE(x)'='x' -D'CAT(x,y)'='PASTE(x)y'")
92
+ # add_definitions("-D'PROFILED(x)'='TYPE(ScopedPerfTimer) :: CAT(x,__LINE__); CALL CAT(x,__LINE__)%init(\"x\",__LINE__,__FILE__);'")
93
+
94
+ add_definitions("-D'PROFILED(x)'=''")
95
+
96
+ # Set bin output dir
97
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
98
+
99
+ # Set nested fit version strings
100
+ set(nested_fit_version_full_str "${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}")
101
+ set(nested_fit_version_str "${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}")
102
+ string(CONCAT nested_fit_target "nested_fit" ${nested_fit_version_full_str})
103
+ string(REPLACE "." "_" nested_fit_target_ac ${nested_fit_target})
104
+
105
+ set(SRC_FILES_COMM
106
+ src/Mod_cluster_analysis.f90
107
+ src/Mod_parameters.f90
108
+ src/Mod_covariance_matrix.f90
109
+ src/Mod_search_new_point.f90 #
110
+ src/Mod_timestamp.f90
111
+ src/Mod_likelihood_gen.f90
112
+ src/Mod_likelihood.f90
113
+ src/Mod_potentials.f90
114
+ src/Mod_integrated_func.f90
115
+
116
+ src/USERFCN_2D.f90
117
+ src/USERFCN_SET.f
118
+ src/USERFCN.f
119
+
120
+ src/Mod_math.f90
121
+
122
+ src/init_interpolation.f
123
+
124
+ src/nested_fit.f90
125
+ src/nested_sampling.f90
126
+
127
+ src/rinteg.f
128
+ src/shirley_fitpack.f90
129
+
130
+ src/cli/argparse.f90
131
+ src/Mod_options.f90
132
+
133
+ src/funceval/auto_func.f90
134
+ src/functions/WOFZ.f
135
+
136
+ src/helper/hash.f90
137
+ src/Mod_input_parse.f90
138
+ src/Mod_jsonio.f90
139
+
140
+ src/Mod_userfcn.f90
141
+
142
+ src/Mod_logger.f90
143
+
144
+ src/Mod_perfprof.f90
145
+
146
+ src/helper/halt.f90
147
+ src/helper/strutil.f90
148
+ src/helper/int_stack.f90
149
+ )
150
+
151
+ string(REPLACE ";" " " SRC_FILES_COMM_AC "${SRC_FILES_COMM}")
152
+ ac_dec_obj_dep("src/Mod_cluster_analysis" "src/Mod_logger")
153
+ ac_dec_obj_dep("src/Mod_logger" "src/Mod_timestamp")
154
+ ac_dec_obj_dep("src/Mod_cluster_analysis" "src/Mod_parameters")
155
+ ac_dec_obj_dep("src/Mod_search_new_point" "src/Mod_likelihood_gen")
156
+ ac_dec_obj_dep("src/Mod_search_new_point" "src/Mod_perfprof") # Performance profilling is not compatible with autoconf
157
+ ac_dec_obj_dep("src/Mod_likelihood" "src/Mod_userfcn")
158
+ ac_dec_obj_dep("src/Mod_likelihood_gen" "src/Mod_likelihood")
159
+ ac_dec_obj_dep("src/Mod_likelihood_gen" "src/Mod_integrated_func")
160
+ ac_dec_obj_dep("src/Mod_likelihood_gen" "src/Mod_potentials")
161
+ ac_dec_obj_dep("src/Mod_userfcn" "src/funceval/auto_func")
162
+ ac_dec_obj_dep("src/funceval/auto_func" "src/Mod_metadata")
163
+ ac_dec_obj_dep("src/funceval/auto_func" "src/helper/strutil")
164
+ ac_dec_obj_dep("src/funceval/auto_func" "src/Mod_options")
165
+ ac_dec_obj_dep("src/Mod_likelihood" "src/Mod_math")
166
+ ac_dec_obj_dep("src/nested_fit" "src/Mod_input_parse")
167
+ ac_dec_obj_dep("src/Mod_input_parse" "src/helper/int_stack")
168
+ ac_dec_obj_dep("src/Mod_jsonio" "src/Mod_logger")
169
+ ac_dec_obj_dep("src/nested_fit" "src/cli/argparse")
170
+ ac_dec_obj_dep("src/nested_fit" "src/Mod_jsonio")
171
+
172
+ set(SRC_EXTERNAL_FUNCS
173
+ src/helper/hash.f90
174
+ src/Mod_interpolate.f90
175
+ src/functions/internal_funcs.f90
176
+ src/Mod_logger.f90 # NOTE :(César) Required for logging from the shared lib
177
+ src/Mod_timestamp.f90 # NOTE :(César) Required for logging from the shared lib
178
+ src/functions/WOFZ.f
179
+ )
180
+ set(SRC_EXTERNAL_FUNCS_AC_F90 "")
181
+ set(SRC_EXTERNAL_FUNCS_AC_F77 "")
182
+
183
+ foreach(file ${SRC_EXTERNAL_FUNCS})
184
+ get_filename_component(file_ext ${file} EXT)
185
+ string(REGEX REPLACE "\\.[^.]*$" "" file_noext ${file})
186
+
187
+ if(${file_ext} STREQUAL ".f")
188
+ set(SRC_EXTERNAL_FUNCS_AC_F77 "${SRC_EXTERNAL_FUNCS_AC_F77} ${file_noext}.o")
189
+ else()
190
+ set(SRC_EXTERNAL_FUNCS_AC_F90 "${SRC_EXTERNAL_FUNCS_AC_F90} ${file_noext}.o")
191
+ endif()
192
+
193
+ message(STATUS "file -> ${file} | ${file_noext}.o")
194
+ endforeach()
195
+
196
+ ac_dec_obj_dep("src/Mod_interpolate" "src/Mod_logger")
197
+ ac_dec_obj_dep("src/functions/internal_funcs" "src/Mod_logger")
198
+
199
+ file(GLOB SRC_DIERCKX RELATIVE ${CMAKE_SOURCE_DIR} src/DIERCKX/*.f)
200
+ string(REPLACE ";" " " SRC_DIERCKX_AC "${SRC_DIERCKX}")
201
+
202
+ file(GLOB SRC_SLATEC RELATIVE ${CMAKE_SOURCE_DIR} src/SLATEC/*.f)
203
+ string(REPLACE ";" " " SRC_SLATEC_AC "${SRC_SLATEC}")
204
+
205
+ if(OPENMP)
206
+ find_package(OpenMP)
207
+ if(NOT OpenMP_FOUND)
208
+ message(WARNING "OpenMP not supported but specified.")
209
+ message(WARNING "Disabling OpenMP.")
210
+ set(OPENMP OFF CACHE BOOL "" FORCE)
211
+ endif()
212
+ endif()
213
+
214
+ if(OPENMP AND NORNG)
215
+ message(ERROR "Having a set seed while enabling OpenMP does not work.")
216
+ message(WARNING "Disabling OpenMP.")
217
+ message(STATUS "Please enable only one feature.")
218
+ set(OPENMP OFF CACHE BOOL "" FORCE)
219
+ endif()
220
+
221
+ if(OPENMP)
222
+ set(nested_fit_parallel_on ".TRUE.")
223
+ else()
224
+ set(nested_fit_parallel_on ".FALSE.")
225
+ endif()
226
+
227
+ if(NORNG)
228
+ set(nested_fit_static_seed ".TRUE.")
229
+ else()
230
+ set(nested_fit_static_seed ".FALSE.")
231
+ endif()
232
+
233
+ # Create the internal functions imutable cache config
234
+ set(Internal_CustomBuiltins "")
235
+ file(READ src/functions/internal_funcs.f90 internal_funcs_data)
236
+ string(REGEX MATCHALL "FUNCTION ([a-zA-Z0-9_]*)\\(" internal_funcs_declaration ${internal_funcs_data})
237
+ foreach(i ${internal_funcs_declaration})
238
+ string(REGEX MATCH "FUNCTION ([a-zA-Z0-9_]*)\\(" dummy ${i})
239
+ list(APPEND Internal_CustomBuiltins ${CMAKE_MATCH_1})
240
+ endforeach()
241
+ configure_file(src/funceval/latex_parser.cpp latex_parser.cpp @ONLY)
242
+
243
+ configure_file(src/Mod_metadata.f90.in Mod_metadata.f90 @ONLY)
244
+
245
+ set(CFG_FILES
246
+ ${CMAKE_CURRENT_BINARY_DIR}/Mod_metadata.f90
247
+ )
248
+
249
+ set(SRC_FILES_CXX
250
+ src/helper/console.cpp
251
+ src/helper/utils.cpp
252
+ src/funceval/native_parser.cpp
253
+ ${CMAKE_CURRENT_BINARY_DIR}/latex_parser.cpp
254
+ )
255
+ set(SRC_FILES_CXX_AC
256
+ "src/helper/console.cpp src/helper/utils.cpp src/funceval/latex_parser.cpp src/funceval/native_parser.cpp"
257
+ )
258
+
259
+ # Compile the object files of the internal functions the user will be able to natively use in their expressions
260
+ #TODO(César): Use generator expression for compile flags here too
261
+ #TODO(César): Optimize fPIC with https://www.macieira.org/blog/2012/01/sorry-state-of-dynamic-libraries-on-linux/
262
+ if(CMAKE_BUILD_TYPE STREQUAL "Release")
263
+ set(SRC_DIERCKX_OBJ_FLAGS "-fPIC -fno-semantic-interposition -static -O3 -ffree-line-length-0")
264
+ else()
265
+ set(SRC_DIERCKX_OBJ_FLAGS "-fPIC -fno-semantic-interposition -static -g -O0 -ffree-line-length-0")
266
+ endif()
267
+ set_source_files_properties(${SRC_DIERCKX} PROPERTIES COMPILE_FLAGS "${SRC_DIERCKX_OBJ_FLAGS}")
268
+
269
+ if(CMAKE_BUILD_TYPE STREQUAL "Release")
270
+ set(SRC_EXTERNAL_FUNCS_OBJ_FLAGS "-fPIC -fno-semantic-interposition -static -O3 -Wall -ffree-line-length-0")
271
+ else()
272
+ set(SRC_EXTERNAL_FUNCS_OBJ_FLAGS "-fPIC -fno-semantic-interposition -static -O0 -g -Wall -ffree-line-length-0")
273
+ endif()
274
+ set_source_files_properties(${SRC_EXTERNAL_FUNCS} PROPERTIES COMPILE_FLAGS "${SRC_EXTERNAL_FUNCS_OBJ_FLAGS}")
275
+
276
+ set(SRC_EXTERNAL_ALL ${SRC_EXTERNAL_FUNCS} ${SRC_DIERCKX})
277
+ add_library(internal_functions OBJECT ${SRC_EXTERNAL_ALL})
278
+
279
+ set(OBJ_RES_FILES "")
280
+ foreach(src_file IN LISTS SRC_EXTERNAL_ALL)
281
+ get_filename_component(src_dir ${src_file} DIRECTORY)
282
+ get_filename_component(base_ext ${src_file} NAME)
283
+ list(APPEND OBJ_RES_FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/internal_functions.dir/${src_dir}/${base_ext}.o)
284
+ endforeach()
285
+
286
+ add_executable(${nested_fit_target}
287
+ # Source files
288
+ ${CFG_FILES}
289
+ ${SRC_DIERCKX}
290
+ ${SRC_SLATEC}
291
+ ${SRC_FILES_COMM}
292
+ ${SRC_FILES_CXX}
293
+ )
294
+
295
+ # NOTE: (César)
296
+ # Use resource manager to link to the built object files
297
+ # They get aggregated into .c files via xxd and compiled
298
+ # into object files. In turn these get linked to the bin.
299
+ # This creates C functions that are of the format:
300
+ # 'CopyCacheData<NAME>(const char* dir)'
301
+ # These funcitons copy the specified 'FILES' into:
302
+ # 'dir'/<OUTDIR>
303
+ rm_link_resources(
304
+ NAME "ObjFiles"
305
+ TARGET ${nested_fit_target}
306
+ FILES ${OBJ_RES_FILES}
307
+ DEPENDS internal_functions
308
+ OUTDIR "sys"
309
+ )
310
+
311
+ rm_link_resources(
312
+ NAME "ManifestFile"
313
+ TARGET ${nested_fit_target}
314
+ FILES ${CMAKE_BINARY_DIR}/manifest.txt
315
+ )
316
+
317
+ # TODO(César): This assumes we are using gfortran!
318
+ set(SRC_FLAGS_D -cpp -O0 -Wall -g -ffree-line-length-0 -ffixed-line-length-0 -Wno-ampersand -Wno-tabs -Wno-unused-dummy-argument)
319
+ set(SRC_FLAGS_R -cpp -O2 -static -ffree-line-length-0 -ffixed-line-length-0)
320
+
321
+ set(SRC_FLAGS_CXX_D -O0 -Wall -pedantic -g -Wno-missing-field-initializers) # Be pedantic
322
+ set(SRC_FLAGS_CXX_R -O2 -Wall -pedantic -static -Wno-missing-field-initializers) # Be pedantic on release too
323
+
324
+ # NOTE(César): Autoconf will use release only for now
325
+ # (this is semi ok, since it is not intended to be a used in a dev env)
326
+ # This behaviour is basically just inside configure.ac.in
327
+ string(REPLACE ";" " " AC_FLAGS_CXX "${SRC_FLAGS_CXX_R}")
328
+ string(REPLACE ";" " " AC_FLAGS_CF "${SRC_FLAGS_R}")
329
+ ac_inline_generic("CPPFLAGS = ${AC_FLAGS_CXX}")
330
+ ac_inline_generic("FCFLAGS = ${AC_FLAGS_CF}")
331
+ ac_inline_generic("FFLAGS = ${AC_FLAGS_CF}")
332
+
333
+ # NOTE: (César) This approach does not work for windows (but autoconf does not either)
334
+ # Also assuming gfortran here
335
+ ac_inline_generic("LIBS = -lgfortran -ldl")
336
+
337
+ # NOTE(César): This is required to preprocessor the OpenMP comments
338
+ set(SRC_FLAGS_OMP "")
339
+ if(OPENMP)
340
+ set(SRC_FLAGS_OMP -fopenmp)
341
+ endif()
342
+
343
+ target_compile_options(${nested_fit_target} PUBLIC
344
+ $<$<COMPILE_LANGUAGE:Fortran>:$<IF:$<CONFIG:Debug>,${SRC_FLAGS_D},${SRC_FLAGS_R}>>
345
+ $<$<COMPILE_LANGUAGE:CXX>:$<IF:$<CONFIG:Debug>,${SRC_FLAGS_CXX_D},${SRC_FLAGS_CXX_R}>>
346
+ ${SRC_FLAGS_OMP}
347
+ )
348
+
349
+ if(LAPACK)
350
+ target_compile_definitions(${nested_fit_target} PUBLIC -DLAPACK_ON)
351
+ if(UNIX)
352
+ # Find LAPACK and BLAS on Unix-like systems
353
+ # old try set(SRC_FLAGS "${SRC_FLAGS} -L/usr/lib/x86_64-linux-gnu/liblapack.so -llapack -L/usr/lib/x86_64-linux-gnu/libblas.so -lblas")
354
+ find_package(LAPACK REQUIRED)
355
+ if(LAPACK_FOUND)
356
+ target_link_libraries(${nested_fit_target} PRIVATE ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
357
+ else()
358
+ message(FATAL_ERROR "LAPACK library not found. Please install LAPACK.")
359
+ endif()
360
+ elseif(APPLE)
361
+ find_library(ACCELERATE_FRAMEWORK Accelerate)
362
+ target_link_libraries(${nested_fit_target} PRIVATE ${ACCELERATE_FRAMEWORK})
363
+ elseif(WIN32)
364
+ # Specify LAPACK and BLAS paths and names on Windows
365
+ #set(LAPACK_LIBRARIES "path/to/lapack.lib")
366
+ #set(BLAS_LIBRARIES "path/to/blas.lib")
367
+ #target_link_libraries(${nested_fit_target} PRIVATE ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
368
+ message(FATAL_ERROR "LAPACK library not found. Please install LAPACK.")
369
+ endif()
370
+ endif()
371
+
372
+ target_link_libraries(${nested_fit_target} PUBLIC dl)
373
+ target_link_libraries(${nested_fit_target} PRIVATE TracyClient)
374
+ target_include_directories(${nested_fit_target} PRIVATE ${tracy_SOURCE_DIR})
375
+
376
+
377
+ if(OPENMP)
378
+ target_link_options(${nested_fit_target} PRIVATE "-fopenmp")
379
+ endif()
380
+
381
+ if(NORNG)
382
+ # Set the NORNG_ON flag for the preprocessor
383
+ target_compile_definitions(${nested_fit_target} PUBLIC -DNORNG_ON)
384
+ endif()
385
+
386
+ install(TARGETS ${nested_fit_target} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/)
387
+
388
+ # Write a manifest file into the cache
389
+ # This makes things easier on the python side
390
+ # For now all the generated data can be generated
391
+ # on configure time
392
+ write_manifest()
393
+
394
+ # configure compatibility files for autoconf / automake
395
+ if(CREATE_AUTOCONF)
396
+ message(STATUS "Generated the following dependecies:")
397
+ message(STATUS "\n${AUTO_MAKE_INLINE_CODE}")
398
+ configure_file(configure.ac.in ${CMAKE_SOURCE_DIR}/configure.ac @ONLY)
399
+ configure_file(Makefile.am.in ${CMAKE_SOURCE_DIR}/Makefile.am @ONLY)
400
+
401
+ file(WRITE ${CMAKE_SOURCE_DIR}/NEWS "")
402
+ file(WRITE ${CMAKE_SOURCE_DIR}/COPYING "")
403
+ file(WRITE ${CMAKE_SOURCE_DIR}/ChangeLog "")
404
+ file(WRITE ${CMAKE_SOURCE_DIR}/README "")
405
+ file(WRITE ${CMAKE_SOURCE_DIR}/AUTHORS "")
406
+
407
+ execute_process(COMMAND autoreconf --verbose --install --force WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
408
+
409
+ file(REMOVE ${CMAKE_SOURCE_DIR}/INSTALL)
410
+ file(REMOVE ${CMAKE_SOURCE_DIR}/NEWS)
411
+ file(REMOVE ${CMAKE_SOURCE_DIR}/COPYING)
412
+ file(REMOVE ${CMAKE_SOURCE_DIR}/ChangeLog)
413
+ file(REMOVE ${CMAKE_SOURCE_DIR}/README)
414
+ file(REMOVE ${CMAKE_SOURCE_DIR}/AUTHORS)
415
+
416
+ # Remove autoconf stuff from src tree
417
+ file(REMOVE ${CMAKE_SOURCE_DIR}/aclocal.m4)
418
+ # file(REMOVE ${CMAKE_SOURCE_DIR}/configure.ac)
419
+ # file(REMOVE ${CMAKE_SOURCE_DIR}/Makefile.am)
420
+ endif()
421
+
422
+ include(CTest)
423
+
424
+ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
425
+ add_subdirectory(test)
426
+ endif()
427
+
428
+ enable_testing()
@@ -0,0 +1,8 @@
1
+ FROM python:3
2
+ WORKDIR /build/docker_app
3
+
4
+ COPY ./dist ./dist
5
+
6
+ RUN pip install dist/nested_fit*.whl
7
+
8
+ CMD [""]