diff --git a/.github/workflows/ci_testing.yml b/.github/workflows/ci_testing.yml index 4dd9015f..442ee696 100644 --- a/.github/workflows/ci_testing.yml +++ b/.github/workflows/ci_testing.yml @@ -8,7 +8,7 @@ env: BUILD_TYPE: Release jobs: - build-library: + Build-and-Test-LinuxOsx: runs-on: ${{ matrix.os }} strategy: matrix: @@ -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 \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index c8028561..196d15a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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 @@ -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 diff --git a/SpiceQL/include/memo.h b/SpiceQL/include/memo.h index 0fe54358..e3d9b494 100644 --- a/SpiceQL/include/memo.h +++ b/SpiceQL/include/memo.h @@ -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; diff --git a/SpiceQL/include/spiceql.h b/SpiceQL/include/spiceql.h index 93034570..c84c9adc 100644 --- a/SpiceQL/include/spiceql.h +++ b/SpiceQL/include/spiceql.h @@ -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" diff --git a/SpiceQL/include/io.h b/SpiceQL/include/spiceql_io.h similarity index 100% rename from SpiceQL/include/io.h rename to SpiceQL/include/spiceql_io.h diff --git a/SpiceQL/src/config.cpp b/SpiceQL/src/config.cpp index d9aeda38..46755d18 100644 --- a/SpiceQL/src/config.cpp +++ b/SpiceQL/src/config.cpp @@ -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(); @@ -150,7 +150,7 @@ namespace SpiceQL { } } - vector> res = getPathsFromRegex(fsDataPath, jsonArrayToVector(eval_json[json_pointer])); + vector> res = getPathsFromRegex(fsDataPath.string(), jsonArrayToVector(eval_json[json_pointer])); eval_json[json_pointer] = res; } copyConfig[pointer] = eval_json; diff --git a/SpiceQL/src/query.cpp b/SpiceQL/src/query.cpp index c2f81efd..e959095d 100644 --- a/SpiceQL/src/query.cpp +++ b/SpiceQL/src/query.cpp @@ -72,9 +72,9 @@ namespace SpiceQL { // Comparator function for kernel paths bool fileNameComp(string a, string b) { - string fna = static_cast(a).filename(); - string fnb = static_cast(b).filename(); - int comp = fna.compare(fnb); + string fna = static_cast(a).filename().string(); + string fnb = static_cast(b).filename().string(); + int comp = fna.compare(fnb); SPDLOG_TRACE("Comparing {} and {}: {}", fna, fnb, comp); return comp < 0; } @@ -85,21 +85,21 @@ namespace SpiceQL { } vector> files = {}; - string extension = static_cast(kernels.at(0)).extension(); + string extension = static_cast(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); @@ -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; } diff --git a/SpiceQL/src/spice_types.cpp b/SpiceQL/src/spice_types.cpp index 1c5478e3..bded7793 100644 --- a/SpiceQL/src/spice_types.cpp +++ b/SpiceQL/src/spice_types.cpp @@ -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); diff --git a/SpiceQL/src/spiceql.cpp b/SpiceQL/src/spiceql.cpp index 89e8eab4..283ca465 100644 --- a/SpiceQL/src/spiceql.cpp +++ b/SpiceQL/src/spiceql.cpp @@ -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; @@ -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()); @@ -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); } } diff --git a/SpiceQL/src/io.cpp b/SpiceQL/src/spiceql_io.cpp similarity index 99% rename from SpiceQL/src/io.cpp rename to SpiceQL/src/spiceql_io.cpp index 0711a6bf..8aad1a41 100644 --- a/SpiceQL/src/io.cpp +++ b/SpiceQL/src/spiceql_io.cpp @@ -5,7 +5,7 @@ #include -#include "io.h" +#include "spiceql_io.h" #include "utils.h" diff --git a/SpiceQL/tests/Fixtures.cpp b/SpiceQL/tests/Fixtures.cpp index a79ffa5b..70740df6 100644 --- a/SpiceQL/tests/Fixtures.cpp +++ b/SpiceQL/tests/Fixtures.cpp @@ -12,7 +12,7 @@ #include #include "utils.h" -#include "io.h" +#include "spiceql_io.h" #include "query.h" #include "inventory.h" diff --git a/SpiceQL/tests/IoTests.cpp b/SpiceQL/tests/IoTests.cpp index f9dc5095..3244a3d1 100644 --- a/SpiceQL/tests/IoTests.cpp +++ b/SpiceQL/tests/IoTests.cpp @@ -2,7 +2,7 @@ #include #include "Fixtures.h" -#include "io.h" +#include "spiceql_io.h" #include "utils.h" #include "api.h" diff --git a/SpiceQL/tests/MemoTests.cpp b/SpiceQL/tests/MemoTests.cpp index 98645865..e66ca6cd 100644 --- a/SpiceQL/tests/MemoTests.cpp +++ b/SpiceQL/tests/MemoTests.cpp @@ -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 diff --git a/bindings/python/io.i b/bindings/python/io.i index decff1ee..3291cc77 100644 --- a/bindings/python/io.i +++ b/bindings/python/io.i @@ -1,7 +1,7 @@ %module(package="pyspiceql") io %{ - #include "io.h" + #include "spiceql_io.h" %} -%include "io.h" \ No newline at end of file +%include "spiceql_io.h" \ No newline at end of file