Skip to content

Commit

Permalink
Oh what fun, msvc 2019 on the ci
Browse files Browse the repository at this point in the history
  • Loading branch information
alxvth committed Oct 9, 2024
1 parent c03cb83 commit b8419e9
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 71 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ add_subdirectory(ExampleTransformation)
add_subdirectory(ExampleLoader)
add_subdirectory(ExampleWriter)
add_subdirectory(ExampleData)
add_subdirectory(ExampleDependencies)
# add_subdirectory(ExampleDependencies)
4 changes: 0 additions & 4 deletions ExampleAnalysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ set(PLUGIN_SOURCES
src/ExampleAnalysisPlugin.json
)

set(PLUGIN_MOC_HEADERS
src/ExampleAnalysisPlugin.h
)

source_group( Plugin FILES ${PLUGIN_SOURCES})

# -----------------------------------------------------------------------------
Expand Down
25 changes: 13 additions & 12 deletions ExampleDependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
endif(MSVC)

include(cmake/get_cpm.cmake)
# include(cmake/get_cpm.cmake)

# -----------------------------------------------------------------------------
# Dependencies
Expand All @@ -30,20 +30,20 @@ find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED)

find_package(ManiVault COMPONENTS Core PointData CONFIG)

find_package(blake3 CONFIG REQUIRED)
# find_package(blake3 CONFIG REQUIRED)

if(NOT APPLE)
include(cmake/ci_fixes.cmake)
find_package(faiss CONFIG REQUIRED)
endif()

CPMAddPackage(
NAME highway
URL https://github.com/google/highway/archive/refs/tags/1.2.0.tar.gz
URL_HASH SHA256=7e0be78b8318e8bdbf6fa545d2ecb4c90f947df03f7aadc42c1967f019e63343
PATCHES "cmake/highway.patch" # see https://github.com/conan-io/conan-center-index/pull/24197/files, fixes https://github.com/google/highway/issues/2225
OPTIONS "HWY_ENABLE_EXAMPLES OFF" "HWY_ENABLE_INSTALL OFF" "HWY_ENABLE_TESTS OFF" "HWY_ENABLE_CONTRIB ON" "BUILD_SHARED_LIBS ON"
)
# CPMAddPackage(
# NAME highway
# URL https://github.com/google/highway/archive/refs/tags/1.2.0.tar.gz
# URL_HASH SHA256=7e0be78b8318e8bdbf6fa545d2ecb4c90f947df03f7aadc42c1967f019e63343
# PATCHES "cmake/highway.patch" # see https://github.com/conan-io/conan-center-index/pull/24197/files, fixes https://github.com/google/highway/issues/2225
# OPTIONS "HWY_ENABLE_EXAMPLES OFF" "HWY_ENABLE_INSTALL OFF" "HWY_ENABLE_TESTS OFF" "HWY_ENABLE_CONTRIB ON" "BUILD_SHARED_LIBS ON"
# )

# -----------------------------------------------------------------------------
# Source files
Expand Down Expand Up @@ -93,8 +93,8 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::WebEngineWidgets)
target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::Core)
target_link_libraries(${PROJECT_NAME} PRIVATE ManiVault::PointData)

target_link_libraries(${PROJECT_NAME} PRIVATE BLAKE3::blake3)
target_link_libraries(${PROJECT_NAME} PRIVATE hwy hwy_contrib)
# target_link_libraries(${PROJECT_NAME} PRIVATE BLAKE3::blake3)
# target_link_libraries(${PROJECT_NAME} PRIVATE hwy hwy_contrib)

if(NOT APPLE)
target_link_libraries(${PROJECT_NAME} PRIVATE faiss)
Expand Down Expand Up @@ -124,7 +124,8 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
)

# Automatically available when using find_package(ManiVault)
mv_install_dependencies(${PROJECT_NAME} "hwy" "hwy_contrib")
#mv_install_dependencies(${PROJECT_NAME} "hwy" "hwy_contrib")
mv_install_dependencies(${PROJECT_NAME})

# -----------------------------------------------------------------------------
# Miscellaneous
Expand Down
40 changes: 20 additions & 20 deletions ExampleDependencies/src/ExampleDependenciesPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include <stdio.h>
#include <vector>

#include <hwy/contrib/sort/order.h>
#include <hwy/contrib/sort/vqsort.h>

#include <blake3.h>
//#include <hwy/contrib/sort/order.h>
//#include <hwy/contrib/sort/vqsort.h>
//
//#include <blake3.h>

#if !defined(__APPLE__)
#include <faiss/IndexFlat.h>
Expand Down Expand Up @@ -53,9 +53,9 @@ void ExampleDependenciesPlugin::init()

