nrkno / sofie-casparcg-server

Sofie-specific fork of CasparCG Server: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
GNU General Public License v3.0
34 stars 8 forks source link

Building on Ubuntu 20.04 LTS #48

Closed dimitry-ishenko closed 2 years ago

dimitry-ishenko commented 3 years ago

Trying to build the server using the set-variables-and-build-linux.sh script inside build-scripts fails miserably.

Things I've run into so far:

I can work through some of these issues, but I am wondering how far this rabbit hole leads and if there is interest in having Linux version of the server.

I've recently upgraded to 2.3.0, but found out they've gutted framerate producer from it, so I am looking at alternatives.

dimitry-ishenko commented 3 years ago

The following patch takes care of all compilation issues:

diff --git a/accelerator/accelerator.cpp b/accelerator/accelerator.cpp
index cda8f08..aaa155b 100644
--- a/accelerator/accelerator.cpp
+++ b/accelerator/accelerator.cpp
@@ -26,7 +26,7 @@ struct accelerator::impl
    {
    }

-   std::unique_ptr<core::image_mixer> create_image_mixer(const int channel_id)
+   spl::unique_ptr<core::image_mixer> create_image_mixer(const int channel_id)
    {
        try
        {
@@ -37,7 +37,7 @@ struct accelerator::impl
                if(!ogl_device_)
                    ogl_device_.reset(new ogl::device());

-               return std::make_unique<ogl::image_mixer>(
+               return spl::make_unique<ogl::image_mixer>(
                        spl::make_shared_ptr(ogl_device_),
                        env::properties().get(L"configuration.mixer.blend-modes", false),
                        env::properties().get(L"configuration.mixer.straight-alpha", false),
@@ -50,7 +50,7 @@ struct accelerator::impl
            if(path_ == L"gpu" || path_ == L"ogl")
                CASPAR_LOG_CURRENT_EXCEPTION();
        }
-       return std::make_unique<cpu::image_mixer>(channel_id);
+       return spl::make_unique<cpu::image_mixer>(channel_id);
    }
 };

@@ -63,7 +63,7 @@ accelerator::~accelerator()
 {
 }

-std::unique_ptr<core::image_mixer> accelerator::create_image_mixer(const int channel_id)
+spl::unique_ptr<core::image_mixer> accelerator::create_image_mixer(const int channel_id)
 {
    return impl_->create_image_mixer(channel_id);
 }
diff --git a/accelerator/accelerator.h b/accelerator/accelerator.h
index 6ac03ea..2a0cd2d 100644
--- a/accelerator/accelerator.h
+++ b/accelerator/accelerator.h
@@ -16,7 +16,7 @@ public:
    accelerator(const std::wstring& path, const core::video_format_repository format_repository);
    ~accelerator();

-   std::unique_ptr<core::image_mixer> create_image_mixer(int channel_id);
+   spl::unique_ptr<core::image_mixer> create_image_mixer(int channel_id);

    std::shared_ptr<ogl::device> get_ogl_device() const;
 private:
@@ -24,4 +24,4 @@ private:
    spl::unique_ptr<impl> impl_;
 };

-}}
\ No newline at end of file
+}}
diff --git a/dependencies64/cef/linux/libcef_dll/CMakeLists.txt b/dependencies64/cef/linux/libcef_dll/CMakeLists.txt
index e36196c..ec2d81a 100644
--- a/dependencies64/cef/linux/libcef_dll/CMakeLists.txt
+++ b/dependencies64/cef/linux/libcef_dll/CMakeLists.txt
@@ -17,6 +17,12 @@ endmacro()

 set(CEF_TARGET libcef_dll_wrapper)

+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+  list(APPEND CEF_CXX_COMPILER_FLAGS
+    -Wno-attributes             # The cfi-icall attribute is not supported by the GNU C++ compiler
+    )
+endif()
+
 set(LIBCEF_SRCS
   ptr_util.h
   transfer_util.cc
diff --git a/modules/decklink/consumer/decklink_consumer.cpp b/modules/decklink/consumer/decklink_consumer.cpp
index f782a50..7ef9101 100644
--- a/modules/decklink/consumer/decklink_consumer.cpp
+++ b/modules/decklink/consumer/decklink_consumer.cpp
@@ -196,7 +196,7 @@ class decklink_timecode : public IDeckLinkTimecode
         return S_OK;
     }

-    HRESULT GetString(BSTR* timecode) override { return S_FALSE; }
+    HRESULT GetString(const char** timecode) override { return S_FALSE; }

     BMDTimecodeFlags GetFlags() override { return flags_; }

