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

Mods to support spectra file IO out of fortran #34

Draft
wants to merge 103 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
ba53a82
Add install stuff and support for Finding Specutils in CMake
hbivens Jul 25, 2024
ab9e951
Merge branch 'master' into issue/31-spectra-io-out-of-fortran
wcjohns Jul 25, 2024
cc1b35f
remove install interface thing that doesn't seem to matter.
hbivens Jul 26, 2024
0334e4d
fortran integration mods
hbivens Aug 5, 2024
aed541f
add extension that accesses a count at a given channel
hbivens Aug 6, 2024
aca0c47
make the *_at extensions 1-based, since calling from fortran
hbivens Aug 6, 2024
4b8bdc9
enable testing at the topmost cmakefile
hbivens Aug 8, 2024
aefc329
cherry pick boost test removal
hbivens Aug 8, 2024
fd24efd
syntax highlighting getting confused
hbivens Aug 8, 2024
17cc031
Make API a little easier
hbivens Aug 10, 2024
48421d9
add round trip test
hbivens Aug 12, 2024
0c59d47
use seconds precision
hbivens Aug 12, 2024
8af3a3b
add deviation pairs to test
hbivens Aug 12, 2024
358b706
check neutrons
hbivens Aug 12, 2024
c89674c
use vax string
hbivens Aug 12, 2024
4aef394
Yeah!!! Figured out fortran array to c++ typemap.
hbivens Aug 14, 2024
fb679da
add a few more extensions and include filesystem stuff
hbivens Aug 15, 2024
45bed0e
call correct method
hbivens Aug 28, 2024
c498e6d
trim the filename and add some error diagnostics
hbivens Aug 28, 2024
e6032bb
add realtime check
hbivens Sep 9, 2024
738cd14
merge master
hbivens Sep 9, 2024
6d8371f
Fix issue compiling with fast_float
wcjohns Sep 9, 2024
80d3ce5
fix windows build error
hbivens Sep 12, 2024
7f4a595
update wrapper
hbivens Sep 13, 2024
2b03814
start some tests to map dev pairs
hbivens Sep 13, 2024
ae3c9a3
make strtod default
hbivens Sep 16, 2024
31cb465
Merge remote-tracking branch 'origin/master' into issue/31-spectra-io…
hbivens Sep 16, 2024
af3631d
checkpoint
hbivens Sep 17, 2024
f39635e
pcf spectra file mods
hbivens Sep 18, 2024
0e27b16
updates - add fortran round trip test
hbivens Sep 18, 2024
62e653c
checkpoint
hbivens Sep 20, 2024
46dbbc5
lose the pcf namespace
hbivens Sep 23, 2024
936b7af
figured out deviation pairs
hbivens Sep 26, 2024
48a3268
update fortran wrapper
hbivens Sep 26, 2024
8d547a3
more dev pair mapping
hbivens Sep 27, 2024
9b195e4
cherrypick Will's tag support
hbivens Sep 27, 2024
a96f242
merge master and fix conflicts
hbivens Sep 30, 2024
e0391ad
revert back to default
hbivens Sep 30, 2024
854b836
update test to show Will
hbivens Oct 2, 2024
431c65c
Fix issues with writing and reading deviation pairs to PCF files.
wcjohns Oct 9, 2024
2f35d06
Make compiling the bindings optional (defaulting to off).
wcjohns Oct 9, 2024
e29f078
Promote measurement source and descriptions to be member variables of…
wcjohns Oct 10, 2024
20c6e55
Remove PcfExtensions.
wcjohns Oct 10, 2024
1b77e69
Fix compile issue.
wcjohns Oct 10, 2024
882b503
Fix some function not always returning values in c-interface.
wcjohns Oct 10, 2024
a1e4396
Fix `SpecUtils_Measurement_set_start_time_str` not returning a value.
wcjohns Oct 10, 2024
68babc7
update fortran bindings
hbivens Oct 10, 2024
6a07a20
add ctest args
hbivens Oct 10, 2024
d6e44d7
rename this, I was getting compiler warning:
hbivens Oct 10, 2024
74d4418
add debug print for CICD
hbivens Oct 10, 2024
13bb819
mas debug
hbivens Oct 10, 2024
0caf7ca
add index, size to exception message
hbivens Oct 10, 2024
3981033
add size
hbivens Oct 10, 2024
cdc7ecd
add build script to aid in cicd debug
hbivens Oct 10, 2024
0f58916
up minimum to avoid cmake warning
hbivens Oct 10, 2024
a80f9af
uri spectra causes fortran test to fail
hbivens Oct 10, 2024
074926e
wrong line
hbivens Oct 10, 2024
1047d13
First try at adding an automated release of shared libraries for windows
wcjohns Oct 11, 2024
9c6163e
Merge branch 'issue/31-spectra-io-out-of-fortran' of github.com:sandi…
wcjohns Oct 11, 2024
9451d07
Add package command to CMake, and bring out option for Windows runtim…
wcjohns Oct 11, 2024
fee1904
Merge branch 'issue/31-spectra-io-out-of-fortran' of github.com:sandi…
wcjohns Oct 11, 2024
02c71ab
Merge branch 'master' into issue/31-spectra-io-out-of-fortran
wcjohns Oct 11, 2024
a22e940
Fix a few things up that I think got messed up during various merges.
wcjohns Oct 11, 2024
61f3224
Maybe fix compile error on Windows
wcjohns Oct 11, 2024
65621cb
Add another missing include
wcjohns Oct 11, 2024
3018b0d
Add another missing include
wcjohns Oct 11, 2024
2ce11ec
Ad UTF-8 BOM to test_utf8_limit_str_size.cpp
wcjohns Oct 11, 2024
dccb2e4
Update ci.yml to upload Windows artifact, maybe
wcjohns Oct 11, 2024
ee04054
Update ci.yml to upload Windows artifact, now a little closer maybe
wcjohns Oct 11, 2024
5e97ccc
Update ci.yml to upload Windows artifact, try again
wcjohns Oct 11, 2024
5408630
Update ci.yml to upload Windows artifact, try again
wcjohns Oct 12, 2024
79d81cb
Update ci.yml to upload Windows artifact, try again
wcjohns Oct 12, 2024
ba26b47
Update ci.yml to upload Windows artifact, try again
wcjohns Oct 12, 2024
03d8889
Minor change
wcjohns Oct 12, 2024
960c637
Fix issue when converting to a VAX string.
wcjohns Oct 14, 2024
6f55a3b
Debug windows automated build of shared libraries a bit
wcjohns Oct 14, 2024
4e6c62b
Maybe fix syntax error in ci.yml
wcjohns Oct 14, 2024
6310f65
Maybe fix syntax error in ci.yml
wcjohns Oct 14, 2024
caab293
Maybe fix syntax error in ci.yml
wcjohns Oct 14, 2024
06fcc6e
Try to improve CI install targets
wcjohns Oct 14, 2024
56d8b78
Debugging chany ci.yml
wcjohns Oct 14, 2024
679bf4e
Remove trying to install export file
wcjohns Oct 14, 2024
53b5039
Turn building C bindings on for CI build
wcjohns Oct 14, 2024
160b5bd
Add exporting classes/structs/functions for Windows DLLs.
wcjohns Oct 14, 2024
16643d3
Trye having CMake generate export header.
wcjohns Oct 14, 2024
1359228
Fix missed export
wcjohns Oct 14, 2024
e3ffee4
Temporarily re-include `pcf_det_name_to_dev_pair_index` so fortran bi…
wcjohns Oct 14, 2024
9adcc44
Fix infinite recursion
wcjohns Oct 14, 2024
902074e
add script
hbivens Oct 15, 2024
bb9fb76
Merge remote-tracking branch 'origin/issue/31-spectra-io-out-of-fortr…
hbivens Oct 15, 2024
f1c5e48
add install
hbivens Oct 17, 2024
bf77e65
Turn off c-bindings
hbivens Oct 17, 2024
a93c8c8
add -fPic
hbivens Oct 17, 2024
5b47ea2
Revert "Turn building C bindings on for CI build"
hbivens Oct 18, 2024
301ee76
Revert "Add exporting classes/structs/functions for Windows DLLs."
hbivens Oct 18, 2024
ae11b15
update swig-gen
hbivens Oct 18, 2024
7de1a45
Revert "Fix missed export"
hbivens Oct 18, 2024
2cceea1
make it work
hbivens Oct 18, 2024
874d8a5
keep the swig generated files in repo
hbivens Oct 18, 2024
cbfc685
update interface
hbivens Oct 21, 2024
1cd879c
update test
hbivens Oct 21, 2024
0e9ebde
Add method to update detector name
hbivens Oct 22, 2024
9ca9f3c
cmake mods to enable valgrind memcheck with ctest
hbivens Oct 23, 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
52 changes: 48 additions & 4 deletions CMakeLists.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If SpecUtils_FLT_PARSE_METHOD is left as 'default_value' here, there is some logic below to hopefully pick the most reasonable float parsing method. Like for MSVC ≥2019, it should pick 'FromChars'.
Is there is reason to default to the slowest common denominator, or was it giving you an issue?

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()

