YomikoR / VapourSynth-Editor

Branch vse-previewer for standalone previewer. Branch vs-api4 for an IDE with a text editor. Branch master for "stability". Forked from https://bitbucket.org/mystery_keeper/vapoursynth-editor
Other
139 stars 9 forks source link

Can't build vsedit on QtCreator on Ubuntu 20.04 #17

Closed Selur closed 2 years ago

Selur commented 2 years ago

When opening 'apoursynth-editor-2/pro/vsedit/vsedit.pro' in QtCreator and running qmake it uses qmake vsedit.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug and I get Project ERROR: failed to parse default search paths from compiler output also tried to build it using the build instructions without qtcreator, but that failed to.

YomikoR commented 2 years ago

In certain distros there's a standalone debug version for Qt. I never tested with debug build though.

To build following the instructions on Ubuntu 20.04: install libqt5websockets5-dev, and run qmake in the pro folder

Selur commented 2 years ago

I installed libqt5websockets5-dev (apt-get install libqt5websockets5-dev), went to the pro folder ran qmake and got the same error. (same in the pro/vsedit/ folder). Also tried with qmake CONFIG+=release, same issue. (updating with git pull also didn't change a thing)

okay, just noticed this does happen with other projects too -> seems like there's some thing wrong with the qt or compiler setup. -> will report back once I know more

Selur commented 2 years ago

I setup a new 20.04 install and I got a lot further. I also adjusted some code to be Qt 5.12.8 compatible. but know I'm stuck compiling at:

common-src/libp2p/simd/cpuinfo_x86.cpp: In function ‘p2p::simd::X86CacheHierarchy p2p::simd::{anonymous}::do_query_x86_cache_hierarchy_amd(int)’:
common-src/libp2p/simd/cpuinfo_x86.cpp:257:56: warning: unused parameter ‘max_feature’ [-Wunused-parameter]
  257 | X86CacheHierarchy do_query_x86_cache_hierarchy_amd(int max_feature) noexcept
      |                                                    ~~~~^~~~~~~~~~~
g++ -pipe -O2 -fexpensive-optimizations -funit-at-a-time -std=c++17 -Wall -Wextra -Wredundant-decls -Wshadow -pedantic -O2 -D_REENTRANT -Wall -W -fPIC -DNDEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DP2P_SIMD -I. -Ivapoursynth-git/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -c common-src/libp2p/simd/p2p_sse41.cpp -o generated/obj-release-64bit-gcc/p2p_sse41.o -std=c++14 -Wno-missing-field-initializers
g++ -c -pipe -O2 -fexpensive-optimizations -funit-at-a-time -std=c++17 -Wall -Wextra -Wredundant-decls -Wshadow -pedantic -O2 -D_REENTRANT -Wall -W -fPIC -DNDEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Ivapoursynth-git/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o generated/obj-release-64bit-gcc/frame_header_writer.o common-src/frame_header_writers/frame_header_writer.cpp
In file included from /usr/lib/gcc/x86_64-linux-gnu/9/include/smmintrin.h:32,
                 from common-src/libp2p/simd/p2p_sse41.cpp:5:
/usr/lib/gcc/x86_64-linux-gnu/9/include/tmmintrin.h: In lambda function:
/usr/lib/gcc/x86_64-linux-gnu/9/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘__m128i _mm_shuffle_epi8(__m128i, __m128i)’: target specific option mismatch
  136 | _mm_shuffle_epi8 (__m128i __X, __m128i __Y)
      | ^~~~~~~~~~~~~~~~
common-src/libp2p/simd/p2p_sse41.cpp:147:23: note: called from here
  147 |   x = _mm_shuffle_epi8(x, shuffle);
      |       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from common-src/libp2p/simd/p2p_sse41.cpp:5:
/usr/lib/gcc/x86_64-linux-gnu/9/include/smmintrin.h:406:1: error: inlining failed in call to always_inline ‘__m128i _mm_insert_epi32(__m128i, int, int)’: target specific option mismatch
  406 | _mm_insert_epi32 (__m128i __D, int __S, const int __N)
      | ^~~~~~~~~~~~~~~~
common-src/libp2p/simd/p2p_sse41.cpp:145:3: note: called from here
  145 |   x = IdxB == 0 ? x : _mm_insert_epi32(x, b, IdxB);
      |   ^
In file included from common-src/libp2p/simd/p2p_sse41.cpp:5:
/usr/lib/gcc/x86_64-linux-gnu/9/include/smmintrin.h:406:1: error: inlining failed in call to always_inline ‘__m128i _mm_insert_epi32(__m128i, int, int)’: target specific option mismatch
  406 | _mm_insert_epi32 (__m128i __D, int __S, const int __N)
      | ^~~~~~~~~~~~~~~~
common-src/libp2p/simd/p2p_sse41.cpp:144:3: note: called from here
  144 |   x = IdxG == 0 ? x : _mm_insert_epi32(x, g, IdxG);
      |   ^
In file included from common-src/libp2p/simd/p2p_sse41.cpp:5:
/usr/lib/gcc/x86_64-linux-gnu/9/include/smmintrin.h:406:1: error: inlining failed in call to always_inline ‘__m128i _mm_insert_epi32(__m128i, int, int)’: target specific option mismatch
  406 | _mm_insert_epi32 (__m128i __D, int __S, const int __N)
      | ^~~~~~~~~~~~~~~~
common-src/libp2p/simd/p2p_sse41.cpp:143:3: note: called from here
  143 |   x = IdxR == 0 ? x : _mm_insert_epi32(x, r, IdxR);
      |   ^
In file included from /usr/lib/gcc/x86_64-linux-gnu/9/include/smmintrin.h:32,
                 from common-src/libp2p/simd/p2p_sse41.cpp:5:
/usr/lib/gcc/x86_64-linux-gnu/9/include/tmmintrin.h:136:1: error: inlining failed in call to always_inline ‘__m128i _mm_shuffle_epi8(__m128i, __m128i)’: target specific option mismatch
  136 | _mm_shuffle_epi8 (__m128i __X, __m128i __Y)
      | ^~~~~~~~~~~~~~~~
common-src/libp2p/simd/p2p_sse41.cpp:147:23: note: called from here
  147 |   x = _mm_shuffle_epi8(x, shuffle);
      |       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from common-src/libp2p/simd/p2p_sse41.cpp:5:
/usr/lib/gcc/x86_64-linux-gnu/9/include/smmintrin.h:406:1: error: inlining failed in call to always_inline ‘__m128i _mm_insert_epi32(__m128i, int, int)’: target specific option mismatch
  406 | _mm_insert_epi32 (__m128i __D, int __S, const int __N)
      | ^~~~~~~~~~~~~~~~
common-src/libp2p/simd/p2p_sse41.cpp:145:3: note: called from here
  145 |   x = IdxB == 0 ? x : _mm_insert_epi32(x, b, IdxB);
      |   ^
In file included from common-src/libp2p/simd/p2p_sse41.cpp:5:
/usr/lib/gcc/x86_64-linux-gnu/9/include/smmintrin.h:406:1: error: inlining failed in call to always_inline ‘__m128i _mm_insert_epi32(__m128i, int, int)’: target specific option mismatch
  406 | _mm_insert_epi32 (__m128i __D, int __S, const int __N)
      | ^~~~~~~~~~~~~~~~
common-src/libp2p/simd/p2p_sse41.cpp:144:3: note: called from here
  144 |   x = IdxG == 0 ? x : _mm_insert_epi32(x, g, IdxG);
      |   ^
In file included from common-src/libp2p/simd/p2p_sse41.cpp:5:
/usr/lib/gcc/x86_64-linux-gnu/9/include/smmintrin.h:406:1: error: inlining failed in call to always_inline ‘__m128i _mm_insert_epi32(__m128i, int, int)’: target specific option mismatch
  406 | _mm_insert_epi32 (__m128i __D, int __S, const int __N)
      | ^~~~~~~~~~~~~~~~
common-src/libp2p/simd/p2p_sse41.cpp:143:3: note: called from here
  143 |   x = IdxR == 0 ? x : _mm_insert_epi32(x, r, IdxR);
      |   ^
make: *** [Makefile:695: generated/obj-release-64bit-gcc/p2p_sse41.o] Fehler 1
make: *** Auf noch nicht beendete Prozesse wird gewartet …

any idea how get libp2p to compile?

YomikoR commented 2 years ago

Looks weird to me, because I did successfully build it in a x64 Ubuntu 20.04.

You may first try building libp2p with its GNU Makefile SIMD=1 make and see what happens.

Selur commented 2 years ago

that works fine,..

selur@ubuntu:~/workspace/libp2p$ SIMD=1 make
g++ -c  -std=c++14 -O2 -fPIC  -DP2P_SIMD  p2p_api.cpp -o p2p_api.o
g++ -c  -std=c++14 -O2 -fPIC  -DP2P_SIMD  simd/cpuinfo_x86.cpp -o simd/cpuinfo_x86.o
g++ -c  -std=c++14 -O2 -fPIC  -DP2P_SIMD  simd/p2p_simd.cpp -o simd/p2p_simd.o
g++ -c -msse4.1 -std=c++14 -O2 -fPIC  -DP2P_SIMD  simd/p2p_sse41.cpp -o simd/p2p_sse41.o
ar rcs libp2p.a p2p_api.o simd/cpuinfo_x86.o simd/p2p_simd.o simd/p2p_sse41.o

since I accidentially reverted all ma adjustements I have to do them again to be Qt5.12.8 compatible (which is the default Qt that comes with Ubuntu 20.04) now it worked,... no clue why but thanks anyways. :)