@@ -583,7 +583,7 @@ struct decklink_consumer

             if (result == bmdOutputFrameDisplayedLate) {
                 std::wstring str = print() + L" late scheduled=" + boost::lexical_cast<std::wstring>(video_scheduled_) + L"*";
-                long long timestamp = 0;
+                long timestamp = 0;
                 double speed = 0;
                 if (SUCCEEDED(output_->GetScheduledStreamTime(format_desc_.time_scale, &timestamp, &speed))) {
                     str += L" decklink=" + boost::lexical_cast<std::wstring>(timestamp);
@@ -595,7 +595,7 @@ struct decklink_consumer
                 audio_scheduled_ += dframe->audio_data().size() / in_channel_layout_.num_channels;
             } else if (result == bmdOutputFrameDropped) {
                 std::wstring str = print() + L" dropped scheduled=" + boost::lexical_cast<std::wstring>(video_scheduled_) + L"*";
-                long long timestamp = 0;
+                long timestamp = 0;
                 double speed = 0;
                 if (SUCCEEDED(output_->GetScheduledStreamTime(format_desc_.time_scale, &timestamp, &speed))) {
                     str += L" decklink=" + boost::lexical_cast<std::wstring>(timestamp);
dimitry-ishenko commented 3 years ago

But now I get this error:

[ 98%] Built target protocol
Error copying file "/opt/server/dependencies64/glew/bin/linux/libGLEW.so.1.12" to "/opt/server/build/shell/./".
make[2]: *** [shell/CMakeFiles/casparcg_copy_dependencies.dir/build.make:58: casparcg_copy_dependencies] Error 1
make[1]: *** [CMakeFiles/Makefile2:752: shell/CMakeFiles/casparcg_copy_dependencies.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

At 98% done... that's a bit of a gut punch :smirk:

Has someone gutted Linux binaries from the dependencies64?... :open_mouth:

dimitry-ishenko commented 3 years ago

@Julusian ahem... I see what you did there... 90b4684f3e1b0bfd497511a0cb30776904cdca2c

commit 90b4684f3e1b0bfd497511a0cb30776904cdca2c
Author: Julian Waller <julian@superfly.tv>
Date:   Thu Jun 27 16:23:54 2019 +0100

    feat: Some opengl performance improvements and logging. Better logging when a frame takes too long. Optionally preallocate buffers in config to help ensure smoother performance

 accelerator/ogl/image/image_mixer.cpp           |    2 +-
 accelerator/ogl/util/buffer.cpp                 |   58 +-
 accelerator/ogl/util/buffer.h                   |    5 +-
 accelerator/ogl/util/device.cpp                 |   99 ++-
 accelerator/ogl/util/device.h                   |    4 +-
 accelerator/ogl/util/texture.cpp                |    7 +-
 core/consumer/output.cpp                        |    4 +
 core/mixer/mixer.cpp                            |    4 +
 core/producer/stage.cpp                         |    4 +
 core/video_channel.cpp                          |    3 +
 dependencies64/glew/bin/win32/glew32.dll        |  Bin 343040 -> 422912 bytes
 dependencies64/glew/bin/win32/glewinfo.exe      |  Bin 378368 -> 539648 bytes
 dependencies64/glew/include/GL/eglew.h          | 2618 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 dependencies64/glew/include/GL/glew.h           | 4641 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 dependencies64/glew/include/GL/glxew.h          |   84 +--
 dependencies64/glew/include/GL/wglew.h          |   69 +-
 dependencies64/glew/lib/linux/libGLEW.so        |    1 -
 dependencies64/glew/lib/linux/libGLEW.so.1.12   |    1 -
 dependencies64/glew/lib/linux/libGLEW.so.1.12.0 |  Bin 757960 -> 0 bytes
 dependencies64/glew/lib/win32/glew32.lib        |  Bin 504054 -> 701288 bytes
 protocol/amcp/AMCPCommandsImpl.cpp              |    9 +-
 shell/server.cpp                                |   42 ++
 22 files changed, 7328 insertions(+), 327 deletions(-)

@Julusian do you remember why the Linux binaries were removed? Should I try putting them back in?

dimitry-ishenko commented 3 years ago

It looks like it's not just GL binaries, but also FFmpeg and several other packages. I've been haxxoring the CMakeFiles to build with system-provided packages and it's getting to be a mess... :confused:

Here is my work-in-progress:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 41ce754..3076c03 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,14 +22,38 @@ set(DEPENDENCIES_FOLDER         "${PROJECT_SOURCE_DIR}/dependencies64")
 set(BOOST_INCLUDE_PATH         "${DEPENDENCIES_FOLDER}/boost")
 set(RXCPP_INCLUDE_PATH         "${DEPENDENCIES_FOLDER}/RxCpp/include")
 set(TBB_INCLUDE_PATH           "${DEPENDENCIES_FOLDER}/tbb/include")
-set(GLEW_INCLUDE_PATH          "${DEPENDENCIES_FOLDER}/glew/include")
-set(SFML_INCLUDE_PATH          "${DEPENDENCIES_FOLDER}/sfml/include")
-set(FREETYPE_INCLUDE_PATH      "${DEPENDENCIES_FOLDER}/freetype/include")

 if (MSVC)
+   set(GLEW_INCLUDE_PATH       "${DEPENDENCIES_FOLDER}/glew/include")
+   set(SFML_INCLUDE_PATH       "${DEPENDENCIES_FOLDER}/sfml/include")
+   set(FREETYPE_INCLUDE_PATH   "${DEPENDENCIES_FOLDER}/freetype/include")
+   set(FREEIMAGE_INCLUDE_PATH  "${DEPENDENCIES_FOLDER}/freeimage/include")
+   set(OPENAL_INCLUDE_PATH     "${DEPENDENCIES_FOLDER}/openal/include")
    set(FFMPEG_INCLUDE_PATH     "${DEPENDENCIES_FOLDER}/ffmpeg/win32/include")
 else ()
-   set(FFMPEG_INCLUDE_PATH     "${DEPENDENCIES_FOLDER}/ffmpeg/include")
+   #find_package(Boost 1.67 REQUIRED COMPONENTS chrono date_time filesystem locale log regex system thread)
+   #set(BOOST_INCLUDE_PATH     ${Boost_INCLUDE_DIRS})
+
+   find_package(PkgConfig REQUIRED)
+
+   pkg_check_modules(GLEW REQUIRED glew)
+   set(GLEW_INCLUDE_PATH       ${GLEW_INCLUDE_DIRS})
+
+   pkg_check_modules(SFML REQUIRED sfml-all)
+   set(SFML_INCLUDE_PATH       ${SFML_INCLUDE_DIRS})
+
+   pkg_check_modules(FREETYPE REQUIRED freetype2)
+   set(FREETYPE_INCLUDE_PATH   ${FREETYPE_INCLUDE_DIRS})
+
+   #pkg_check_modules(FREEIMAGE REQUIRED freeimage)
+   #set(FREEIMAGE_INCLUDE_PATH ${FREEIMAGE_INCLUDE_DIRS})
+   set(FREEIMAGE_INCLUDE_PATH  "")
+
+   pkg_check_modules(OPENAL REQUIRED openal)
+   set(OPENAL_INCLUDE_PATH     ${OPENAL_INCLUDE_DIRS})
+
+   pkg_check_modules(FFMPEG REQUIRED libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale)
+   set(FFMPEG_INCLUDE_PATH     ${FFMPEG_INCLUDE_DIRS})
 endif ()

 if (MSVC)
@@ -38,8 +62,6 @@ elseif (CMAKE_COMPILER_IS_GNUCXX)
    set(PLATFORM_FOLDER_NAME    "linux")
 endif ()

-set(FREEIMAGE_INCLUDE_PATH     "${DEPENDENCIES_FOLDER}/freeimage/include")
-set(OPENAL_INCLUDE_PATH            "${DEPENDENCIES_FOLDER}/openal/include")
 set(BLUEFISH_INCLUDE_PATH      "${DEPENDENCIES_FOLDER}/bluefish/include")
 set(CEF_INCLUDE_PATH           "${DEPENDENCIES_FOLDER}/cef/${PLATFORM_FOLDER_NAME}/include")
 set(GTEST_INCLUDE_PATH         "${DEPENDENCIES_FOLDER}/gtest/include")
@@ -56,14 +78,18 @@ set(CEF_RESOURCE_PATH           "${DEPENDENCIES_FOLDER}/cef/${PLATFORM_FOLDER_NAME}/Reso

 link_directories("${DEPENDENCIES_FOLDER}/boost/stage/lib/${PLATFORM_FOLDER_NAME}")
 link_directories("${DEPENDENCIES_FOLDER}/tbb/lib/${PLATFORM_FOLDER_NAME}")
-link_directories("${DEPENDENCIES_FOLDER}/glew/lib/${PLATFORM_FOLDER_NAME}")
-link_directories("${DEPENDENCIES_FOLDER}/sfml/lib/${PLATFORM_FOLDER_NAME}")
-link_directories("${DEPENDENCIES_FOLDER}/sfml/extlibs/lib")
-link_directories("${DEPENDENCIES_FOLDER}/freetype/objs/win32/vc2010")
-link_directories("${DEPENDENCIES_FOLDER}/ffmpeg/win32/lib")
 link_directories("${DEPENDENCIES_FOLDER}/asmlib")
-link_directories("${DEPENDENCIES_FOLDER}/freeimage/lib/${PLATFORM_FOLDER_NAME}")
-link_directories("${DEPENDENCIES_FOLDER}/openal/lib/${PLATFORM_FOLDER_NAME}")
+
+if (MSVC)
+   link_directories("${DEPENDENCIES_FOLDER}/glew/lib/${PLATFORM_FOLDER_NAME}")
+   link_directories("${DEPENDENCIES_FOLDER}/sfml/lib/${PLATFORM_FOLDER_NAME}")
+   link_directories("${DEPENDENCIES_FOLDER}/sfml/extlibs/lib")
+   link_directories("${DEPENDENCIES_FOLDER}/freetype/objs/win32/vc2010")
+   link_directories("${DEPENDENCIES_FOLDER}/ffmpeg/win32/lib")
+   link_directories("${DEPENDENCIES_FOLDER}/freeimage/lib/${PLATFORM_FOLDER_NAME}")
+   link_directories("${DEPENDENCIES_FOLDER}/openal/lib/${PLATFORM_FOLDER_NAME}")
+endif ()
+
 link_directories("${DEPENDENCIES_FOLDER}/bluefish/lib")
 link_directories("${DEPENDENCIES_FOLDER}/zlib/lib")
 link_directories("${DEPENDENCIES_FOLDER}/gtest/lib/${PLATFORM_FOLDER_NAME}")
@@ -93,9 +119,11 @@ elseif (CMAKE_COMPILER_IS_GNUCXX)
    add_compile_options( -mssse3 )
    add_compile_options( -msse4.1 )
    add_compile_options( -pthread )
-   add_compile_options( -fPIC )
+   #add_compile_options( -fPIC )
    add_compile_options( -fnon-call-exceptions ) # Allow signal handler to throw exception
    add_definitions( -DBOOST_NO_SWPRINTF ) # swprintf on Linux seems to always use , as decimal point regardless of C-locale or C++-locale
+   add_compile_options( -Wno-deprecated-declarations )
+   add_compile_options( -Wno-return-type )
 endif ()

 if (POLICY CMP0045)
diff --git a/accelerator/accelerator.cpp b/accelerator/accelerator.cpp
index cda8f08..aaa155b 100644
--- a/accelerator/accelerator.cpp
+++ b/accelerator/accelerator.cpp
@@ -26,7 +26,7 @@ struct accelerator::impl
    {
    }

-   std::unique_ptr<core::image_mixer> create_image_mixer(const int channel_id)
+   spl::unique_ptr<core::image_mixer> create_image_mixer(const int channel_id)
    {
        try
        {
@@ -37,7 +37,7 @@ struct accelerator::impl
                if(!ogl_device_)
                    ogl_device_.reset(new ogl::device());

-               return std::make_unique<ogl::image_mixer>(
+               return spl::make_unique<ogl::image_mixer>(
                        spl::make_shared_ptr(ogl_device_),
                        env::properties().get(L"configuration.mixer.blend-modes", false),
                        env::properties().get(L"configuration.mixer.straight-alpha", false),
@@ -50,7 +50,7 @@ struct accelerator::impl
            if(path_ == L"gpu" || path_ == L"ogl")
                CASPAR_LOG_CURRENT_EXCEPTION();
        }
-       return std::make_unique<cpu::image_mixer>(channel_id);
+       return spl::make_unique<cpu::image_mixer>(channel_id);
    }
 };

@@ -63,7 +63,7 @@ accelerator::~accelerator()
 {
 }

-std::unique_ptr<core::image_mixer> accelerator::create_image_mixer(const int channel_id)
+spl::unique_ptr<core::image_mixer> accelerator::create_image_mixer(const int channel_id)
 {
    return impl_->create_image_mixer(channel_id);
 }
diff --git a/accelerator/accelerator.h b/accelerator/accelerator.h
index 6ac03ea..2a0cd2d 100644
--- a/accelerator/accelerator.h
+++ b/accelerator/accelerator.h
@@ -16,7 +16,7 @@ public:
    accelerator(const std::wstring& path, const core::video_format_repository format_repository);
    ~accelerator();

-   std::unique_ptr<core::image_mixer> create_image_mixer(int channel_id);
+   spl::unique_ptr<core::image_mixer> create_image_mixer(int channel_id);

    std::shared_ptr<ogl::device> get_ogl_device() const;
 private:
@@ -24,4 +24,4 @@ private:
    spl::unique_ptr<impl> impl_;
 };

-}}
\ No newline at end of file
+}}
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 77437dc..a658c80 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -139,19 +139,16 @@ else ()
        tbb
        tbbmalloc
        tbbmalloc_proxy
-       sfml-graphics-s
-       sfml-window-s
-       sfml-system-s
-       GLEW
-       GL
        X11
-       jpeg
-       sndfile
-       freetype
-       udev
-       Xrandr
+#      jpeg
+#      sndfile
+#      udev
+#      Xrandr
        pthread
    )