void ExampleDependenciesPlugin::compute()
{
std::cout << "ExampleDependenciesPlugin: Startin..." << std::endl;
std::cout << "ExampleDependenciesPlugin: Starting..." << std::endl;

std::cout << "ExampleDependenciesPlugin: Using blake version: " << blake3_version() << std::endl;
//std::cout << "ExampleDependenciesPlugin: Using blake version: " << blake3_version() << std::endl;

auto printData = [](const std::vector<float>& vec, size_t dims, size_t points) {
for (size_t dim = 0; dim < dims; dim++)
Expand All @@ -81,11 +81,11 @@ void ExampleDependenciesPlugin::compute()
std::cout << "ExampleDependenciesPlugin: Data before sorting" << std::endl;
printData(data, numDims, numPoints);

for (size_t dim = 0; dim < numDims; dim++)
{
size_t offset = numPoints * dim;
hwy::VQSort(data.data() + offset, numPoints, hwy::SortAscending{});
}
//for (size_t dim = 0; dim < numDims; dim++)
//{
// size_t offset = numPoints * dim;
// hwy::VQSort(data.data() + offset, numPoints, hwy::SortAscending{});
//}

std::cout << "ExampleDependenciesPlugin: Data after sorting" << std::endl;
printData(data, numDims, numPoints);
Expand All @@ -96,19 +96,19 @@ void ExampleDependenciesPlugin::compute()
events().notifyDatasetDataChanged(outputPoints);

// Create hash
blake3_hasher hasher;
blake3_hasher_init(&hasher);
//blake3_hasher hasher;
//blake3_hasher_init(&hasher);

blake3_hasher_update(&hasher, data.data(), data.size());
//blake3_hasher_update(&hasher, data.data(), data.size());

uint8_t output[BLAKE3_OUT_LEN];
blake3_hasher_finalize(&hasher, output, BLAKE3_OUT_LEN);
//uint8_t output[BLAKE3_OUT_LEN];
//blake3_hasher_finalize(&hasher, output, BLAKE3_OUT_LEN);

// Print the hash as hexadecimal
for (size_t i = 0; i < BLAKE3_OUT_LEN; i++) {
printf("%02x", output[i]);
}
printf("\n");
//for (size_t i = 0; i < BLAKE3_OUT_LEN; i++) {
// printf("%02x", output[i]);
//}
//printf("\n");

#if !defined(__APPLE__)
// find knn
Expand Down
6 changes: 3 additions & 3 deletions ExampleDependencies/src/ExampleDependenciesPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ class ExampleDependenciesPluginFactory : public AnalysisPluginFactory
/** Destructor */
~ExampleDependenciesPluginFactory() override {}

/** Creates an instance of the example analysis plugin */
/** Creates an instance of the example dependencies plugin */
AnalysisPlugin* produce() override;

/** Returns the data types that are supported by the example analysis plugin */
/** Returns the data types that are supported by the example dependencies plugin */
mv::DataTypes supportedDataTypes() const override;

/** Enable right-click on data set to open analysis */
/** Enable right-click on data set to open dependencies */
PluginTriggerActions getPluginTriggerActions(const mv::Datasets& datasets) const override;
};
5 changes: 0 additions & 5 deletions ExampleLoader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ set(PLUGIN_SOURCES
src/ExampleLoaderPlugin.json
)

set(PLUGIN_MOC_HEADERS
src/ExampleLoaderPlugin.h
)

source_group( Plugin FILES ${PLUGIN_SOURCES})

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -98,7 +94,6 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
# Miscellaneous
# -----------------------------------------------------------------------------
# Automatically set the debug environment (command + working directory) for MSVC
# Automatically set the debug environment (command + working directory) for MSVC
if(MSVC)
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $<IF:$<CONFIG:DEBUG>,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>)
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $<IF:$<CONFIG:DEBUG>,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>)
Expand Down
2 changes: 1 addition & 1 deletion ExampleLoader/src/ExampleLoaderPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <random>

Q_PLUGIN_METADATA(IID "nl.tudelft.ExampleLoaderPlugin")
Q_PLUGIN_METADATA(IID "studio.manivault.ExampleLoaderPlugin")

using namespace mv;

