Bug 25175 - Compilation error: temporary mcs not working
Summary: Compilation error: temporary mcs not working
Alias: None
Product: MonoMac
Classification: Desktop
Component: Bindings ()
Version: GIT
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Chris Hamons
Depends on:
Reported: 2014-12-09 06:25 UTC by ingwie2000
Modified: 2014-12-09 22:57 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description ingwie2000 2014-12-09 06:25:57 UTC
Good afternoon!

After cloning the latest mono/mono.git repository, I did as described and attempted to compile Mono on my Mac. Result:

$ CC='cc -m32' ./autogen.sh --prefix=$PREFIX --disable-nls --build=i386-apple-darwin$(uname -r)
... Configure ...
$ make
... Make ...
if test -w /Users/Ingwie/Work/mono/mcs; then :; else chmod -R +w /Users/Ingwie/Work/mono/mcs; fi
cd /Users/Ingwie/Work/mono/mcs && /Applications/Xcode.app/Contents/Developer/usr/bin/make --no-print-directory -s NO_DIR_CHECK=1 PROFILES='net_4_0 net_4_5 xbuild_12 xbuild_14   ' CC='cc -m32' all-profiles
make[6]: mcs: No such file or directory
make[6]: *** [build/deps/basic-profile-check.exe] Error 1
*** The compiler 'mcs' doesn't appear to be usable.
*** You need Mono version 3.2 or better installed to build MCS
*** Check mono README for information on how to bootstrap a Mono installation.
/bin/sh: mcs: command not found
*** The version of 'mcs' is: .
make[5]: *** [do-profile-check] Error 1
make[4]: *** [profile-do--basic--all] Error 2
make[3]: *** [profiles-do--all] Error 2
make[2]: *** [all-local] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

The same error is produced when compiling for 64bit. Running MCS from the build results in:

$ ./runtime/_tmpinst/bin/mcs
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/lib/mono/4.5/mscorlib.dll' directory.

"/lib" is not available on Mac OS - rather /usr/lib or /usr/local/lib.

Mono's Auto*-based configuration should not hardcode such paths, maybe...

My platform:
$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.10.1
BuildVersion:	14B25
$ xcrun --show-sdk-version
$ automake --version
automake (GNU automake) 1.14.1
$ autoconf --version
autoconf (GNU Autoconf) 2.69
$ clang --version
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

Kind regards,
Comment 1 Rodrigo Kumpera 2014-12-09 11:12:06 UTC
Hi Ingwie,

You can change the install targets at configure time by passing a different --prefix to it.

When compiling mono you must have a recent enough one installed in the system or use monolite.
Comment 2 ingwie2000 2014-12-09 22:10:43 UTC
Hey Rodrigo.

I did use the defined make target - but only ran into a 404 message, saying the file is not available. Looks like the Makefile's URL is a bit outdated.

Then I googled a little and found the Wrench (a network of buildbots if I got that right?) but could not find any "successful" build of OS X related releases. Well, I did - but only two commits out of a felt 20 were marked as having been successful. Further, I could not find a download link to monolite...

Maybe I just looked wrong. But could you maybe point me to where I can pick up an actual monolite package? By the way:

$ make get-monolite-latest
rm -fr /Users/Ingwie/Work/mono/mcs/class/lib/monolite-*
mkdir -p /Users/Ingwie/Work/mono/mcs/class/lib
test ! -d /Users/Ingwie/Work/mono/mcs/class/lib/monolite || test ! -d /Users/Ingwie/Work/mono/mcs/class/lib/monolite.old || rm -fr /Users/Ingwie/Work/mono/mcs/class/lib/monolite.old
test ! -d /Users/Ingwie/Work/mono/mcs/class/lib/monolite || mv -f /Users/Ingwie/Work/mono/mcs/class/lib/monolite /Users/Ingwie/Work/mono/mcs/class/lib/monolite.old
cd /Users/Ingwie/Work/mono/mcs/class/lib && { (wget -O- http://storage.bos.xamarin.com/mono-dist-master/latest/monolite-113-latest.tar.gz || curl http://storage.bos.xamarin.com/mono-dist-master/latest/monolite-113-latest.tar.gz) | gzip -d | tar xf - ; }
--2014-12-10 04:09:13--  http://storage.bos.xamarin.com/mono-dist-master/latest/monolite-113-latest.tar.gz
Resolving storage.bos.xamarin.com...
Connecting to storage.bos.xamarin.com||:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-12-10 04:09:14 ERROR 404: Not Found.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   601    0   601    0     0   1131      0 --:--:-- --:--:-- --:--:--  1133
gzip: unknown compression format
cd /Users/Ingwie/Work/mono/mcs/class/lib && mv -f monolite-* monolite
mv: rename monolite-* to monolite: No such file or directory
make: *** [get-monolite-latest] Error 1

Kind regards, Ingwie
Comment 3 Rodrigo Kumpera 2014-12-09 22:57:25 UTC
Mono is currently going through a series of bootstrapping problems so it won't be as trivial as it looks.

This sort of discussion, on how to build it from source, belongs to the community mailing list an not bugzilla.