+   target_link_libraries(common ${SFML_LIBRARIES})
+    target_link_libraries(common ${GLEW_LIBRARIES}) 
+    target_link_libraries(common ${FREETYPE_LIBRARIES}) 
 endif ()

 if(MSVC)
@@ -165,7 +162,6 @@ if(MSVC)
    # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy.dll")
    # casparcg_add_runtime_dependency("${TBB_BIN_PATH}/tbbmalloc_proxy_debug.dll")
 else()
-   casparcg_add_runtime_dependency("${GLEW_BIN_PATH}/libGLEW.so.1.12")
    casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbb.so.2")
    casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc_proxy.so.2")
    casparcg_add_runtime_dependency("${TBB_BIN_PATH}/libtbbmalloc.so.2")
diff --git a/core/thumbnail_generator.cpp b/core/thumbnail_generator.cpp
index d9a6362..a21c0fe 100644
--- a/core/thumbnail_generator.cpp
+++ b/core/thumbnail_generator.cpp
@@ -102,7 +102,7 @@ public:
            int height,
            const video_format_repository& format_repository,
            const video_format_desc& render_video_mode,
-           std::unique_ptr<image_mixer> image_mixer,
+           spl::unique_ptr<image_mixer> image_mixer,
            int generate_delay_millis,
            const thumbnail_creator& thumbnail_creator,
            spl::shared_ptr<media_info_repository> media_info_repo,
