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

Compilation and performance issues on Linux Manjaro #1191

Closed
unelsson opened this issue Jan 2, 2023 · 4 comments
Closed

Compilation and performance issues on Linux Manjaro #1191

unelsson opened this issue Jan 2, 2023 · 4 comments

Comments

@unelsson
Copy link
Contributor

unelsson commented Jan 2, 2023

As of 2.1.2023 there are compilation and performance issues on Linux Manjaro (Arch-based distro).

First, I got ffmpeg error about missing av_free_packet and some other similar ffmpeg-related errors. I believe there are commands that are not any more supported by new ffmpeg versions. I used cmake options from AUR PKGBUILD for testing, and for some reason didn't get this with later builds even when trying to compile with ffmpeg.
edit: DUPLICATE of #1111

There's a warning about policy [CMP0072](https://cmake.org/cmake/help/latest/policy/CMP0072.html), related to OpenGL version settings. cmake_policy(SET CMP0072 OLD) is the default, so adding that in CMakeLists.txt compiles. However, cmake_policy(SET CMP0072 NEW) fails to build with various ld OpenGL linking errors, such as: /usr/bin/ld: ../../lib/libosgUtil.so.3.6.5: undefined reference to glClearDepth'. Linking errors can be fixed by adding add_link_options("-lGL")` to CMakeLists.txt.

Still, testing with OpenMW 0.48 branch, there are some performance issues that may be related to how OSG compiles on newer Manjaro with settings mentioned above. I've had much better performance in the past.
edit: This was caused by wrong build settings, therefore it's not OSG issue.

@unelsson
Copy link
Contributor Author

unelsson commented Jan 2, 2023

I also got the following FindOpenSceneGraph errors when compiling OpenMW. This also has worked in the past.

CMake Warning at /usr/share/cmake/Modules/FindOpenSceneGraph.cmake:171 (message):
  [ FindOpenSceneGraph.cmake:171 ] Failed to parse version number, please
  report this as a bug
Call Stack (most recent call first):
  CMakeLists.txt:410 (find_package)


CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find OpenSceneGraph: Found unsuitable version "..", but required
  is at least "3.6.5"

edit: cmake version 3.25.1. This has worked in the past, so it may be related to some cmake changes.
edit 2: This was an user error: Related to old data in CMakeCache.txt, solved by deleting the file and running cmake again.

@unelsson
Copy link
Contributor Author

unelsson commented Jan 2, 2023

ffmpeg-related build errors

In file included from /.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp:10,
                 from /.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:1:
/.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegPacket.hpp: In member function ‘void osgFFmpeg::FFmpegPacket::clear()’:
/.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegPacket.hpp:45:17: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
   45 |                 av_free_packet(&packet);
      |                 ^~~~~~~~~~~~~~
      |                 av_new_packet
/.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp: In function ‘int osgFFmpeg::decode_audio(AVCodecContext*, int16_t*, int*, const uint8_t*, int, SwrContext*, int, int, AVSampleFormat)’:
/.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:48:11: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
   48 |     ret = avcodec_decode_audio4(avctx, frame, &got_frame, &avpkt);
      |           ^~~~~~~~~~~~~~~~~~~~~
      |           avcodec_decode_subtitle2
/.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:53:34: error: ‘av_frame_get_channels’ was not declared in this scope; did you mean ‘av_frame_get_buffer’?
   53 |     if (ret >= 0 && got_frame && av_frame_get_channels(frame)>0) {
      |                                  ^~~~~~~~~~~~~~~~~~~~~
      |                                  av_frame_get_buffer
/.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp: In member function ‘void osgFFmpeg::FFmpegDecoderAudio::open(AVStream*, osgFFmpeg::FFmpegParameters*)’:
/.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:154:29: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  154 |         m_context = stream->codec;
      |                             ^~~~~
/.../OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:217:55: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
  217 |         AVCodec * const p_codec = avcodec_find_decoder(m_context->codec_id);
      |                                   ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                                                       |
      |                                                       const AVCodec*

@critkitten
Copy link

#1111

@unelsson
Copy link
Contributor Author

unelsson commented Jan 2, 2023

Turns out these are duplicates or non-issues. Closing.

@unelsson unelsson closed this as completed Jan 2, 2023
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