server icon indicating copy to clipboard operation
server copied to clipboard

Mac OSX build

Open 7ammer opened this issue 8 years ago • 20 comments

I've recently noticed that CasparCG can be built for linux machines. Seeing as Mac OSX is based off of ~~Linux~~ Unix I was wondering how likely it would be to be able to build CasparCG for a Mac?

I was just going to try it myself but I have next to no experience on compiling applications so was hoping I could get some advice on whether this is theoretically possible or not before I spend time attempting to get something working.

Cheers :)

7ammer avatar Apr 17 '16 11:04 7ammer

So I decided to have a quick go anyway. I didn't really know what I was doing but I did this:

screen shot 2016-04-17 at 13 46 16

Then in the 'build' folder I ran "make -j8".

This is a dump of the failed output: http://pastebin.com/brqPPfKE

7ammer avatar Apr 17 '16 13:04 7ammer

This won't work out of the box... OSX is based on Unix not Linux.

ronag avatar Apr 17 '16 13:04 ronag

Oh well, there we go then.

Would you know if there's a lot left out of the box or if its a case of including/ swapping in some packages and config files.

7ammer avatar Apr 17 '16 13:04 7ammer

Not that it helps in your effort, but here is a good read on history of Mac OS: http://unix.stackexchange.com/a/713 Theoretically, you should be able to build it.

  • First, you should use the build scripts in the build-scripts directory and not run CMake directly
  • The server comes packaged with a number of binary dependencies for Linux and Weendoze only, so
  • You would need to pre-install them yourself and use this fork to build against system installed dependecies.
  • You should be able to install the needed dependencies through MacPorts and
  • The Blackmagic SDK should be installed from from the Blackmagic Design's website
  • You will probably need to tweak the system-build-linux.sh script and use it to disable some components

Good luck.

dimitry-ishenko avatar Apr 17 '16 14:04 dimitry-ishenko

Also CEF binaries are system dependant and Mac OS X version has to be downloaded from CEF web-site and manually added to the repository. I didn't try new CEF builds for Mac OS X yet, but when i tried last time (probably 2-3 years ago) there were some tricky parts with multi-threading inside CEF, so i ended up running single-threaded CEF inside my Mac OS X application, and that was slow

yapus avatar Apr 17 '16 14:04 yapus

Mamy errors look like compiler related. I wonder whether CMAKE_COMPILER_IS_GNUCXX is set to true for Clang and can not find answer - can you create simple CMakeLists.txt with: MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCXX: " ${CMAKE_COMPILER_IS_GNUCXX} ) MESSAGE( STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} ) and tell me what values were returned?

edited Maybe adding -std=c++11 -stdlib=libc++ compiler flags will help?

krzyc avatar Apr 17 '16 14:04 krzyc

Thanks for the thoughts and advice guys! I'll have another go but I'm really out of my depth here. I'm a web developer not a app developer so this is new ground for me.

@krzyc is this what you're asking for?

CMAKE_COMPILER_IS_GNUCXX: 
CMAKE_CXX_COMPILER_ID: Clang
Configuring done
Generating done

7ammer avatar Apr 17 '16 15:04 7ammer

@7immy Yes, I expected this output. Try replacing original CMakeLists.txt with modified one (it will not compile of course, but C++11 related errors should be gone and linker will be aware of osx dir where libs for OS X should be copied) https://github.com/krzyc/CasparCG-Server/blob/3fa150732bed599c0ae994da1de0ddd205adfea8/CMakeLists.txt Then you can provide failed output.

krzyc avatar Apr 17 '16 15:04 krzyc

Hey @krzyc. Ok so if I understand you correctly I should replace: /CMakeLists.txt with the link you gave me?

If so this is the output from CMAKE: http://pastebin.com/B14chWeK

and this is the MAKE build attempt: http://pastebin.com/CMv9pZ4p

Cheers :)

7ammer avatar Apr 17 '16 16:04 7ammer

Hmm...should we get a crowd-funding campaign going for Mac OS Support?

TomKaltz avatar Apr 17 '16 19:04 TomKaltz

I will fund a bit if it's possible, someone is up for the task, performance will match windows, not too many features will differ/miss and maitainability compared to linux version is minimal.

jesperstarkar avatar Apr 17 '16 19:04 jesperstarkar

I'm up for that!

7ammer avatar Apr 17 '16 19:04 7ammer

One thing I am worried about is the additional work associated with one more platform to support. I don't have a Mac to develop on so even if somebody else does the initial port I will need to be able to compile and run/debug later refactorings/features/bug fixes on Mac in addition to Windows/Linux.

The only other alternative is that after I have made some changes that breaks the Mac version, somebody else makes a pull request making the Mac version fully operational again.

HellGore avatar Apr 18 '16 09:04 HellGore

Yes, this is a concern. But if we have another dedicated developer with mac-skills, it's another story.

jesperstarkar avatar Apr 18 '16 09:04 jesperstarkar

We could also perhaps crowd-fund a Mac for Helge?

On Monday, April 18, 2016, Jesper Stærkær [email protected] wrote:

Yes, this is a concern. But if we have another dedicated developer with mac-skills, it's another story.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/CasparCG/Server/issues/428#issuecomment-211305222

Thomas Kaltz III 586-214-7150 Sent from Gmail Mobile

TomKaltz avatar Apr 18 '16 12:04 TomKaltz

Do you guys know if there is a worthwhile market for this? I know I would benefit from this but have others been asking for this two?

I don't mind testing if thats needed.

7ammer avatar Apr 18 '16 12:04 7ammer

screen shot 2016-04-18 at 14 44 38

I think this shows there is a "market". However, it's not worth starting messing about with a version that's not gonna be fully supported or maintained. But boy do I want to run CasparCG from my mac if the performance and features match windows.

jesperstarkar avatar Apr 18 '16 12:04 jesperstarkar

There could also be a difference between wanting to run the client on a platform and wanting to run the server on the same platform. I'm guessing that a Mac version could become popular for people who like to run the client on the same computer as the server, but not for broadcasting facility installations in a 19" rack. I think that sysadmins generally prefer Linux systems over both Windows and MacOS systems.

HellGore avatar Apr 18 '16 13:04 HellGore

Exactly. But my hypothesis is that at least half the user base runs the client and server on the same machine.

jesperstarkar avatar Apr 18 '16 13:04 jesperstarkar

To just pipe in here as a random observer: Had the server been available for Mac, we would've used it when we started to use Caspar (because Macs were all we had). Instead we spent good money on a very nice Windows machine, and it all turned out fine.

There's probably no definite way to determine a market for it, but if resources are available and people are willing to fund at least one stable build for Mac, it probably doesn't hurt. And it's not the end of the world if 2.2 came out later for Mac than for the other OS or even needs another crowdfund push. Might be nice to put a warning/notice in the Readme though about Mac Development not being actively pursued.

niklasR avatar Apr 18 '16 13:04 niklasR