@@ -335,7 +335,7 @@ thumbnail_generator::thumbnail_generator(
        int height,
        const video_format_repository& format_repository,
        const video_format_desc& render_video_mode,
-       std::unique_ptr<image_mixer> image_mixer,
+       spl::unique_ptr<image_mixer> image_mixer,
        int generate_delay_millis,
        const thumbnail_creator& thumbnail_creator,
        spl::shared_ptr<media_info_repository> media_info_repo,
diff --git a/core/thumbnail_generator.h b/core/thumbnail_generator.h
index aa396ce..c949c0c 100644
--- a/core/thumbnail_generator.h
+++ b/core/thumbnail_generator.h
@@ -50,7 +50,7 @@ public:
            int height,
            const video_format_repository& format_repository,
            const video_format_desc& render_video_mode,
-           std::unique_ptr<image_mixer> image_mixer,
+           spl::unique_ptr<image_mixer> image_mixer,
            int generate_delay_millis,
            const thumbnail_creator& thumbnail_creator,
            spl::shared_ptr<media_info_repository> media_info_repo,
diff --git a/core/video_channel.cpp b/core/video_channel.cpp
index 4948fa8..f93ac41 100644
--- a/core/video_channel.cpp
+++ b/core/video_channel.cpp
@@ -94,7 +94,7 @@ struct video_channel::impl final
     impl(int                               index,
          const core::video_format_desc&    format_desc,
          const core::audio_channel_layout& channel_layout,
-         std::unique_ptr<image_mixer>      image_mixer)
+         spl::unique_ptr<image_mixer>      image_mixer)
         : monitor_subject_(spl::make_shared<monitor::subject>("/channel/" + boost::lexical_cast<std::string>(index)))
         , index_(index)
         , format_desc_(format_desc)
