Help setting up KOS on macOS

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
thalukas
DCEmu Newbie
DCEmu Newbie
Posts: 2
Joined: Mon Oct 08, 2018 11:14 am

Help setting up KOS on macOS

Post by thalukas » Tue Oct 09, 2018 3:03 pm

Hi, I'm new to all of this and have learning how to code, please be kind. I'm try to use the script to install KOS on my machine, macOS High Sierra 10.13.6 (17G65)

My first attempt...
$ sh kos_setup_script.sh
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
Attempt 2, In the script I updated zlib-1.2.8.tar.gz to lib-1.2.11.tar.gz, and I got these message
Please install pkg-config.
Please install wget.
Attempt 3, installed pkg-config & wget via homebrew
Warning: jpeg 9c is already installed, it's just not linked
You can use `brew link jpeg` to link this version.
Warning: libpng 1.6.35 is already installed, it's just not linked
You can use `brew link libpng` to link this version.
Linking /usr/local/Cellar/jpeg/9c... 
Error: Could not symlink bin/cjpeg
Target /usr/local/bin/cjpeg
already exists. You may want to remove it:
  rm '/usr/local/bin/cjpeg'

To force the link and overwrite all conflicting files:
  brew link --overwrite jpeg

To list all files that would be deleted:
  brew link --overwrite --dry-run jpeg
