Skip to content

Commit

Permalink
Add vcpkg.json file
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhmm committed Nov 23, 2024
1 parent 0a7b921 commit 3fe844c
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: CMake

on: [push, pull_request]
on: [push]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
BUILD_TYPE: Debug

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: OS prerequisites
run: sudo add-apt-repository -y ppa:mhier/libboost-latest && sudo apt update && sudo apt upgrade -y && sudo apt install -y libboost1.83-all-dev libxss-dev libx11-dev libxcb-screensaver0-dev ocl-icd-opencl-dev libopengl-dev freeglut3-dev libleveldb-dev libsnappy-dev libvulkan-dev liblz4-dev libfmt-dev librocksdb-dev libpython3-all-dev libopencl-clang-dev libtbb-dev ninja-build
Expand All @@ -21,7 +21,7 @@ jobs:

- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake ${{github.workspace}} -DOPENMIND_BUILD_SAMPLES=OFF -DOPENMIND_BUILD_TESTS=ON -DOPENMIND_USE_OPENCL=OFF -G "Ninja Multi-Config"
run: cmake ${{github.workspace}} -DOPENMIND_BUILD_SAMPLES=OFF -DOPENMIND_BUILD_TESTS=ON -DOPENMIND_USE_OPENCL=OFF -G "Ninja Multi-Config" -DOPENMIND_USE_VCPKG=NO

- name: Build
working-directory: ${{github.workspace}}/build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ CMakeSettings.json
/enc_temp_folder/
*Cache.solutions
/.idea
/cmake-build-*/
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
cmake_minimum_required (VERSION 3.8)

# Select C++ active standard
enable_language(CXX)
set (CMAKE_CXX_STANDARD 20)
set (CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

option(OPENMIND_DEBUG_CHECKS "Additional debug checks" OFF)
find_package(OpenCL)
option(OPENMIND_USE_OPENCL "OpenCL GPU calculations" ${OpenCL_FOUND})
option(OPENMIND_MATH_USE_LEVELDB_CACHE "DB cache solutions" ON)
set(BOOST_ADDITIONAL_COMPONENTS ${BOOST_ADDITIONAL_COMPONENTS};program_options CACHE VERSION "Boost components" FORCE)
set(BOOST_ADDITIONAL_COMPONENTS ${BOOST_ADDITIONAL_COMPONENTS} program_options)
list(REMOVE_DUPLICATES BOOST_ADDITIONAL_COMPONENTS)
set(BOOST_ADDITIONAL_COMPONENTS ${BOOST_ADDITIONAL_COMPONENTS} CACHE VERSION "Boost components" FORCE)
# Tell OpenMind to use any boost version installed in the system if any
if(Boost_FOUND)
set(OPENMIND_REQUIRED_BOOST_VERSION ${Boost_VERSION_STRING} CACHE VERSION "Boost library version to use" FORCE)
Expand All @@ -35,7 +36,7 @@ FetchContent_Declare(openmind
FetchContent_MakeAvailable(openmind)

if(BUILD_TESTS OR OPENMIND_BUILD_TESTS)
enable_testing()
enable_testing()
endif(BUILD_TESTS OR OPENMIND_BUILD_TESTS)

# OpenMind: traverse subprojects
Expand Down
28 changes: 14 additions & 14 deletions libskrypt/skrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ namespace {

void Skrypt::ProcessQuestionLine(std::string_view& line)
{
Valuable::YesNoMaybe is = Valuable::YesNoMaybe::Maybe;
YesNoMaybe is = YesNoMaybe::Maybe;
auto questionless = Questionless(line);
if (questionless.empty()) {
PrintAllKnowns();
Expand All @@ -173,29 +173,29 @@ void Skrypt::ProcessQuestionLine(std::string_view& line)

if (expression.IsSimple() == constants::zero) {
if (expression == constants::zero)
is = Valuable::YesNoMaybe::Yes;
is = YesNoMaybe::Yes;
else if (expression.Distinct().contains(constants::zero)) {
std::cout << "potentially ";
is = Valuable::YesNoMaybe::Yes;
is = YesNoMaybe::Yes;
}
else {
is = Valuable::YesNoMaybe::No;
is = YesNoMaybe::No;
}
} else if (knowns.size()) {
expression.eval(knowns);
expression.optimize();
if (expression.IsInt()) {
if (expression == 0) {
is = Valuable::YesNoMaybe::Yes;
is = YesNoMaybe::Yes;
} else {
is = Valuable::YesNoMaybe::No;
is = YesNoMaybe::No;
}
} else if (expression.IsSimple()) {
if (expression.Distinct().contains(constants::zero)) {
std::cout << "not neccessarily, but ";
is = Valuable::YesNoMaybe::Yes;
is = YesNoMaybe::Yes;
} else {
is = Valuable::YesNoMaybe::No;
is = YesNoMaybe::No;
}
} else {
IMPLEMENT
Expand All @@ -218,33 +218,33 @@ void Skrypt::ProcessQuestionLine(std::string_view& line)
if (rest.IsSum()) {
auto restGrade = rest.as<Sum>().FillPolyCoeff(coefficients, va);
if (totalGrade == restGrade + lineGrade)
is = Valuable::YesNoMaybe::Yes;
is = YesNoMaybe::Yes;
}
} else if (expression.IsVa()) {
auto solutions = Solve(expression.as<Variable>());
if (solutions.size() == 1) {
if (solutions.cbegin()->operator==(0))
is = Valuable::YesNoMaybe::Yes;
is = YesNoMaybe::Yes;
}
}
} else {
IMPLEMENT
}
} else if (total == constants::zero) {
} else if (total.IsInt()) {
is = Valuable::YesNoMaybe::No;
is = YesNoMaybe::No;
} else {
IMPLEMENT
}
}
catch (...) {
is = Valuable::YesNoMaybe::Maybe;
is = YesNoMaybe::Maybe;
}

std::cout << '\n' << expression << " ?\n";
if (is == Valuable::YesNoMaybe::Yes)
if (is == YesNoMaybe::Yes)
std::cout << "YES";
else if (is == Valuable::YesNoMaybe::No)
else if (is == YesNoMaybe::No)
std::cout << "NO";
else
std::cout << "IDK";
Expand Down
2 changes: 1 addition & 1 deletion libskrypt/skrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Skrypt

using module_t = std::shared_ptr<Skrypt>;
using modules_t = std::map<std::string_view, module_t>;
using loading_module_t = std::future<module_t>;
using loading_module_t = std::shared_future<module_t>;
using loading_modules_t = std::map<std::string_view, loading_module_t>;
using loading_modules_future_t = std::future<loading_modules_t>;

Expand Down
2 changes: 1 addition & 1 deletion libskrypt/tests/Comparison.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define BOOST_TEST_MODULE comparison test
#define BOOST_TEST_MODULE Comparison test
#include <boost/test/unit_test.hpp>
#include "skrypt.h"

Expand Down
33 changes: 33 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"builtin-baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da",
"name": "skrypt",
"version": "1.0.0",
"description": "Sergii Kryvonos Relation Yarn Plausibility Tool",
"dependencies": [
"boost",
"boost-chrono",
"boost-compute",
"boost-date-time",
"boost-dll",
"boost-filesystem",
"boost-iostreams",
"boost-locale",
"boost-multiprecision",
"boost-program-options",
"boost-serialization",
"boost-system",
"boost-test",
"boost-thread",
"boost-uuid",
"leveldb",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

0 comments on commit 3fe844c

Please sign in to comment.