project( SpecUtils )
project( SpecUtils VERSION 1.0.0 )

option( SpecUtils_ENABLE_D3_CHART "Enables exporting of the D3 chart format" ON )
option( SpecUtils_D3_SUPPORT_FILE_STATIC "Compiles the JS and CSS files into memory, rather than reading files on disk; disable to allow changing JS/CSS without having to recompile" ON )
Expand All @@ -27,7 +27,6 @@ option( SpecUtils_USE_FROM_CHARS "Use c++17 std::from_chars for parsing floats/i
option( SpecUtils_ENABLE_EQUALITY_CHECKS "Enables the equal_enough(...) functions for comparing two spectrum files." OFF ) #code size is only reason to default to off, I think
option( PERFORM_DEVELOPER_CHECKS "Performs additional computationally expensive tests during execution" off )


# If we are building this on Windows, not as a sub-project, lets enable selecting C++ runtime
if( MSVC AND (SpecUtils_PYTHON_BINDINGS OR SpecUtils_BUILD_UNIT_TESTS) )
get_directory_property(hasParent PARENT_DIRECTORY)
Expand Down Expand Up @@ -232,6 +231,7 @@ endif( SpecUtils_JAVA_SWIG )
add_library( SpecUtils ${SpecUtils_LIB_TYPE} ${sources} ${headers} ${OTHER_SUPPORT_FILES} )
set_target_properties( SpecUtils PROPERTIES PREFIX "lib" OUTPUT_NAME "SpecUtils" )


#For CMake 3.8+, could specify C++11 using the following so it will be propagated to down-line targets...
#target_compile_features(SpecUtils PUBLIC cxx_std_11)
#set_target_properties(SpecUtils PROPERTIES CXX_EXTENSIONS OFF)
Expand Down Expand Up @@ -306,7 +306,7 @@ elseif( WIN32 )
target_link_libraries( SpecUtils PUBLIC "Shlwapi.lib" )
endif( MINGW )

target_include_directories( SpecUtils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${Boost_INCLUDE_DIRS}
target_include_directories( SpecUtils PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> $<INSTALL_INTERFACE:include/SpecUtils> ${Boost_INCLUDE_DIRS}
PRIVATE ${THIRD_PARTY_DIR} ${PYTHON_INCLUDE_DIRS} )

if( SpecUtils_BUILD_REGRESSION_TEST )
Expand All @@ -327,9 +327,53 @@ if( SpecUtils_BUILD_FUZZING_TESTS )
add_subdirectory( fuzz_test )
endif( SpecUtils_BUILD_FUZZING_TESTS )


# Specify installation rules
include(GNUInstallDirs)

# Install the library
install(TARGETS SpecUtils
EXPORT SpecUtilsTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

set( SpecUtils_config_OUT ${CMAKE_CURRENT_BINARY_DIR}/SpecUtils_config.h )
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/SpecUtils/SpecUtils_config.h.in
${CMAKE_CURRENT_BINARY_DIR}/SpecUtils_config.h
${SpecUtils_config_OUT}
)
LIST(APPEND headers ${SpecUtils_config_OUT})
# Install the headers
install(FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SpecUtils)

# Create and install the CMake package configuration files
include(CMakePackageConfigHelpers)

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/SpecUtilsConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)

configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/SpecUtilsConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/SpecUtilsConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SpecUtils
)



install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/SpecUtilsConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/SpecUtilsConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SpecUtils
)

install(EXPORT SpecUtilsTargets
FILE SpecUtilsTargets.cmake
NAMESPACE SpecUtils::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SpecUtils
)
11 changes: 11 additions & 0 deletions SpecUtilsConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

# Add any dependencies here, e.g.,
# find_dependency(SomeOtherLibrary)

include("${CMAKE_CURRENT_LIST_DIR}/SpecUtilsTargets.cmake")

set(SpecUtils_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")
set(SpecUtils_LIBRARIES SpecUtils)