Attempt 4, per KingCrazy suggestion, I removed all the files and got this...
Warning: jpeg 9c is already installed and up-to-date
To reinstall 9c, run `brew reinstall jpeg`
Warning: libpng 1.6.35 is already installed and up-to-date
To reinstall 1.6.35, run `brew reinstall libpng`
Warning: Already linked: /usr/local/Cellar/jpeg/9c
To relink: brew unlink jpeg && brew link jpeg
Warning: Already linked: /usr/local/Cellar/libpng/1.6.35
To relink: brew unlink libpng && brew link libpng
Creating directory /opt/toolchains/dc as root, giving users access to it.
Password:
Downloading KOS and KOS ports.
Compiling KOS.
for i in utils kernel addons ; do make -C $i || exit -1; done
for i in genromfs wav2adpcm vqenc scramble dcbumpgen; do make -C $i; done
cc -O2 -Wall    -c -o genromfs.o genromfs.c
error: unable to open output file 'genromfs.o': 'Permission denied'
1 error generated.
make[2]: *** [genromfs.o] Error 1
cc -O2 -Wall     wav2adpcm.c   -o wav2adpcm
ld: can't open output file for writing: wav2adpcm, errno=13 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [wav2adpcm] Error 1
cc -O2 -Wall -DINLINE=inline -I/usr/local/include    -c -o vqenc.o vqenc.c
cc -O2 -Wall -DINLINE=inline -I/usr/local/include    -c -o get_image.o get_image.c
cc -O2 -Wall -DINLINE=inline -I/usr/local/include    -c -o get_image_jpg.o get_image_jpg.c
cc -O2 -Wall -DINLINE=inline -I/usr/local/include    -c -o get_image_png.o get_image_png.c
cc -O2 -Wall -DINLINE=inline -I/usr/local/include    -c -o readpng.o readpng.c
error: unable to open output file 'get_image_png.o': 'Permission denied'
1 error generated.
error: unable to open output file 'readpng.o': 'Permission denied'
1 error generated.
error: unable to open output file 'vqenc.o': 'Permission denied'
1 error generated.
error: unable to open output file 'get_image.o': 'Permission denied'
1 error generated.
make[2]: *** [get_image_png.o] Error 1
make[2]: *** Waiting for unfinished jobs....
error: unable to open output file 'get_image_jpg.o': 'Permission denied'
1 error generated.
make[2]: *** [readpng.o] Error 1
make[2]: *** [vqenc.o] Error 1
make[2]: *** [get_image.o] Error 1
make[2]: *** [get_image_jpg.o] Error 1
cc -o scramble scramble.c
ld: can't open output file for writing: scramble, errno=13 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [scramble] Error 1
cc -O2 -Wall -DINLINE=inline -I/usr/local/include   -c -o dcbumpgen.o dcbumpgen.c
cc -O2 -Wall -DINLINE=inline -I/usr/local/include   -c -o get_image.o get_image.c
cc -O2 -Wall -DINLINE=inline -I/usr/local/include   -c -o get_image_jpg.o get_image_jpg.c
cc -O2 -Wall -DINLINE=inline -I/usr/local/include   -c -o get_image_png.o get_image_png.c
cc -O2 -Wall -DINLINE=inline -I/usr/local/include   -c -o readpng.o readpng.c
error: unable to open output file 'get_image_jpg.o': 'Permission denied'
1 error generated.
error: unable to open output file 'get_image.o': 'Permission denied'
1 error generated.
error: unable to open output file 'dcbumpgen.o': 'Permission denied'
1 error generated.
error: unable to open output file 'readpng.o': 'Permission denied'
1 error generated.
make[2]: *** [get_image_jpg.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [get_image.o] Error 1
make[2]: *** [readpng.o] Error 1
make[2]: *** [dcbumpgen.o] Error 1
error: unable to open output file 'get_image_png.o': 'Permission denied'
1 error generated.
make[2]: *** [get_image_png.o] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 255
Conclusion: Per KingCrazy & lerabot suggestion, I'm switching to VM/Linux...
Last edited by thalukas on Wed Oct 10, 2018 11:39 am, edited 1 time in total.
KingCrazy
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 22
Joined: Sat Aug 04, 2018 11:36 am

Re: Help setting up KOS on macOS

Post by KingCrazy » Tue Oct 09, 2018 5:26 pm

Hello!~
I seem to remember having issues getting KOS installed on Mac awhile back when I tried! It was a pain in the butt for some reason... @~@; I remember there was always something that would throw an error after letting it go for almost an hour.

I'm no expert on this, and I hope someone else might come along and correct me with a better solution, but I can give it a shot!

It might sound silly, but did you try running

Code: Select all

rm '/usr/local/bin/cjpeg'
To remove it and let KOS install its own? Though it does seem kinda weird it doesn't just skip over things if they already exist... But if that's what it's suggesting, then I'd just follow what it says. ^^

If you're not dead-set on using Mac, what I'd personally recommend (and what I've done myself in the past few days on my own High Sierra machine) is getting Ubuntu and installing it as a virtual machine with VirtualBox. A lot of the tutorials around here are geared towards Linux, and while most translate to Mac (since it's also a UNIX-like environment), there's a lot of packages they'll expect you to have that Mac doesn't already come installed with (or doesn't support, meaning you'll have to find alternatives). It ends up being a pain in the butt to get everything working sometimes.

However, if you're more comfortable with Mac, then definitely stick with what you know! No sense in trying to learn an entirely new environment just for this.
User avatar
lerabot
Insane DCEmu
Insane DCEmu
Posts: 109
Joined: Sun Nov 01, 2015 8:25 pm

Re: Help setting up KOS on macOS

Post by lerabot » Wed Oct 10, 2018 10:38 am

+1 for doing it in a VM/Linux.

Just from a tool/tutorial perspective, it's just much better. Otherwise go on windows, a bunch of people use that too.
thalukas
DCEmu Newbie
DCEmu Newbie
Posts: 2
Joined: Mon Oct 08, 2018 11:14 am

Re: Help setting up KOS on macOS

Post by thalukas » Wed Oct 10, 2018 11:40 am

Thanks guys, switching over to VM/Linux
KingCrazy
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 22
Joined: Sat Aug 04, 2018 11:36 am

Re: Help setting up KOS on macOS

Post by KingCrazy » Wed Oct 10, 2018 3:21 pm

No problem! Hope it works out.

Just to follow up, I tried installing KOS on my own Macbook this morning and ran into some errors, myself. I seem to remember this happening when I tried before on Mac. The KOS toolchain installs for a good 30~40 minutes and then returns some error, even when you have "wget" and other requirements. Didn't have this issue installing it on Ubuntu, or while running Cygwin/MSYS2 on my Windows machine.

Anyway, best of luck with installing everything! Feel free to stop by if you have any other questions about installing or using KOS!
Post Reply