Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest changes #100

Merged
merged 93 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
b1b020a
WIP
erikfrojdh Oct 25, 2024
54dd88f
added documentation
erikfrojdh Oct 25, 2024
5d643dc
added cluster finder
erikfrojdh Oct 25, 2024
a4fb217
Files and structure for python interface
erikfrojdh Oct 28, 2024
abb1d20
WIP
erikfrojdh Oct 28, 2024
7f9151f
WIP
erikfrojdh Oct 28, 2024
8a435cb
WIP
erikfrojdh Oct 28, 2024
1a16d45
WIP
erikfrojdh Oct 28, 2024
c509e29
building with scikit build
erikfrojdh Oct 29, 2024
8a10bcb
workflow
erikfrojdh Oct 29, 2024
9f29f17
updated path
erikfrojdh Oct 29, 2024
082d793
WIP
erikfrojdh Oct 29, 2024
b4fe044
WIP
erikfrojdh Oct 29, 2024
eb855fb
updated workflow
erikfrojdh Oct 29, 2024
a8afa04
updated workflow
erikfrojdh Oct 29, 2024
c3a5d22
added anaconda-client
erikfrojdh Oct 29, 2024
4cc6aa9
updated workflows
erikfrojdh Oct 30, 2024
dea5aaf
slight mod
erikfrojdh Oct 30, 2024
b037aeb
update
erikfrojdh Oct 30, 2024
b37f484
cmake defaults
erikfrojdh Oct 30, 2024
af4f000
fetch content for json
erikfrojdh Oct 30, 2024
be019b9
updated readme
erikfrojdh Oct 30, 2024
f754e0f
file reading
erikfrojdh Oct 30, 2024
5035c20
added action for docs
erikfrojdh Oct 30, 2024
29a4250
WIP
erikfrojdh Oct 30, 2024
1f539a2
forgot json
erikfrojdh Oct 30, 2024
9b33ad0
pybind
erikfrojdh Oct 30, 2024
1cbded0
doxygen
erikfrojdh Oct 30, 2024
da5ba03
WIP
erikfrojdh Oct 30, 2024
801adcc
updated path for docs
erikfrojdh Oct 30, 2024
8b43011
modified action
erikfrojdh Oct 30, 2024
acdcaac
fmt
erikfrojdh Oct 30, 2024
504e8b4
updated doxyfile
erikfrojdh Oct 30, 2024
41fbddb
pinned sphinx version
erikfrojdh Oct 30, 2024
6b8f247
added deploy
erikfrojdh Oct 30, 2024
738934f
added github token
erikfrojdh Oct 30, 2024
1b61155
another try
erikfrojdh Oct 30, 2024
dde92b9
xml back in
erikfrojdh Oct 30, 2024
a466887
added variable cluster finder
erikfrojdh Oct 30, 2024
6505f37
added type bindings
erikfrojdh Oct 30, 2024
9b733fd
WIP
erikfrojdh Oct 30, 2024
79d924c
docs and version bump
erikfrojdh Oct 30, 2024
13ac6b0
added missing numpy dependency
erikfrojdh Oct 30, 2024
b7e6962
added numpy as dep
erikfrojdh Oct 30, 2024
92d9c28
numpy in conda env for docs
erikfrojdh Oct 30, 2024
19c6a40
improved docs and added PixelMap
erikfrojdh Oct 31, 2024
cee0d71
added check to prevent segfault on missing subfile
erikfrojdh Oct 31, 2024
ec61132
WIP
erikfrojdh Oct 31, 2024
ae1166b
WIP
erikfrojdh Oct 31, 2024
563c39c
decoding of old Moench03
erikfrojdh Oct 31, 2024
49da039
working on 05
erikfrojdh Oct 31, 2024
b8a4498
WIP
erikfrojdh Oct 31, 2024
80a3941
added CtbRawFile
erikfrojdh Nov 5, 2024
d98b452
optional
erikfrojdh Nov 5, 2024
7f244e2
extra methods in CtbRawFile
erikfrojdh Nov 5, 2024
2efb763
func to prop
erikfrojdh Nov 5, 2024
654c1db
WIP
erikfrojdh Nov 5, 2024
25812cb
RawFile is now using RawMasterFile
erikfrojdh Nov 6, 2024
1cc7690
discard partial
erikfrojdh Nov 6, 2024
4bb8487
added moench03 back
erikfrojdh Nov 6, 2024
5b2809d
working Moench03 detector type
erikfrojdh Nov 6, 2024
cbfd1f0
ClusterFinder
erikfrojdh Nov 6, 2024
b2e5c71
MH02 1-4 counters
erikfrojdh Nov 6, 2024
9c220bf
added simple decoding of scan parameters
erikfrojdh Nov 7, 2024
d5fb823
added numpy variants
erikfrojdh Nov 7, 2024
b172c7a
starting work on ROI
erikfrojdh Nov 7, 2024
ecf1b2a
WIP
erikfrojdh Nov 11, 2024
5f21759
removed prints, bumped version
erikfrojdh Nov 11, 2024
a0b6c4c
Merge branch 'main' into developer
erikfrojdh Nov 11, 2024
2ee1a55
WIP
erikfrojdh Nov 12, 2024
db936b6
improved documentation
erikfrojdh Nov 12, 2024
17917ac
Merge branch 'main' into developer
erikfrojdh Nov 12, 2024
13b2cb4
docs and reorder
erikfrojdh Nov 14, 2024
cb94d07
Merge branch 'developer' of github.com:slsdetectorgroup/aare into dev…
erikfrojdh Nov 14, 2024
dc889da
removed subfile from cmake
erikfrojdh Nov 14, 2024
7ffd732
ported reading clusters (#95)
erikfrojdh Nov 14, 2024
dcedb4f
added missing header
erikfrojdh Nov 14, 2024
5cde7a9
WIP
erikfrojdh Nov 14, 2024
0d05827
WIP
erikfrojdh Nov 14, 2024
e77b615
Added expression templates (#98)
erikfrojdh Nov 15, 2024
17f8d28
frame reading for cluster file
erikfrojdh Nov 15, 2024
632c2ee
bumped version
erikfrojdh Nov 15, 2024
62a14dd
Merge branch 'main' into developer
erikfrojdh Nov 15, 2024
9d4459e
linking json with PUBLIC to avoid errors
erikfrojdh Nov 18, 2024
0882887
Merge branch 'developer' of github.com:slsdetectorgroup/aare into dev…
erikfrojdh Nov 18, 2024
13394c3
cmake targets
erikfrojdh Nov 18, 2024
9ab61ca
deps in pkg
erikfrojdh Nov 18, 2024
35c6706
docs
erikfrojdh Nov 18, 2024
37d3dfc
WIP
erikfrojdh Nov 18, 2024
30d05f9
detecting need to link with stdfs
erikfrojdh Nov 18, 2024
75f83e5
detecting need to link with stdfs
erikfrojdh Nov 18, 2024
8ea4372
fix
erikfrojdh Nov 18, 2024
47e867f
Merge branch 'main' into developer
erikfrojdh Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 36 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ include(FetchContent)

#Set default build type if none was specified
include(cmake/helpers.cmake)


default_build_type("Release")
set_std_fs_lib()
message(STATUS "Extra linking to fs lib:${STD_FS_LIB}")

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

Expand Down Expand Up @@ -113,8 +117,17 @@ if (AARE_FETCH_FMT)
GIT_PROGRESS TRUE
USES_TERMINAL_DOWNLOAD TRUE
)
set(FMT_INSTALL ON CACHE BOOL "")
# set(FMT_CMAKE_DIR "")
FetchContent_MakeAvailable(fmt)
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
install(TARGETS fmt
EXPORT ${project}-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
else()
find_package(fmt 6 REQUIRED)
endif()
Expand All @@ -125,7 +138,16 @@ if (AARE_FETCH_JSON)
json
URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
)
set(JSON_Install ON CACHE BOOL "")
FetchContent_MakeAvailable(json)
set(NLOHMANN_JSON_TARGET_NAME nlohmann_json)

install(
TARGETS nlohmann_json
EXPORT "${TARGETS_EXPORT_NAME}"

)
message(STATUS "target: ${NLOHMANN_JSON_TARGET_NAME}")
else()
find_package(nlohmann_json 3.11.3 REQUIRED)
endif()
Expand Down Expand Up @@ -292,7 +314,15 @@ target_include_directories(aare_core PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

target_link_libraries(aare_core PUBLIC fmt::fmt PRIVATE aare_compiler_flags nlohmann_json::nlohmann_json)
target_link_libraries(
aare_core
PUBLIC
fmt::fmt
nlohmann_json::nlohmann_json
${STD_FS_LIB} # from helpers.cmake
PRIVATE
aare_compiler_flags
)

set_target_properties(aare_core PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
Expand Down Expand Up @@ -389,8 +419,8 @@ add_custom_target(
VERBATIM
)

# if(AARE_MASTER_PROJECT)
# set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
# set(PROJECT_LIBRARIES slsSupportShared slsDetectorShared slsReceiverShared)
# include(cmake/package_config.cmake)
# endif()
if(AARE_MASTER_PROJECT)
set(CMAKE_INSTALL_DIR "share/cmake/${PROJECT_NAME}")
set(PROJECT_LIBRARIES aare-core aare-compiler-flags )
include(cmake/package_config.cmake)
endif()
40 changes: 40 additions & 0 deletions cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,43 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE ${val} CACHE STRING "Build type (default ${val})" FORCE)
endif()
endfunction()

function(set_std_fs_lib)
# from pybind11
# Check if we need to add -lstdc++fs or -lc++fs or nothing
if(DEFINED CMAKE_CXX_STANDARD AND CMAKE_CXX_STANDARD LESS 17)
set(STD_FS_NO_LIB_NEEDED TRUE)
elseif(MSVC)
set(STD_FS_NO_LIB_NEEDED TRUE)
else()
file(
WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
"#include <filesystem>\nint main(int argc, char ** argv) {\n std::filesystem::path p(argv[0]);\n return p.string().length();\n}"
)
try_compile(
STD_FS_NO_LIB_NEEDED ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
COMPILE_DEFINITIONS -std=c++17)
try_compile(
STD_FS_NEEDS_STDCXXFS ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
COMPILE_DEFINITIONS -std=c++17
LINK_LIBRARIES stdc++fs)
try_compile(
STD_FS_NEEDS_CXXFS ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
COMPILE_DEFINITIONS -std=c++17
LINK_LIBRARIES c++fs)
endif()

if(${STD_FS_NEEDS_STDCXXFS})
set(STD_FS_LIB stdc++fs PARENT_SCOPE)
elseif(${STD_FS_NEEDS_CXXFS})
set(STD_FS_LIB c++fs PARENT_SCOPE)
elseif(${STD_FS_NO_LIB_NEEDED})
set(STD_FS_LIB "" PARENT_SCOPE)
else()
message(WARNING "Unknown C++17 compiler - not passing -lstdc++fs")
set(STD_FS_LIB "")
endif()
endfunction()
4 changes: 3 additions & 1 deletion cmake/project-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ include(CMakeFindDependencyMacro)

set(SLS_USE_HDF5 "@SLS_USE_HDF5@")


# List dependencies
find_dependency(Threads)
find_dependency(fmt)
find_dependency(nlohmann_json)

# Add optional dependencies here
if (SLS_USE_HDF5)
Expand Down
19 changes: 19 additions & 0 deletions docs/src/Consume.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Use from C++
========================

There are a few different way to use aare in your C++ project. Which one you choose
depends on how you intend to work with the library and how you manage your dependencies.


Install and use cmake with find_package(aare)
-------------------------------------------------

https://github.com/slsdetectorgroup/aare-examples

.. include:: _install.rst


Use as a submodule
-------------------

Coming soon...
47 changes: 26 additions & 21 deletions docs/src/Installation.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
****************
Installation
===============
****************

.. attention ::

- https://cliutils.gitlab.io/modern-cmake/README.html

conda/mamaba
~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~

This is the recommended way to install aare. Using a package manager makes it easy to
switch between versions and is (one of) the most convenient way to install up to date
dependencies on older distributions.

.. note ::

Expand All @@ -16,8 +25,11 @@ conda/mamaba
conda install aare=2024.11.11.dev0 -c slsdetectorgroup


cmake (development install)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmake build (development install)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you are working on aare or want to test our a version that doesn't yet have
a conda package. Build using cmake and then run from the build folder.

.. code-block:: bash

Expand All @@ -32,30 +44,23 @@ cmake (development install)
make -j4


# add the build folder to your PYTHONPATH
# add the build folder to your PYTHONPATH and then you should be able to
# import aare in python

cmake install and use in your C++ project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmake build + install and use in your C++ project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: bash

#build and install aare
git clone [email protected]:slsdetectorgroup/aare.git --branch=v1 #or using http...
mkdir build
cd build
.. warning ::

#configure using cmake
cmake ../aare -DCMAKE_INSTALL_PREFIX=/where/to/put/aare
When building aare with default settings we also include fmt and nlohmann_json.
Installation to a custom location is highly recommended.

#build (replace 4 with the number of threads you want to use)
make -j4

#install
make install
.. note ::

It is also possible to install aare with conda and then use in your C++ project.

#Now configure your project
cmake .. -DCMAKE_PREFIX_PATH=SOME_PATH
.. include:: _install.rst


cmake options
Expand Down
23 changes: 23 additions & 0 deletions docs/src/_install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. code-block:: bash

#build and install aare
git clone [email protected]:slsdetectorgroup/aare.git --branch=developer #or using http...
mkdir build
cd build

#configure using cmake
cmake ../aare -DCMAKE_INSTALL_PREFIX=/where/to/put/aare

#build (replace 4 with the number of threads you want to use)
make -j4

#install
make install

#Go to your project
cd /your/project/source

#Now configure your project
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=SOME_PATH
4 changes: 3 additions & 1 deletion docs/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ AARE

.. toctree::
:caption: Installation
:maxdepth: 1
:maxdepth: 3

Installation
Requirements
Consume




Expand Down
Loading