psteinb / x264

GNU General Public License v2.0
3 stars 1 forks source link

AviSynth support (non)-issue #2

Open qyot27 opened 8 years ago

qyot27 commented 8 years ago

This is strictly a configuration issue, CMake has no problems actually enabling this.

Remove the USE_AVXSYNTH line from config.h.in, and the WITH_AVS testing block should be changed to set it on, with the difference being that for WIN32, USE_AVISYNTH is set, for Linux/OSX, USE_AVXSYNTH is set.

if(WITH_AVS)
    if(WIN32)
        set(HAS_AVS 1)
        set(USE_AVISYNTH)
    else()
        set(HAS_AVS 1)
        set(USE_AVXSYNTH)
    endif()
endif()

Check for dlfcn.h/windows.h inside there if you want, but that's the basic way to fix it.

psteinb commented 8 years ago

alrighty, I'll add that ASAP

psteinb commented 8 years ago

wait: one more question, how is USE_AV?SYNTH propagated to the code. is that a compile time flag like -DFOO?

psteinb commented 8 years ago

@qyot27 please have a look at my fix and close this issue if possible

qyot27 commented 8 years ago

Results (not entirely related to AviSynth directly, but they do concern getting the project built):

AviSynth (32-bit Windows 10):

MSVC VS2013 32-bit      pass
MSVC VS2013 64-bit      compilation fails in general*
MinGW-GCC 6.1.0/MSYS2 32-bit    pass (building CLI requires threading* be disabled right now)

AviSynth (cross-compiling):

MinGW-GCC 6.2.0/Ubuntu 64-bit   pass (errors out in CMake invocation due to faulty system processor check; have to override to make it work. threading has to be disabled for CLI to build.)
MinGW-GCC 6.2.0/Ubuntu 32-bit   pass (errors out in CMake invocation due to faulty system processor check; have to override to make it work. threading has to be disabled for CLI to build.)

AvxSynth:

GCC 5.4.0/Ubuntu 64-bit     pass

*64-bit MSVC compilation failure:

"x264\cmake_unofficial\x264.vcxproj" (default target) (1) ->
(Link target) ->
  x264.lib(cpu.obj) : error LNK2019: unresolved external symbol x264_cpu_cpuid_test referenced in function x264_cpu_detect [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(dct.obj) : error LNK2019: unresolved external symbol x264_sub8x8_dct_mmx referenced in function x264_dct_init [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(dct.obj) : error LNK2019: unresolved external symbol x264_sub16x16_dct_mmx referenced in function x264_dct_init [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(dct.obj) : error LNK2019: unresolved external symbol x264_add8x8_idct_mmx referenced in function x264_dct_init [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(dct.obj) : error LNK2019: unresolved external symbol x264_add16x16_idct_mmx referenced in function x264_dct_init [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(dct.obj) : error LNK2019: unresolved external symbol x264_sub8x8_dct8_mmx referenced in function x264_dct_init [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(dct.obj) : error LNK2019: unresolved external symbol x264_sub16x16_dct8_mmx referenced in function x264_dct_init [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(dct.obj) : error LNK2019: unresolved external symbol x264_add8x8_idct8_mmx referenced in function x264_dct_init [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(dct.obj) : error LNK2019: unresolved external symbol x264_add16x16_idct8_mmx referenced in function x264_dct_init [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(predict-c.obj) : error LNK2019: unresolved external symbol x264_predict_16x16_p_core_mmx2 referenced in function x264_predict_16x16_p_mmx2 [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(predict-c.obj) : error LNK2019: unresolved external symbol x264_predict_8x16c_p_core_mmx2 referenced in function x264_predict_8x16c_p_mmx2 [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(predict-c.obj) : error LNK2019: unresolved external symbol x264_predict_8x8c_p_core_mmx2 referenced in function x264_predict_8x8c_p_mmx2 [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_c_sse2 referenced in function x264_hpel_filter_sse2 [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_v_ssse3 referenced in function x264_hpel_filter_ssse3 [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_c_ssse3 referenced in function x264_hpel_filter_ssse3 [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_h_ssse3 referenced in function x264_hpel_filter_ssse3 [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_v_avx referenced in function x264_hpel_filter_avx [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_c_avx referenced in function x264_hpel_filter_avx [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_h_avx referenced in function x264_hpel_filter_avx [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_v_avx2 referenced in function x264_hpel_filter_avx2 [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_c_avx2 referenced in function x264_hpel_filter_avx2 [x264\cmake_unofficial\x264.vcxproj]
  x264.lib(mc-c.obj) : error LNK2019: unresolved external symbol x264_hpel_filter_h_avx2 referenced in function x264_hpel_filter_avx2 [x264\cmake_unofficial\x264.vcxproj]
  x264\cmake_unofficial\Release\x264.exe : fatal error LNK1120: 22 unresolved externals [x264\cmake_unofficial\x264.vcxproj]

    3186 Warning(s)
    23 Error(s)

Time Elapsed 00:01:14.43

x264\cmake_unofficial>

*threading failure for the MinGW targets:

libx264.a(frame.c.obj):frame.c:(.text+0x9be): undefined reference to `x264_pthread_mutex_init'
libx264.a(frame.c.obj):frame.c:(.text+0x9dd): undefined reference to `x264_pthread_cond_init'
libx264.a(frame.c.obj):frame.c:(.text+0x154a): undefined reference to `x264_pthread_mutex_destroy'
libx264.a(frame.c.obj):frame.c:(.text+0x1558): undefined reference to `x264_pthread_cond_destroy'
libx264.a(frame.c.obj):frame.c:(.text+0x3d6e): undefined reference to `x264_pthread_mutex_lock'
libx264.a(frame.c.obj):frame.c:(.text+0x3d79): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(frame.c.obj):frame.c:(.text+0x3daf): undefined reference to `x264_pthread_mutex_lock'
libx264.a(frame.c.obj):frame.c:(.text+0x3dc8): undefined reference to `x264_pthread_cond_wait'
libx264.a(frame.c.obj):frame.c:(.text+0x3e08): undefined reference to `x264_pthread_mutex_lock'
libx264.a(frame.c.obj):frame.c:(.text+0x3e20): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(frame.c.obj):frame.c:(.text+0x3e5f): undefined reference to `x264_pthread_mutex_lock'
libx264.a(frame.c.obj):frame.c:(.text+0x3e78): undefined reference to `x264_pthread_cond_wait'
libx264.a(frame.c.obj):frame.c:(.text+0x3eeb): undefined reference to `x264_pthread_mutex_lock'
libx264.a(frame.c.obj):frame.c:(.text+0x3f02): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(frame.c.obj):frame.c:(.text+0x43da): undefined reference to `x264_pthread_mutex_destroy'
libx264.a(frame.c.obj):frame.c:(.text+0x43e8): undefined reference to `x264_pthread_cond_destroy'
libx264.a(frame.c.obj):frame.c:(.text+0x4467): undefined reference to `x264_pthread_mutex_init'
libx264.a(frame.c.obj):frame.c:(.text+0x447e): undefined reference to `x264_pthread_cond_init'
libx264.a(frame.c.obj):frame.c:(.text+0x4495): undefined reference to `x264_pthread_cond_init'
libx264.a(frame.c.obj):frame.c:(.text+0x44d2): undefined reference to `x264_pthread_mutex_destroy'
libx264.a(frame.c.obj):frame.c:(.text+0x44dd): undefined reference to `x264_pthread_cond_destroy'
libx264.a(frame.c.obj):frame.c:(.text+0x44e8): undefined reference to `x264_pthread_cond_destroy'
libx264.a(frame.c.obj):frame.c:(.text+0x45aa): undefined reference to `x264_pthread_mutex_destroy'
libx264.a(frame.c.obj):frame.c:(.text+0x45b8): undefined reference to `x264_pthread_cond_destroy'
libx264.a(frame.c.obj):frame.c:(.text+0x45f6): undefined reference to `x264_pthread_mutex_lock'
libx264.a(frame.c.obj):frame.c:(.text+0x460d): undefined reference to `x264_pthread_cond_wait'
libx264.a(frame.c.obj):frame.c:(.text+0x462b): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(frame.c.obj):frame.c:(.text+0x4651): undefined reference to `x264_pthread_mutex_lock'
libx264.a(frame.c.obj):frame.c:(.text+0x4668): undefined reference to `x264_pthread_cond_wait'
libx264.a(frame.c.obj):frame.c:(.text+0x468d): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(frame.c.obj):frame.c:(.text+0x4695): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(frame.c.obj):frame.c:(.text+0x3d88): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(frame.c.obj):frame.c:(.text+0x3de0): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(frame.c.obj):frame.c:(.text+0x3e2f): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(frame.c.obj):frame.c:(.text+0x3e90): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(frame.c.obj):frame.c:(.text+0x463b): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(cpu.c.obj):cpu.c:(.text+0x621): undefined reference to `x264_pthread_num_processors_np'
libx264.a(osdep.c.obj):osdep.c:(.text+0x71): undefined reference to `x264_win32_threading_init'
libx264.a(osdep.c.obj):osdep.c:(.text+0x1): undefined reference to `x264_win32_threading_destroy'
libx264.a(encoder.c.obj):encoder.c:(.text+0x9e91): undefined reference to `x264_pthread_mutex_init'
libx264.a(encoder.c.obj):encoder.c:(.text+0x9eb0): undefined reference to `x264_pthread_cond_init'
libx264.a(encoder.c.obj):encoder.c:(.text+0x10943): undefined reference to `x264_pthread_mutex_lock'
libx264.a(encoder.c.obj):encoder.c:(.text+0x10957): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(encoder.c.obj):encoder.c:(.text+0x10968): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(encoder.c.obj):encoder.c:(.text+0x12bc1): undefined reference to `x264_pthread_mutex_destroy'
libx264.a(encoder.c.obj):encoder.c:(.text+0x12bd1): undefined reference to `x264_pthread_cond_destroy'
libx264.a(encoder.c.obj):encoder.c:(.text+0x131cd): undefined reference to `x264_pthread_mutex_lock'
libx264.a(encoder.c.obj):encoder.c:(.text+0x131de): undefined reference to `x264_pthread_mutex_lock'
libx264.a(encoder.c.obj):encoder.c:(.text+0x131ef): undefined reference to `x264_pthread_mutex_lock'
libx264.a(encoder.c.obj):encoder.c:(.text+0x1320b): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(encoder.c.obj):encoder.c:(.text+0x1321c): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(encoder.c.obj):encoder.c:(.text+0x1322f): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x63): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x93): undefined reference to `x264_pthread_cond_wait'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0xb2): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0xfb): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x103): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x114): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x140): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x198): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x1a9): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x205): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x20d): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x21e): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x24e): undefined reference to `x264_pthread_cond_wait'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x26d): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x287): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x298): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x2a9): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x2f0): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x2f8): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x309): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x31a): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x34d): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x364): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x377): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x509): undefined reference to `x264_pthread_create'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x5ad): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x5c1): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x5d2): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x607): undefined reference to `x264_pthread_join'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x6aa): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x6bb): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x6e0): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x6f3): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x74f): undefined reference to `x264_pthread_mutex_lock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x778): undefined reference to `x264_pthread_cond_wait'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x7fb): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x8bf): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x8c7): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x7a3): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(lookahead.c.obj):lookahead.c:(.text+0x972): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x2a): undefined reference to `x264_pthread_mutex_lock'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x4f): undefined reference to `x264_pthread_cond_wait'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x75): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0xb1): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x1f8): undefined reference to `x264_pthread_create'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x268): undefined reference to `x264_pthread_mutex_lock'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x2b5): undefined reference to `x264_pthread_cond_wait'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x2db): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x313): undefined reference to `x264_pthread_mutex_lock'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x324): undefined reference to `x264_pthread_cond_broadcast'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x32e): undefined reference to `x264_pthread_mutex_unlock'
libx264.a(threadpool.c.obj):threadpool.c:(.text+0x378): undefined reference to `x264_pthread_join'
libx264.a(analyse.c.obj):analyse.c:(.text+0x2c88): undefined reference to `x264_pthread_mutex_lock'
libx264.a(analyse.c.obj):analyse.c:(.text+0x2cff): undefined reference to `x264_pthread_mutex_unlock'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
[cmake_unofficial:$] 
psteinb commented 8 years ago

I believe #3 is related to the threading issue, I discovered a couple bugs in my setup of multi-threading support. I hope to come around that very soon (it's a priority issue for me).

For the other stuff, I'd need some more details (most notably how cmake was called and what system, what version of ubuntu for example or what version of MSVC related to the x264_cpu_detect issue). further, did you try the clean-first flag of cmake for all of these? Did you call vcvarsall amd64 before invoking cmake?

I'll split your issue and create independent issues, so that we can focus on individual aspects

psteinb commented 8 years ago

one more note, I am not sure how to reproduce the problems on Windows 10 that you reported. I simply don't have the resources for that.

qyot27 commented 8 years ago

Before each test, I used git clean -xdf to scrub everything generated.