@@ -296,7 +296,7 @@ struct video_channel::impl final
 video_channel::video_channel(int                               index,
                              const core::video_format_desc&    format_desc,
                              const core::audio_channel_layout& channel_layout,
-                             std::unique_ptr<image_mixer>      image_mixer)
+                             spl::unique_ptr<image_mixer>      image_mixer)
     : impl_(new impl(index, format_desc, channel_layout, std::move(image_mixer)))
 {
 }
diff --git a/core/video_channel.h b/core/video_channel.h
index cae0da1..546e3f8 100644
--- a/core/video_channel.h
+++ b/core/video_channel.h
@@ -50,7 +50,7 @@ class video_channel final
     explicit video_channel(int                          index,
                            const video_format_desc&     format_desc,
                            const audio_channel_layout&  channel_layout,
-                           std::unique_ptr<image_mixer> image_mixer);
+                           spl::unique_ptr<image_mixer> image_mixer);
     ~video_channel();

     // Methods
diff --git a/dependencies64/cef/linux/libcef_dll/CMakeLists.txt b/dependencies64/cef/linux/libcef_dll/CMakeLists.txt
index e36196c..0782851 100644
--- a/dependencies64/cef/linux/libcef_dll/CMakeLists.txt
+++ b/dependencies64/cef/linux/libcef_dll/CMakeLists.txt
@@ -25,6 +25,12 @@ set(LIBCEF_SRCS
   )
 source_group(libcef_dll FILES ${LIBCEF_SRCS})

+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+  list(APPEND CEF_CXX_COMPILER_FLAGS
+    -Wno-attributes             # The cfi-icall attribute is not supported by the GNU C++ compiler
+  )
+endif()
+
 set(LIBCEF_BASE_SRCS
   base/cef_atomicops_x86_gcc.cc
   base/cef_bind_helpers.cc
diff --git a/modules/decklink/consumer/decklink_consumer.cpp b/modules/decklink/consumer/decklink_consumer.cpp
index f782a50..7ef9101 100644
--- a/modules/decklink/consumer/decklink_consumer.cpp
+++ b/modules/decklink/consumer/decklink_consumer.cpp
@@ -196,7 +196,7 @@ class decklink_timecode : public IDeckLinkTimecode
         return S_OK;
     }

-    HRESULT GetString(BSTR* timecode) override { return S_FALSE; }
+    HRESULT GetString(const char** timecode) override { return S_FALSE; }

     BMDTimecodeFlags GetFlags() override { return flags_; }

