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

Cannot Build obs-midi-mg in Fedora. #145

Open
GraysonPeddie opened this issue Oct 17, 2024 · 4 comments
Open

Cannot Build obs-midi-mg in Fedora. #145

GraysonPeddie opened this issue Oct 17, 2024 · 4 comments

Comments

@GraysonPeddie
Copy link

As there is not an RPM package, I tried to use alien to convert from deb to rpm which works fine, but I tried installing obs-midi-mg with the created .rpm file and I get package conflicts with filesystem.

So, I turned over to build obs-midi-mg from source. I did a cmake .. inside a build directory I created.

-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at cmake/linux/defaults.cmake:63 (find_package):
  By not providing "FindLibObs.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "LibObs", but
  CMake did not find one.

  Could not find a package configuration file provided by "LibObs" with any
  of the following names:

    LibObsConfig.cmake
    libobs-config.cmake

  Add the installation prefix of "LibObs" to CMAKE_PREFIX_PATH or set
  "LibObs_DIR" to a directory containing one of the above files.  If "LibObs"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:15 (include)


-- Configuring incomplete, errors occurred!

Seems to me building from source with cmake is complicated for me. Can I please at least have a proper RPM package for installing obs-midi-mg?

Thank you.

@InfoSec812
Copy link

I just cloned on Fedora 41 today and was able to start building with the following:

mkdir ../obs-midi-build
cmake -DQT_VERSION=5 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -S ${PWD} -B ../obs-midi-build
cd ../obs-midi-build
make

But I get a different error:

[ 22%] Building CXX object libremidi/CMakeFiles/libremidi.dir/include/libremidi/writer.cpp.o
/home/dphillips/Documents/Personal/Workspace/obs-midi-mg/libremidi/include/libremidi/writer.cpp: In member function ‘void libremidi::writer::write(std::ostream&) const’:
/home/dphillips/Documents/Personal/Workspace/obs-midi-mg/libremidi/include/libremidi/writer.cpp:205:30: error: conversion from ‘int’ to ‘uint16_t’ {aka ‘short unsigned int’} may change value [-Werror=conversion]
  205 |   util::write_uint16_be(out, ticksPerQuarterNote);
      |                              ^~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [libremidi/CMakeFiles/libremidi.dir/build.make:216: libremidi/CMakeFiles/libremidi.dir/include/libremidi/writer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: libremidi/CMakeFiles/libremidi.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

@InfoSec812
Copy link

Turning off CMAKE_COMPILE_WARNING_AS_ERROR lets me get a little further until I get this error:

In file included from /home/dphillips/Documents/Personal/Workspace/obs-midi-mg/src/actions/../mmg-utils.h:20,
                 from /home/dphillips/Documents/Personal/Workspace/obs-midi-mg/src/actions/../mmg-message.h:22,
                 from /home/dphillips/Documents/Personal/Workspace/obs-midi-mg/src/actions/mmg-action.h:22,
                 from /home/dphillips/Documents/Personal/Workspace/obs-midi-mg/src/actions/mmg-action.cpp:19:
/home/dphillips/Documents/Personal/Workspace/obs-midi-mg/src/actions/../obs-midi-mg.h:22:10: fatal error: QObject: No such file or directory
   22 | #include <QObject>
      |          ^~~~~~~~~

Looks like it's not finding the QT headers... Investigating.

@InfoSec812
Copy link

OK, adding -DENABLE_QT=ON to the cmake command is getting me further, but I am seeing a LOT of warnings...

@InfoSec812
Copy link

InfoSec812 commented Jan 6, 2025

And it seems to be working... Here's what I did and my current concerns:

  1. Clone the repo
  2. Change to the repo directory
  3. Create a dir, outside of the source dir, where the build is done (e.g. mkdir /tmp/obs-midi-mg-build)
  4. Run cmake with the following params:
    cmake -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF -DENABLE_QT=ON -DCMAKE_BUILD_TYPE=linux-ci-x86_64 -DCMAKE_INSTALL_PREFIX=/usr -S ${PWD} -B /tmp/obs-midi-mg-build
    
  5. Change to the build dir (e.g. /tmp/obs-midi-mg-build)
  6. Run make
  7. Run sudo make install

As to my concerns, there are a LOT of warnings during the build and under normal circumstances the -Werror would prevent these from completing... Perhaps there is something which can be done via the profiles, but I am not conversant enough to know how to fix this.

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