From e337ccc50ca3c5c89536669de9074f93b32d380d Mon Sep 17 00:00:00 2001 From: Asd-g <65298684+Asd-g@users.noreply.github.com> Date: Sun, 5 May 2024 02:25:15 +0300 Subject: [PATCH 1/2] Fix Linux building --- CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++--- DoViBaker/DoViBaker.cpp | 2 -- DoViBaker/DoViCubes.cpp | 1 + include/DoViBaker.h | 1 + include/DoViStatsFileLoader.h | 1 + 5 files changed, 49 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5314efc..0baf778 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,16 +40,58 @@ endif() target_compile_features(DoViBaker PRIVATE cxx_std_20) +# graphengine +add_library(graphengine STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/graphengine/graphengine/cpuinfo.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/graphengine/graphengine/graph.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/graphengine/graphengine/node.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/graphengine/graphengine/x86/cpuinfo_x86.cpp +) + +target_include_directories(graphengine PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/graphengine/graphengine + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/graphengine/graphengine/x86 + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/graphengine/include +) + +if (UNIX) + target_compile_options(graphengine PRIVATE "-fPIC") +endif() +# end graphengine + +# timecube +add_library(timecube STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/cube.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/lut.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/timecube.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86/lut_x86.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86/lut_sse41.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86/lut_avx2.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86/lut_avx512.cpp +) + +target_include_directories(timecube PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86 + ${CMAKE_CURRENT_SOURCE_DIR}/timecube/graphengine/include +) + +if (UNIX) + target_compile_options(timecube PRIVATE "-fPIC") +endif() + +target_link_libraries(timecube PRIVATE graphengine) +#end timecube + find_library(dovi dovi) -find_library(timecube timecube) -target_link_libraries(DoViBaker +target_link_libraries(DoViBaker PRIVATE ${dovi} - ${timecube} + timecube ) if (WIN32) - target_link_libraries(DoViBaker + target_link_libraries(DoViBaker PRIVATE ws2_32 bcrypt userenv diff --git a/DoViBaker/DoViBaker.cpp b/DoViBaker/DoViBaker.cpp index 0d2dfef..dd2cd07 100644 --- a/DoViBaker/DoViBaker.cpp +++ b/DoViBaker/DoViBaker.cpp @@ -1,5 +1,3 @@ -#include - #include "DoViBaker.h" ////////////////////////////// diff --git a/DoViBaker/DoViCubes.cpp b/DoViBaker/DoViCubes.cpp index 203d034..9a07074 100644 --- a/DoViBaker/DoViCubes.cpp +++ b/DoViBaker/DoViCubes.cpp @@ -1,4 +1,5 @@ #include "DoViCubes.h" +#include #include AVS_FORCEINLINE void* aligned_malloc(size_t size, size_t align) diff --git a/include/DoViBaker.h b/include/DoViBaker.h index 89712ff..6799677 100644 --- a/include/DoViBaker.h +++ b/include/DoViBaker.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include "DoViProcessor.h" diff --git a/include/DoViStatsFileLoader.h b/include/DoViStatsFileLoader.h index d3d21c0..4c4143d 100644 --- a/include/DoViStatsFileLoader.h +++ b/include/DoViStatsFileLoader.h @@ -2,6 +2,7 @@ #include "avisynth.h" #include #include +#include class DoViStatsFileLoader : public GenericVideoFilter { From c41023b804bff2a9750ffdca7053379e13dd7de6 Mon Sep 17 00:00:00 2001 From: Asd-g <65298684+Asd-g@users.noreply.github.com> Date: Sun, 5 May 2024 02:41:48 +0300 Subject: [PATCH 2/2] CMake: set proper source flags (timecube) --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0baf778..6637dd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,14 @@ target_include_directories(timecube PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/timecube/graphengine/include ) -if (UNIX) +if (MSVC) + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86/lut_avx2.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX2") + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86/lut_avx512.cpp PROPERTIES COMPILE_OPTIONS "/arch:AVX512") +else() + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86/lut_sse41.cpp PROPERTIES COMPILE_OPTIONS "-mfpmath=sse;-msse4.1") + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86/lut_avx2.cpp PROPERTIES COMPILE_OPTIONS "-mavx2;-mfma") + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/timecube/timecube/x86/lut_avx512.cpp PROPERTIES COMPILE_OPTIONS "-mavx512f;-mavx512bw;-mavx512dq;-mavx512vl;-mfma") + target_compile_options(timecube PRIVATE "-fPIC") endif()