ambrosiogabe / MathAnimation

A simple C++/OpenGL application to create quick and dirty mathematically accurate animations
979 stars 47 forks source link

Add Linux Support #58

Open ambrosiogabe opened 1 year ago

ambrosiogabe commented 1 year ago

This is just to track progress on Linux support. Once support and README instructions get added for building on Linux, this issue can be resolved.

dromer commented 1 year ago

I was just trying to build this on linux, mainly get stuck on finding the following libraries:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIB_AVCODEC
    linked by target "MathAnimations" in directory /home/dreamer/Sources/_downloads/MathAnimation
LIB_AVDEVICE
    linked by target "MathAnimations" in directory /home/dreamer/Sources/_downloads/MathAnimation
LIB_AVFILTER
    linked by target "MathAnimations" in directory /home/dreamer/Sources/_downloads/MathAnimation
LIB_AVFORMAT
    linked by target "MathAnimations" in directory /home/dreamer/Sources/_downloads/MathAnimation
LIB_AVUTIL
    linked by target "MathAnimations" in directory /home/dreamer/Sources/_downloads/MathAnimation
LIB_SWRESAMPLE
    linked by target "MathAnimations" in directory /home/dreamer/Sources/_downloads/MathAnimation
LIB_SWSCALE
    linked by target "MathAnimations" in directory /home/dreamer/Sources/_downloads/MathAnimation
arf20 commented 1 year ago

@dromer I solved the ffmpeg issue First build ffmpeg in Animations/vendor/ffmpeg with:

./configure
make -j<CPUs>

Then in cmakelists:

find_library(LIB_AVCODEC avcodec HINTS ${CMAKE_SOURCE_DIR}/Animations/vendor/ffmpeg/libavcodec)
find_library(LIB_AVDEVICE avdevice HINTS ${CMAKE_SOURCE_DIR}/Animations/vendor/ffmpeg/libavdevice)
find_library(LIB_AVFILTER avfilter HINTS ${CMAKE_SOURCE_DIR}/Animations/vendor/ffmpeg/libavfilter)
find_library(LIB_AVFORMAT avformat HINTS ${CMAKE_SOURCE_DIR}/Animations/vendor/ffmpeg/libavformat)
find_library(LIB_AVUTIL avutil HINTS ${CMAKE_SOURCE_DIR}/Animations/vendor/ffmpeg/libavutil)
find_library(LIB_SWRESAMPLE swresample HINTS ${CMAKE_SOURCE_DIR}/Animations/vendor/ffmpeg/libswresample)
find_library(LIB_SWSCALE swscale HINTS ${CMAKE_SOURCE_DIR}/Animations/vendor/ffmpeg/libswscale)

Because thats where the .a files are supposed to be, and find_library adds the lib prefix itself.

arf20 commented 1 year ago

Animations/vendor/nativeFileDialog/src/nfd_win.cpp depends in the Windows header.

arf20 commented 1 year ago

Line 180 of CMakeLists, nfd_win.cpp -> nfd_gtk.cpp, solved

arf20 commented 1 year ago

cppUtils.hpp:254: g++ doesn't find \, requires C++20 (god damn new). so we

set(CMAKE_CXX_STANDARD 20)

but in CMakeLists.txt, but turns out that Luau can't be build in C++20 because it defines lerp(), which conflicts with the STL.

arf20 commented 1 year ago

Okay so apparently \ is not required, so we can just comment it lol. No C++20 required. Next problem is in the same file, cppUtils.hpp:548, localtime_s and fopen_s are not declared, windows ffs.

ambrosiogabe commented 1 year ago

Hi @arf20 thanks for the comments! I should have included that Linux support is currently being added and in progress here: https://github.com/ambrosiogabe/MathAnimation/pull/47 , so most of these issues are being addressed.

arf20 commented 1 year ago

Oh damn, you are already much more ahead of me, apparently builds. Sorry, gl with the port.

ambrosiogabe commented 1 year ago

No worries, Toby, a community member, is actually the one implementing the changes. Sorry for not addressing this earlier!

Toby222 commented 1 year ago

I'm the Toby, and I'm slooowly getting there ^^;