@@ -583,7 +583,7 @@ struct decklink_consumer

             if (result == bmdOutputFrameDisplayedLate) {
                 std::wstring str = print() + L" late scheduled=" + boost::lexical_cast<std::wstring>(video_scheduled_) + L"*";
-                long long timestamp = 0;
+                long timestamp = 0;
                 double speed = 0;
                 if (SUCCEEDED(output_->GetScheduledStreamTime(format_desc_.time_scale, &timestamp, &speed))) {
                     str += L" decklink=" + boost::lexical_cast<std::wstring>(timestamp);
@@ -595,7 +595,7 @@ struct decklink_consumer
                 audio_scheduled_ += dframe->audio_data().size() / in_channel_layout_.num_channels;
             } else if (result == bmdOutputFrameDropped) {
                 std::wstring str = print() + L" dropped scheduled=" + boost::lexical_cast<std::wstring>(video_scheduled_) + L"*";
-                long long timestamp = 0;
+                long timestamp = 0;
                 double speed = 0;
                 if (SUCCEEDED(output_->GetScheduledStreamTime(format_desc_.time_scale, &timestamp, &speed))) {
                     str += L" decklink=" + boost::lexical_cast<std::wstring>(timestamp);
diff --git a/modules/ffmpeg/CMakeLists.txt b/modules/ffmpeg/CMakeLists.txt
index 352b57b..7d71404 100644
--- a/modules/ffmpeg/CMakeLists.txt
+++ b/modules/ffmpeg/CMakeLists.txt
@@ -87,52 +87,7 @@ if (MSVC)
            swresample.lib
    )
 else()
-   target_link_libraries(ffmpeg
-           common
-           core
-
-           -Wl,--start-group
-           avformat.so
-           avcodec.so
-           avutil.so
-           avfilter.so
-           avdevice.so
-           swscale.so
-           swresample.so
-           postproc.so
-
-           ass
-           bluray
-           crypto
-           expat
-           fontconfig
-           fribidi
-           gmp
-           gnutls
-           gsm
-           hogweed
-           ilbc
-           modplug
-           mp3lame
-           nettle
-           ogg
-           opencore-amrnb
-           opencore-amrwb
-           opus
-           rtmp
-           ssl
-           tasn1
-           theoradec
-           theoraenc
-           vorbis
-           vorbisenc
-           vpx
-           x264
-           xavs
-           xvidcore
-           z
-           -Wl,--end-group
-   )
+   target_link_libraries(ffmpeg ${FFMPEG_LIBRARIES})
 endif()

 casparcg_add_include_statement("modules/ffmpeg/ffmpeg.h")
@@ -149,75 +104,4 @@ if(MSVC)
    casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/postproc-55.dll")
    casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swresample-3.dll")
    casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/swscale-5.dll")
-else()
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavcodec.so.56")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavdevice.so.56")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavfilter.so.5")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavformat.so.56")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libavutil.so.54")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libpostproc.so.53")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libswresample.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libswscale.so.3")
-
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libass.so.5")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libbluray.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libcrypto.so.1.0.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libexpat.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libfontconfig.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libfreetype.so.6")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libfribidi.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libgme.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libgmp.so.10")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libgnutls-openssl.so.27")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libgnutls-xssl.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libgnutls.so.28")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libgsm.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libhogweed.so.2")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libilbc.so.2")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/liblzma.so.5")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libmodplug.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libmp3lame.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libnettle.so.4")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libogg.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libopencore-amrnb.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libopencore-amrwb.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libopenjpeg.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libopus.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/liborc-0.4.so.0")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/liborc-test-0.4.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libpcre.so.1")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libpcrecpp.so.0")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libpcreposix.so.0")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libpng.so.3")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libpng12.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/librtmp.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libschroedinger-1.0.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libsoxr-lsr.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libsoxr.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libspeex.so.1")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libspeexdsp.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libssl.so.1.0.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libtasn1.so.6")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libtheora.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libtheoradec.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libtheoraenc.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libtwolame.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libva.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libvidstab.so.0.9")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libvo-aacenc.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libvo-amrwbenc.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libvorbis.so.0")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libvorbisenc.so.2")
-#  casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libvorbisfile.so.3")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libvpx.so.2")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libwavpack.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libwebp.so.5")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libx264.so.148")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libx265.so.59")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libxavs.so.1")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libxml2.so.2")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libxvidcore.so.4")
-   casparcg_add_runtime_dependency("${FFMPEG_BIN_PATH}/libz.so.1")
-
 endif()
-
diff --git a/modules/html/CMakeLists.txt b/modules/html/CMakeLists.txt
index 6ceb9a4..c3c3c3e 100644
--- a/modules/html/CMakeLists.txt
+++ b/modules/html/CMakeLists.txt
@@ -86,5 +86,5 @@ if(MSVC)
 else()
    casparcg_add_runtime_dependency("${CEF_BIN_PATH}/chrome-sandbox")
    casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libcef.so")
-   casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libwidevinecdmadapter.so")
+   #casparcg_add_runtime_dependency("${CEF_BIN_PATH}/libwidevinecdmadapter.so")
 endif()
dimitry-ishenko commented 3 years ago

Everything compiles nicely, but I get this linking problem at the end:

[100%] Linking CXX executable casparcg
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_system.a(error_code.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_thread.a(thread.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_thread.a(once.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_chrono.a(chrono.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_filesystem.a(operations.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_filesystem.a(path.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_filesystem.a(path_traits.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_filesystem.a(codecvt_error_category.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(attribute_name.o): relocation R_X86_64_32 against hidden symbol `_ZZN5boost3log12v2s_mt_posix3aux14lazy_singletonINS1_14attribute_name10repositoryENS_10shared_ptrIS5_EEE3getEvE29_boost_log_once_block_flag_43' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(attribute_set.o): relocation R_X86_64_32 against symbol `_ZNSt9bad_allocD1Ev@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(attribute_value_set.o): relocation R_X86_64_32 against symbol `_ZNSt9bad_allocD1Ev@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(code_conversion.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(core.o): relocation R_X86_64_32S against hidden symbol `_ZN5boost3log12v2s_mt_posix3aux14light_functionIFbRKNS1_19attribute_value_setEEE4implINS1_6filter14default_filterEE11invoke_implEPvS6_' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(record_ostream.o): relocation R_X86_64_32S against hidden symbol `_ZTVN5boost6detail20tss_cleanup_functionE' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(severity_level.o): relocation R_X86_64_32 against hidden symbol `_ZZN5boost3log12v2s_mt_posix3aux14lazy_singletonINS1_7sources3aux21severity_level_holderENS2_15thread_specificIPmEEE3getEvE29_boost_log_once_block_flag_43' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(global_logger_storage.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(process_id.o): relocation R_X86_64_32S against hidden symbol `_ZN5boost3log12v2s_mt_posix3aux16g_hex_char_tableE' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(thread_id.o): relocation R_X86_64_32S against hidden symbol `_ZN5boost3log12v2s_mt_posix3aux16g_hex_char_tableE' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(exceptions.o): relocation R_X86_64_32S against symbol `_ZTVN5boost3log12v2s_mt_posix13runtime_errorE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(default_attribute_names.o): relocation R_X86_64_32S against hidden symbol `_ZTVN5boost6detail15sp_counted_baseE' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(default_sink.o): relocation R_X86_64_32S against hidden symbol `_ZTVN5boost3log12v2s_mt_posix5sinks3aux12default_sinkE' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(text_ostream_backend.o): relocation R_X86_64_32 against symbol `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(text_file_backend.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(thread_specific.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(once_block.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(threadsafe_queue.o): relocation R_X86_64_32S against symbol `_ZTVSt9bad_alloc@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(event.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(trivial.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(dump.o): relocation R_X86_64_32S against hidden symbol `_ZN5boost3log12v2s_mt_posix3aux16g_hex_char_tableE' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(dump_ssse3.o): relocation R_X86_64_32S against hidden symbol `_ZN5boost3log12v2s_mt_posix3aux16g_hex_char_tableE' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_log.a(dump_avx2.o): relocation R_X86_64_32S against hidden symbol `_ZN5boost3log12v2s_mt_posix3aux16g_hex_char_tableE' can not be used when making a PIE object
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(codepage.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(generator.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(ids.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(localization_backend.o): relocation R_X86_64_32 against symbol `__pthread_key_create@@GLIBC_2.2.5' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(posix_backend.o): relocation R_X86_64_32S against symbol `_ZTVN5boost6locale10impl_posix26posix_localization_backendE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(std_backend.o): relocation R_X86_64_32S against symbol `_ZTVN5boost6locale8impl_std24std_localization_backendE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(gregorian.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(message.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(mo_lambda.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(default_locale.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(info.o): relocation R_X86_64_32S against symbol `_ZTVN5boost6locale4util11simple_infoE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(locale_data.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(codecvt.o): relocation R_X86_64_32S against symbol `_ZTVN5boost6locale10impl_posix19mb2_iconv_converterE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(collate.o): relocation R_X86_64_32S against symbol `_ZTVSt7collateIwE@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(converter.o): relocation R_X86_64_32S against symbol `_ZTVN5boost6locale10impl_posix13std_converterIwEE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(numeric.o): relocation R_X86_64_32S against symbol `_ZTVSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(codecvt.o): relocation R_X86_64_32S against symbol `_ZTVSt14codecvt_bynameIwc11__mbstate_tE@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(collate.o): relocation R_X86_64_32S against symbol `_ZTVSt7collateIwE@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(converter.o): relocation R_X86_64_32S against symbol `_ZTVN5boost6locale8impl_std13std_converterIwEE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(numeric.o): relocation R_X86_64_32S against symbol `_ZTVN5boost6locale8impl_std18time_put_from_baseIwEE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(formatting.o): relocation R_X86_64_32S against symbol `_ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(codecvt_converter.o): relocation R_X86_64_32S against symbol `_ZTVN5boost6locale4util14utf8_converterE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_locale.a(date_time.o): relocation R_X86_64_32 against symbol `_ZN5boost6locale14calendar_facet2idE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_regex.a(instances.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_regex.a(regex.o): relocation R_X86_64_32S against symbol `_ZTVN5boost11regex_errorE' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_regex.a(regex_traits_defaults.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_regex.a(winstances.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_regex.a(cpp_regex_traits.o): relocation R_X86_64_32 against symbol `_ZZN5boost16cpp_regex_traitsIcE14get_mutex_instEvE7s_mutex' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /opt/server/dependencies64/boost/stage/lib/linux/libboost_date_time.a(greg_month.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: ../core/libcore.a(osd_graph.cpp.o): in function `caspar::core::diagnostics::osd::get_default_font()':
osd_graph.cpp:(.text+0x66e): undefined reference to `sf::Font::loadFromFile(std::string const&)'
/usr/bin/ld: ../core/libcore.a(osd_graph.cpp.o): in function `caspar::core::diagnostics::osd::graph::render(sf::RenderTarget&, sf::RenderStates)':
osd_graph.cpp:(.text._ZN6caspar4core11diagnostics3osd5graph6renderERN2sf12RenderTargetENS4_12RenderStatesE[_ZN6caspar4core11diagnostics3osd5graph6renderERN2sf12RenderTargetENS4_12RenderStatesE]+0x486): undefined reference to `sf::String::String(std::string const&, std::locale const&)'
/usr/bin/ld: osd_graph.cpp:(.text._ZN6caspar4core11diagnostics3osd5graph6renderERN2sf12RenderTargetENS4_12RenderStatesE[_ZN6caspar4core11diagnostics3osd5graph6renderERN2sf12RenderTargetENS4_12RenderStatesE]+0x55f): undefined reference to `sf::String::String(std::string const&, std::locale const&)'
/usr/bin/ld: ../modules/screen/libscreen.a(screen_consumer.cpp.o): in function `caspar::screen::screen_consumer::init()':
screen_consumer.cpp:(.text._ZN6caspar6screen15screen_consumer4initEv[_ZN6caspar6screen15screen_consumer4initEv]+0xb7): undefined reference to `sf::String::String(std::string const&, std::locale const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [shell/CMakeFiles/casparcg.dir/build.make:162: shell/casparcg] Error 1
make[1]: *** [CMakeFiles/Makefile2:790: shell/CMakeFiles/casparcg.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
dimitry-ishenko commented 3 years ago

I can't tell if bundled Boost needs to be recompiled with -fPIE or the server. Tried adding add_compiler_options( -fPIE ) but that didn't help. Neither did removing the -fPIC options.

@Julusian any hints before I spend a few more hours sorting this mess out?

Julusian commented 3 years ago

I suspect your patch may cause build issues for windows, with the type changes in the decklink_consumer. Its hard to say from reading this, but I know that the decklink sdk uses different types across windows and linux, with some aliases (such as BSTR) to help.

Yeah, so I think I have been not caring about the linux dependencies for a while. ffmpeg has been missing since this fork started, and so it didnt feel worthwhile adding in the new version of glew for linux when I updated windows.

I have a feeling it is wanting you to recompile boost with -fPIE. It will probably be easier to use the system boost instead of fixing that. There are a few sfml link errors hiding at the bottom there too which is strange, I dont know why they would be appearing

If you raise a PR with all of these changes I will be happy to merge it. Having linux always build against system versions is better than it not building at all. I should make you aware that we are investigating switching to 2.3 at NRK, so I don't know how much more life/support you can expect out of this 2.1 fork

dimitry-ishenko commented 3 years ago

@Julusian thank you for taking a look at this:

I suspect your patch may cause build issues for windows, with the type changes in the decklink_consumer. Its hard to say from reading this, but I know that the decklink sdk uses different types across windows and linux, with some aliases (such as BSTR) to help.

This is not a problem. I will do a proper PR with explanation.

Yeah, so I think I have been not caring about the linux dependencies for a while. ffmpeg has been missing since this fork started, and so it didnt feel worthwhile adding in the new version of glew for linux when I updated windows.

Makes sense.

I have a feeling it is wanting you to recompile boost with -fPIE. It will probably be easier to use the system boost instead of fixing that. There are a few sfml link errors hiding at the bottom there too which is strange, I dont know why they would be appearing

If you raise a PR with all of these changes I will be happy to merge it. Having linux always build against system versions is better than it not building at all.

OK good. I will break it up into smaller easy-to-digest patches and submit.

I should make you aware that we are investigating switching to 2.3 at NRK, so I don't know how much more life/support you can expect out of this 2.1 fork

I saw you mention that in the forums, but I really need the framerate_producer functionality, which is why started looking at this fork. Once NRK switches to 2.3 I will re-evaluate.

dimitry-ishenko commented 3 years ago

@Julusian OK I've opened PR #50. Everything compiles and links fine now. I've built 2 versions - one for 18.04 and one for 20.04 - and did some very brief testing.

The pre-built binaries can be found here:

https://github.com/dimitry-ishenko-casparcg/tv-automation-casparcg-server/releases/tag/v2.1.11%2B_NRK

Julusian commented 2 years ago

Should be resolved now