Tutorial: Compile Kallistios in Win Sub-Sys for Linux

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
Rizzoislandgame
DCEmu Junior
DCEmu Junior
Posts: 44
Joined: Sat Dec 30, 2017 4:03 pm

Tutorial: Compile Kallistios in Win Sub-Sys for Linux

Post by Rizzoislandgame » Mon Jul 09, 2018 8:17 pm

Hey guys! Just thought I write a small little tutorial on how to compile KallitiOS on Windows Subsystem for Linux since no one has really made a new tutorial for doing this I believe.

So here it goes! Kallistios on Windows 10 Subsystem for Linux

1. Go to your "Programs and Features" menu inside the control panel

2. Click on "Turn Windows Features on or off"

3. Scroll down and check the box that says "Windows Subsystem for Linux" and click "Ok"

4. Go to the Windows 10 App Store and install "Ubuntu for Windows"

5. Wait for it to install then open it up

6. Choose your username and password

7. Copy and paste the following commands:
sudo apt-get update
sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev gettext wget libelf-dev bison flex sed make tar bzip2 patch gawk git gcc g++ python subversion
sudo apt-get install libpng12-dev libjpeg8-dev libjpeg8
sudo apt-get install mkisofs
mkdir dc
cd dc
git clone git://git.code.sf.net/p/cadcdev/kallistios kos
git clone git://git.code.sf.net/p/cadcdev/kos-ports
cd kos-ports
cd ../kos/utils/dc-chain
./download.sh --no-deps
Wait until this completes
./unpack.sh --no-deps
Wait until this completes
sudo make
Wait until this completes with no errors
cd ../..
cp doc/environ.sh.sample ./environ.sh
sudo nano environ.sh
8. Edit the KOS_BASE directory to "/home/[your Username]/dc/kos" (Replace [Your Username] with your actual username you assigned to the linux terminal)

9. Press the keys ctrl+x and press the "y" key then press the enter button

10. Enter the following commands
chmod u+x environ.sh
source environ.sh
sudo make
cd ../kos-ports
cd utils
./build-all.sh
11. Now that it's all built, lets add the last few commands to our startup script so we don't have to do this manually all the time! Copy and paste the following commands:
sudo nano ~/.bashrc
12. Now copy this bottom code and right click to paste it to the bottom of your code in the terminal
source /opt/toolchains/dc/kos/environ.sh
13. Press ctrl+x then press "y" then press enter

14. Exit out of the program then open it up again to test it. If everything works you should be done!
Last edited by Rizzoislandgame on Sat Jul 21, 2018 3:54 pm, edited 2 times in total.
"Smile for me, You're in loving hands
Don't be sad today, You can make other plans"

-Smile, Tom Rizzo
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5292
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: Tutorial: Compile Kallistios in Win Sub-Sys for Linux

Post by BlueCrab » Wed Jul 18, 2018 9:15 pm

I'm glad to hear you got it all working out nicely! :)

I do have a couple of comments, to simplify things a bit (some of which I also sent to the person whose tutorial yours seems to be based on?)...

1. In the compilation part, there's no reason to be doing the "git submodule update --init" part, as kos-ports has no submodules anymore.
2. Most of this should not need sudo at all. Once I get back from the vacation that I'm on, I'll be posting a similar tutorial on the KOS website itself, as I had mostly written it up before I saw your post here. Basically, if you create the "/opt/toolchains/dc" directory before starting most of the build, and create it with correct permissions, then you shouldn't need sudo at all other than for the apt-get stuff and for creating that directory (which will stop you from having to type your password so often). Plus, you can also conveniently put the kos and kos-ports directories in /opt/toolchains/dc and still have them be easily updatable/accessible (and stop you from having to modify the environ script at all).
3. There's absolutely no reason to have it doing a make in the kos directory or a build-all.sh in the kos-ports one in the .bashrc file. All you should be adding to the .bashrc file is this line:

Code: Select all

source /opt/toolchains/dc/kos/environ.sh
4. Things also work nicely enough in the Debian-based WSL distro as well, which likely is a bit smaller than the Ubuntu one. Considering you're only going to be using a shell, it probably doesn't matter much which you use.
Rizzoislandgame
DCEmu Junior
DCEmu Junior
Posts: 44
Joined: Sat Dec 30, 2017 4:03 pm

Re: Tutorial: Compile Kallistios in Win Sub-Sys for Linux

Post by Rizzoislandgame » Fri Jul 20, 2018 6:23 pm

Thanks for the suggestions! I guess mine would just be a stop-gap before yours comes out. I’ll change it up a little using your suggestions when I get the chance!


Sent from my iPhone using Tapatalk
"Smile for me, You're in loving hands
Don't be sad today, You can make other plans"

-Smile, Tom Rizzo
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5292
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Contact:

Re: Tutorial: Compile Kallistios in Win Sub-Sys for Linux

Post by BlueCrab » Mon Jul 23, 2018 7:46 pm

Here's the "official" guide to setting things up, which I got a chance to finish up today: http://gamedev.allusion.net/softprj/kos/setup-wsl.php

Feel free to look it over, give any feedback, etc.
Post Reply