cd-athena / VCA

Video complexity analyzer
GNU General Public License v3.0
74 stars 9 forks source link

Cmake build error on (Arch)-Linux -- getopt #52

Closed mizhozan closed 2 years ago

mizhozan commented 2 years ago

Hi,

I'm trying to build VCA using the doc here, but I get the following error on cmake --build .:

Scanning dependencies of target vcaLib
[  5%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/vcaLib.cpp.o
[ 10%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/analyzer/Analyzer.cpp.o
[ 15%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/analyzer/DCTTransforms.cpp.o
[ 20%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/analyzer/EnergyCalculation.cpp.o
[ 25%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/analyzer/MultiThreadQueue.cpp.o
[ 30%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/analyzer/ProcessingThread.cpp.o
[ 35%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/analyzer/ShotDetection.cpp.o
[ 40%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/analyzer/simd/cpu.cpp.o
[ 45%] Building CXX object source/lib/CMakeFiles/vcaLib.dir/analyzer/simd/dct-ssse3.cpp.o
[ 50%] Building ASM_NASM object source/lib/CMakeFiles/vcaLib.dir/analyzer/simd/dct8.asm.o
[ 55%] Building ASM_NASM object source/lib/CMakeFiles/vcaLib.dir/analyzer/simd/const-a.asm.o
[ 60%] Building ASM_NASM object source/lib/CMakeFiles/vcaLib.dir/analyzer/simd/cpu-a.asm.o
[ 65%] Linking CXX static library libvcaLib.a
[ 65%] Built target vcaLib
[ 70%] Building CXX object source/apps/vca/CMakeFiles/vca.dir/vca.cpp.o
In file included from /usr/include/bits/getopt_posix.h:27,
                 from /usr/include/unistd.h:903,
                 from /usr/include/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /home/mizho/Desktop/VCA/source/apps/vca/vca.cpp:33:
/usr/include/bits/getopt_core.h:91:12: error: declaration of ‘int getopt(int, char* const*, const char*) noexcept’ has a different exception specifier
   91 | extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
      |            ^~~~~~
In file included from /home/mizho/Desktop/VCA/source/apps/vca/vcacli.h:23,
                 from /home/mizho/Desktop/VCA/source/apps/vca/vca.cpp:21:
/home/mizho/Desktop/VCA/source/apps/common/getopt/getopt.h:147:12: note: from previous declaration ‘int getopt(int, char* const*, const char*)’
  147 | extern int getopt (int argc, char *const *argv, const char *shortopts);
      |            ^~~~~~
make[2]: *** [source/apps/vca/CMakeFiles/vca.dir/build.make:76: source/apps/vca/CMakeFiles/vca.dir/vca.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: source/apps/vca/CMakeFiles/vca.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

As of requirement:

ChristianFeldmann commented 2 years ago

Hi! We never tested arch as a platform for our builds. I was able to reproduce this in an arch docker container.

mizhozan commented 2 years ago

Hi,

Thanks for the fix.

I just did another try. With git clone version (stable) it's the same as original post on tested machine but I can confirm that with the bugfix #54 (dev branch) it now compiles.

Here are my machine state (I actually tested on two Arch machines one with NASM another with YASM):

Here is the cmake ../ output:

-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- VCA version v1.5+2-g9f209dc
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Detected x86_64 target processor
-- The ASM_NASM compiler identification is NASM
-- Found assembler: /usr/bin/nasm
-- Nasm found. Activating nasm assembly.
-- Looking for include file getopt.h
-- Looking for include file getopt.h - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mizho/Desktop/VCA/build

and here is the successful bulid message:

[ 60%] Building ASM_NASM object source/lib/CMakeFiles/vcaLib.dir/analyzer/simd/cpu-a.asm.o
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:32: warning: improperly calling multi-line macro `SETUP_STACK_POINTER' with 0 parameters [-w+macro-params-legacy]
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:719: ... from macro `cglobal' defined here
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:752: ... from macro `cglobal_internal' defined here
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:570: ... from macro `PROLOGUE' defined here
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:32: warning: improperly calling multi-line macro `ALLOC_STACK' with 0 parameters [-w+macro-params-legacy]
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:719: ... from macro `cglobal' defined here
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:752: ... from macro `cglobal_internal' defined here
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:573: ... from macro `PROLOGUE' defined here
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:32: warning: dropping trailing empty parameter in call to multi-line macro `DEFINE_ARGS_INTERNAL' [-w+macro-params-legacy]
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:719: ... from macro `cglobal' defined here
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:752: ... from macro `cglobal_internal' defined here
/home/mizho/Desktop/VCA/source/lib/analyzer/simd/cpu-a.asm:575: ... from macro `PROLOGUE' defined here

[ 65%] Linking CXX static library libvcaLib.a
[ 65%] Built target vcaLib
[ 70%] Building CXX object source/apps/vca/CMakeFiles/vca.dir/vca.cpp.o
[ 75%] Building CXX object source/apps/vca/CMakeFiles/vca.dir/__/common/common.cpp.o
[ 80%] Building CXX object source/apps/vca/CMakeFiles/vca.dir/__/common/input/IInputFile.cpp.o
[ 85%] Building CXX object source/apps/vca/CMakeFiles/vca.dir/__/common/input/Y4MInput.cpp.o
[ 90%] Building CXX object source/apps/vca/CMakeFiles/vca.dir/__/common/input/YUVInput.cpp.o
[ 95%] Building CXX object source/apps/vca/CMakeFiles/vca.dir/__/common/stats/YUViewStatsFile.cpp.o
[100%] Linking CXX executable vca
[100%] Built target vca
vigneshvijay94 commented 2 years ago

Thanks for confirming that the bug fix works. It is now pushed to stable.