JeffM2501 / LunarLambda

Open source bridge simulator. Build with the LudicrousElectron engine
MIT License
1 stars 1 forks source link

Verify build on OS X #4

Open JeffM2501 opened 6 years ago

JeffM2501 commented 6 years ago

The build on MacOS needs to be verified. Optimally using Visual Studio for Mac, https://docs.microsoft.com/en-us/visualstudio/mac/

But also with the latest mono tools (mono develop or msbuild)

JeffM2501 commented 6 years ago

Note that since this is a C# project, it does not compile down to a normal Mach-O binary like a C++ or Objective C program on OSX. The results of compilation are a Common Language Runtime (CLR) .exe file. This .exe file is run by the mono runtime package. The exe files are NOT run by wine, and not run in emulation. The CLR exe format is the intermediary binary format used by all platforms.

There is no need for a OSXspecific binary build in order to run the project. The reason for making sure the build works on OSX is to allow for mac users to develop the project..

Lunar Lambda uses the most current version of the .net framework (v4.7.1) and thus requires a recent build of mono to work. Mono is not shipped by apple, and may need to be installed manually from https://www.mono-project.com/docs/getting-started/install/mac/ if it is not installed as part of the Visual Studio for Mac.

I don't have a Mac so I can't test any of this, and it's all just theoretical, what actually has to be done to build may change from my expectations, and that's fine. I just need the info on what OSX needs.

msbeck commented 6 years ago

Installed VS and cloned the game and the engine.

Ran debug and got the following runtime exception:

  at Microsoft.Xna.Framework.SDL2_FNAPlatform.ProgramInit () [0x00022] in /Users/Projects/LudicrousElectron/FNA/src/FNAPlatform/SDL2_FNAPlatform.cs:62
  at Microsoft.Xna.Framework.FNAPlatform..cctor () [0x002b7] in /Users/Projects/LudicrousElectron/FNA/src/FNAPlatform/FNAPlatform.cs:89
  --- End of inner exception stack trace ---
  at at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
  at Microsoft.Xna.Framework.Audio.AudioDevice.Initialize () [0x00048] in /Users/Projects/LudicrousElectron/FNA/src/Audio/AudioDevice.cs:138
  at Microsoft.Xna.Framework.FrameworkDispatcher.Update () [0x00011] in /Users/Projects/LudicrousElectron/FNA/src/FrameworkDispatcher.cs:42
  at LudicrousElectron.Engine.Audio.SoundManager.Setup () [0x00001] in /Users/Projects/LudicrousElectron/Engine/Audio/SoundManager.cs:77
  at LudicrousElectron.Engine.Core.Setup () [0x00001] in /Users/Projects/LudicrousElectron/Engine/Core.cs:108
  at LunarLambda.Program.SetupCore () [0x00001] in /Users/Projects/lunarlambda/Application/Program.cs:158
  at LunarLambda.Program.Main (System.String[] args) [0x00027] in /Users/Projects/lunarlambda/Application/Program.cs:44

Run copy_win_libs.bat from the LunarLambda to copy the required dependency libs into the runtime folders.

Realized I hadn't run the bash script yet, but that errored when I did:


copy_win_libs.bat: line 1: syntax error near unexpected token `('
copy_win_libs.bat: line 1: `if exist _bin_debug\ ('```
msbeck commented 6 years ago

I copied those DLLs manually.

After running, got:

/Library/Frameworks/Mono.framework/Versions/5.12.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Error MSB3073: The command "copy /Users/Projects/lunarlambda/Campaigns/Standard/bin/Debug/LunarLambda.Campaigns.Standard.dll /Users/Projects/lunarlambda/data/plugins" exited with code 127. (MSB3073) (Standard)
/Library/Frameworks/Mono.framework/Versions/5.12.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Error MSB3073: The command "copy /Users/Projects/lunarlambda/Campaigns/Scenarios/BasicScenarios/bin/Debug/LunarLambda.Campaigns.BasicScenarios.dll /Users/Projects/lunarlambda/data/plugins" exited with code 127. (MSB3073) (BasicScenarios)

so I copied LunarLambda.Campaigns.BasicScenarios.dll and LunarLambda.Campaigns.Standard.dll into the Plugins folder manually.

I get the same error as the previous comment.

msbeck commented 6 years ago

When I clean and rebuild I get

/Library/Frameworks/Mono.framework/Versions/5.12.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Error MSB3073: The command "if "Debug" == "Debug" if exist /Users/Projects/lunarlambda/_bin_debug copy /Users/Projects/lunarlambda/Application/bin/Debug/*.exe /Users/Projects/lunarlambda/_bin_debug
if "Debug" == "Debug" if exist /Users/Projects/lunarlambda/_bin_debug copy /Users/Projects/lunarlambda/Application/bin/Debug/*.dll /Users/Projects/lunarlambda/_bin_debug
if "Debug" == "Release" if exist /Users/Projects/lunarlambda/_bin_debug copy /Users/Projects/lunarlambda/Application/bin/Debug/*.exe /Users/Projects/lunarlambda/_bin_release
if "Debug" == "Release" if exist /Users/Projects/lunarlambda/_bin_debug copy /Users/Projects/lunarlambda/Application/bin/Debug/*.dll /Users/Projects/lunarlambda/_bin_release" exited with code 1. (MSB3073) (LunarLambda)
JeffM2501 commented 6 years ago

I just checked in some changes that should copy the files for non windows OSs using the CP command.

As for the batch file that is windows only, it is not a shell script. I had put in the readme "At this time only windows has a bat file, but the other OS libs are in the Libs dir, just copy them manually."

The batch file copies the windows native libs into the build dirs.

There is a folder in the Libs dir for OSX. Those are the files that need to be copied into the bin dir. image

These are the only native libs in the project. They are not built as part of the compile, they are pre-made native libraries provided by other vendors.

Since I don't have a mac I could not write a copy_osx_libs.sh file. I need someone to write that for me. It needs to copy all the .dylib files from Libs/osx into the _bin_debug and _bin_release folders. No files from libs/msvc are needed on OSX.