xcoll 0.6.0__py3-none-any.whl → 0.6.2__py3-none-any.whl

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.

Potentially problematic release.


This version of xcoll might be problematic. Click here for more details.

Files changed (82) hide show
  1. xcoll/general.py +1 -1
  2. xcoll/plot.py +1 -1
  3. {xcoll-0.6.0.dist-info → xcoll-0.6.2.dist-info}/METADATA +5 -4
  4. xcoll-0.6.2.dist-info/RECORD +61 -0
  5. {xcoll-0.6.0.dist-info → xcoll-0.6.2.dist-info}/WHEEL +1 -1
  6. xcoll/scattering_routines/fluka/flukaio/.git +0 -1
  7. xcoll/scattering_routines/fluka/flukaio/.gitignore +0 -2
  8. xcoll/scattering_routines/fluka/flukaio/CMakeLists.txt +0 -18
  9. xcoll/scattering_routines/fluka/flukaio/ComponentMakefile +0 -192
  10. xcoll/scattering_routines/fluka/flukaio/Makefile +0 -144
  11. xcoll/scattering_routines/fluka/flukaio/README +0 -26
  12. xcoll/scattering_routines/fluka/flukaio/doc/Doxyfile +0 -1551
  13. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.asciidoc +0 -1054
  14. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.epub +0 -0
  15. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.html +0 -1607
  16. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.pdf +0 -0
  17. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__1.png +0 -0
  18. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__2.png +0 -0
  19. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__3.png +0 -0
  20. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__4.png +0 -0
  21. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__5.png +0 -0
  22. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__6.png +0 -0
  23. xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__7.png +0 -0
  24. xcoll/scattering_routines/fluka/flukaio/doc/Makefile +0 -8
  25. xcoll/scattering_routines/fluka/flukaio/doc/docbook.xsl +0 -1690
  26. xcoll/scattering_routines/fluka/flukaio/include/Connection.h +0 -79
  27. xcoll/scattering_routines/fluka/flukaio/include/FlukaIO.h +0 -58
  28. xcoll/scattering_routines/fluka/flukaio/include/FlukaIOServer.h +0 -33
  29. xcoll/scattering_routines/fluka/flukaio/include/FortranFlukaIO.h +0 -277
  30. xcoll/scattering_routines/fluka/flukaio/include/Message.h +0 -89
  31. xcoll/scattering_routines/fluka/flukaio/include/ParticleInfo.h +0 -76
  32. xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.a +0 -0
  33. xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.so +0 -0
  34. xcoll/scattering_routines/fluka/flukaio/samples/ClientTest.c +0 -156
  35. xcoll/scattering_routines/fluka/flukaio/samples/ServerTest.c +0 -123
  36. xcoll/scattering_routines/fluka/flukaio/samples/fclient.f +0 -149
  37. xcoll/scattering_routines/fluka/flukaio/samples/fserver.f +0 -118
  38. xcoll/scattering_routines/fluka/flukaio/src/Connection.c +0 -264
  39. xcoll/scattering_routines/fluka/flukaio/src/Connection.d +0 -69
  40. xcoll/scattering_routines/fluka/flukaio/src/Connection.o +0 -0
  41. xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.c +0 -211
  42. xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.d +0 -46
  43. xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.o +0 -0
  44. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.c +0 -45
  45. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.d +0 -29
  46. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.h +0 -17
  47. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.o +0 -0
  48. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.c +0 -84
  49. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.d +0 -70
  50. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.o +0 -0
  51. xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer_private.h +0 -22
  52. xcoll/scattering_routines/fluka/flukaio/src/FlukaIO_private.h +0 -16
  53. xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.c +0 -533
  54. xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.d +0 -40
  55. xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.o +0 -0
  56. xcoll/scattering_routines/fluka/flukaio/src/NetIO.c +0 -304
  57. xcoll/scattering_routines/fluka/flukaio/src/NetIO.d +0 -66
  58. xcoll/scattering_routines/fluka/flukaio/src/NetIO.h +0 -30
  59. xcoll/scattering_routines/fluka/flukaio/src/NetIO.o +0 -0
  60. xcoll/scattering_routines/fluka/flukaio/src/tags +0 -167
  61. xcoll/scattering_routines/fluka/flukaio/tests/AllTests.cpp +0 -8
  62. xcoll/scattering_routines/fluka/flukaio/tests/CommonTest.h +0 -10
  63. xcoll/scattering_routines/fluka/flukaio/tests/ConnectionTest.cpp +0 -99
  64. xcoll/scattering_routines/fluka/flukaio/tests/FlukaIOServerTest.cpp +0 -104
  65. xcoll/scattering_routines/fluka/flukaio/tests/FlukaIOTest.cpp +0 -439
  66. xcoll/scattering_routines/fluka/flukaio/tests/FortranFlukaIOTest.cpp +0 -682
  67. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeConnection.c +0 -19
  68. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeConnection.h +0 -16
  69. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIO.c +0 -74
  70. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIO.h +0 -50
  71. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOHandshake.c +0 -16
  72. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOHandshake.h +0 -20
  73. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOServer.c +0 -12
  74. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOServer.h +0 -18
  75. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFortranFlukaIO.h +0 -19
  76. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeNetIO.c +0 -80
  77. xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeNetIO.h +0 -35
  78. xcoll-0.6.0.dist-info/LICENSE +0 -201
  79. xcoll-0.6.0.dist-info/NOTICE +0 -2
  80. xcoll-0.6.0.dist-info/RECORD +0 -135
  81. /LICENSE → /xcoll-0.6.2.dist-info/LICENSE +0 -0
  82. /NOTICE → /xcoll-0.6.2.dist-info/NOTICE +0 -0
