Problem compiling libretro on Linux Ubuntu

Hello,

I can not compile Libretro on Ubuntu, I obtain this error:

=== Building virtualjaguar ===
make: Rien à faire pour « all ».
=== OpenGL enabled ===
=== Building Mupen 64 Plus (x86_64 dynarec) ===
make: Rien à faire pour « all ».
=== OpenGL enabled ===
=== Building ffmpeg ===
Package libswresample was not found in the pkg-config search path.
Perhaps you should add the directory containing `libswresample.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libswresample' found
"gcc" -c -std=gnu99 -o libretro.o libretro.c -DHAVE_GL -I/usr/include/freetype2 -I/usr/include/fribidi   -pthread -DHAVE_STRUCT_SOCKADDR_STORAGE -DHAVE_STRUCT_ADDRINFO -DHAVE_FMINF          -D__LIBRETRO__ -DHAVE_SSA -DHAVE_GL_FFT -Wall -fPIC -O3 -DHAVE_INTRINSICS_NEON=0
libretro.c:18:38: fatal error: libswresample/swresample.h: Aucun fichier ou dossier de ce type
 #include <libswresample/swresample.h>
                                      ^
compilation terminated.
make: *** [libretro.o] Erreur 1
Failed to build ffmpeg
cp: impossible d'évaluer «ffmpeg_libretro.so»: Aucun fichier ou dossier de ce type
=== OpenGL enabled ===
=== Building 3dengine ===
make: Rien à faire pour « all ».
=== OpenGL enabled ===
=== Building ppsspp ===
make: Rien à faire pour « all ».
=== Building o2em ===
"g++" -o o2em_libretro.dll libretro.o src/audio.o src/cpu.o src/crc32.o src/cset.o src/debug.o src/keyboard.o src/score.o src/table.o src/timefunc.o src/vdc.o src/vmachine.o src/voice.o src/vpp.o src/vpp_cset.o allegrowrapper/wrapalleg.o -static-libgcc -static-libstdc++ -lwinmm  -shared -Wl,--no-undefined -Wl,--version-script=link.T
/usr/bin/ld.bfd.real: libretro.o: réadressage de R_X86_64_32S en vertu de « .rodata.str1.1 » ne peut être utilisé lors de la création d'un objet partagé; recompilez avec -fPIC
libretro.o: error adding symbols: Mauvaise valeur
collect2: error: ld returned 1 exit status
make: *** [o2em_libretro.dll] Erreur 1
Failed to build o2em
cp: impossible d'évaluer «o2em_libretro.so»: Aucun fichier ou dossier de ce type

  1. As you can see on the terminal log, “Package libswresample was not found in the pkg-config search path.” so it can not compile ffmpeg_libretro.so.

  2. Then it can not compile o2em

I don’t know if this 2 errors are related, does o2em need ffmpeg_libretro.so to compile or it is another problem? On ubuntu, FFMPEG is considered as obsolete and avconv is installed instead. So the libswresample package is not in the official Ubuntu depot.

Please help.

FFmpeg is necessary for the ffmpeg-libretro core, which indeed failed, but o2em failed for another reason. It’s trying to build a DLL (i.e., a Windows dynamic library), so it seems to have misdetected your platform for that one. It looks like the other cores have built successfully, though, and should be in your ‘dist’ subdirectory in your source tree.

Thank you for your quick answer. Do you think I have to open an issue on Github for FFMPEG libretro module (ask to add ubuntu compatibility) and another for o2em for misdetection of linux platform?

You can open issues if you like, but FFmpeg-libretro isn’t going to switch to libav. There is a way to compile it using its own internal dependencies and this will work on Ubuntu, but it doesn’t work directly through the libretro-super scripts. You’ll have to modify the makefile for that core directly.

O2em is very new and isn’t surprising that it still needs work, but if you want to open the issue about it, go nuts :slight_smile:

You can change libretro/Makefile like it:

LIBRETRO_SWITCH        = 1

INTERNAL_LIBAVCODEC    = 1
INTERNAL_LIBAVFORMAT   = 1
INTERNAL_LIBAVUTIL     = 1
INTERNAL_LIBSWRESAMPLE = 1
INTERNAL_LIBSWSCALE    = 1

The problem is that you can’t compile with some CPU optimizations, like HAVE_SSE2 = 1 and HAVE_THREADS = 2, you’ll get errors with them. If you install ffmpeg in your system, in the place of libav, you can compile the core with these options = 0, and then you’ll get a better performance, since the ffmpeg probably have these CPU optimizations enabled, but you’ll mess and break the system.

The testing ppa has this ffmpeg core, without optimizations (and it’s big).

I compiled the last git yesterday without errors on Ubuntu 14.04 and his FFMPEG fork LIBAV. Someone should had correct this, thanks to him.