Expand Down
3 changes: 2 additions & 1 deletion ExampleLoader/src/ExampleLoaderPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using namespace mv::plugin;
class ExampleLoaderPlugin : public LoaderPlugin
{
Q_OBJECT

public:
ExampleLoaderPlugin(const PluginFactory* factory);
~ExampleLoaderPlugin(void) override;
Expand All @@ -32,7 +33,7 @@ class ExampleLoaderPluginFactory : public LoaderPluginFactory
{
Q_INTERFACES(mv::plugin::LoaderPluginFactory mv::plugin::PluginFactory)
Q_OBJECT
Q_PLUGIN_METADATA(IID "nl.tudelft.ExampleLoaderPlugin"
Q_PLUGIN_METADATA(IID "studio.manivault.ExampleLoaderPlugin"
FILE "ExampleLoaderPlugin.json")

public:
Expand Down
8 changes: 2 additions & 6 deletions ExampleTransformation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ set(PLUGIN_SOURCES
src/ExampleTransformationPlugin.json
)

set(PLUGIN_MOC_HEADERS
src/ExampleTransformationPlugin.h
)

source_group( Plugin FILES ${PLUGIN_SOURCES})

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -99,6 +95,6 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
# -----------------------------------------------------------------------------
# Automatically set the debug environment (command + working directory) for MSVC
if(MSVC)
set_property(TARGET ${EXAMPLETRANSFORMATION} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $<IF:$<CONFIG:DEBUG>,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>)
set_property(TARGET ${EXAMPLETRANSFORMATION} PROPERTY VS_DEBUGGER_COMMAND $<IF:$<CONFIG:DEBUG>,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>)
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $<IF:$<CONFIG:DEBUG>,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>)
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_COMMAND $<IF:$<CONFIG:DEBUG>,${ManiVault_INSTALL_DIR}/debug/ManiVault\ Studio.exe,${ManiVault_INSTALL_DIR}/release/ManiVault\ Studio.exe>)
endif()
4 changes: 2 additions & 2 deletions ExampleTransformation/src/ExampleTransformationPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ using namespace mv::plugin;
*/
class ExampleTransformationPlugin : public TransformationPlugin
{
Q_OBJECT
Q_OBJECT

public:

/** Define the transformation options */
enum class Type {
Abs, /** abosulte value */
Abs, /** absolute value */
Pow2 /** value squared */
};

Expand Down
4 changes: 0 additions & 4 deletions ExampleViewJS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ set(PLUGIN_SOURCES
src/ExampleViewJSPlugin.json
)

set(PLUGIN_MOC_HEADERS
src/ExampleViewJSPlugin.h
)

set(WEB
res/example_chart/radar_chart.html
res/example_chart/radar_chart.tools.js
Expand Down
4 changes: 0 additions & 4 deletions ExampleViewOpenGL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ set(PLUGIN_SOURCES
src/ExampleViewGLPlugin.json
)

set(PLUGIN_MOC_HEADERS
src/ExampleViewGLPlugin.h
)

set(PLUGIN_WIDGETS
src/ExampleGLWidget.h
src/ExampleGLWidget.cpp
Expand Down
4 changes: 0 additions & 4 deletions ExampleWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ set(PLUGIN_SOURCES
src/ExampleWriterPlugin.json
)

set(PLUGIN_MOC_HEADERS
src/ExampleWriterPlugin.h
)

source_group( Plugin FILES ${PLUGIN_SOURCES})

# -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion ExampleWriter/src/ExampleWriterPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <fstream>
#include <filesystem>

Q_PLUGIN_METADATA(IID "nl.tudelft.ExampleWriterPlugin")
Q_PLUGIN_METADATA(IID "studio.manivault.ExampleWriterPlugin")

using namespace mv;

Expand Down
2 changes: 1 addition & 1 deletion ExampleWriter/src/ExampleWriterPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ExampleWriterPluginFactory : public WriterPluginFactory
{
Q_INTERFACES(mv::plugin::WriterPluginFactory mv::plugin::PluginFactory)
Q_OBJECT
Q_PLUGIN_METADATA(IID "nl.tudelft.ExampleWriterPlugin"
Q_PLUGIN_METADATA(IID "studio.manivault.ExampleWriterPlugin"
FILE "ExampleWriterPlugin.json")

public:
Expand Down
7 changes: 5 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def generate(self):

tc = CMakeToolchain(self, generator=generator)

tc.variables["CMAKE_CXX_STANDARD_REQUIRED"] = "ON"
if self.settings.os == "Windows" and self.options.shared:
tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True
if self.settings.os == "Linux" or self.settings.os == "Macos":
tc.variables["CMAKE_CXX_STANDARD_REQUIRED"] = "ON"

# Use the Qt provided .cmake files
qt_path = pathlib.Path(self.deps_cpp_info["qt"].rootpath)
Expand All @@ -105,7 +108,7 @@ def generate(self):
print("ManiVault_DIR: ", self.manivault_dir)

# Set some build options
tc.variables["MV_UNITY_BUILD"] = "ON"
#tc.variables["MV_UNITY_BUILD"] = "ON"

# Install vcpkg dependencies
if os.environ.get("VCPKG_ROOT", None):
Expand Down

0 comments on commit b8419e9

Please sign in to comment.