YomikoR commented 2 years ago

It seems the building failed because -msse4.1 was missing in the args. Did you mistakenly remove it from the .pro file?

Selur commented 2 years ago

that might be the case, not totally sure

Selur commented 2 years ago

for the code to compile on Ubuntu 20.04 with standard qt one needs to do the following changes:

diff --git a/vsedit/src/script_templates/drop_file_category_model.cpp b/vsedit/src/script_templates/drop_file_category_model.cpp
index 9942121..ad634e8 100644
--- a/vsedit/src/script_templates/drop_file_category_model.cpp
+++ b/vsedit/src/script_templates/drop_file_category_model.cpp
@@ -169,9 +169,8 @@ bool DropFileCategoryModel::setData(const QModelIndex & a_index,
                {
                        if(i == a_index.row())
                                continue;
-                       QSet<QString> set_curr(maskList.begin(), maskList.end());
-                       QSet<QString> set_i(m_categories[i].maskList.begin(),
-                               m_categories[i].maskList.end());
+                       QSet<QString> set_curr = QSet<QString>::fromList(maskList);
+                       QSet<QString> set_i = QSet<QString>::fromList(m_categories[i].maskList);
                        QSet<QString> intersection = set_curr.intersect(set_i);
                        if(intersection.size() > 0)
                                return false;
diff --git a/vsedit/src/vapoursynth/vapoursynth_plugins_manager.cpp b/vsedit/src/vapoursynth/vapoursynth_plugins_manager.cpp
index 2c3cc9f..14d1633 100644
--- a/vsedit/src/vapoursynth/vapoursynth_plugins_manager.cpp
+++ b/vsedit/src/vapoursynth/vapoursynth_plugins_manager.cpp
@@ -385,7 +385,7 @@ VSData::Function VapourSynthPluginsManager::parseFunctionSignature(
 {
        VSData::Function function;
        function.name = a_name;
-       QStringList argumentsList = a_arguments.split(';', Qt::SkipEmptyParts);
+       QStringList argumentsList = a_arguments.split(';', QString::SkipEmptyParts);
        if(argumentsList.size() == 0)
                return function;

did those quick&dirty, but you should include them with:

#if(QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
  QStringList argumentsList = a_arguments.split(';', Qt::SkipEmptyParts);
#else
  QStringList argumentsList = a_arguments.split(';', QString::SkipEmptyParts);
#endif

and

#if(QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
      QSet<QString> set_curr(maskList.begin(), maskList.end());
      QSet<QString> set_i(m_categories[i].maskList.begin(), m_categories[i].maskList.end());
#else
      QSet<QString> set_curr = QSet<QString>::fromList(maskList);
      QSet<QString> set_i = QSet<QString>::fromList(m_categories[i].maskList);
#endif

for qt5.9.5 (latest on Ubuntu 18.04) some additional changes are needed.

YomikoR commented 2 years ago

Thanks. Some of these changes have been made because they are deprecated in a recent version of Qt5 (or even since Qt4), and will probably be broken in Qt6, see https://github.com/YomikoR/VapourSynth-Editor/issues/6.

I will check building in 20.04 again. But if you have QT_DISABLE_DEPRECATED_BEFORE specified that will be a different story.

As for 18.04, I will probably not install it to take a test. But I guess reverting https://github.com/YomikoR/VapourSynth-Editor/commit/86cb20426af4334d1fc996d3062ed3f1f5d2cee5 (the last commit in the ref list of #6) should be enough.

Selur commented 2 years ago

Some of these changes have been made because they are deprecated in a recent version of Qt5

that is why one usually uses pre-compiler compiler statements. To stay compatible without having to deal with it all the time. (Same when you aim for Qt6 compatibility,..)

Personally I can to the changes myself, but for others it would be better to use pre-compiler statements to stay compatible with current linux distributions.

YomikoR commented 2 years ago

Now have building in 18.04 fixed as well (in WSL, shamelessly...)