Skip to content

Commit

Permalink
Commit local changes before updating submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] committed May 6, 2024
1 parent 3600bc2 commit 6db9a53
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 27 deletions.
26 changes: 14 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,25 @@ endif()

find_package(Threads)

# Fetch some OpenMind
# include(FetchContent)
# FetchContent_Declare(openmind
# GIT_REPOSITORY https://github.com/ohhmm/openmind.git
# GIT_TAG main)
# FetchContent_MakeAvailable(openmind)

# Add the libskrypt subdirectory
# Define BOOST_ALL_DYN_LINK to ensure dynamic linking of Boost libraries
add_definitions(-DBOOST_ALL_DYN_LINK)

# Find Boost libraries
find_package(Boost 1.74.0 REQUIRED COMPONENTS filesystem system serialization thread unit_test_framework)

# Include the openmind headers
include_directories(${CMAKE_SOURCE_DIR}/_deps/openmind-src)
include_directories(${CMAKE_SOURCE_DIR}/_deps/openmind-src/omnn)
include_directories(${CMAKE_SOURCE_DIR}/_deps/openmind-src/omnn/math)
include_directories(${CMAKE_SOURCE_DIR}/_deps/openmind-src/omnn/rt)

# Add the libskrypt and openmind subdirectories
add_subdirectory(libskrypt)
add_subdirectory(_deps/openmind-src)

if(BUILD_TESTS OR OPENMIND_BUILD_TESTS)
enable_testing()
add_subdirectory(libskrypt/tests)
endif(BUILD_TESTS OR OPENMIND_BUILD_TESTS)

# OpenMind: traverse subprojects
# fold(libskrypt) # parse libskrypt prior to skrypt
# The 'fold' command is not recognized by CMake and has been commented out to prevent configuration errors

install(DIRECTORY modules DESTINATION modules)
7 changes: 5 additions & 2 deletions libskrypt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ target_include_directories(skrypt PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)

# Add the tests subdirectory
add_subdirectory(tests)
# Link the omnn static library with the skrypt target
target_link_libraries(skrypt PUBLIC omnn)

# The tests subdirectory is added conditionally in the top-level CMakeLists.txt
# add_subdirectory(tests)
10 changes: 5 additions & 5 deletions libskrypt/skrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,31 +365,31 @@ Skrypt::Skrypt(std::istream & stream)
}

boost::filesystem::path Skrypt::FindModulePath(std::string_view name) const {
auto path = sourceFilePath.parent_path() / name;
auto path = sourceFilePath.parent_path() / std::string(name); // Convert std::string_view to std::string
if (!path.has_extension())
path.replace_extension(".skrypt");
if (!boost::filesystem::exists(path)) {
path = path.filename();
}
auto base = boost::dll::program_location();
if (!boost::filesystem::exists(path)) {
path = base.parent_path() / name;
path = base.parent_path() / std::string(name);
if (!path.has_extension())
path.replace_extension(".skrypt");
}

if (!boost::filesystem::exists(path)) {
auto loc = boost::dll::this_line_location();
if (loc != base) {
path = loc.parent_path() / name;
path = loc.parent_path() / std::string(name);
if (!path.has_extension())
path.replace_extension(".skrypt");
}
}

if (!boost::filesystem::exists(path)) {
for (auto& searchPath : moduleFileSearchAdditionalPaths) {
path = searchPath / name;
path = searchPath / std::string(name);
if (!path.has_extension())
path.replace_extension(".skrypt");
if (boost::filesystem::exists(path)) {
Expand Down Expand Up @@ -649,4 +649,4 @@ Skrypt::Skrypt(const skrypt::Skrypt& that)
, sourceFilePath(that.sourceFilePath)
, moduleFileSearchAdditionalPaths(that.moduleFileSearchAdditionalPaths)
{
}
}
2 changes: 1 addition & 1 deletion libskrypt/skrypt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <omnn/rt/tasq.h>
#include "/home/ubuntu/skrypt/_deps/openmind-src/omnn/rt/tasq.h"
#include <omnn/math/System.h>
#include <omnn/math/VarHost.h>

Expand Down
16 changes: 9 additions & 7 deletions libskrypt/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ include_directories(${CMAKE_SOURCE_DIR}/libskrypt)

# Include the openmind headers
include_directories(${CMAKE_SOURCE_DIR}/_deps/openmind-src)
include_directories(${CMAKE_SOURCE_DIR}/_deps/openmind-src/omnn/math)
include_directories(${CMAKE_SOURCE_DIR}/_deps/openmind-src/omnn/rt)

# Specify the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Find the Boost library components
find_package(Boost 1.74.0 REQUIRED COMPONENTS filesystem system serialization)
find_package(Boost 1.74.0 REQUIRED COMPONENTS filesystem system serialization thread unit_test_framework)

# Message to confirm the tests configuration is being processed
message(STATUS "Configuring tests...")
Expand Down Expand Up @@ -83,12 +85,12 @@ target_compile_definitions(ModulesTest PUBLIC
)

# Link test executables with the libskrypt library and necessary Boost components
target_link_libraries(ChemistryTest skrypt Boost::filesystem Boost::system Boost::serialization)
target_link_libraries(ComparisonTest skrypt Boost::filesystem Boost::system Boost::serialization)
target_link_libraries(DisjConjTest skrypt Boost::filesystem Boost::system Boost::serialization)
target_link_libraries(TestExpPrecedence skrypt Boost::filesystem Boost::system Boost::serialization)
target_link_libraries(TestIssue10 skrypt Boost::filesystem Boost::system Boost::serialization)
target_link_libraries(ModulesTest skrypt Boost::filesystem Boost::system Boost::serialization)
target_link_libraries(ChemistryTest skrypt Boost::filesystem Boost::system Boost::serialization Boost::thread Boost::unit_test_framework)
target_link_libraries(ComparisonTest skrypt Boost::filesystem Boost::system Boost::serialization Boost::thread Boost::unit_test_framework)
target_link_libraries(DisjConjTest skrypt Boost::filesystem Boost::system Boost::serialization Boost::thread Boost::unit_test_framework)
target_link_libraries(TestExpPrecedence skrypt Boost::filesystem Boost::system Boost::serialization Boost::thread Boost::unit_test_framework)
target_link_libraries(TestIssue10 skrypt Boost::filesystem Boost::system Boost::serialization Boost::thread Boost::unit_test_framework)
target_link_libraries(ModulesTest skrypt Boost::filesystem Boost::system Boost::serialization Boost::thread Boost::unit_test_framework)

# Register tests with CTest
enable_testing()
Expand Down

0 comments on commit 6db9a53

Please sign in to comment.