Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build is failing with error "./libvpx.a: archive has no index; run ranlib to add one" #19

Open
subesokun opened this issue Sep 26, 2020 · 8 comments · Fixed by #20
Open

Comments

@subesokun
Copy link

Unfortunately, the build is currently failing with the following error message:

npm install
npx napa
npm run build

...
3 warnings generated.
    [CXX] test/y4m_test.cc.o
In file included from ../node_modules/libvpx/test/y4m_test.cc:13:
In file included from ../node_modules/libvpx/third_party/googletest/src/include/gtest/gtest.h:62:
In file included from ../node_modules/libvpx/third_party/googletest/src/include/gtest/gtest-param-test.h:193:
../node_modules/libvpx/third_party/googletest/src/include/gtest/internal/gtest-param-util-generated.h:107:8: warning: definition of implicit copy constructor for 'ValueArray2<bool, bool>' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy]
  void operator=(const ValueArray2& other);
       ^
../node_modules/libvpx/third_party/googletest/src/include/gtest/gtest-param-test.h:354:10: note: in implicit copy constructor for 'testing::internal::ValueArray2<bool, bool>' first required here
  return internal::ValueArray2<T1, T2>(v1, v2);
         ^
../node_modules/libvpx/third_party/googletest/src/include/gtest/gtest-param-test.h:1221:10: note: in instantiation of function template specialization 'testing::Values<bool, bool>' requested here
  return Values(false, true);
         ^
1 warning generated.
    [LD] test_libvpx
wasm-ld: error: ./libvpx.a: archive has no index; run ranlib to add one
wasm-ld: error: ./libgtest.a: archive has no index; run ranlib to add one
em++: error: '/emsdk_portable/upstream/bin/wasm-ld -o /tmp/emscripten_temp_5es6iua9/test_libvpx.wasm test/../ivfenc.c.o -L/emsdk_portable/upstream/emscripten/system/local/lib test/../md5_utils.c.o -L/emsdk_portable/upstream/emscripten/system/lib test/../y4menc.c.o -L/emsdk_portable/.data/cache/wasm test/../y4minput.c.o test/alt_ref_aq_segment_test.cc.o test/altref_test.cc.o test/aq_segment_test.cc.o test/config_test.cc.o test/cq_test.cc.o test/datarate_test.cc.o test/decode_test_driver.cc.o test/encode_api_test.cc.o test/encode_test_driver.cc.o test/error_resilience_test.cc.o test/idct_test.cc.o test/keyframe_test.cc.o test/predict_test.cc.o test/quantize_test.cc.o test/realtime_test.cc.o test/resize_test.cc.o test/sad_test.cc.o test/set_roi.cc.o test/sum_squares_test.cc.o test/test_libvpx.cc.o test/test_vectors.cc.o test/variance_test.cc.o test/vp8_fdct4x4_test.cc.o test/vpx_scale_test.cc.o test/y4m_test.cc.o -L. ./libvpx.a ./libgtest.a /emsdk_portable/.data/cache/wasm/libc.a /emsdk_portable/.data/cache/wasm/libcompiler_rt.a /emsdk_portable/.data/cache/wasm/libc-wasm.a /emsdk_portable/.data/cache/wasm/libc++-noexcept.a /emsdk_portable/.data/cache/wasm/libc++abi-noexcept.a /emsdk_portable/.data/cache/wasm/libdlmalloc.a /emsdk_portable/.data/cache/wasm/libpthread_stub.a /emsdk_portable/.data/cache/wasm/libc_rt_wasm.a /emsdk_portable/.data/cache/wasm/libsockets.a -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --allow-undefined --import-memory --import-table --strip-debug --export main --export malloc --export free --export stackSave --export stackRestore --export stackAlloc --export __data_end --export __wasm_call_ctors --export __errno_location --export setThrew --export emscripten_main_thread_process_queued_calls --export realloc --export testSetjmp --export saveSetjmp --export _get_tzname --export _get_daylight --export _get_timezone -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024' failed (1)
make[1]: *** [../node_modules/libvpx/libs.mk:517: test_libvpx] Error 1
make: *** [Makefile:17: .DEFAULT] Error 2
make: make
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] 

Maybe something has changed in the emsdk. Any ideas how to fix this error?

I've searched already for this error and found only this comment emscripten-core/emscripten#9329 (comment) but with my modest make/configure skills I couldn't figure out yet if there is an issue with the ar settings. Upgrading to the latest libvpx version also didn't help. Same error.

@willmorgan
Copy link
Contributor

I've found this too. The last time this project had active contributions I know about was last year so I tried building from this image instead:

FROM trzeci/emscripten:1.38.48

This should solve the problem.

@surma
Copy link
Contributor

surma commented Oct 2, 2020

Gonna re-open this.

@willmorgan fixed the build issue by pinning to a specific Emscripten release, which is great. But ideally I should bring the code base up-to-date, but currently just don’t have the time to investigate.

@surma surma reopened this Oct 2, 2020
@subesokun
Copy link
Author

@willmorgan Thanks for the hint!

@surma Any rough idea where to look into? Then I could try to fix it too.

@surma
Copy link
Contributor

surma commented Oct 2, 2020

My hunch is that the dependencies need updating, too. But not sure.

@subesokun
Copy link
Author

Ok, I'll have a look.

@willmorgan
Copy link
Contributor

FWIW you can upgrade to libvpx 1.9.0 with no issues as I happen to be doing the same 😁

@subesokun
Copy link
Author

subesokun commented Oct 3, 2020

Found another issue. The image trzeci/emscripten is to be deprecated in favour of the official image emscripten/emsdk. But when switching the images I get the following error. It seems like the cmake version is now different or some other configuration is missing.

=============================================
Compiling libyuv
=============================================
CMake Warning (dev) at CMakeLists.txt:29 (ADD_LIBRARY):
  ADD_LIBRARY called with SHARED option but the target platform does not
  support dynamic linking.  Building a STATIC library instead.  This may lead
  to problems.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR) 
CMake Warning (dev) at CMakeLists.txt:45 (if):
  Policy CMP0064 is not set: Support new TEST if() operator.  Run "cmake
  --help-policy CMP0064" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  TEST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:86 (INSTALL):
  INSTALL TARGETS given no ARCHIVE DESTINATION for static library target
  "yuv_shared".


Building ver.: 0.0.1764
Packaging for: x86-32
-- Configuring incomplete, errors occurred!

@willmorgan
Copy link
Contributor

willmorgan commented Aug 5, 2021

I'm now experimenting using emsdk:2.0.26.

Community wisdom suggested that this was a good starting point:

export AR="emar"
export RANLIB="emranlib"

It does seem that AR is a thing: https://github.com/webmproject/libvpx/blob/705bf9de8c96cfe5301451f1d7e5c90a41c64e5f/build/make/configure.sh#L497

Calling emmake make -e -t --keep-going seems to allow libvpx to build, but I am now stuck on libwebm. It's complaining about types not being precise enough (types? what are types?)

This got me further:

emcmake cmake ../node_modules/libwebm -DCMAKE_CXX_STANDARD=98

I could run emcc but I guess I need to update the command and the program structure to conform to the updated Emscripten config.

I will keep experimenting and report back with a PR if I am successful - the end goal for me is to look at building this with SIMD and seeing what happens.


Edit: It seems that you still get a libvpx.a which you might be able to use... if you run emmake make --keep-going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants