Skip to content

Commit 53c7e6a

Browse files
committed
add licenses
1 parent 0198d1f commit 53c7e6a

12 files changed

Lines changed: 825 additions & 62 deletions

CMakeLists.txt

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -97,29 +97,29 @@ if(QDATA_BUILD_TESTS)
9797
add_test(NAME qdata_odr_headers COMMAND qdata_odr_headers)
9898
endif()
9999

100-
find_program(RSCRIPT_EXECUTABLE Rscript)
101-
if(RSCRIPT_EXECUTABLE)
102-
execute_process(
103-
COMMAND ${RSCRIPT_EXECUTABLE} -e "cat(as.integer(requireNamespace('qs2', quietly = TRUE)))"
104-
OUTPUT_VARIABLE QDATA_HAS_QS2
105-
OUTPUT_STRIP_TRAILING_WHITESPACE
106-
)
107-
108-
if(QDATA_HAS_QS2 STREQUAL "1")
109-
add_test(
110-
NAME qdata_builtin_write_support
111-
COMMAND ${RSCRIPT_EXECUTABLE}
112-
${CMAKE_CURRENT_SOURCE_DIR}/tests/r/builtin_write_support.R
113-
$<TARGET_FILE:qdata_write_builtin_support>
114-
${CMAKE_CURRENT_BINARY_DIR}/builtin_cases
115-
)
116-
add_test(
117-
NAME qdata_roundtrip_qs2
118-
COMMAND ${RSCRIPT_EXECUTABLE}
119-
${CMAKE_CURRENT_SOURCE_DIR}/tests/r/roundtrip_testing.R
120-
$<TARGET_FILE:qdata_roundtrip_file>
121-
$<TARGET_FILE:qdata_roundtrip_memory>
122-
)
123-
endif()
100+
find_program(RSCRIPT_EXECUTABLE Rscript REQUIRED)
101+
execute_process(
102+
COMMAND ${RSCRIPT_EXECUTABLE} -e
103+
"pkgs <- c('qs2', 'stringi', 'stringfish'); cat(as.integer(all(vapply(pkgs, requireNamespace, logical(1), quietly = TRUE))))"
104+
OUTPUT_VARIABLE QDATA_HAS_R_TEST_DEPS
105+
OUTPUT_STRIP_TRAILING_WHITESPACE
106+
)
107+
if(NOT QDATA_HAS_R_TEST_DEPS STREQUAL "1")
108+
message(FATAL_ERROR "QDATA_BUILD_TESTS=ON requires Rscript with the qs2, stringi, and stringfish packages installed.")
124109
endif()
110+
111+
add_test(
112+
NAME qdata_builtin_write_support
113+
COMMAND ${RSCRIPT_EXECUTABLE}
114+
${CMAKE_CURRENT_SOURCE_DIR}/tests/r/builtin_write_support.R
115+
$<TARGET_FILE:qdata_write_builtin_support>
116+
${CMAKE_CURRENT_BINARY_DIR}/builtin_cases
117+
)
118+
add_test(
119+
NAME qdata_roundtrip_qs2
120+
COMMAND ${RSCRIPT_EXECUTABLE}
121+
${CMAKE_CURRENT_SOURCE_DIR}/tests/r/roundtrip_testing.R
122+
$<TARGET_FILE:qdata_roundtrip_file>
123+
$<TARGET_FILE:qdata_roundtrip_memory>
124+
)
125125
endif()

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

LICENSES/BLOSC-BSD-3-Clause.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
BSD License
2+
3+
For Blosc - A blocking, shuffling and lossless compression library
4+
5+
Copyright (c) 2009-2018 Francesc Alted <francesc@blosc.org>
6+
Copyright (c) 2019-present Blosc Development Team <blosc@blosc.org>
7+
8+
Redistribution and use in source and binary forms, with or without modification,
9+
are permitted provided that the following conditions are met:
10+
11+
* Redistributions of source code must retain the above copyright notice, this
12+
list of conditions and the following disclaimer.
13+
14+
* Redistributions in binary form must reproduce the above copyright notice,
15+
this list of conditions and the following disclaimer in the documentation
16+
and/or other materials provided with the distribution.
17+
18+
* Neither the name Francesc Alted nor the names of its contributors may be used
19+
to endorse or promote products derived from this software without specific
20+
prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
26+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

LICENSES/xxHash-BSD-2-Clause.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
xxHash Library
2+
Copyright (c) 2012-2021 Yann Collet
3+
All rights reserved.
4+
5+
BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above copyright notice, this
14+
list of conditions and the following disclaimer in the documentation and/or
15+
other materials provided with the distribution.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CTEST_FLAGS ?= --output-on-failure -V
66
QS_EXTENDED_TESTS ?= 1
77
ROWS ?=
88
REPS ?=
9+
LICENSE_DIR ?= LICENSES
910

1011
BENCH_ARGS :=
1112
ifneq ($(strip $(ROWS)),)
@@ -15,7 +16,7 @@ ifneq ($(strip $(REPS)),)
1516
BENCH_ARGS += $(REPS)
1617
endif
1718

18-
.PHONY: all configure example bench benchmark benchmark-build test test-extended clean distclean
19+
.PHONY: all configure example bench benchmark benchmark-build test test-extended get-license-files clean distclean
1920

2021
all: configure
2122
$(CMAKE) --build $(BUILD_DIR)
@@ -41,6 +42,12 @@ test-extended: configure
4142
$(CMAKE) --build $(BUILD_DIR)
4243
QS_EXTENDED_TESTS=$(QS_EXTENDED_TESTS) $(CTEST) --test-dir $(BUILD_DIR) $(CTEST_FLAGS)
4344

45+
get-license-files:
46+
@mkdir -p $(LICENSE_DIR)
47+
curl -fsSL https://www.gnu.org/licenses/gpl-3.0.txt -o LICENSE
48+
curl -fsSL https://raw.githubusercontent.com/Cyan4973/xxHash/dev/LICENSE -o $(LICENSE_DIR)/xxHash-BSD-2-Clause.txt
49+
curl -fsSL https://raw.githubusercontent.com/Blosc/c-blosc/main/LICENSE.txt -o $(LICENSE_DIR)/BLOSC-BSD-3-Clause.txt
50+
4451
clean:
4552
@if [ -d "$(BUILD_DIR)" ]; then $(CMAKE) --build $(BUILD_DIR) --target clean; fi
4653

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ int main() {
3333
3434
`zstd` is required but `TBB` is optional only if you want multithreading.
3535
36+
## Testing
37+
38+
The test suite is driven through `Rscript` and requires the `qs2`, `stringi`,
39+
and `stringfish` packages when `QDATA_BUILD_TESTS=ON`.
40+
3641
## Core qdata types
3742
3843
qdata is built around a small set of data types:

THIRD_PARTY_NOTICES.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Third-Party Notices
2+
3+
This repository includes vendored or adapted code from the following upstream
4+
projects.
5+
6+
## xxHash
7+
8+
- Upstream project: <https://github.com/Cyan4973/xxHash>
9+
- Vendored files:
10+
- `include/xxhash/xxhash.h`
11+
- `include/xxhash/xxhash.c`
12+
- License: BSD 2-Clause
13+
- Local license text: [LICENSES/xxHash-BSD-2-Clause.txt](LICENSES/xxHash-BSD-2-Clause.txt)
14+
15+
## Blosc shuffle routines
16+
17+
- Upstream project: <https://github.com/Blosc/c-blosc>
18+
- Adapted files:
19+
- `include/blosc/shuffle_routines.h`
20+
- `include/blosc/unshuffle_routines.h`
21+
- License: BSD 3-Clause
22+
- Local license text: [LICENSES/BLOSC-BSD-3-Clause.txt](LICENSES/BLOSC-BSD-3-Clause.txt)
23+
24+
## Notes
25+
26+
- The project itself is distributed under the GNU General Public License,
27+
version 3. See [LICENSE](LICENSE).

docs/experimental/full_graph.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ reader_node -> decompressor_node -> sequencer_node -> deserializer_node
2929
Notes:
3030

3131
- the old full-graph implementation lived in the vendored `qdata-cpp` tree before this cleanup
32-
- if we revisit the idea later, git history and the performance notes in [perf_experiments.md](/home/ted/Repo/qs2/inst/include/qdata-cpp/docs/perf_experiments.md) are the reference
32+
- if we revisit the idea later, git history and the performance notes in [perf_experiments.md](../perf_experiments.md) are the reference

examples/mtcars_roundtrip.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33
#include <fstream>
44
#include <iostream>
55

6-
int main() {
7-
if(!std::ifstream("mtcars.qdata")) {
8-
std::cerr << "missing mtcars.qdata\n";
6+
int main(int argc, char** argv) {
7+
const char* path = argc >= 2 ? argv[1] : "mtcars.qdata";
8+
9+
if(!std::ifstream(path)) {
10+
std::cerr << "missing " << path
11+
<< " (run: Rscript examples/write_mtcars_qdata.R";
12+
if(argc >= 2) {
13+
std::cerr << ' ' << path;
14+
}
15+
std::cerr << ")\n";
916
return 1;
1017
}
1118

12-
auto obj = qdata::read("mtcars.qdata");
19+
auto obj = qdata::read(path);
1320
auto& frame = std::get<qdata::list_vector>(obj.data);
1421
auto& mpg = std::get<qdata::real_vector>(frame.values[0]->data);
1522

examples/write_mtcars_qdata.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
args <- commandArgs(TRUE)
2+
outfile <- if (length(args) >= 1L) args[[1]] else "mtcars.qdata"
3+
4+
stopifnot(requireNamespace("qs2", quietly = TRUE))
5+
6+
qs2::qd_save(mtcars, outfile, nthreads = 1)
7+
cat("wrote", outfile, "\n")

0 commit comments

Comments
 (0)