Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 36 additions & 2 deletions .github/workflows/ci_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
BUILD_TYPE: Release

jobs:
build-library:
Build-and-Test-LinuxOsx:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -122,4 +122,38 @@ jobs:
run: |
test -e index.html


Build-and-Test-Win:
runs-on: windows-2025
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
submodules: recursive
- uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830
with:
miniforge-version: latest
use-mamba: true
channels: conda-forge
activate-environment: spiceql
environment-file: environment.yml
auto-activate-base: false
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Check build environment
run: |
conda list
- name: Build Package
run: |
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON -DCMAKE_CXX_STANDARD=20 -G Ninja -DSPICEQL_BUILD_TESTS=OFF -DSPICEQL_BUILD_DOCS=OFF ..
cmake --build . --target install --config Release
ls ${{ github.workspace }}\build\Release
- uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1
with:
name: SpiceQL-py${{ matrix.python-version }}
path: |
${{ github.workspace }}\build\Release\SpiceQL.dll
${{ github.workspace }}\build\Release\SpiceQL.lib
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ if(SPICEQL_BUILD_LIB)
add_subdirectory("submodules/gularkfilesystem")
add_subdirectory("submodules/json")

find_package(cspice REQUIRED)
find_package(fmt REQUIRED)
find_package(cereal REQUIRED)
find_package(spdlog REQUIRED)
find_package(CSpice REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package(cereal CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(HighFive REQUIRED)
find_package(CURL REQUIRED)

set(SPICEQL_INSTALL_INCLUDE_DIR "include/SpiceQL")
set(SPICEQL_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/src/spiceql.cpp
${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/src/utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/src/io.cpp
${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/src/spiceql_io.cpp
${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/src/query.cpp
${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/src/spice_types.cpp
${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/src/memoized_functions.cpp
Expand All @@ -78,7 +78,7 @@ if(SPICEQL_BUILD_LIB)
set(SPICEQL_HEADER_FILES ${SPICEQL_BUILD_INCLUDE_DIR}/spiceql.h
${SPICEQL_BUILD_INCLUDE_DIR}/utils.h
${SPICEQL_BUILD_INCLUDE_DIR}/memoized_functions.h
${SPICEQL_BUILD_INCLUDE_DIR}/io.h
${SPICEQL_BUILD_INCLUDE_DIR}/spiceql_io.h
${SPICEQL_BUILD_INCLUDE_DIR}/spice_types.h
${SPICEQL_BUILD_INCLUDE_DIR}/query.h
${SPICEQL_BUILD_INCLUDE_DIR}/config.h
Expand Down Expand Up @@ -153,6 +153,7 @@ target_include_directories(SpiceQL
PUBLIC
fmt::fmt-header-only
nlohmann_json::nlohmann_json
cereal::cereal
PRIVATE
CSPICE::cspice
spdlog::spdlog_header_only
Expand Down
4 changes: 2 additions & 2 deletions SpiceQL/include/memo.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ namespace Memo {
if (CACHE_DIRECTORY == "") {
const char* cache_dir_char = getenv("SPICEQL_CACHE_DIR");

std::string cache_dir;
std::string cache_dir;

if (cache_dir_char == NULL) {
std::string tempname = "spiceql-cache-" + gen_random(10);
cache_dir = fs::temp_directory_path() / tempname / "spiceql_cache";
cache_dir = (fs::temp_directory_path() / tempname / "spiceql_cache").string();
}
else {
cache_dir = cache_dir_char;
Expand Down
2 changes: 1 addition & 1 deletion SpiceQL/include/spiceql.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "utils.h"
#include "spice_types.h"
#include "io.h"
#include "spiceql_io.h"
#include "query.h"
#include "api.h"
#include "inventory.h"
File renamed without changes.
4 changes: 2 additions & 2 deletions SpiceQL/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ namespace SpiceQL {

fs::path fsDataPath(dataPath);
json::json_pointer kernelPath(getParentPointer(full_pointer.to_string(), 1));
if (fs::exists((string)fsDataPath + kernelPath.to_string())) {
if (fs::exists(fsDataPath.string() + kernelPath.to_string())) {
fsDataPath += kernelPath.to_string();
kernelPath = json::json_pointer("/kernels");
string kernelType = json::json_pointer(getParentPointer(full_pointer.to_string(), 2)).back();
Expand All @@ -150,7 +150,7 @@ namespace SpiceQL {
}
}

vector<vector<string>> res = getPathsFromRegex(fsDataPath, jsonArrayToVector(eval_json[json_pointer]));
vector<vector<string>> res = getPathsFromRegex(fsDataPath.string(), jsonArrayToVector(eval_json[json_pointer]));
eval_json[json_pointer] = res;
}
copyConfig[pointer] = eval_json;
Expand Down
20 changes: 10 additions & 10 deletions SpiceQL/src/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ namespace SpiceQL {

// Comparator function for kernel paths
bool fileNameComp(string a, string b) {
string fna = static_cast<fs::path>(a).filename();
string fnb = static_cast<fs::path>(b).filename();
int comp = fna.compare(fnb);
string fna = static_cast<fs::path>(a).filename().string();
string fnb = static_cast<fs::path>(b).filename().string();
int comp = fna.compare(fnb);
SPDLOG_TRACE("Comparing {} and {}: {}", fna, fnb, comp);
return comp < 0;
}
Expand All @@ -85,21 +85,21 @@ namespace SpiceQL {
}
vector<vector<string>> files = {};

string extension = static_cast<fs::path>(kernels.at(0)).extension();
string extension = static_cast<fs::path>(kernels.at(0)).extension().string();
transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
// ensure everything is different versions of the same file
for(const fs::path &k : kernels) {
string currentKernelExt = k.extension();
string currentKernelExt = k.extension().string();
transform(currentKernelExt.begin(), currentKernelExt.end(), currentKernelExt.begin(), ::tolower);
if (currentKernelExt != extension) {
throw invalid_argument("The input extensions (" + (string)k.filename() + ") are not different versions of the same file " + kernels.at(0));
throw invalid_argument("The input extensions (" + k.filename().string() + ") are not different versions of the same file " + kernels.at(0));
}
bool foundList = false;
for (int i = 0; i < files.size(); i++) {

const fs::path &firstVecElem = files[i][0];
string fileName = firstVecElem.filename();
string kernelName = k.filename();
string fileName = firstVecElem.filename().string();
string kernelName = k.filename().string();
SPDLOG_TRACE("filename: {}", fileName);
SPDLOG_TRACE("kernel name: {}", kernelName);

Expand All @@ -116,12 +116,12 @@ namespace SpiceQL {
SPDLOG_TRACE("Truncated kernel name: {}", kernelName);

if (fileName == kernelName) {
files[i].push_back(k);
files[i].push_back(k.string());
foundList = true;
}
}
if (!foundList) {
files.push_back({k});
files.push_back({k.string()});
}
foundList = false;
}
Expand Down
2 changes: 1 addition & 1 deletion SpiceQL/src/spice_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ namespace SpiceQL {
SPDLOG_TRACE("k is absolute");
} else {
SPDLOG_TRACE("k is relative");
k = data_dir / k;
k = fs::path(data_dir / k).string();
}

SPDLOG_TRACE("Creating shared kernel {}", k);
Expand Down
4 changes: 1 addition & 3 deletions SpiceQL/src/spiceql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ namespace SpiceQL {
// init with log level
const char* log_level_char = getenv("SPICEQL_LOG_LEVEL");
string log_level_string;
spdlog::level::level_enum log_level;

if (log_level_char != NULL) {
log_level_string = log_level_char;
Expand All @@ -68,7 +67,7 @@ namespace SpiceQL {
auto max_size = 1048576 * 10;
auto max_files = 5;
try {
auto logger = spdlog::rotating_logger_mt("spiceql_file_log", log_file, max_size, max_files);
auto logger = spdlog::rotating_logger_mt("spiceql_file_log", log_file.string(), max_size, max_files);
}
catch (const spdlog::spdlog_ex &ex) {
SPDLOG_ERROR("file log init failed: {}", ex.what());
Expand All @@ -79,7 +78,6 @@ namespace SpiceQL {

SPDLOG_DEBUG("Using log dir: {}", log_dir);
SPDLOG_DEBUG("Log level: {}", log_level_string);
SPDLOG_DEBUG("Log level enum: {}", int(log_level));
SPDLOG_TRACE("Log dir: {}", log_dir);
}
}
Expand Down
2 changes: 1 addition & 1 deletion SpiceQL/src/io.cpp → SpiceQL/src/spiceql_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <SpiceUsr.h>

#include "io.h"
#include "spiceql_io.h"
#include "utils.h"


Expand Down
2 changes: 1 addition & 1 deletion SpiceQL/tests/Fixtures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <sstream>

#include "utils.h"
#include "io.h"
#include "spiceql_io.h"
#include "query.h"
#include "inventory.h"

Expand Down
2 changes: 1 addition & 1 deletion SpiceQL/tests/IoTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <vector>

#include "Fixtures.h"
#include "io.h"
#include "spiceql_io.h"
#include "utils.h"
#include "api.h"

Expand Down
2 changes: 1 addition & 1 deletion SpiceQL/tests/MemoTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using namespace std::chrono;
#include "memo.h"
#include "memoized_functions.h"
#include "spiceql.h"
#include "io.h"
#include "spiceql_io.h"
#include "Fixtures.h"

#include <spdlog/spdlog.h>
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/io.i
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%module(package="pyspiceql") io

%{
#include "io.h"
#include "spiceql_io.h"
%}

%include "io.h"
%include "spiceql_io.h"
Loading