About Monkey 2 › Forums › Monkey 2 Development › Compiling on Mac OS X
This topic contains 9 replies, has 4 voices, and was last updated by
abakobo
2 years, 8 months ago.
-
AuthorPosts
-
August 7, 2016 at 9:20 pm #2844
Just got latest sources from github, and module std does not build here:
[/crayon]Monkey12345678910111213141516[crayon-5cb9b540d9ccf124070914 inline="true" ]***** Making module 'std' *****Parsing...Semanting...Translating...Compiling....Build error: System command 'as -I"/Users/danilo/Monkey/monkey2/modules/monkey/native" -c -o "/Users/danilo/Monkey/monkey2/modules/std/std.buildv1.0.2/build_cache/desktop_release_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/danilo/Monkey/monkey2/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S"' failed.as -I"/Users/danilo/Monkey/monkey2/modules/monkey/native" -c -o "/Users/danilo/Monkey/monkey2/modules/std/std.buildv1.0.2/build_cache/desktop_release_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/danilo/Monkey/monkey2/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S"FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'c' flag!***** Fatal mx2cc error *****Build error.mx2cc version 1.0.2Ted2 and Launcher also can’t be build then (missing std.a).
Latest OS X ‘El Capitan’, Version 10.11.6
August 7, 2016 at 9:35 pm #2845It sounds like your xcode tools are wrong.
I would check my steps against readme.txt:
Monkey123456789101112***** Building monkey2 on MacOS/Linux *****1) Install the xcode command line tools. You can do this by entering 'xcode-select --install' in a shell.2) Open a shell and change to the 'monkey2/scripts' directory.3) Enter './rebuildall.sh' and hit return. Wait...4) If all went well, you should end up with a 'Monkey2 (...)' app in the monkey2 directory.5) You should now be able to build and run monkey2 apps. There is a simple 'hello-world.monkey2' test in the monkey2directory, and some simple demos in the '/bananas' directory. Docs can be found at 'docs/index.html'.and maybe version of your as:
Monkey1234567$ as -vApple LLVM version 7.3.0 (clang-703.0.31)Target: x86_64-apple-darwin15.6.0Thread model: posixInstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1as -triple x86_64-apple-macosx10.11.0 -filetype obj -main-file-name - -target-cpu core2 -dwarf-version=2 -fdebug-compilation-dir /Users/simon -dwarf-debug-producer Apple LLVM version 7.3.0 (clang-703.0.31) -mrelocation-model pic -o a.out -August 7, 2016 at 9:46 pm #2846Actually, the ‘-c’ flag shouldn’t be in there, will remove.
August 7, 2016 at 9:52 pm #2847Thanks Simon, but still not working.
Xcode Version 7.3.1 (7D1014)
Xcode command-line tools Version 7.3.1 (7D1014)‘as’ is there, but it does not understand the ‘-c’ flag.
‘ld -v’ output:
[/crayon]Monkey123[crayon-5cb9b540e2b36979266680 inline="true" ]@(#)PROGRAM:ld PROJECT:ld64-253.3configured to support archs: i386 x86_64 x86_64h armv6 armv7 armv7s armv7m armv7k arm64 (tvOS)LTO support using: LLVM version 3.7.1‘as -v’ output:
Apple Inc version cctools-877.5, GNU assembler version 1.38Your ‘ld’ shows LLVM version 7.3.0, mine shows version 3.7.1 –
looks like a typo and should probably be 7.3.1August 8, 2016 at 6:19 am #2848> Actually, the ‘-c’ flag shouldn’t be in there, will remove.
Thanks, Mark! Do you have a hint where I need to remove the ‘-c’ flag?
Can’t compile anything…August 17, 2016 at 9:51 am #3110just tried to compile v1.03 on osx 10.11.3 with latest xcode and comand line get this error (no -c flag problem anymore
[/crayon]Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156[crayon-5cb9b540e7552045884463 inline="true" ](some making with no errors here)***** Making module 'std' *****Parsing...Semanting...Translating...Compiling....Build error: System command 'as -o "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/build_cache/desktop_release_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S"' failed.as -o "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/build_cache/desktop_release_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S").sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:7:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:26:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:27:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:28:Rest of line ignored. 1st junk character valued 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:29:Rest of line ignored. 1st junk character valued 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:30:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:32:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:33:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:35:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:36:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:37:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:40:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:41:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:43:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:44:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:46:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:49:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:50:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:52:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:53:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:55:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:57:invalid character (0xd) in operand 1/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:58:invalid character (0xd) in mnemonic***** Fatal mx2cc error *****Internal mx2cc build errormx2cc version 1.0.3(some more lines with no error here)***** Making module 'stb-vorbis' *****Parsing...Semanting...Translating...Compiling....Archiving /Users/koko/Desktop/monkey2103/modules/stb-vorbis/stb-vorbis.buildv1.0.3/desktop_debug_macos/stb-vorbis.a***** Making module 'std' *****Parsing...Semanting...Translating...Compiling....Build error: System command 'as -o "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/build_cache/desktop_debug_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S"' failed.as -o "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/build_cache/desktop_debug_macos/_1_1_1fiber_2native_2asm_2make_0x86_064_0sysv_0macho_0gas.S.o" "/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S").sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:7:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:26:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:27:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:28:Rest of line ignored. 1st junk character valued 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:29:Rest of line ignored. 1st junk character valued 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:30:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:32:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:33:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:35:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:36:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:37:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:40:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:41:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:43:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:44:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:46:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:49:invalid character (0xd) in operand 2).sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:50:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:52:Junk character 13 ().sers/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:53:Junk character 13 (/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:55:invalid character (0xd) in operand 2/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:57:invalid character (0xd) in operand 1/Users/koko/Desktop/monkey2103/modules/std/fiber/native/asm/make_x86_64_sysv_macho_gas.S:58:invalid character (0xd) in mnemonic***** Fatal mx2cc error *****Internal mx2cc build error***** Rebuilding ted2 *****mx2cc version 1.0.3***** Building app '/Users/koko/Desktop/monkey2103/src/ted2/ted2.monkey2' *****Parsing...Semanting...Translating...Compiling....Build error: System command 'g++ -std=c++11 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -O3 -DNDEBUG -I"/Users/koko/Desktop/monkey2103/modules/litehtml/litehtml/include/" -I"/Users/koko/Desktop/monkey2103/modules/freetype/freetype-2.6.3/include/" -I"/Users/koko/Desktop/monkey2103/modules/sdl2/SDL/include/" -I"/Users/koko/Desktop/monkey2103/modules/monkey/native" -c -o "/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_0ted2.cpp.o" "/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_ted2.cpp"' failed.g++ -std=c++11 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -O3 -DNDEBUG -I"/Users/koko/Desktop/monkey2103/modules/litehtml/litehtml/include/" -I"/Users/koko/Desktop/monkey2103/modules/freetype/freetype-2.6.3/include/" -I"/Users/koko/Desktop/monkey2103/modules/sdl2/SDL/include/" -I"/Users/koko/Desktop/monkey2103/modules/monkey/native" -c -o "/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_0ted2.cpp.o" "/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_ted2.cpp"/Users/koko/Desktop/monkey2103/src/ted2/ted2.buildv1.0.3/build_cache/desktop_release_macos/ted2_ted2.cpp:7:10: fatal error: '../../../../../modules/mojo/mojo.buildv1.0.3/desktop_release_macos/mojo_app_2app.h' file not found#include "../../../../../modules/mojo/mojo.buildv1.0.3/desktop_release_macos/mojo_app_2app.h"^1 error generated.***** Fatal mx2cc error *****Internal mx2cc build errormx2cc version 1.0.3***** Building app '/Users/koko/Desktop/monkey2103/src/launcher/launcher.monkey2' *****Parsing...Semanting...Translating...Compiling....Linking /Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/desktop_release_macos/launcher.app/Contents/MacOS/launcherBuild error: System command 'g++ -Wl,-rpath,@executable_path -Wl,-rpath,@executable_path/../Frameworks -O3 -o "/Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/desktop_release_macos/launcher.app/Contents/MacOS/launcher" "/Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/build_cache/desktop_release_macos/launcher_0launcher.cpp.o" "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/desktop_release_macos/std.a" "/Users/koko/Desktop/monkey2103/modules/stb-vorbis/stb-vorbis.buildv1.0.3/desktop_release_macos/stb-vorbis.a" "/Users/koko/Desktop/monkey2103/modules/stb-image-write/stb-image-write.buildv1.0.3/desktop_release_macos/stb-image-write.a" "/Users/koko/Desktop/monkey2103/modules/stb-image/stb-image.buildv1.0.3/desktop_release_macos/stb-image.a" "/Users/koko/Desktop/monkey2103/modules/miniz/miniz.buildv1.0.3/desktop_release_macos/miniz.a" "/Users/koko/Desktop/monkey2103/modules/libc/libc.buildv1.0.3/desktop_release_macos/libc.a" "/Users/koko/Desktop/monkey2103/modules/monkey/monkey.buildv1.0.3/desktop_release_macos/monkey.a" ' failed.g++ -Wl,-rpath,@executable_path -Wl,-rpath,@executable_path/../Frameworks -O3 -o "/Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/desktop_release_macos/launcher.app/Contents/MacOS/launcher" "/Users/koko/Desktop/monkey2103/src/launcher/launcher.buildv1.0.3/build_cache/desktop_release_macos/launcher_0launcher.cpp.o" "/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/desktop_release_macos/std.a" "/Users/koko/Desktop/monkey2103/modules/stb-vorbis/stb-vorbis.buildv1.0.3/desktop_release_macos/stb-vorbis.a" "/Users/koko/Desktop/monkey2103/modules/stb-image-write/stb-image-write.buildv1.0.3/desktop_release_macos/stb-image-write.a" "/Users/koko/Desktop/monkey2103/modules/stb-image/stb-image.buildv1.0.3/desktop_release_macos/stb-image.a" "/Users/koko/Desktop/monkey2103/modules/miniz/miniz.buildv1.0.3/desktop_release_macos/miniz.a" "/Users/koko/Desktop/monkey2103/modules/libc/libc.buildv1.0.3/desktop_release_macos/libc.a" "/Users/koko/Desktop/monkey2103/modules/monkey/monkey.buildv1.0.3/desktop_release_macos/monkey.a"clang: error: no such file or directory: '/Users/koko/Desktop/monkey2103/modules/std/std.buildv1.0.3/desktop_release_macos/std.a'***** Fatal mx2cc error *****Internal mx2cc build errorcp: ../src/ted2/ted2.buildv1.0.3/desktop_release_macos/ted2.app: No such file or directorymx2cc version 1.0.3(some doccing with no errors here)***** Doccing module 'mojo' *****Parsing...Semanting...MarkdownBuffer: unrecognized directive @see in @see [[ActiveWindow]], [[MouseX]], [[MouseY]]***** Doccing module 'mojox' *****Parsing...Semanting...***** Doccing module 'sdl2-mixer' *****Parsing...Semanting...***** Doccing module 'stb-truetype' *****Parsing...Semanting...August 17, 2016 at 10:23 pm #3153Just a did a ‘download zip’ of monkey2-master and rebuild all worked fine.
It looks like an EOL conversion problem to me – but this shouldn’t happen on Mac!
Are you using git to get the project? Can you confirm a zip download/.rebuild instead works?
August 18, 2016 at 11:17 am #3164uninstalled xcode and command line tools. downloaded zip master from github, installed command line tools with readme suggested command and still have the same error.
I’m on a hackintosh(asus laptop but no virtual machine) so it may be that. though it would be the first time I have issues like that with it (MX1 runs perfectly for example). Usualy only drivers problems occur.
Should I update to 10.11.6? (don’t want to because it can be painfull with a hackintosh).August 19, 2016 at 11:31 am #3222solved the problem by editing the following files:
jump_x86_64_sysv_macho_gas.S
make_x86_64_sysv_macho_gas.S
ontop_x86_64_sysv_macho_gas.S“unixed” them with sublime_text_3 view>line_endings>Unix (there’s a osx9 choice too but i chose unix first and it worked)
don’t know how to manage that in github though, will try on my fork using this manual “https://help.github.com/articles/dealing-with-line-endings/” or other googled sources. any suggestion is appreciated.
modified files are attached to this post
Attachments:
August 19, 2016 at 5:26 pm #3235Not all the files in the repo are ending their lines with linefeed (unix/linux/osx). The files in modules/std/fiber/native/asm are all ending lines with CRLF (windows style) (LINCENSE.TXT has the same problem but doesn’t matter for code of course)
I tried to play with .gitattributes on a branch but I could not force the .S and .asm (or any file with some CR or CRLF in it) to stop having the CR (chr13) at eol. I could force files with LF as eol to be transformed to CRLF though so I don’t understand, must learn more about git/.gitattribute use.There probably is a solution with .gitattributes but for now I copied the 3 modified files in in a branch and all compiles ok directly with it when dowloading the zip… it should probably be better if all files in the repo had LF eol as it seems to be the standard with git repos.
PS: By trying all this I accidentaly deleted the branch with a pull request for ted2 “file>open”, sorry if you received duplicate messages about it.
-
AuthorPosts
You must be logged in to reply to this topic.