Closed
Description
Describe the bug:
I am trying to install fairseq2 from source using the instruction but getting a fail when building fairseq2n.
Describe how to reproduce:
Env: scratch docker image for python:3.11
> uname -a
Linux 582069085efd 5.15.49-linuxkit-pr #1 SMP PREEMPT Thu May 25 07:27:39 UTC 2023 aarch64 GNU/Linux
apt install -y libsndfile1 libsndfile-dev
git clone --recurse-submodules https://github.com/facebookresearch/fairseq2.git
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
cd fairseq2
pip install -r fairseq2n/python/requirements-build.txt
cd fairseq2n
> cmake -GNinja -B build
-- Module support is disabled.
-- Version: 9.1.0
-- Build type: RelWithDebInfo
-- CXX_STANDARD: 14
-- Required features: cxx_variadic_templates
CMake Deprecation Warning at third-party/kaldi-native-fbank/CMakeLists.txt:24 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- BUILD_SHARED_LIBS: FALSE
-- KALDI_NATIVE_FBANK_BUILD_TESTS: OFF
-- KALDI_NATIVE_FBANK_BUILD_PYTHON: OFF
-- KALDI_NATIVE_FBANK_ENABLE_CHECK: OFF
-- KALDI_NATIVE_FBANK_ENABLE_CHECK: OFF
-- CMAKE_CXX_FLAGS:
-- CMAKE_INSTALL_PREFIX: /usr/local
-- Disable building Python
CMake Deprecation Warning at third-party/sentencepiece/CMakeLists.txt:15 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- VERSION: 0.1.97
-- Not Found TCMalloc: TCMALLOC_LIB-NOTFOUND
-- pybind11 v2.11.1
--
-- ******************** Summary ********************
-- CMake Version : 3.27.7
-- CMake Command : /usr/local/lib/python3.11/site-packages/cmake/data/bin/cmake
-- System : Linux
-- C++ Compiler : /usr/bin/c++
-- C++ Compiler Version : 12.2.0
-- Python Version : 3.11.6
-- Python Interpreter : /usr/local/bin/python3.11
-- Torch Version : 2.1.1
-- Torch Library : /usr/local/lib/python3.11/site-packages/torch/lib/libtorch.so
-- Build Type : RelWithDebInfo
--
-- PROJECT_VERSION : 0.2.0
-- FAIRSEQ2N_BUILD_FOR_NATIVE : OFF
-- FAIRSEQ2N_INSTALL_STANDALONE : ON
-- FAIRSEQ2N_PERFORM_LTO : OFF
-- FAIRSEQ2N_RUN_CLANG_TIDY : OFF
-- FAIRSEQ2N_SANITIZERS : -
-- FAIRSEQ2N_TREAT_WARNINGS_AS_ERRORS : OFF
-- FAIRSEQ2N_USE_LIBTORCH : OFF
-- FAIRSEQ2N_USE_CUDA : OFF
-- FAIRSEQ2N_BUILD_PYTHON_BINDINGS : ON
-- FAIRSEQ2N_PYTHON_DEVEL : ON
--
-- System Dependencies
-- libsndfile : 1.2.0
--
-- Configuring done (3.3s)
-- Generating done (0.3s)
-- Build files have been written to: /opt/app/build/fairseq2/fairseq2n/build
> cmake --build build
[2/2] Linking CXX executable tests/run-tests
FAILED: tests/run-tests
: && /usr/bin/c++ -O2 -g -DNDEBUG -Wl,--as-needed -Wl,--build-id=sha1 -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs tests/CMakeFiles/tests.dir/test_float.cc.o tests/CMakeFiles/tests.dir/test_memory.cc.o tests/CMakeFiles/tests.dir/test_span.cc.o tests/CMakeFiles/tests.dir/data/test_immutable_string.cc.o tests/CMakeFiles/tests.dir/data/test_tape.cc.o tests/CMakeFiles/tests.dir/data/detail/test_lru_cache.cc.o tests/CMakeFiles/tests.dir/utils/test_cast.cc.o -o tests/run-tests -Wl,-rpath,/opt/app/build/fairseq2/fairseq2n/build/src/fairseq2n:/usr/local/lib/python3.11/site-packages/torch/lib lib/libgtest_main.a src/fairseq2n/libfairseq2n.so.0.2.0 lib/libgtest.a /usr/local/lib/python3.11/site-packages/torch/lib/libtorch.so /usr/local/lib/python3.11/site-packages/torch/lib/libtorch_cpu.so /usr/local/lib/python3.11/site-packages/torch/lib/libc10.so && :
/usr/bin/ld: warning: libgfortran-b6d57c85.so.5.0.0, needed by /usr/local/lib/python3.11/site-packages/torch/lib/../../torch.libs/libopenblasp-r0-56e95da7.3.24.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/local/lib/python3.11/site-packages/torch/lib/../../torch.libs/libopenblasp-r0-56e95da7.3.24.so: undefined reference to `_gfortran_concat_string@GFORTRAN_8'
/usr/bin/ld: /usr/local/lib/python3.11/site-packages/torch/lib/../../torch.libs/libopenblasp-r0-56e95da7.3.24.so: undefined reference to `_gfortran_etime@GFORTRAN_8'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.