Building without prebuilt directory

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

Locked
MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Building without prebuilt directory

Post by MaxV » Thu Dec 05, 2013 10:25 pm

Hi,
I'm trying to build Livecode for raspberry pi. It's a Linux with ARM processor, my problem is that there isn't any prebuilt Livecode for ARM processor.
Is there a way to build Livecode without using the prebuilt directory?

P.S What is perfect.lnx?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

LCfraser
Livecode Staff Member
Livecode Staff Member
Posts: 71
Joined: Thu Nov 28, 2013 11:18 am
Contact:

Building for RaspberryPi

Post by LCfraser » Fri Dec 06, 2013 12:19 pm

Hi MaxV,

I'll answer your questions in reverse order: the perfect.lnx executable is a perfect hash generator; it generates a hash table (in the form of a C++ source file) used for looking up script keywords efficiently. As you rightly point out, it is an x86 executable and won't run on the RaspberryPi.

I've built LiveCode for the RPi myself and it can be a bit of a challenge. On an overclocked original model B (the one with 256MB rather than 512MB of RAM) running at 1GHz, building the release version of 6.5.0 with GCC 4.6 took around 90 minutes; I'd recommend building on a faster desktop machine if at all possible. Setting up the cross-compiler environment is a bit of a pain but only needs to be done once and the improved build times are worth it. I've written up some notes on this but they're not yet available on the website; I'm actually in the process of cleaning them up a bit ready for publication and they should be available soon.

The notes also contain instructions for building on the RPi itself. The main points of which are:
  • Some files get generated using the pre-built executables. The easiest way to deal with these is to built LiveCode normally on an x86/x86_64 machine and copy the files to the RPi.
  • The RPi framebuffer is (by default) 16-bit colour which the engine doesn't handle well. Change it in the /boot/config.txt file to 32-bit
  • There are some other miscellaneous oddities; I have a git branch at https://github . com/runrevfraser/livecode.git called feature-rpi with some fixes (version 6.5.0)
If you're copying across the generated files, the ones you need are engine/src/{linuxstubs,startupstack,encodederrors,hashedstrings}.cpp, engine/include/revbuild.h, thirdparty/libopenssl/src/sslstubs.cpp.

I'll post another message shortly to let you know when the notes are up as they're more comprehensive than my description here.

Good luck!
Fraser

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Building wuthout prebuilt directory

Post by MaxV » Fri Dec 06, 2013 2:37 pm

Fraser, thank you for your support! I felt so lonely in the ARM processor field. I'm waiting your notes greedly :mrgreen:
I don't want to cross compile, I have all the time to compile on raspberry pi.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

LCfraser
Livecode Staff Member
Livecode Staff Member
Posts: 71
Joined: Thu Nov 28, 2013 11:18 am
Contact:

Re: Building wuthout prebuilt directory

Post by LCfraser » Fri Dec 06, 2013 2:54 pm

The LiveCode IDE isn't exactly blindingly fast on the RPi but it's not bad. Certainly fun to play around with.

If you have any other questions, please feel free to get in touch. We don't officially support RPi but I'm willing to help out when I have the time. There are probably a few RPi-specific bugs lurking around but hopefully nothing too bad. We build for ARM for iPhones and iPads and support x86 Linux so I'd like to think ARM Linux should work reasonably well. Once I get the notes sorted out, I'll create a thread pointing to them so if you post any problems/comments/etc to that it'll be useful for anyone else with an interest in LC on RPi.

Out of interest, what model of RPi are you building on? The newer model B's with 512MB of RAM should be a decent bit faster as they'll swap a lot less. Having a fast SD card should also help; the one I have is quite slow and ends up being a bottleneck when archiving the static libraries and doing the final link.

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Building wuthout prebuilt directory

Post by MaxV » Fri Dec 06, 2013 5:33 pm

You are right, I have the new model B with 512mb and the new raspberry SD (8Gb!).

I still didn't look your branch, but my first question is: I'll prepare the generated files on another Linux, but how I can tell to the makefile to avoid using the prebuild directory to create them again? :oops:

My second question is: what is the difference between ??

P.S. I just added in /boot/config.txt

Code: Select all

framebuffer_depth=32
Last edited by MaxV on Fri Dec 06, 2013 5:57 pm, edited 1 time in total.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

LCfraser
Livecode Staff Member
Livecode Staff Member
Posts: 71
Joined: Thu Nov 28, 2013 11:18 am
Contact:

Re: Building wuthout prebuilt directory

Post by LCfraser » Fri Dec 06, 2013 5:42 pm

If the copied files are newer than the files from which they get generated, the Makefile won't re-generate them so the pre-built tools won't get called. You could disable the lines in the Makefile that cause them to be generated but having the build fail due to trying to re-generate them is a helpful hint that they are out of date. Strange things can happen when the generated files contain old contents!

