CppSharp building on OS X

93 views
Skip to first unread message

papa...@gmail.com

unread,
Jan 28, 2015, 5:04:04 PM1/28/15
to cppsha...@googlegroups.com
I'm having troubles building on OS X - a previous post here indicated that the 64-bit version fails to build because mono is 32-bit (I confirmed my mono VM is 32-bit). The source code builds but it fails at Build.Gen.dll.

So, trying to build the 32-bit version I get this:

https://gist.github.com/joshuaferguson/860077faf076b113cb28#file-gistfile1-txt

Apparently my LLVM libraries are 64-bit. I've build llvm and clang with the 32-bit flag set. I'm not sure what else to try.

João Matos

unread,
Jan 28, 2015, 6:13:04 PM1/28/15
to papa...@gmail.com, cppsha...@googlegroups.com
Hi,

I think your LLVM/Clang compile is 64-bits but needs to be 32-bit.

There is a flag named LLVM_BUILD_32_BITS that you should set to true when configuring CMake. I think that should be enough to get it going from the build log you provided.

If you haven't yet please check out the getting started guide at: https://github.com/mono/CppSharp/blob/master/docs/GettingStarted.md

Let me know if the problem persists and you need further help.


--
You received this message because you are subscribed to the Google Groups "CppSharp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cppsharp-lis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
João Matos

papa...@gmail.com

unread,
Jan 28, 2015, 8:53:21 PM1/28/15
to cppsha...@googlegroups.com, papa...@gmail.com
Thanks for the response. I did in fact set the LLVM_BUILD_32_BITS flag. However, I found when running make on the CppSharp that in order to get the .cpp files to compile and link for config=release_x64, I had to "make install" the llvm project. Is there a problem with the CppShare make files that's not referencing the build in the deps folder? I couldn't run the make command like the guide state, either - I had to go into the gmake directory and run the make form there. Is there something I'm missing?

Thanks!

navysparks

unread,
Jun 22, 2015, 12:17:14 AM6/22/15
to cppsha...@googlegroups.com, papa...@gmail.com
I notice the same problem in the OS X environment. Following the OS X instructions did not work for me. I am attempting to compile and link for config=release_x32, and while the linker warnings about the i386 architecture are missing, I still receive the first linker warning:
ld: warning: directory not found for option '-L/usr/lib32'

I also had to cd into the gmake directory to kick off the build- the location of the Makefiles is obvious from the output of premake, but this is not reflected in the Readme instructions.

Is OS X support something that needs more attention? If so, how could I get started helping out?

João Matos

unread,
Jun 22, 2015, 7:39:09 AM6/22/15
to navysparks, cppsha...@googlegroups.com, Josh Ferguson
It's possible the OS X build needs some attention on environments different than the ones I've tested with. 

We've been using CppSharp on OS X in production for a few months at Xamarin though so it definitely works at least on the environments I've been working with.

I'm working on setting up a build bot so that we can more closely monitor the build in OS X.

Can you open an issue on Github and post the build log with the errors you're getting? Don't worry about the warning, that's harmless.



--
You received this message because you are subscribed to the Google Groups "CppSharp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cppsharp-lis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
João Matos

navysparks

unread,
Jun 22, 2015, 9:39:55 AM6/22/15
to cppsha...@googlegroups.com, papa...@gmail.com, brad....@gmail.com
Thanks, I will ignore the linker warning. I double-checked the github issues and found one that matches the issues in my build log -- issue #494. This was opened 2 days ago. Apparently a feature had to be added that caused regression in the OS X build?

Glad to hear it works for your environment. One suggestion is to document the known working environment alongside the build instructions. 

I look forward to getting this working. Keep up the excellent work on this tool- it appears to have helped lots of people.

João Matos

unread,
Jun 22, 2015, 12:58:14 PM6/22/15
to navysparks, cppsha...@googlegroups.com, Josh Ferguson
The issue should be fixed now. Build works here on OSX. Please let me know if you hit any further problems.

navysparks

unread,
Jun 22, 2015, 4:12:05 PM6/22/15
to cppsha...@googlegroups.com, papa...@gmail.com, brad....@gmail.com
Thanks! I just successfully built the project.
Reply all
Reply to author
Forward
0 new messages