Monkey X2 and Linux.

Community Forums/Monkey2 Talk/Monkey X2 and Linux.

Richard Betson(Posted 2015) [#1]
Hi,

I have started to migrate from Windows as my preferred Desktop OS to Linux (Kubuntu 15.04) . I was wondering if MX2 will have a 64bit version of Ted and will the dependencies and the effort to get MX2 up and running be easier this time around? It seems to me that in Linux MX2 should be made to use in a 64bit Linux environment.

For ease of use and development I am hoping that MX2 is going to be friendly to using and developing with it on 64bit distributions.

I have not tried to use MX2 on Linux. Does it run on Linux yet (supporters release)?


therevills(Posted 2015) [#2]
I'm interested on seeing if MX2 will work on SteamOS (Debian-based Linux)....


dawlane(Posted 2015) [#3]
will the dependencies and the effort to get MX2 up and running be easier this time around?
I doubt it. And as I haven't got a copy of MX2, I wouldn't know much about how it's been put together.
I was hoping that as Mark has decided to use emscripten, and that as emscripten relies on python, that he would consider using the Scons software construction tool instead of having premade make/project files and having trans do all the work of building the environment. There are a number of projects that I have come across that use Scons. The most well known would be blender.

I'm interested on seeing if MX2 will work on SteamOS (Debian-based Linux)....
If it's in source code and works on Ubuntu, then it will.


Richard Betson(Posted 2015) [#4]
The reason I am posting here is looking over whats needed to get Monkey X1 going on Linux got me thinking...hmmmm.. Looking over 32bit and Linux I get the feeling 32bit is dead or dying and adding in 32bit dependencies is a drag. I would also love to see Monkey available as a part of a repository of some sort.

I have already laid out why I am abandoning Windows ( http://www.blitzmax.com/Community/posts.php?topic=104843 ) on the BltzMax forums and I would not touch Windows 10 with a 10 foot digital pole (EULA? Try open ended Orwellian nightmare.), so I am looking for better focus on Linux when it comes to MX2.


arawkins(Posted 2015) [#5]
I'm pretty new to linux myself so I'm probably not the best person to answer this (using xubuntu 14.04 64 bit for about a month now), but I took a stab at running the Monkey 2 demos last night and can confirm they run on linux.

screenshot

I had to install sdl2. Other than that since this release is dependent on MonkeyXPro84e you still have to install that on linux the old fashioned way, so that hasn't changed. I haven't tried emscripten yet but plan to soon.

*edit* Tested out emscripten as well, seems to work ok :)

screenshot 2


marksibly(Posted 2015) [#6]
> *edit* Tested out emscripten as well, seems to work ok :)

How was it installing emscripten? Took me ages!


dawlane(Posted 2015) [#7]
How was it installing emscripten? Took me ages!
It depends on whether you build fast-comp by hand (aka the hard way) or just use the Portable SDK.


arawkins(Posted 2015) [#8]
It was pretty straightforward, but yeah, it took a long time (obligatory xkcd). I had to manually add it to my PATH as well to get it to work with monkey. This step in the installation:

 # Linux/Mac OS X only: Set the current Emscripten path
source ./emsdk_env.sh


only added it to the path for the current terminal session. As I said, I am pretty new to Linux so maybe I am missing something there about how that's supposed to work.


Richard Betson(Posted 2015) [#9]
@arawkins
Did you use dawlane's Install Monkey on Linux (a rough guide)! article to get Monkey X1 going? Just looking at the size of it makes me want to bolt. :)

I am going to try and get Monley X1 going on Kubuntu 15.04. Then try MX2.


arawkins(Posted 2015) [#10]
@Richard Betson yes, I did. It is definitely a long guide but it was really helpful to go through (thanks dawlane!). I ended up only using a smaller subset of the instructions, setting up transcc_linux, and then using it directly as a command line tool with jEdit as an editor. So I did not set up/compile TED, or set up launchers or anything. I am also mainly just using the html5 and Android targets so I skipped over the stuff about compiling for 32 or 64 bit targets. in other words, I just kind of cheated my way through the set up ;)


Richard Betson(Posted 2015) [#11]
^Right oh.

I would have to place myself in the 'newbie' category. With the help of dawlane and others I was able to compile in BlitzMax on Debian 7 Wheezy (64bit). That was not easy and this (MX1 install) looks even tougher. I guess my hope is that this all gets reasonable somehow with MX2. Eh, I have Vbox going and Kubuntu 15.04 running and the rest of the day to mess with it. Fingers crossed. :)




Richard Betson(Posted 2015) [#12]
Success!


I hunted around in the forums and found the libraries I needed for Monkey X1 to work, surprisingly few.

sudo apt-get install ""
g++
xorg-dev
qtcreator
libopenal-dev


So far I can compile in Glfw3 and HTML5 on Kubuntu 15.04. Way easier then I had imagined it to be. I am able to build for mojo2 as well. :) The only other thing I need to do was set the permissions for the executable files. Piece of cake really although perhaps Android as a target is a challenge. I will install MX2 and emscripten and see what happens.


marksibly(Posted 2015) [#13]

sudo apt-get install ""
g++
xorg-dev
qtcreator
libopenal-dev



Was that on a 'clean' install?

I'm currently trying to install steamos (the 'easy' installer didn't work, now trying the 'custom' one...) and will give this a whirl.


Richard Betson(Posted 2015) [#14]
Was that on a 'clean' install?

Yes it was. I tested all of it on a clean install on VirtualBox before I made the changes to my system install of Kubuntu. So it worked twice on two septate installs with the VM version completely clean.

I cant praise Kubuntu 15.04 enough so far. A few crashes here and there (non-Monkey) but almost always on program exit (just a few and not often). I would rate it pretty stable ATM.

Testing MX2 next ;)


Richard Betson(Posted 2015) [#15]
@All
Mark of course knows this but the source for the libraries/dependencies I used is here. Just in case I missed listing one or you need others.


Richard Betson(Posted 2015) [#16]
Just to make sure I had it all down right I tested it again with a clean install in VirtualBox. Works just like I posted above. :)


marksibly(Posted 2015) [#17]
Well, that wasn't a whole lot of fun...messiest Linux install ever!

But I'm stumped installing the GL dev stuff, although I'm not alone...

http://steamcommunity.com/groups/steamuniverse/discussions/1/648814842661436493/

Bummer, 'coz I got ted/transcc etc built with just the "qt4-dev-tools" and "g++" packages.

Think I'll give up at this point and wait for the next version of steamos. Might try debian instead of going back to ubuntu, as 15.04 was crashing like crazy on me.


marksibly(Posted 2015) [#18]
Working!

I had to edit the /etc/apt/sources.list file to add the debian repos'. Here's what I ended up with:



Then:



(xdg-utils needs for html5 mserver support).

Best of all, my crappy onboard graphics card appears to be using an accelerated driver, something I could never get working in ubuntu.

Html5 performance isn't great though...


Richard Betson(Posted 2015) [#19]
Might try debian instead of going back to ubuntu, as 15.04 was crashing like crazy on me

Huh, so far it's hanging in there on AMD. Maybe an Intel thing?I like Ubuntu and would like to stay around in it for dev.

SDL2
I have the SDL demo for MX2 running which is nice to see. I am not sure what to do yet to get emscripten running.


dawlane(Posted 2015) [#20]
Well it took me around about an hour to get SteamOS install into virtual box including the download. The last time I tried it wouldn't install at all.
My verdict after a good few hours of poking around, is that it's not going to be useful in it's current state as a development platform, especially if you have to add additional Debian repositories. This OS is aimed with SteamBoxes in mind and I cannot see them adding OpenAL as part of the default installation, which would cause problems for any application that use OpenAL. Many users of this OS wouldn't know how to install them in any case, and those that do would think it an unnecessary inconvenience.
I believe that the zlib license allows static linking and as SDL2 comes under the zlib license it could be a solution.


Richard Betson(Posted 2015) [#21]
it's not going to be useful in it's current state as a development platform

This is what I have read about Steam OS, that it is pretty narrow in it's focus and that it is 'not' meant to replace your current Linux distribution. It's just a gaming focused version of Linux. I really do not see why I would ever use it other then to pedal a game on it.


dawlane(Posted 2015) [#22]
I really do not see why I would ever use it other then to pedal a game on it.
Exactly. That is all it would be good for and nothing else. I cannot see why there is even a desktop environment in there. To me it's just add over head for something that will never be used. A simple window manager would suffice for any simple maintenance.

Edit: Come to think of it. They will at some point need to include the development libraries into their repositories if the wish people to target their OS. You do tend to find inconstancies with binaries that were not build against the right versions of the libraries.
After all they did have to back port libc6 from Jessie into Wheezy to make it compatable with the steam client, that if memory serves was built against Ubuntu 12.04.


Richard Betson(Posted 2015) [#23]
@Mark.

I would be interested on what you settle on for MX2 development on Linux. When you do choose a distribution let us know. :)

I have been reading news about Kubuntu and Ubuntu and the things going on there give me some pause at least about Kubuntu's future. So I am testing out Linux Mint 17.2 “Rafaela” KDE (LTS 2019) and whatever Debian flavor comes with KDE. I can understand going Debian as Steam OS and Ubuntu are based on it (as I understand it). Anyway, since I am just starting out on Linux it is a good time for me to just install and use the distribution you choose (or one compatible) for Monkey development.


dawlane(Posted 2015) [#24]
I would be interested on what you settle on for MX2 development on Linux
It actually doesn't matter what Linux distribution he uses, as long as he releases source files that can be built with GCC, and any required libraries are present in the distributions repository. It's the developer who uses those files to produce binaries that has to choose what Linux distribution to use to gain maximum compatibility. Before the release of Debian 8, it was Debian 7. Now it's Ubuntu 12.04/Linux Mint 13. You can get round the problem if you like using a new version of a Linux distribution by setting up a chroot environment and compiling your software in that.

I have been reading news about Kubuntu and Ubuntu
In the Linux world it's nothing new. There are always some disagreements that end up with someone leaving. And I've never understood the need for tailor made Ubuntu/Mint distributions when they could just have easily offered which desktop environment to use during installation. It's not as though they couldn't fit it on to a DVD now is it as the Ubuntu iso file sits at 1GB.


Richard Betson(Posted 2015) [#25]
It actually doesn't matter what Linux distribution he uses

That is true but my experience has been tainted I guess by BlitzMax 1.50 and Debian Wheezy; if you recall that. When Mark switched to Ubuntu 14.04 (I Think) there were issues. Monkey X2 should not suffer from kernel+build issues like BlitzMax so I am probably worried over nothing. Still, I cant help feel that sticking close to Marks development distribution is a plus. Being inexperienced in Linux and really focused on creativity maintaining dependencies and what not is something I would like to minimize.
Edit- I should add that I also just want work/play and develop in one Linux distribution.

Now it's Ubuntu 12.04

Not 14.04?

In the Linux world it's nothing new

I get that for sure and have read as much. Starting out I would like to go with a solid distribution and avoid any political hiccups that set back a project. That aside Mint is based on Ubuntu and is highly recommended. I like KDE and there is 'Linux Mint 17.2 “Rafaela” KDE' which is based on Ubuntu 14.04 (LTS till 2019). I will be giving it a try here in a bit, was just released so I will see if I can run Monkey X1 and 2.and take it for a spin. Mint really has been recommend to me quite a lot.


dawlane(Posted 2015) [#26]
When Mark switched to Ubuntu 14.04 (I Think)
I believe he use Ubuntu 12.04 for BlitzMax 1.50.
Not 14.04?
Support ends for Ubuntu 12.04 (and Linux Mint 13) in 2017. Then I would imagine that the base will again be Debian as it has a longer cycle between releases.
Being inexperienced in Linux and really focused on creativity maintaining dependencies and what not is something I would like to minimize.
You don't have to think to much about dependencies if you are just a normal user, thats the developers job. But as a developer, you have to be very aware of dependencies, building and deployment.
Mint really has been recommend to me quite a lot.
I use Linux Mint 17 (with Ubuntu 12.04 as chroot), but I also like Mageia. You will come across articles questioning Linux Mint security that cropped up when a Ubuntu developer bad mouthed Linux Mint, but ended up with egg on his face when it was fully explained why that certain updates are not selected automatically.
http://www.howtogeek.com/176495/ubuntu-developers-say-linux-mint-is-insecure-are-they-right/
http://segfault.linuxmint.com/2013/11/answering-controversy-stability-vs-security-is-something-you-configure/


Richard Betson(Posted 2015) [#27]
You will come across articles questioning Linux Mint security

I can see why and agree that 'filtering' updates is preferable in my setting. Unfiltered or unpreventable updates are why at this very moment Windows 10 systems are in an endless loop of installing an update, crashing/rebooting, and then recover/reinstall update.

Support ends for Ubuntu 12.04 (and Linux Mint 13) in 2017

This helps in understanding where the various builds stand in the scheme of things. I might be cool with embracing 14.04 as by the time MX2 is ready for prime time little life will be left in 12.04 officially. Opposed to chroot I may have say a Mint 13 version on a separate partition, At least until I am a little more comfortable on where I settle.


Richard Betson(Posted 2015) [#28]
I have Monkey X1 working on 'Linux Mint 17.2 “Rafaela” KDE' on Glfw3 and Html5. :) The dependencies are the same as Kubuntu 15.04 except for on addition ( libgl1-mesa-dev ) and this may be related to ATI video drivers. I'll give MX2 a go on desktop. Any advice on installing emscripten?

'Linux Mint 17.2 “Rafaela” KDE' Monkey X1 dependencies.
sudo apt-get install ""
g++
xorg-dev
qtcreator
libopenal-dev
libgl1-mesa-dev


BTW; Mint 17.2 KDE seems very stable so far. Not one issue as of yet.


dawlane(Posted 2015) [#29]
@Richard Betson: You do know that xorg-dev is a meta package and will install more than what you really need. The same goes for for installing qtcreator unless you have a great overwhelming desire to add more bells and whistles to TED.

You will find that you will possibly need to install one additional development library for Qt5. libicu-dev
The basic package set for MonkeyX on Ubuntu\Mint is
g++-multilib libglu1-mesa-dev libopenal-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev libxxf86vm-dev libx11-dev libgl1-mesa-dev

and for 32bit support on 64bit
libglu1-mesa:i386 libopenal1:i386 libxpm4:i386 libxrender1:i386 libxcursor1:i386 libxi6:i386 libxinerama1:i386 libxxf86vm1:i386 libxrandr2:i386

with a few links
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib32/libGL.so
sudo ln -s /usr/lib/i386-linux-gnu/libopenal.so.1 /usr/lib32/libopenal.so
sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib32/libX11.so
sudo ln -s /usr/lib/i386-linux-gnu/libXxf86vm.so.1 /usr/lib32/libXxf86vm.so
sudo ln -s /usr/lib/i386-linux-gnu/libXi.so.6 /usr/lib32/libXi.so
sudo ln -s /usr/lib/i386-linux-gnu/libXrandr.so.2 /usr/lib32/libXrandr.so
sudo ln -s /usr/lib/i386-linux-gnu/libXinerama.so.1 /usr/lib32/libXinerama.so
sudo ln -s /usr/lib/i386-linux-gnu/libXcursor.so.1 /usr/lib32/libXcursor.so


And for Qt 4
libqt4-dev libqtwebkit-dev qt4-default

and Qt 5
libqt5webkit5-dev qtlocation5-dev qtsensors5-dev libxslt-dev libsqlite3-dev libgstreamer-plugins-base0.10-dev qt5-default libicu-dev

Of course the above is for MX1 you will need to install git-core, python 2.7, nodejs and a JDK for emscripten.


Richard Betson(Posted 2015) [#30]

The MX2 SDL test.

I have been able to get MX2 running on Linux Mint 17.2 KDE. This latest version of Mint is 'solid', no issues or crashes or problems at all. :) Got to love that. I do like Plasma 5 better then Plasma 4 but I am more then happy to use KDE 4 until Mint upgrades 17,xx to Plasma 5 next year (I guess it's just to buggy ATM). Mint pretty sweet and stable.

@dawlane
I will note the above. I don't mind the 'overkill' and those few packages are easy to remember. ;) I may try this in a Vbox here in a bit as I like learning the various ways of installing dependencies.

With emscripten there is a I guess manually built SDK you can do as well as a portable SDK which you mentioned as easier. How do I use/install the potable SDK?


Dabz(Posted 2015) [#31]
http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#all-os-installation-instructions-portable-sdk

Maybe! ;)

Dabz


marksibly(Posted 2015) [#32]
> This latest version of Mint is 'solid', no issues or crashes or problems at all. :)

This is what I ended up settling on after a weekend's tootling around, and it is indeed 'mint'!

> http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#all-os-installation-instructions-portable-sdk

Yeah, this is what I used to install (well, build really) emscripten on Linux earlier. Took several hours of compiling, followed by a massive 10-15 minute link that thrashed my poor HD mercilessly!


Xaron(Posted 2015) [#33]
Looks like Linux is still an OS for nerds. ;)


Richard Betson(Posted 2015) [#34]
This is what I ended up settling on after a weekend's tootling around, and it is indeed 'mint'!

Awesome. I really like Linux Mint 17.2 KDE. Just super solid. A nice bonus is that the Blitzmax IDE and my Linux game/demo (built with BlitzMax) ran on it with no issues. The i386 dependencies must be included in the distribution. This is a great example of a good distribution and I am glad to live in Mint. :)

.
Yeah, this is what I used to install (well, build really) emscripten on Linux earlier. Took several hours of compiling, followed by a massive 10-15 minute link that thrashed my poor HD mercilessly!

I will give this a try today. I will probably do it in a Vbox first just to make sure. :/

.
Looks like Linux is still an OS for nerds. ;)

It's not your daddy's Linux anymore. ;P I cant believe I lingered in Windows 7 this long and there is no way I will use Windows 10 and agree to MS's EULA. Windows is dead and Linux is the future! :)


marksibly(Posted 2015) [#35]
Just tried 'sudo apt-get install emscripten' on mint and it worked! So give that a try before resorting to manual installation.


Richard Betson(Posted 2015) [#36]
Just tried 'sudo apt-get install emscripten'

Wouldn't that be nice. Will do.


Richard Betson(Posted 2015) [#37]
It installed emscripten. Then did an sudo apt-get update, all good.

I get this error on compiling the SDL demo. I am sure I am missing something, ;) Is it maybe a path issue?

Edit Do I need to download 'emsdk-portable.tar.gz' and unzip that into the SDK directory? That appears to include the command prompt interface so you can update. I think.

So I can't do ./emsdk update from the emsctripten folder (/user/share/exmsripten), cause it is not there.
.



Richard Betson(Posted 2015) [#38]
Of course the above is for MX1 you will need to install git-core, python 2.7, nodejs and a JDK for emscripten.

This may be the issue and I do not see them in the locations expressed by using 'emcc -v'. So I will try installing them. It's node.js and python 2 I do not see installed in the directory emcc says they should be in. Not sure why I need github.

Edit - Nodejs and Python 2.7.6 are installed. Checking github.


Richard Betson(Posted 2015) [#39]
So I have run through what is required and have the following installed,

cmake python2.7 nodejs default-jre git-core


Both nodejs and python2.7 were already installed. So based on the console output (see below) where should I begin to look to solve the issue? The emscripten site mentions:
Your system may provide Node.js as node instead of nodejs. In that case, you may need to also update the NODE_JS attribute of your ~/.emscripten file.

and I was wondering if this could be the issue. How do I view the '/.emscripten' file? Thanks.




dawlane(Posted 2015) [#40]
You can turn on the 'show hidden' file in the file browser (accessing this is by the window menu). All files and directories that start with a period are hidden. The ./emscripten one is placed in the users home directory.
In most distributions you can execute a command by using a key combination to bring up a run dialog. Usually it's Alt+F2, then you can run a program with arguments.
A few examples are:
Note: The text editor or file manager you get, it the one associated with your desktop environment. The command gksu is so you can run a graphical application as sudo
gedit ~/.emscripten
gksu nemo /etc/apt/sources.list

List of keyboard short cuts for Linux Mint KDE
List of keyboard short cuts for Linux Mint GNOME


Richard Betson(Posted 2015) [#41]
You can turn on the 'show hidden' file

I had just figured that out before your post. Thanks. And thanks for the links.

Emscripten
I had a similar issue when I first tried to use emscripten in Windows. The offline version of the SDK allowed me to update emscripten via the the emscripten console (commnads update and install latest). That fixed the issue when compiling in windows. I bet I need to do the same in Linux but getting emscripten from the Ubuntu repository only gets updated periodically and can only be updated by 'apt-get update'. So the only way I can think of being able to use 'emsdk' is through the portable SDK. This may be a better route as I think it updates from git-hub.


dawlane(Posted 2015) [#42]
I will see if I can knock up a script that will automate building it the hard way to avoid the SDK which uses a lot of disk space and in my opinion is messy. It will not increase build times as fastcomp is the time consumer. If you want faster builds, then use a machine with a 64bit OS, 8 CPU cores and 6-12GB memory. It takes me about twenty minutes when I'm not using the machine.

Building emscripten on Ubuntu 12.04/Linux Mint 13 is a bit of a problem as the basic requirement for building is GCC 4.7. The default in the repositories is GCC 4.6.3, so you have to add a PPA repository with GCC back-ports.


Richard Betson(Posted 2015) [#43]
I'm not sure that the repository version of emscripten is complete. I cant find 'emrun' in the emscripten root directory. Some of the MX2 demos seem to compile (non-SDL) but MX2 can't seem to find 'emrun' to launch the app in a browser. I get the following error:

sh: 1: emrun: not found


BTW, where does Monkey X2 put the build for emscripten and the HTML5 file?
Edit: Found a.html. :) It seems some of the test examples do compile and others do not.
.
If you want faster builds, then use a machine with a 64bit OS, 8 CPU cores and 6-12GB memory. It takes me about twenty minutes when I'm not using the machine.

Is this long compile just on the first build? After first compile do things build faster?


dawlane(Posted 2015) [#44]
Is this long compile just on the first build? After first compile do things build faster?
As I have said before I haven't got access to MX2, so I haven't a clue how Mark has implemented the tool chain. But building any tool or SDK from source can take time. How much time depends on the processing power and memory of the host, but once it's built and installed. Then you don't need to build it again, unless there is a real need to do so. If you do, then it's time to open a novel and read it while you wait.


Richard Betson(Posted 2015) [#45]
@dawlane
Then you don't need to build it again

Thanks.

Should I remove the my current (apt-get - Local install? Wondering what to call it.) install of emscripten before building/applying the portable SDK? I was going to use this method If I need to.
http://installion.co.uk/ubuntu/vivid/universe/e/emscripten/uninstall/index.html

Edit Synaptic Package Manager. ;) Been awhile.


dawlane(Posted 2015) [#46]
Well, well, well. No wonder the emsdk was taking so long to compile and eating my hard drive space.
If you follow the instructions and install the latest, it builds it in release mode with debug symbols. You can rectify this before running any emsdk commands by first backing up the emsdk_manifest.json file and replacing all occurrences of RelwithDebug in the original. It cut around five minutes off the build.

After the compile has completed run the command below in the emsdk_portable directory to get rid of any lingering intermediate build files.
find . -name "*.o" -type f -delete

Edit: Must be going blind.
Use parameter --build= in the ./emsdk install command
Both commands 'install' and 'activate' accept an optional parameter
'--build=type', which can be used to override what kind of installation
or activation to perform. Possible values for type are Debug, Release,
MinSizeRel or RelWithDebInfo. Note: When overriding a custom build type,
be sure to match the same --build= option to both 'install' and
'activate' commands and the invocation of 'emsdk_env', or otherwise
these commands will default to operating on the default build types,
which are Release for the 'master' SDK, and RelWithDebInfo for the
'incoming' SDK.


Richard Betson(Posted 2015) [#47]
Hi,

I am going to give emscipten another try this weekend. :)

ATM I am having way too much fun getting to know Linux Mint and KDE. My awesome desktop.


I am also upgrading (on the cheap) to this (8GB, Phenom II X4, Asus MB) which looked like a great deal and should help with compile times. Got to be better then my duel core 4GB.
Asus M4A88T-V EVO Motherboard Quad-Core AMD Phenom II X4 965 8GB RAM DDR3 AM3

Super stoked to get MX2/MX1 development going on Linux. :D


dawlane(Posted 2015) [#48]
Special note. Make sure that the firewall is enabled. For some reason the default install doesn't have the firewall enabled which is a big let down. Believe it or not the firewall in OS X is disabled as well when installed.


Richard Betson(Posted 2015) [#49]
I was able to build the emscripten sdk (about four hours on my laptop, Mint 17.2), but I get this error on compile (with Ted). How do I set the environment/source path for emscripten?


I did run 'source ./emsdk_env.sh' which returns the following which is the right path.



dawlane(Posted 2015) [#50]
source ./emsdk_env.sh is pretty much useless as it only works with the current shell that ran it.
To solve it. You will need to append to your hidden .profile in the home directory the appropriate paths and variables.
EMSCRIPTEN_PATH="$HOME/Programing/emsdk_portable:$HOME/Programing/emsdk_portable/emscripten/tag-1.34.4/bin:$HOME/Programing/emsdk_portable/clang/tag-e1.34.4/build_tag-e1.34.4_64/bin:$HOME/Programing/emsdk_portable/emscripten/tag-1.34.4:$PATH"
export EMSCRIPTEN="$HOME/Programing/emsdk_portable/emscripten/tag-1.34.4"
PATH="$EMSCRIPTEN_PATH:$PATH"

You will need to log out and back in again for the changes to take affect.


Richard Betson(Posted 2015) [#51]

Success!

I had to change the following in .emscripten (home directory).
NODE_JS = 'node'
'
and change it to
'
NODE_JS = 'nodejs'

.
You will need to append to your hidden .profile in the home directory the appropriate paths and variables.

That worked and thanks. Could I also have done 'emsdk activate --global <sdk_name>'? It is an option and it looks like it would install the paths (.profile) globally although I am still not sure of it's usage yet.


Richard Betson(Posted 2015) [#52]
I will post the exact steps I took to install all of this on Linux Mint 17.2 shortly. :) I am installing a new CPU/Motherboard and I want to run through a compile of the emscripten SDK again just to make sure I have each one of the steps verified . But it should be pretty straightforward and fairly easy to do for those interested in using emscripten on Linux.


Richard Betson(Posted 2015) [#53]
Hi,

I have emscripten compiling the on my desktop with it's new CPU and MB. With my Phenom II X4 965 with a 3.92GHZ overclock (normally 3.4Ghz) it only took about 40 minutes to compile and complete the process. Much better then I had hoped for. :)

I do have an issue. I get several warnings and I am not sure why. Perhaps it's because I am using a newer version of emscripten then Mark did for MX2? Thoughts? :) I am apparently able to generate an "A.HTML" file when compiling the SDL2 demo which seems run OK when launched into a browser (does not run after compile in Monkey). Both my laptop (fresh install of Mint 17.2) and my desktop (also Mint 17.2) have the same issue.
.



Richard Betson(Posted 2015) [#54]
I realized just after posting above I should remove the build directory for emscripten. :) That solves most of the problem. But I still get the following and after compiling, Monkey does 'not' launch the SDL2 demo into a browser (I have a default one set). Although Monkey does generate a working "A.HTML" file for the SDL2 demo (SDL2 demo runs).




dawlane(Posted 2015) [#55]
socket.error: [Errno 98] Address already in use
That should give you a clue. But the question would be which port is already being used? I would suspect that the problem could be related to mserver.


Richard Betson(Posted 2015) [#56]
I would suspect that the problem could be related to mserver.

I think it is. I rebooted and compiled the SDL2 demo (emscripten) again and it ran fine and opened up into a browser (Firefox). I think the issue might be related to clicking on the "kill" icon (red circle) in Monkey's tool bar instead of closing the emscripten tab in the browser. Clicking on that icon will kill Ted and then relaunching Ted and recompiling gives the above error. So a bug I guess. ;)

Edit: In case Mark is lurking I did this with Monkey 85.a


dawlane(Posted 2015) [#57]
socket.error: [Errno 98] Address already in use
This error crops up on the odd occasion and is mentioned in IBM's developerworks web site. You can find information about sockets in the GNU C documentation.
Usually you have to wait a minute or so before you relaunch TED or recompile.


Richard Betson(Posted 2015) [#58]
This error crops up on the odd occasion

This may be true but it persists even after waiting and clicking on the kill icon in Ted should not kill Ted but kill the running emscripten process.


Richard Betson(Posted 2015) [#59]
So as a recap for those who might like to try running MX2 in Linux I did the following.

Dependencies for Linux Mint 17.2 (64bit)
================================
To get Monkey X1 setup install the following in console.
sudo apt-get install "  "
g++
xorg-dev
qtcreator
libopenal-dev
libgl1-mesa-dev

'
Next for Monkey X2 you will need to do the following.
=========================================
Install SDL2
---------------
 sudo apt-get install libsdl2-dev 

.
Install and compile emscripten,
----------------------------------------
You will need to download the "Portable Emscripten SDK for Linux and OS X" located here.
https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#linux-and-mac-os-x
Once you have that downloaded put/expand it into your 'home' directory (or one of your choice).
.
You will need to install these dependencies next.
sudo apt-get install " "
build-essential
cmake
nodejs
default-jre
git-core

.
Next you will need to run the command line tool emsdk which is in the emsdk_portable directory. From your file manager open up the emsdk_portable folder and right-click and open up a console from that location. Then type the following into the console window.
.
./emsdk update

This will download a list of available resources.
.
./emsdk install latest

This will start the compile process for the emscripten SDK. It will first get a few dependencies and then start what can be a very long compile (hours in some cases).
.
./emsdk activate latest

This will finalize and activate the SDK.
'
.
The last step involves modifying two files. They are both located in your 'home' directory (in some cases this could also be home/your-user-name.
----
Using your file manager set to view 'hidden files' open the file called '.profile' in a text editor. You will need to add the following to it. This is an example and you will need to modify it with your paths and you will also need to modify the file names so that they match the version numbers of your version of emscripten (so 'tag-1.34.4' might become say 'tag-1.34.6' ).
EMSCRIPTEN_PATH="$HOME/Programming/emsdk_portable:$HOME/Programming/emsdk_portable/emscripten/tag-1.34.4/bin:$HOME/Programming/emsdk_portable/clang/tag-e1.34.4/build_tag-e1.34.4_64/bin:$HOME/Programming/emsdk_portable/emscripten/tag-1.34.4:$PATH"
export EMSCRIPTEN="$HOME/Programming/emsdk_portable/emscripten/tag-1.34.4"
PATH="$EMSCRIPTEN_PATH:$PATH"


Lastly you will need to modify a file called '.emscripten' located in your home directory. You will need to change the following.
NODE_JS = 'node'
'
and change it to
'
NODE_JS = 'nodejs'

.
This is just a rough guide of what I did to get things going and there are 'thinner' ways of doing this and you can read about them within this thread. This method is simple and easy for beginners I would think. Big thanks to dawlane for getting me through this. :D

Edit-
I will include a list of what files to change permissions on in Monkey here shortly. Because monkey is in a zip file it does not include file permissions. So you have to change a few file permissions manually (like making Ted as an executable).


dawlane(Posted 2015) [#60]
You should use
./emsdk install --build=MinSizeRel latest
./emsdk activate --build=MinSizeRel latest
If you don't, it defaults to RelWithDebugInfo, which makes the binaries rather large.


Richard Betson(Posted 2015) [#61]

Monkey/Android on Linux Mint 17.2

I now have Linux setup for Monkey and have Android working as a target. Just to help anyone who wants to run MX1/2 and have a Android target setup on Mint 17.2.

To get Android working with Monkey X1 as a target using Min17.2 (Ubuntu 14.04) do the following.

Install Java JDK.
sudo apt-get install openjdk-7-jdk


Next download and extract the Linux Android SDK
http://developer.android.com/sdk/index.html#download

Once you have done that you will need to open the 'tools' folder (will probably be in a folder called 'android_sdk_linux') in your file manager and change the permissions for the following files to be executable.
emulator , emulator-arm , emulator-mips , emulator-ranchu-arm64 , emulator-ranchu-mips64 , emulator-x86 , emulator64-arm , emulator64-mips , emulator64-ranchu-arm64 , emulator64-ranchu-mips64 , emulator64-x86


Lastly you will need to run the script file 'android' in the 'tool' folder. You may need to also set it's permission to executable. Once run it will open the Android SDK Manager. You will also have to modify your Monkey 'config.linux' file (located in the 'bin' folder within your monkey folder) and modify the path for the Android SDK.

Thats all I had to do do get Android running on Mint 17.2 (Ubuntu 14.04). :D