The livecode-ide repository contains the LiveCode stacks for the IDE while the livecode repo contains the code for the engine. There is also a livecode-prebuilt which contains the pre-built tools and a livecode-thirdparty which contains the sources for the libraries that get built into LiveCode but we didn't write ourselves. Running git submodule update ensures that these other repos are up-to-date for the version of LiveCode you have checked out.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: Building wuthout prebuilt directory

Post by monte » Fri Dec 06, 2013 8:47 pm

Great to see you working on this @runrevfraser. I'll need to dust off my Pi.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Building wuthout prebuilt directory

Post by MaxV » Wed Dec 11, 2013 12:44 pm

I'm trying compilation on a normal Linux x86 VM, I did:

Code: Select all

sudo apt-get update
sudo apt-get install make gcc g++ libX11-dev libXext-dev libXrender-dev libXft-dev libXinerama-dev libXv-dev libXcursor-dev libfreetype6-dev libgtk2.0-dev libpopt-dev libesd0-dev liblcms-dev

git clone --recursive https://github.com/runrev/livecode.git

cd livecode

MODE=release make development
and I get the following error:

Code: Select all

make[1]: Entering directory `/home/max/livecode/thirdparty/libopenssl'
mkdir -p ../../_cache/linux/i386/release/libopenssl/./
gcc   -O2 -fvisibility=hidden -g -I./include -I./src -I../../engine/include -I../../libcore/include -I../../libexternal/include -I../../libgraphics/include -I../../thirdparty/libiodbc/include -I../../thirdparty/libjpeg/include -I../../thirdparty/libmysql/include -I../../thirdparty/libpcre/include -I../../thirdparty/libpng/include -I../../thirdparty/libgif/include -I../../thirdparty/libpq/include -I../../thirdparty/libsqlite/include -I../../thirdparty/libxml/include -I../../thirdparty/libxslt/include -I../../thirdparty/libz/include -I../../thirdparty/libzip/include -I../../thirdparty/libopenssl/include -I../../thirdparty/libcurl/include -I../../thirdparty/libskia/include/core -I../../thirdparty/libskia/include/config -I../../thirdparty/libskia/include/effects -I/usr/include/gtk-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-unix-print-2.0   -I../../thirdparty/headers/linux/include -I../../thirdparty/headers/linux/include/cairo -D_LINUX -DTARGET_PLATFORM_POSIX -D_RELEASE -DNDEBUG -D__LITTLE_ENDIAN__ -MMD -MF ../../_cache/linux/i386/release/libopenssl/sslstubs.d -c -o../../_cache/linux/i386/release/libopenssl/sslstubs.o ./src/sslstubs.cpp
./src/sslstubs.cpp:67:58: error: expected identifier before ‘,’ token
./src/sslstubs.cpp:67:72: error: expected identifier before ‘,’ token
./src/sslstubs.cpp:67:86: error: expected identifier before ‘,’ token
./src/sslstubs.cpp:67:98: error: expected identifier before ‘)’ token
...
A LOT OF ERROR LIKE THESE
...

./src/sslstubs.cpp:2682:44: error: expected primary-expression before ‘)’ token
make[1]: *** [../../_cache/linux/i386/release/libopenssl/sslstubs.o] Error 1
make[1]: Leaving directory `/home/max/livecode/thirdparty/libopenssl'
make: *** [libopenssl] Error 2
What is the problem?
I read the file sslstubs.cpp and the first guity line is:

Code: Select all

typedef int (*EVP_CipherInit_t)(void *pArg1, void *pArg2,, void *pArg3,, void *pArg4,, int pArg5,);
Is the file created wrong?
I suspect the ",," and ",)" are wrong?
Is it correct to remove the excessive commas?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Building without prebuilt directory

Post by MaxV » Thu Dec 12, 2013 10:42 am

I'm still working on x86 Linux:
I investigated and I believe that "Revolution.lnx" prebuilt binary produce wrong .cpp files.
It produces wrong .cpp files with missing or wrong variables like: pArg1, pArg2, pArg3, pArg4, pArg5
:shock:
And now?
Do you have a good set of the .cpp files?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Building without prebuilt directory

Post by Simon » Thu Dec 12, 2013 11:48 am

Hi MaxV,
I'm not sure I'm adding anything but:
http://livecode.com/blog/2013/02/20/liv ... pberry-pi/
If you haven't seen it.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Building without prebuilt directory

Post by MaxV » Mon Dec 16, 2013 1:05 pm

WOW, great work! Now you can install the last Livecode 6.5 on raspberry PI, just download from:

http://downloads.livecode.com/livecode/pi/

It works on my raspberry Pi and builds also correct standalone for rapsberry PI!!!!
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Locked

Return to “Engine Contributors”