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

Werid build behavior arch linux #614

Open
tukot870 opened this issue Aug 13, 2024 · 3 comments
Open

Werid build behavior arch linux #614

tukot870 opened this issue Aug 13, 2024 · 3 comments

Comments

@tukot870
Copy link

Hello , I tried building on manjaro using aur and by following build guide but both resulted in errors . I have installed both ffmpeg and ffmpeg4.4 . Libs are located in /usr/include and /usr/lib like /usr/include/libavcodec/ . I have cuda 11.8 and g++-14 .

When building from aur the libs get found but other error shows (See below) . I tried to change PKGBUILD to change g++ version . I tried using g++-12 but it is broken on aur . So I downgraded g++ but it still showed no libs found . And also I have tried g++-10 and g++-11 .
When using ./configure nothing was found in all the versions .

When git clone:

./configure 
checking for g++...checking for g++...OK
egrep: warning: egrep is obsolescent; using grep -E
checking for cuda (CUDA_PATH=/opt/cuda)...nvcc=/opt/cuda/bin/nvcc
checking for cuda...OK, CUDA 11.8
checking for pthread...OK
checking for c++17...OK
checking for -msse2...OK
checking for __rdtscp()...yes
checking for -fPIE...configuring for speed...
checking for -mfpmath=sse...yes
checking for -ffast-math...yes
checking for -fomit-frame-pointer...yes
checking for pkg-config...OK
checking libavcodec with pkg-config...OK
checking for libavutil...no
checking for libavcodec...no
checking for libavformat...no
checking for libavfilter...no
checking for AVChannelLayout...no
checking for AVFrame::duration...no
checking for libswresample...no
checking for AVCodecParameters::coded_side_data...no
libavutil, libavcodec, libavformat, libavfilter, libswresample are required to build nvencc.

When aur and g++-13 as in PKGBUILD:

/usr/include/bits/mathcalls.h(107): error: identifier "_Float32" is undefined

/usr/include/bits/mathcalls.h(110): error: identifier "_Float32" is undefined

/usr/include/bits/mathcalls.h(110): error: identifier "_Float32" is undefined

/usr/include/bits/mathcalls.h(110): error: identifier "_Float32" is undefined

/usr/include/bits/mathcalls.h(110): error: identifier "_Float32" is undefined

/usr/include/bits/mathcalls.h(110): error: identifier "_Float32" is undefined

Error limit reached.
100 errors detected in the compilation of "NVEncCore/NVEncFilterDenoiseNLMeans.cu".
Compilation terminated.
make: *** [makefile:40: NVEncCore/NVEncFilterSsim.o] Error 255
make: *** [makefile:40: NVEncCore/NVEncFilterDenoiseDct.o] Error 255
make: *** [makefile:40: NVEncCore/NVEncFilterSmooth.o] Error 255
make: *** [makefile:40: NVEncCore/NVEncFilterDenoiseNLMeans.o] Error 255
/usr/include/stdlib.h(141): error: identifier "_Float32" is undefined

/usr/include/stdlib.h(147): error: identifier "_Float64" is undefined

/usr/include/stdlib.h(153): error: identifier "_Float128" is undefined

/usr/include/stdlib.h(159): error: identifier "_Float32x" is undefined

/usr/include/stdlib.h(165): error: identifier "_Float64x" is undefined

/usr/include/stdlib.h(299): error: identifier "_Float32" is undefined

/usr/include/stdlib.h(305): error: identifier "_Float64" is undefined

/usr/include/stdlib.h(311): error: identifier "_Float128" is undefined

/usr/include/stdlib.h(317): error: identifier "_Float32x" is undefined

/usr/include/stdlib.h(323): error: identifier "_Float64x" is undefined

/usr/include/stdlib.h(436): error: identifier "_Float32" is undefined

/usr/include/stdlib.h(443): error: identifier "_Float64" is undefined

/usr/include/stdlib.h(450): error: identifier "_Float128" is undefined

/usr/include/stdlib.h(457): error: identifier "_Float32x" is undefined

/usr/include/stdlib.h(464): error: identifier "_Float64x" is undefined
@rigaya
Copy link
Owner

rigaya commented Aug 13, 2024

  1. I think we need more information for the below.

    checking libavcodec with pkg-config...OK
    checking for libavutil...no
    checking for libavcodec...no
    checking for libavformat...no
    checking for libavfilter...no
    checking for AVChannelLayout...no
    checking for AVFrame::duration...no
    checking for libswresample...no
    checking for AVCodecParameters::coded_side_data...no
    libavutil, libavcodec, libavformat, libavfilter, libswresample are required to build nvencc.
    

    After running configure script, file "config.log" is generated for configure logs, please have look and check for error reasons or attach the file.

  2. g++-13
    Although I'm not familiar with aur nor PKGBUILD, gcc13 is not compatible with CUDA 11.8. I think you will need to update to CUDA 12.4 to be compiled with gcc13. (and I've not tested gcc14)
    Compile error on recent Arch #533

@tukot870
Copy link
Author