xcoll/general.py CHANGED
@@ -12,5 +12,5 @@ citation = "F.F. Van der Veken, et al.: Recent Developments with the New Tools f
12
12
  # ======================
13
13
  # Do not change
14
14
  # ======================
15
- __version__ = '0.6.0'
15
+ __version__ = '0.6.2'
16
16
  # ======================
xcoll/plot.py CHANGED
@@ -5,7 +5,6 @@
5
5
 
6
6
  import numpy as np
7
7
  from numbers import Number
8
- import matplotlib.pyplot as plt
9
8
 
10
9
 
11
10
  _NORMS = ["total", "coll_max", "max", "none", "raw"]
@@ -13,6 +12,7 @@ _NORMS = ["total", "coll_max", "max", "none", "raw"]
13
12
 
14
13
  def _plot_lossmap_base(lossmap: dict, *, norm="total", ax=None, xlim=None, ylim=None,
15
14
  legend=True, grid=True, energy=False, show=True, savefig=None):
15
+ import matplotlib.pyplot as plt
16
16
  if norm in _NORMS:
17
17
  norm = norm.lower()
18
18
  elif not isinstance(norm, Number):
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: xcoll
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: Xsuite collimation package
5
- Home-page: https://github.com/xsuite/xcoll
6
5
  License: Apache 2.0
7
6
  Author: Frederik F. Van der Veken
8
7
  Author-email: frederik@cern.ch
@@ -14,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
17
  Provides-Extra: tests
18
18
  Requires-Dist: numpy (>=1.0)
19
19
  Requires-Dist: pandas (>=1.4)
@@ -21,7 +21,8 @@ Requires-Dist: ruamel-yaml (>=0.17.31,<0.18.0) ; extra == "tests"
21
21
  Requires-Dist: xdeps (>=0.10.5)
22
22
  Requires-Dist: xobjects (>=0.5.0)
23
23
  Requires-Dist: xpart (>=0.23.0)
24
- Requires-Dist: xtrack (>=0.84.5)
24
+ Requires-Dist: xtrack (>=0.84.8)
25
+ Project-URL: Homepage, https://github.com/xsuite/xcoll
25
26
  Project-URL: Repository, https://github.com/xsuite/xcoll
26
27
  Description-Content-Type: text/markdown
27
28
 
@@ -0,0 +1,61 @@
1
+ xcoll/__init__.py,sha256=wEk3szUGeeN2Bg7_nx2D2pCgzRR0zcbEcWCP33p-e3I,854
2
+ xcoll/beam_elements/__init__.py,sha256=qu2-LefWfEKZHfALGqZo97DTrwdZVh7Sp97V-3XokJU,1189
3
+ xcoll/beam_elements/absorber.py,sha256=Gw1l1ng1MqF0dRTk7YhkiPAoinS5xsTASMxMDWGsmTw,2842
4
+ xcoll/beam_elements/base.py,sha256=mjnzLbZ-GC56N56Eq5r5oQB8cLmeaqR5oEH1-FnS_H4,57816
5
+ xcoll/beam_elements/blowup.py,sha256=0jfuxaIwXsEY4e6DlzGmv29OY7DGRKhbb2L-qKJwImQ,8079
6
+ xcoll/beam_elements/elements_src/black_absorber.h,sha256=AXs_bNLaK8xBl8IeLJvGz7AfFaasruPMtYz8lbRtqG4,4705
7
+ xcoll/beam_elements/elements_src/black_crystal.h,sha256=ZlLkJec4_naeoS3jEx-vQVAKBI0dInzMZq06pzKQOn0,4355
8
+ xcoll/beam_elements/elements_src/blowup.h,sha256=YlTt7YxswLM0ZjPuEjuE7xzjQ3hMt6FX9V3MbqVYmN4,1564
9
+ xcoll/beam_elements/elements_src/emittance_monitor.h,sha256=vlHzQFoUjKQHWBmzpaSzRbILtxSWqEasMtxHC-FFoAc,7078
10
+ xcoll/beam_elements/elements_src/everest_block.h,sha256=ITSzfiqwm8ZNIkAj_odQkAjKhPcdT8b0AUlq_uxtsqI,6562
11
+ xcoll/beam_elements/elements_src/everest_collimator.h,sha256=fkD5GazVv2zlmqyb6s9zVNMq6baXeFb_pf7gg9TKjNc,9787
12
+ xcoll/beam_elements/elements_src/everest_crystal.h,sha256=LISp_9NEWMIi5GvZ3LwPfeSbmsbXvHWcTqxW6eCCsiE,11951
13
+ xcoll/beam_elements/elements_src/transparent_collimator.h,sha256=pA_Fxx85N87iSbpHSjR2OSOx6JN9e38T1pOUKrC7zxs,4610
14
+ xcoll/beam_elements/elements_src/transparent_crystal.h,sha256=DGX4uL0hpm4njOypoPuEWtMzYxnL9jQkf2ZrGaS0alI,4128
15
+ xcoll/beam_elements/everest.py,sha256=iJva_S0OQnmG-qj7rIAiUCssu5WL_Qs5P_n6Qx-IWzo,9080
16
+ xcoll/beam_elements/monitor.py,sha256=baMYT_PNya8KX35ReeMwk5Cm04ePUqiDF_s69L5GTX0,16968
17
+ xcoll/beam_elements/transparent.py,sha256=AZOWfH3dvsetL6DjQGejUgX7T18e_3omIIffG_1gwc0,2894
18
+ xcoll/colldb.py,sha256=WaJC6gkDNVvxo65OhucTM6Fwo6pgRFHNnBnHSkiX7AQ,31054
19
+ xcoll/general.py,sha256=tayWZwdCHAmngxUu5-_6CV_PDpnIdLJlzXrtbGZfkOA,534
20
+ xcoll/headers/checks.h,sha256=qdXsOTBOK1MwW6bdFF93j4yE648mcDtEv5rGN1w9sfk,1582
21
+ xcoll/headers/particle_states.py,sha256=N8ehLtg99358I4RGCJ3sjuKCk2LVdGqgVx2xGoHrRdM,1959
22
+ xcoll/initial_distribution.py,sha256=CHhqeCVjVOyaBWhfy2sDgLwIgtXZoqcTW-su-M2YByE,10989
23
+ xcoll/interaction_record/__init__.py,sha256=UFoLiKa-z2oX7YoszP-7Vgdt1nM6kT382v1CaIu8_u0,50
24
+ xcoll/interaction_record/interaction_record.py,sha256=cCjfVCYUJaV0Y-pCljA2_u8GLyhHt7zNjbSXkE7cRO4,13299
25
+ xcoll/interaction_record/interaction_record_src/interaction_record.h,sha256=0rNagnfSGc2i1jauOMIcDbj9QFic9dV_MOyqVx1kw5Q,6067
26
+ xcoll/interaction_record/interaction_types.py,sha256=XTeg2dcImMpqhTqzkJKh6JYam2v9gUMhED-dDKLsilk,2894
27
+ xcoll/line_tools.py,sha256=JBySkKKZ-RGumqAZF_8PSQ3OV0M87P78NeQgbXAdFc4,16699
28
+ xcoll/lossmap.py,sha256=HLdhej9tUjk36T5BulVWurJtfiNa61L_1X7-8kT6JoQ,28407
29
+ xcoll/plot.py,sha256=27fYdXstPg3o8XyeBlPuD2yz0GR3dKkNWy4kO2BD9WA,4071
30
+ xcoll/rf_sweep.py,sha256=hMgW15uTp7qPprdlHCZBjOOe8Emdm-R0TfxPDoRXnJU,9021
31
+ xcoll/scattering_routines/engine.py,sha256=1VCBEZLMd5orFo3sZqK51NrqbqELBVrbsz6bB2SXsFQ,22962
32
+ xcoll/scattering_routines/environment.py,sha256=xZ8A7XfvSfpe8vYbM5oD5qbcp8Tuag5qWAI6VqgGUlA,12033
33
+ xcoll/scattering_routines/everest/__init__.py,sha256=7lkkeZ1liBjXVHCuRpgzZI6ohzHVMj5uJBO792147XY,286
34
+ xcoll/scattering_routines/everest/amorphous.h,sha256=8v_5P94LDxeLp1xI2nvwdbEPJNDY6LTB1CwXv4AwjZs,11806
35
+ xcoll/scattering_routines/everest/channelling.h,sha256=WrYBcvGWP2Da47__AGbbKsT8yvZmHhVZd5F1gku--GU,10941
36
+ xcoll/scattering_routines/everest/constants.h,sha256=_y9QqKAUSwPOkk8A4BF8ILNdDDJf66eINJwda8skwZM,1380
37
+ xcoll/scattering_routines/everest/crystal_parameters.h,sha256=QtmSQM4qzVXfjdkxs0ns8utqtqZ_u-Ej_y6m7UOKITo,6001
38
+ xcoll/scattering_routines/everest/everest.h,sha256=T9mESIy_oC86WJSsU7LY_A0iqHT2PKl5MmhnKQaGVSg,3200
39
+ xcoll/scattering_routines/everest/everest.py,sha256=aKy5d7HGiqEphFZDZE4RnYbxh0j10Boc04EZ0By9WdM,1542
40
+ xcoll/scattering_routines/everest/ionisation_loss.h,sha256=QIujj_qrKOY7L7CVFNSyexjlDJ94sfilvakhfWVfe44,6108
41
+ xcoll/scattering_routines/everest/jaw.h,sha256=4Ml9FofWPkGlvw6oWNdbZQIYV4K1xhfbEkNwwfDcITc,2069
42
+ xcoll/scattering_routines/everest/materials.py,sha256=pKQfrMNrqU3sitICTRjqfvwsvHrBDSUf3jfmOEE5Kls,10292
43
+ xcoll/scattering_routines/everest/multiple_coulomb_scattering.h,sha256=oX_ZN32eLcZX3VdYn4kAnT5wMKVTe4fLudPgbX9w37Y,5434
44
+ xcoll/scattering_routines/everest/nuclear_interaction.h,sha256=07yg9AD3jAfPetFVSY6cXT0iN5tBCrXXmYWvGMTaUDI,3892
45
+ xcoll/scattering_routines/everest/properties.h,sha256=AJf7Q_iPsiXTavnguzsNozdoH4NYGdDvyqP3iXychKU,3845
46
+ xcoll/scattering_routines/geometry/__init__.py,sha256=a2DFji3U6Msj-aJE2Dt5Il8FgesfICJHeK9yQj4zHa4,221
47
+ xcoll/scattering_routines/geometry/collimator_geometry.h,sha256=0gHiSEALJtQdW0mUav7GmES4JCAvq-xmch_ZRPkCfUI,7819
48
+ xcoll/scattering_routines/geometry/crystal_geometry.h,sha256=DHuQPMKq_Q0uK0WW2YRd7oxxhMwRPWtNUUn5fBW4Cxc,4968
49
+ xcoll/scattering_routines/geometry/geometry.py,sha256=bF8v7aEP09E4_EMkN0KEJFU-PQrBSOB0Xv699VBUzRY,1102
50
+ xcoll/scattering_routines/geometry/get_s.h,sha256=TWxZ-GjCcLrOV1wota7ltE53Nit0LQASoXmsqn-N0LQ,2947
51
+ xcoll/scattering_routines/geometry/methods.h,sha256=I8ik46SgkCHHtZ99anbdb3ZC7A_5Q809fgpeWMajdkY,3747
52
+ xcoll/scattering_routines/geometry/objects.h,sha256=A5ktGvVlSkC4hUsI_PQFsE80CuDwYbcioxKGRmEf2I0,5499
53
+ xcoll/scattering_routines/geometry/rotation.h,sha256=lO3RaQBys9r0ROMjR8T8Rr7UsIEm-H9_C_70Nwz4MXY,701
54
+ xcoll/scattering_routines/geometry/segments.h,sha256=7nKnnin2ByxkKyaYwGvFaqgLQg5uBba4CdLHL7L3iQs,7667
55
+ xcoll/scattering_routines/geometry/sort.h,sha256=b1MkFO2ddzv1fWGeQzsLuz46qo2pKyRSXHjoAEVU7Ts,5763
56
+ xcoll/xaux.py,sha256=mh4E_jhaUFm2LOKawJ0b6X4zuz8JiJhx6w7GcnRgIXQ,2291
57
+ xcoll-0.6.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
58
+ xcoll-0.6.2.dist-info/METADATA,sha256=3ggN0J33OYQp2Yjn7kWMTLeXmuTjI06lbAAJVWYkt7U,2739
59
+ xcoll-0.6.2.dist-info/NOTICE,sha256=6DO_E7WCdRKc42vUoVVBPGttvQi4mRt9fAcxj9u8zy8,74
60
+ xcoll-0.6.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
61
+ xcoll-0.6.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1 +0,0 @@
1
- gitdir: ../../../../.git/modules/xcoll/scattering_routines/fluka/flukaio
@@ -1,2 +0,0 @@
1
- lib
2
- src/*.d
@@ -1,18 +0,0 @@
1
- PROJECT(FLUKA_IO)
2
- cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
3
-
4
- SET(LIBFLUKAIO_SOURCES src/Connection.c src/FlukaIO.c src/FlukaIOHandshake.c src/FlukaIOServer.c src/FortranFlukaIO.c src/NetIO.c)
5
-
6
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
7
-
8
- add_library(flukaIO STATIC ${LIBFLUKAIO_SOURCES})
9
-
10
- if(${CMAKE_SYSTEM_PROCESSOR} MATCHES AMD64 OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES x86_64 OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES i686)
11
- if(32BIT)
12
- target_compile_options(flukaIO PRIVATE -m32)
13
- endif(32BIT)
14
-
15
- if(64BIT)
16
- target_compile_options(flukaIO PRIVATE -m64)
17
- endif(64BIT)
18
- endif()
@@ -1,192 +0,0 @@
1
- #---------
2
- #
3
- # ComponentMakefile
4
- #
5
- # Include this file in your makefile
6
- # It makes
7
- # A static library
8
- # A test executable
9
- #
10
- # The necessary parameters are shown in
11
- # ComponentMakefileExampleParameters
12
- #
13
- # Inputs
14
- # SRC_FILES - Specific source files to build into library
15
- # SRC_DIRS - Directories od source file to built into the library
16
- # TEST_SRC - unit test code build into the unit test runner
17
- # MOCKS_SRC - mock objects build into the test runner
18
- # INCLUDES - List of -I files
19
- # CPPUTEST_CXXFLAGS - flags for the C++ compiler
20
- # CPPUTEST_CPPFLAGS - flags for the C++ AND C compiler
21
- # CPPUTEST_CFLAGS - C complier
22
- # CPPUTEST_LDFLAGS - Linker flags
23
- # TARGET_LIB - the created library
24
- # TEST_TARGET - the created test executable
25
- # OTHER_MAKEFILE_TO_INCLUDE - a hook to use this makefile to make
26
- # other targets. Like CSlim, which is part of fitnesse
27
- #----------
28
-
29
- #Helper Functions
30
- get_src_from_dir = $(wildcard $1/*.cpp) $(wildcard $1/*.c)
31
- get_dirs_from_dirspec = $(wildcard $1)
32
- get_src_from_dir_list = $(foreach dir, $1, $(call get_src_from_dir,$(dir)))
33
- src_to_o = $(subst .c,.o, $(subst .cpp,.o,$1))
34
- src_to_d = $(subst .c,.d, $(subst .cpp,.d,$1))
35
- #move_file_location = $(patsubst %.d,build/%.d, $1)
36
- src_to = $(subst .c,$1, $(subst .cpp,$1,$2))
37
-
38
- #Derived
39
- STUFF_TO_CLEAN += $(TEST_TARGET) $(TEST_TARGET).exe $(TARGET_LIB)
40
-
41
- SRC += $(call get_src_from_dir_list, $(SRC_DIRS)) $(SRC_FILES)
42
- OBJ = $(call src_to_o,$(SRC))
43
- STUFF_TO_CLEAN += $(OBJ)
44
-
45
- TEST_SRC = $(call get_src_from_dir_list, $(TEST_SRC_DIRS))
46
- TEST_OBJS = $(call src_to_o,$(TEST_SRC))
47
- STUFF_TO_CLEAN += $(TEST_OBJS)
48
-
49
- MOCKS_SRC = $(call get_src_from_dir_list, $(MOCKS_SRC_DIRS))
50
- MOCKS_OBJS = $(call src_to_o,$(MOCKS_SRC))
51
- STUFF_TO_CLEAN += $(MOCKS_OBJS)
52
-
53
- ALL_SRC = $(SRC) $(TEST_SRC) $(MOCKS_SRC)
54
-
55
- #Test coverage with gcov
56
- GCOV_OUTPUT = gcov_output.txt
57
- GCOV_REPORT = gcov_report.txt
58
- GCOV_ERROR = gcov_error.txt
59
- GCOV_GCDA_FILES = $(call src_to,.gcda, $(ALL_SRC))
60
- GCOV_GCNO_FILES = $(call src_to,.gcno, $(ALL_SRC))
61
- TEST_OUTPUT = $(TEST_TARGET).txt
62
- STUFF_TO_CLEAN += \
63
- $(GCOV_OUTPUT)\
64
- $(GCOV_REPORT)\
65
- $(GCOV_ERROR)\
66
- $(GCOV_GCDA_FILES)\
67
- $(GCOV_GCNO_FILES)\
68
- $(TEST_OUTPUT)
69
-
70
-
71
- #Other stuff needed
72
- CPPUTEST_LIB = $(CPPUTEST_HOME)/lib/libCppUTest.a
73
-
74
- CPPUTEST_CPPFLAGS += $(INCLUDES) $(GCOVFLAGS)
75
-
76
- #The gcda files for gcov need to be deleted before each run
77
- #To avoid annoying messages.
78
- GCOV_CLEAN = $(SILENCE)rm -f $(GCOV_GCDA_FILES) $(GCOV_OUTPUT) $(GCOV_REPORT) $(GCOV_ERROR)
79
- RUN_TEST_TARGET = $(SILENCE) $(GCOV_CLEAN) ; echo "Running $(TEST_TARGET)"; ./$(TEST_TARGET)
80
-
81
- ifneq "$(OTHER_MAKEFILE_TO_INCLUDE)" ""
82
- -include $(OTHER_MAKEFILE_TO_INCLUDE)
83
- endif
84
-
85
- ifneq "$(MAP_FILE)" ""
86
- CPPUTEST_LDFLAGS += -Wl,-map,$(MAP_FILE)
87
- endif
88
-
89
- INCLUDES_DIRS_EXPANDED = $(call get_dirs_from_dirspec, $(INCLUDE_DIRS))
90
- INCLUDES += $(foreach dir, $(INCLUDES_DIRS_EXPANDED), -I$(dir))
91
- MOCK_DIRS_EXPANDED = $(call get_dirs_from_dirspec, $(MOCKS_SRC_DIRS))
92
- INCLUDES += $(foreach dir, $(MOCK_DIRS_EXPANDED), -I$(dir))
93
-
94
-
95
- DEP_FILES = $(call src_to_d, $(ALL_SRC))
96
- STUFF_TO_CLEAN += $(DEP_FILES) + $(PRODUCTION_CODE_START) + $(PRODUCTION_CODE_END)
97
- STUFF_TO_CLEAN += $(STDLIB_CODE_START) + $(MAP_FILE) + cpputest_*.xml junit_run_output
98
-
99
- # We'll use the CPPUTEST_CFLAGS etc so that you can override AND add to the CppUTest flags
100
- CFLAGS = $(CPPUTEST_CFLAGS) $(CPPUTEST_ADDITIONAL_CFLAGS)
101
- CPPFLAGS = $(CPPUTEST_CPPFLAGS) $(CPPUTEST_ADDITIONAL_CPPFLAGS)
102
- CXXFLAGS = $(CPPUTEST_CXXFLAGS) $(CPPUTEST_ADDITIONAL_CXXFLAGS)
103
- LDFLAGS = $(CPPUTEST_LDFLAGS) $(CPPUTEST_ADDITIONAL_LDFLAGS)
104
-
105
- # Targets
106
- .PHONY: all
107
- all: $(TEST_TARGET)
108
- $(RUN_TEST_TARGET)
109
-
110
- .PHONY: all_no_tests
111
- all_no_tests: $(TEST_TARGET)
112
-
113
- .PHONY: flags
114
- flags:
115
- $(SILENCE)echo Compile with these flags:
116
- $(SILENCE)for f in $(CPPFLAGS) ; do \
117
- echo " C++ $$f" ; \
118
- done
119
- $(SILENCE)for f in $(CFLAGS) ; do \
120
- echo " C $$f" ; \
121
- done
122
- $(SILENCE)for f in $(LDFLAGS) ; do \
123
- echo " LD $$f" ; \
124
- done
125
- $(SILENCE)for f in $(ARFLAGS) ; do \
126
- echo " AR $$f" ; \
127
- done
128
-
129
-
130
- $(TEST_TARGET): $(TEST_OBJS) $(MOCKS_OBJS) $(PRODUCTION_CODE_START) $(TARGET_LIB) $(USER_LIBS) $(PRODUCTION_CODE_END) $(CPPUTEST_LIB) $(STDLIB_CODE_START)
131
- $(SILENCE)echo Linking $@
132
- $(SILENCE)echo command $(LINK.o) -o $@ $^ $(LD_LIBRARIES)
133
- $(SILENCE)$(LINK.o) -o $@ $^ $(LD_LIBRARIES)
134
-
135
- $(TARGET_LIB): $(OBJ)
136
- $(SILENCE)echo Building archive $@
137
- $(SILENCE)mkdir -p lib
138
- $(SILENCE)echo command $(AR) $(ARFLAGS) $@ $^
139
- $(SILENCE)$(AR) $(ARFLAGS) $@ $^
140
- $(SILENCE)ranlib $@
141
-
142
- test: $(TEST_TARGET)
143
- $(RUN_TEST_TARGET) | tee $(TEST_OUTPUT)
144
-
145
- vtest: $(TEST_TARGET)
146
- $(RUN_TEST_TARGET) -v | tee $(TEST_OUTPUT)
147
-
148
- %.o: %.cpp
149
- @echo compiling $(notdir $<)
150
- $(SILENCE)echo command $(COMPILE.cpp) -M -MF $(subst .o,.d,$@) -MT "$@ $(subst .o,.d,$@)" $<
151
- $(SILENCE)$(COMPILE.cpp) -M -MF $(subst .o,.d,$@) -MT "$@ $(subst .o,.d,$@)" $<
152
- $(SILENCE)echo command $(COMPILE.cpp) $(OUTPUT_OPTION) $<
153
- $(SILENCE)$(COMPILE.cpp) $(OUTPUT_OPTION) $<
154
-
155
- %.o: %.c
156
- @echo compiling $(notdir $<)
157
- $(SILENCE)echo command $(COMPILE.c) -M -MF $(subst .o,.d,$@) -MT "$@ $(subst .o,.d,$@)" $<
158
- $(SILENCE)$(COMPILE.c) -M -MF $(subst .o,.d,$@) -MT "$@ $(subst .o,.d,$@)" $<
159
- $(SILENCE)echo command $(COMPILE.c) $(OUTPUT_OPTION) $<
160
- $(SILENCE)$(COMPILE.c) $(OUTPUT_OPTION) $<
161
-
162
- ifneq "$(MAKECMDGOALS)" "clean"
163
- -include $(DEP_FILES)
164
- endif
165
-
166
- .PHONY: clean
167
- clean:
168
- $(SILENCE)echo Making clean
169
- $(SILENCE)$(RM) -rf $(STUFF_TO_CLEAN)
170
- $(SILENCE)find . -name \*.gcov | xargs rm -f
171
-
172
- gcov: test
173
- $(SILENCE)for d in $(SRC_DIRS) ; do \
174
- gcov -o $$d $$d/*.c $$d/*.cpp >> $(GCOV_OUTPUT) 2>>$(GCOV_ERROR) ; \
175
- done
176
- $(CPPUTEST_HOME)/scripts/filterGcov.sh $(GCOV_OUTPUT) $(GCOV_ERROR) $(GCOV_REPORT) $(TEST_OUTPUT)
177
- cat $(GCOV_REPORT)
178
-
179
- .PHONEY: format
180
- format:
181
- $(CPPUTEST_HOME)/scripts/reformat.sh $(PROJECT_HOME_DIR)
182
-
183
- debug:
184
- echo Stuff to clean
185
- $(SILENCE)for f in $(STUFF_TO_CLEAN) ; do \
186
- echo "$$f" ; \
187
- done
188
- echo Includes
189
- $(SILENCE)for i in $(INCLUDES) ; do \
190
- echo "$$i" ; \
191
- done
192
-
@@ -1,144 +0,0 @@
1
- #Set this to @ to keep the makefile quiet
2
- SILENCE = @
3
-
4
- #---- Outputs ----#
5
- COMPONENT_NAME = FlukaIO
6
- TARGET_LIB = \
7
- lib/lib$(COMPONENT_NAME).a
8
- TARGET_SHARED_LIB = \
9
- lib/lib$(COMPONENT_NAME).so
10
-
11
- TEST_TARGET = \
12
- $(COMPONENT_NAME)_tests
13
-
14
- ifeq ($(BUILD64), Y)
15
- TARGET_SUFFIX = 64
16
- CPPUTEST_CPPFLAGS += -m64
17
- G77FLAGS += -m64
18
- endif
19
- ifeq ($(BUILD32), Y)
20
- TARGET_SUFFIX = 32
21
- CPPUTEST_CPPFLAGS += -m32
22
- CPPUTEST_LDFLAGS += -m32
23
- G77FLAGS += -m32
24
- endif
25
-
26
- COMPONENT_NAME = FlukaIO
27
- TARGET_LIB = \
28
- lib/lib$(COMPONENT_NAME)$(TARGET_SUFFIX).a
29
- TARGET_SHARED_LIB = \
30
- lib/lib$(COMPONENT_NAME)$(TARGET_SUFFIX).so
31
-
32
- TEST_TARGET = \
33
- $(COMPONENT_NAME)$(TARGET_SUFFIX)_tests
34
-
35
- #--- Inputs ----#
36
- PROJECT_HOME_DIR = .
37
- #CPPUTEST_HOME = /home/dsinuela/src/cpputest
38
- CPP_PLATFORM = Gcc
39
-
40
- # in case of Ubuntu 16.04, comment out -Werror
41
- WARNINGFLAGS = -Wall -Wswitch-default -Wswitch-enum -Werror
42
- #CPPUTEST_CFLAGS are set to override malloc and free to get memory leak detection in C programs
43
- #CPPUTEST_CFLAGS = -Dmalloc=cpputest_malloc -Dfree=cpputest_free
44
- #GCOVFLAGS = -fprofile-arcs -ftest-coverage
45
-
46
- CPPUTEST_CPPFLAGS += $(WARNINGFLAGS)
47
- CPPUTEST_CPPFLAGS += -g
48
- CPPUTEST_CPPFLAGS += -fpic
49
- #CPPUTEST_CPPFLAGS += -DFLUKAIO_NODELAY
50
-
51
- G77 = gfortran
52
- G77FLAGS += $(WARNINGFLAGS)
53
- G77FLAGS += -g
54
-
55
- #SRC_DIRS is a list of source directories that make up the target library
56
- #If test files are in these directories, their IMPORT_TEST_GROUPs need
57
- #to be included in main to force them to be linked in. By convention
58
- #put them into an AllTests.h file in each directory
59
- SRC_DIRS = \
60
- src
61
-
62
- #TEST_SRC_DIRS is a list of directories including
63
- # - A test main (AllTests.cpp by conventin)
64
- # - OBJ files in these directories are included in the TEST_TARGET
65
- # - Consequently - AllTests.h containing the IMPORT_TEST_GROUPS is not needed
66
- # -
67
- TEST_SRC_DIRS = \
68
- tests \
69
- tests/fakes
70
-
71
- #includes for all compiles
72
- INCLUDES =\
73
- -I.\
74
- -Iinclude
75
- # -I$(CPPUTEST_HOME)/include\
76
-
77
- #Flags to pass to ld
78
- USER_LIBS =
79
- LD_LIBRARIES += -lstdc++
80
-
81
- include ComponentMakefile
82
-
83
- all: $(TARGET_LIB) $(TARGET_SHARED_LIB)
84
-
85
- libs: $(TARGET_LIB) $(TARGET_SHARED_LIB)
86
-
87
- $(TARGET_SHARED_LIB): $(OBJ)
88
- $(SILENCE)echo Building archive $@
89
- $(SILENCE)$(CC) --version
90
- $(SILENCE)echo command $(CC) $(LDFLAGS) -shared -o $@ $^
91
- $(SILENCE)mkdir -p lib
92
- $(SILENCE)$(CC) $(LDFLAGS) -shared -o $@ $^
93
-
94
- STUFF_TO_CLEAN += $(TARGET_SHARED_LIB)
95
-
96
- # Samples
97
-
98
- .PHONY: clean_samples
99
-
100
- clean_samples:
101
- rm -rf samples/{ServerTest,ClientTest,fserver,fclient}
102
-
103
- samples: ServerTest ClientTest fserver fclient
104
-
105
- ServerTest: samples/ServerTest.c $(TARGET_LIB)
106
- $(CC) $^ $(CPPFLAGS) -I./include -o samples/$@
107
-
108
- ClientTest: samples/ClientTest.c $(TARGET_LIB)
109
- $(CC) $^ $(CPPFLAGS) -I./include -o samples/$@
110
-
111
- fserver: samples/fserver.f $(TARGET_LIB)
112
- $(G77) $^ $(G77FLAGS) -o samples/$@
113
-
114
- fclient: samples/fclient.f $(TARGET_LIB)
115
- $(G77) $^ $(G77FLAGS) -o samples/$@
116
-
117
- STUFF_TO_CLEAN += samples/ServerTest
118
- STUFF_TO_CLEAN += samples/ClientTest
119
- STUFF_TO_CLEAN += samples/fserver
120
- STUFF_TO_CLEAN += samples/fclient
121
-
122
- # Documentation
123
-
124
- .PHONY: doc
125
-
126
- doc:
127
- @echo Making documentation
128
- $(SILENCE)doxygen doc/Doxyfile 1> doxygen.log
129
- #@$(RM) doxygen.log
130
- cd doc; make
131
-
132
- STUFF_TO_CLEAN += doc/html doxygen.log
133
-
134
- show:
135
- @echo "CPPFLAGS=$(CPPFLAGS)"
136
- @echo "LDFLAGS=$(LDFLAGS)"
137
-
138
- .PHONY: clean_all
139
-
140
- clean_all:
141
- $(SILENCE)echo "Making clean_all"
142
- $(SILENCE)make clean BUILD32=Y > /dev/null
143
- $(SILENCE)make clean BUILD64=Y > /dev/null
144
-
@@ -1,26 +0,0 @@
1
- FlukaIO
2
- =======
3
-
4
- How to compile
5
- ==============
6
-
7
- In a machine with CppUTest correctly configured, it can be compiled and tested running "make".
8
-
9
- In a machine without CppUTest both 32 and 64 bit versions of the libraries can be compiled issuing the following commands:
10
-
11
- make libs BUILD32=Y
12
- make clean
13
- make libs BUILD64=Y
14
-
15
- The resulting libraries will be compiled under the directory "lib".
16
-
17
- Documentation
18
- =============
19
-
20
- The doxygen documentation can be generated with the command "make doc"
21
-
22
- Compiling samples
23
- =================
24
-
25
- Run "make samples" to compile sample clients and servers under samples directory.
26
-