obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
58.82k stars 7.83k forks source link

Building on Mac OSX 10.12.6 fails due to missing endian.h include #2205

Closed LukeKeywalker closed 4 years ago

LukeKeywalker commented 4 years ago

Expected Behavior

Running cmake would build OBS

Current Behavior

When running cmake it fails with an error specified in the build/CMakeFiles/CMakeError.log:

Building C object CMakeFiles/cmTC_f5539.dir/HAVE_ENDIAN_H.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc   -Wall -Wextra -Wvla -Wno-unused-function -Werror-implicit-function-declaration -Wno-missing-braces -Wno-missing-field-i
nitializers  -std=gnu99 -fno-strict-aliasing    -o CMakeFiles/cmTC_f5539.dir/HAVE_ENDIAN_H.c.o   -c /Users/lkzmvc/Projects/obs-studio/build/CMakeFiles/CheckIncludeFiles/HAVE_ENDIAN_H.c
/Users/lkzmvc/Projects/obs-studio/build/CMakeFiles/CheckIncludeFiles/HAVE_ENDIAN_H.c:2:10: fatal error: 'endian.h' file not found
#include <endian.h>
         ^~~~~~~~~~
1 error generated.
make[1]: *** [CMakeFiles/cmTC_f5539.dir/HAVE_ENDIAN_H.c.o] Error 1
make: *** [cmTC_f5539/fast] Error 2

Steps to Reproduce

  1. Follow the build guide
  2. Run cmake .. && make
  3. See error in the CMakeError.log
fzwoch commented 4 years ago

This sounds like the Xcode compiler tool chain is not correctly/completely installed. More specifically you may need the Xcode command line utilities installed.

Can you try running xcode-select --install in a terminal and see if it changes anything?

LukeKeywalker commented 4 years ago

Unfortunatelly it's not that:

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

I have used tool chain before and updated it prior to building. I worked around first error by symlinking /usr/include/machine/endian.h to /usr/local/include/endian.h, but then many errors like these follow:

Determining size of __int64 failed with the following output:
Change Dir: /Users/lkzmvc/Projects/obs-studio/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_ce644/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_ce644.dir/build.make CMakeFiles/cmTC_ce
644.dir/build
Building C object CMakeFiles/cmTC_ce644.dir/__INT64.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc   -Wall -Wextra -Wvla -Wno-unused-function -Werror-implicit-function-declarati
on -Wno-missing-braces -Wno-missing-field-initializers  -std=gnu99 -fno-strict-aliasing    -o CMakeFiles/cmTC_ce644.dir/__INT64.c.o   -c /Users/lkzmvc/Projects/obs-stud
io/build/CMakeFiles/CheckTypeSize/__INT64.c
/Users/lkzmvc/Projects/obs-studio/build/CMakeFiles/CheckTypeSize/__INT64.c:25:12: error: use of undeclared identifier '__int64'
  ('0' + ((SIZE / 10000)%10)),
           ^
/Users/lkzmvc/Projects/obs-studio/build/CMakeFiles/CheckTypeSize/__INT64.c:23:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(__int64))
                     ^
/Users/lkzmvc/Projects/obs-studio/build/CMakeFiles/CheckTypeSize/__INT64.c:26:12: error: use of undeclared identifier '__int64'
  ('0' + ((SIZE / 1000)%10)),

...
kkartaltepe commented 4 years ago

Please provide your actual cmake log instead of picking out what you think might be the error from the error log.

--- edit --- By this i mean the entire log, not snippets. And not CMakeError.log

LukeKeywalker commented 4 years ago

Sure @kkartaltepe, thank you for looking into it . Now I see that it complains about some unset variables, although I am not sure what it means. Here is the log:

$ cmake ..
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.10", minimum required is "2.7")
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
-- Found PythonLibs: /usr/bin/python2.7 (found suitable version "2.7.10", minimum required is "2.7")
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OBS_VERSION: 24.0.3-172-gf09c7d04-modified
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework
-- Found FFmpeg: /usr/local/Cellar/ffmpeg/4.2.1_2/lib/../lib/libavcodec.dylib (found version "58.54.100") found components:  avcodec avdevice avutil avformat
-- Found Libcurl: /usr/bin/../lib/libcurl.dylib
-- Luajit support not found.
-- Python support not found.
-- Scripting: Neither Python 3 nor Luajit was found; scripting plugin disabled
-- Jansson >=2.5 not found, building bundled version
C compiler: Clang
-- Looking for include file endian.h
-- Looking for include file endian.h - found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file sched.h
-- Looking for include file sched.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file sys/param.h
-- Looking for include file sys/param.h - found
-- Looking for include file sys/stat.h
-- Looking for include file sys/stat.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for close
-- Looking for close - found
-- Looking for getpid
-- Looking for getpid - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for open
-- Looking for open - found
-- Looking for read
-- Looking for read - found
-- Looking for sched_yield
-- Looking for sched_yield - found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of __int64
-- Check size of __int64 - failed
-- Check size of int64_t
-- Check size of int64_t - done
-- Check size of long long
-- Check size of long long - done
-- Check size of int32_t
-- Check size of int32_t - done
-- Check size of __int32
-- Check size of __int32 - failed
-- Check size of long
-- Check size of long - done
-- Check size of int
-- Check size of int - done
-- Check size of unsigned long
-- Check size of unsigned long - done
-- Check size of unsigned int
-- Check size of unsigned int - done
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Check size of uint32_t
-- Check size of uint32_t - done
-- Check size of __uint32
-- Check size of __uint32 - failed
-- Check size of uint16_t
-- Check size of uint16_t - done
-- Check size of __uint16
-- Check size of __uint16 - failed
-- Check size of uint8_t
-- Check size of uint8_t - done
-- Check size of __uint8
-- Check size of __uint8 - failed
-- Check size of ssize_t
-- Check size of ssize_t - done
-- Check size of SSIZE_T
-- Check size of SSIZE_T - failed
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoq
-- Looking for strtoq - found
-- Looking for _strtoi64
-- Looking for _strtoi64 - not found
-- Looking for include file locale.h
-- Looking for include file locale.h - found
-- Looking for localeconv
-- Looking for localeconv - found
-- Looking for setlocale
-- Looking for setlocale - found
-- Performing Test HAVE_INLINE
-- Performing Test HAVE_INLINE - Success
-- Performing Test HAVE___INLINE
-- Performing Test HAVE___INLINE - Success
-- Performing Test HAVE___INLINE__
-- Performing Test HAVE___INLINE__ - Success
-- Performing Test HAVE_SYNC_BUILTINS
-- Performing Test HAVE_SYNC_BUILTINS - Success
-- Performing Test HAVE_ATOMIC_BUILTINS
-- Performing Test HAVE_ATOMIC_BUILTINS - Success
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Found FFmpeg: /usr/local/Cellar/ffmpeg/4.2.1_2/lib/../lib/libavformat.dylib (found version "58.29.100") found components:  avformat avutil swscale swresample avcodec
-- Using libavcodec for image loading in libobs
-- Found zlib: /usr/bin/../lib/libz.dylib
-- Could NOT find LibVLC_INCLUDES (missing: VLC_INCLUDE_DIR)
-- LibVLC includes not found, VLC video plugin disabled
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for module 'jack'
--   No package 'jack' found
-- JACK Audio Connection Kit not found, disabling JACK plugin
-- Using the bundled VST header.
-- Found Libx264: /usr/local/Cellar/x264/r2917_1/lib/../lib/libx264.dylib
-- Libfdk not found - obs-libfdk plugin disabled
-- Found FFmpeg: /usr/local/Cellar/ffmpeg/4.2.1_2/lib/../lib/libavcodec.dylib (found version "58.54.100") found components:  avcodec avfilter avdevice avutil swscale avformat swresample
-- Found FFmpeg: /usr/local/Cellar/ffmpeg/4.2.1_2/lib/../lib/libavcodec.dylib (found version "58.54.100") found components:  avcodec avutil avformat
-- Found Libmbedtls: /usr/local/bin/../lib/libmbedtls.dylib;/usr/local/bin/../lib/libmbedcrypto.dylib;/usr/local/bin/../lib/libmbedx509.dylib
-- Found ftl-sdk: ftl outputs enabled
-- SpeexDSP support not found
-- Found AppKit: /System/Library/Frameworks/AppKit.framework
-- Configuring incomplete, errors occurred!
See also "/Users/lkzmvc/Projects/obs-studio/build/CMakeFiles/CMakeOutput.log".
See also "/Users/lkzmvc/Projects/obs-studio/build/CMakeFiles/CMakeError.log"
kkartaltepe commented 4 years ago

It looks like you have modified the cmake configuration locally and broken it.

-- edit -- Or your cmake install is broken as the error suggests.

-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.10", minimum required is "2.7")
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
-- Found PythonLibs: /usr/bin/python2.7 (found suitable version "2.7.10", minimum required is "2.7")

Is not a part of our build on the macos platforms that I can see. (the CI build)

kkartaltepe commented 4 years ago

You can try with -DDISABLE_PYTHON=1 and see if that fixes your issue perhaps. But I dont believe that is running at the point where it fails.

LukeKeywalker commented 4 years ago

Right... I jumped straight into adding source of obs-ffmpeg-encoder that I want to eventually modify, and was messing around with python versions. I should have tried building vanilla version first. Thanks for pointing that out.