I can't upgrade because other programs use cuda 11.8 .
Aur is like a repo for packages that are not official in arch main repo . Official packages are compiled and aur's can already be compiled and then just installed but usually you need to compile it on your machine .

And PKGBUILD contains steps for installing and/or building
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=nvenc

This is the main page of package
https://aur.archlinux.org/packages/nvenc

config.log

### - checking for libavformat... --------------
------ command ------------
g++ -w cxx_check.c -Wall -Wno-unknown-pragmas -Wno-unused -Wno-missing-braces -DLINUX -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -pthread -msse2 -fPIE -O3 -DNDEBUG=1 -mfpmath=sse -ffast-math -fomit-frame-pointer -L. -ldl -lstdc+>
------ test ---------------
#include <iostream>
extern "C" {
#include <libavformat/avformat.h>
}
int main(void){ avformat_find_stream_info(0,0);; std::cout << "Hello World!" << std::endl; return 0;}
---------------------------
/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendbfsf2@GCC_13.0.0'
/usr/bin/ld: /usr/lib/libx265.so.209: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32'
/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendhfdf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libvapoursynth-script.so.0: undefined reference to `__cxa_call_terminate@CXXABI_1.3.15'
collect2: error: ld returned 1 exit status
### - test fin -> 1 ----------
no

### - checking for libavfilter... --------------
------ command ------------
g++ -w cxx_check.c -Wall -Wno-unknown-pragmas -Wno-unused -Wno-missing-braces -DLINUX -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -pthread -msse2 -fPIE -O3 -DNDEBUG=1 -mfpmath=sse -ffast-math -fomit-frame-pointer -L. -ldl -lstdc+>
------ test ---------------
#include <iostream>
extern "C" {
#include <libavfilter/avfilter.h>
}
int main(void){ avfilter_version();; std::cout << "Hello World!" << std::endl; return 0;}
---------------------------
/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendbfsf2@GCC_13.0.0'
/usr/bin/ld: /usr/lib/libx265.so.209: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32'
/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendhfdf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libvapoursynth-script.so.0: undefined reference to `__cxa_call_terminate@CXXABI_1.3.15'
collect2: error: ld returned 1 exit status
### - test fin -> 1 ----------
no

### - checking for AVChannelLayout... --------------
------ command ------------
g++ -w cxx_check.c -Wall -Wno-unknown-pragmas -Wno-unused -Wno-missing-braces -DLINUX -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -pthread -msse2 -fPIE -O3 -DNDEBUG=1 -mfpmath=sse -ffast-math -fomit-frame-pointer -L. -ldl -lstdc+>
------ test ---------------
#include <iostream>
extern "C" {
#include <libavutil/channel_layout.h>
}
int main(void){ AVChannelLayout ch_layout;; std::cout << "Hello World!" << std::endl; return 0;}
---------------------------
/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendbfsf2@GCC_13.0.0'
/usr/bin/ld: /usr/lib/libx265.so.209: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32'
/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendhfdf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libvapoursynth-script.so.0: undefined reference to `__cxa_call_terminate@CXXABI_1.3.15'
collect2: error: ld returned 1 exit status
### - test fin -> 1 ----------
no

### - checking for AVFrame::duration... --------------
------ command ------------
g++ -w cxx_check.c -Wall -Wno-unknown-pragmas -Wno-unused -Wno-missing-braces -DLINUX -DUNIX -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -pthread -msse2 -fPIE -O3 -DNDEBUG=1 -mfpmath=sse -ffast-math -fomit-frame-pointer -L. -ldl -lstdc+>
------ test ---------------
#include <iostream>
extern "C" {
#include <libavutil/frame.h>
}
int main(void){ AVFrame *frame; frame->duration = 0;; std::cout << "Hello World!" << std::endl; return 0;}
---------------------------
/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendbfsf2@GCC_13.0.0'
/usr/bin/ld: /usr/lib/libx265.so.209: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32'
/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendhfdf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libvapoursynth-script.so.0: undefined reference to `__cxa_call_terminate@CXXABI_1.3.15'
collect2: error: ld returned 1 exit status
### - test fin -> 1 ----------
no

@rigaya
Copy link
Owner

rigaya commented Aug 15, 2024

I can't upgrade because other programs use cuda 11.8.

The easiest way to build and avoid these kind of errors is to use the latest compiler and CUDA version which supports it. If it is difficult to upgrade CUDA, then I'm sorry but it might be difficult to build.

Building with gcc12 or below might do, but generally speaking, you might need to also rebuild the other required libraries such as libavutil, libavcodec, libavformat, libavfilter, libswresample.

From the log, you will need to fix the errors below yourself, which seems to be related with the libraries used. Generally, it is caused by mismatch of gcc version between the compiler currently used and the one used for building libraries.

/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendbfsf2@GCC_13.0.0'
/usr/bin/ld: /usr/lib/libx265.so.209: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32'
/usr/bin/ld: /usr/lib/libhwy.so.1: undefined reference to `__extendhfdf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libvapoursynth-script.so.0: undefined reference to `__cxa_call_terminate@CXXABI_1.3.15'

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

No branches or pull requests

2 participants