Ubuntu setup

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Ubuntu setup

Post by Nyyrazzilyss »

I'm setting up a mudlet compile environment inside an Ubuntu virtualbox.

I've followed the instructions at http://wiki.mudlet.org/w/Compiling_Mudl ... _on_Ubuntu

It would appear to be missing a step between 2 and 3: cd Mudlet

The compilation however fails midway through:

gcc -c -m64 -pipe -O2 -w -D_REENTRANT -fPIE -DAPP_VERSION=\"3.0.1\" -DAPP_BUILD=\"-dev\" -DAPP_TARGET=\"mudlet\" -DLUA_DEFAULT_PATH=\"/usr/local/share/mudlet/lua\" -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_UITOOLS_LIB -DQT_CORE_LIB -I. -isystem /usr/include/lua5.1 -Iirc/include -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtUiTools -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o lua_yajl.o lua_yajl.c
lua_yajl.c:1:29: fatal error: yajl/yahl_parse.h: No such file or directory
compilation terminated.
Makefile:2596: recipe for target 'lua_yajl.o' failed
make: *** [lua_yajl.o] Error 1

fixed -

sudo apt-get install libyajl-dev

Mudlet 3.0.1-dev now compiles/runs

followup: It runs, but my package didn't. A lot of the lua libraries weren't present. I had to use apt-get on a number of packages: lua-sql-sqlite3, lua-filesystem, lua-rex-pcre, lua-zip after which my package ran successfully.

I'm sure there's going to be more I find that aren't present. This should be added to the ubuntu compile instructions also.

Are there any instructions about crosscompiling Mudlet from Ubuntu to Windows? Has anyone configured that?

User avatar
SlySven
Posts: 935
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Ubuntu setup

Post by SlySven »

Ah, it seems you do not have the Ubuntu equivalents of what is libyajl2 and/or libyajl-dev packages installed {those are at version 2.0.4-2 on my Debian Wheezy (7.x) box} - it would seem they are already installed on the Travis CI Linux platform so didn't show up in the testing process.

P.S. Also I have just updated those instructions so that the code is built out-of-source, which helps to keep the source code directories clean of build artifacts for Linux and Mac builds - so it should work for both qmake AND cmake build systems - though the latter was originally used specifically for Windows builds...

P.P.S. You edited at the same time I did! As for issues that might arise one you have a runnable executable you might want to look at a recent post here.
For cross-compiling I'd suggest using cmake rather than qmake as that is rather better at doing it - indeed it is quite likely that the relevant cross-compiling Qt libraries are already packaged. However I suspect that you will be making 32-bit Windows executables rather than 64-bit ones - my mine system can dual-boot into Windows 7 (I'm still trying to get the 10 upgrade to go in :evil: ) but I, personally, have not yet been able to create a Mingw 64-Bit Qt setup and official pre-compiled binaries are only 32-Bit for the Mingw system {we, as the Mudlet developers, cannot use the sort-of "free" MSVC build system to make Mudlet Windows binaries for distribution to users because that is incompatible with the GPL AFAIK :twisted: }

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Ubuntu setup

Post by Nyyrazzilyss »

I've got the compile re-running right now. I'm using an ubuntu virtualbox (15.04) sourced from http://virtualboxes.org/images/ubuntu/. I just purged/reimported the image.

In step 2 of the compile instructions: Why is there a padlock with mudlet following it?

In step 4: The user would currently be located in Mudlet/src. The CI/travis etc commands would need to be changed to ../CI/

In step 6: Since you're now located in Mudlet/src/build, the path to src.pro would now be ../src.pro

I haven't tried the cmake command yet, however, qmake still errors out re: yahl_parse.h - I didn't install that package myself first before I ran the compile because it wasn't in the instructions :)

I installed (sudo apt-get install libyajl-dev) and qmake ran again successfully. cmake however is still erroring out unable to find the library [ Could NOT find YAJL (missing: YAJL_LIBRARIES) ]

I tried installing all the yajl files, same error (from cmake only) - qmake compiles

I thought the make install command (though maybe I just didn't see that before) was going to solve the problem with missing lua libraries, but it didn't :( As an aside, I had to run it with sudo. Mudlet runs, but I do get errors that rex_pcre, zip, lfs, and luasql.sqlite3 aren't present (I can manually install them myself to fix that)

User avatar
SlySven
Posts: 935
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Ubuntu setup

Post by SlySven »

Nyyrazzilyss wrote:In step 2 of the compile instructions: Why is there a padlock with mudlet following it?
I think that is because the preceding URL is an HTTPS: one.
Nyyrazzilyss wrote:In step 4: The user would currently be located in Mudlet/src. The CI/travis etc commands would need to be changed to ../CI/
Nope, if you look carefully, I changed the text so the user is in the parent directory to the src one, which is right as the CI files are in a parallel sub-directory to that (and the created build) one.
Nyyrazzilyss wrote:In step 6: Since you're now located in Mudlet/src/build, the path to src.pro would now be ../src.pro
Yep, and that is what it says...
Nyyrazzilyss wrote:I haven't tried the cmake command yet, however, qmake still errors out re: yahl_parse.h - I didn't install that package myself first before I ran the compile because it wasn't in the instructions :)
Well I recently revised the CMake files to use pkg-config on the Mac platform {which helps with the unusual header file location for the zip library (there is an internal include for a file called zipconf.h which is in a ./libzip/include/ directory relative to the actual libzip.so shared library)} and I guess I'll need to do something similar. This has probably come about because CMake was the build system used specifically for Windows and it was originally tuned for personal compiles of several bits needed for that platform. I'll need to take a closer look at how libyajl is handled - IIRC on MacOs a pre-compiled package is not available and on THAT platform we have to include a single file (a combined header file and implementation file, requiring libzzip) which is now called luazip.h but was until very recently called luazip.c).

Ah ha, in the ./CI/travis.linux.before_install.sh file at the very end is a:

Code: Select all

pushd $HOME
git clone https://github.com/lloyd/yajl.git
popd
which is used in the subsequent ./CI/travis.linux.install.sh:

Code: Select all

pushd $HOME/yajl
./configure
sudo make install
popd
That should be sourcing yajl, compiling it and installing it into your system (with the sudo) so that it will be findable when needed for header includes and for linking...

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Ubuntu setup

Post by Nyyrazzilyss »

The directory issue was my fault: Sorry about that! I created/misread the instructions on the build folder, and created it in the wrong place.

I am erroring out when I run CI/travis.linux.before_install.sh - The error is occuring/exiting prior to alj2 being installed.

That's likely part of it - If I move the ajl2 lines at the end of it prior to the error'ing code, qmake does compile (though not cmake)

Error:

sudo apt-get update
W: Failed to fetch http://ppa.launchpad.net/boost-latest/p ... 4/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/boost-latest/p ... 6/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/kalakris/cmake ... 4/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/kalakris/cmake ... 6/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.


This is quite likely due to installing on the image of 15.04 i'm using. I've tested a couple other earlier images (10.04 and 10.10), but they're both trying to use the wrong sources. Which version of Ubuntu (or Debian, for that matter) should I be using?

User avatar
SlySven
Posts: 935
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Ubuntu setup

Post by SlySven »

Well the Travis C.I. is using Precise Pangolin (12.04 LTS) version - I realise now that I hard coded libboost1.55-dev in there (because the default was a mongrel mix of 1.46 and 1.48 which I think was causing compilation issues, so I explicitly remove those before installing the later one) but from here I see that they are currently at 1.59...

The yajl2 stuff should result in moving to the user's home directory, and cloning the git repository there (which creates a yajl directory directly off there) in the before_install script and then changing to the yajl sub-directory to do a "configure; sudo make install" cycle in the install script (which is before the main Mudlet application build remember!) The sub-directory used is probably non-optimum for normal users - who'd probably prefer a "configure; make; sudo install" in something like ~/src/yajl, i.e. down in a src (typical location for personal projects) off their home directory (a.k.a. "~" in bash and other shells) - the directory location chosen was just the simplest to use on the C.I. platform which gets created anew before each build; but this was decided on before the scripts started to form a basis for other users, *sigh*...

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Ubuntu setup

Post by Nyyrazzilyss »

I setup a vanilla virtualbox using Ubuntu 12.04

Following the instructions from the website, I had no compile errors either from cmake or qmake, or in either of the CI/ commands.

I couldn't find where cmake was putting the binary, but qmake was where I expected it (in my current directory).

The binary ran successfully, though after running it did popup the errors about the missing lua libraries (rex_pcre, zip, lfp, luasql.sqlite3). I can apt-get those packages. I haven't looked closely at it yet (one of the reasons I was setting this up was about lack of sound), but it also errors about org.qt-project.qt.mediaplayer

I'm not sure if it's the correct packages, but I used apt-get on liblua5.1-sql-sqlite3-2, liblua5.1-rex-pcre0, liblua5.1-filesystem0, liblua5.1-zip0

While it does appear to be running/my package did install successfully, I am seeing some errors in the gui / a constant error message 'QBackingStore:flush() called with non-exposed window, behavior is undefined' - Quite likely something i've done wrong with my setup/ or a new error message coming about from linking with newer libraries.

I might suggest in the Ubuntu compile instructions if it noted tested on/known working for 12.04 - While this is mentioned in the Travis section, it wouldn't hurt to duplicate that in the Ubuntu compile instructions.

Adding 'make install' that moves the created binary to the correct install location, and retrieves the above mentioned lua files if not present also wouldn't hurt :)

Thanks!
Last edited by Nyyrazzilyss on Wed Nov 25, 2015 4:04 am, edited 1 time in total.

User avatar
SlySven
Posts: 935
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Ubuntu setup

Post by SlySven »

The trouble with positioning the executable and the shared readonly files was where to put them on non-proper, er, non-Linux OSs :lol: - I had some fancy code that compiled in a default into the code, and went looking for the shared-readonly stuff on start up and only if it didn't find it, invited the user to play "spot-the-LuaGlobal.lua". It then "remembered" where it was in the ~/.config/Mudlet/Mudlet 1.0.conf file which is associated with the Qt libraries' QtSettings class - so that it would only activate again if the file disappeared from there. At the time this was complicated by the fact that the source code had TWO different copies of LuaGlobal.lua in two places so I had to check that it was one >50K in size and the rogue one might hang around in a user's build environment.

tl;dr; it was put on hold until I could get concrete directions as to what to do on MacOs and 'Doze platforms - it is getting a little easier to understand how the latter does "shared/readonly" stuff now and the Qt QStandardPaths seems to be something to look into so I ought to go back to it at a less busy moment...

If you use the same directory for a qmake and a cmake build (e.g. a generic "build" one, the executable will end up there for both, so the later one will overwrite the earlier build one. ;) ) If you want to compare and contrast the two project systems or have qtchooser installed and configured for multiple Qt versions just use a different build directory for each case - and they will happily share the same copy of the source code. This is what QtCreator does if you specify a "shadow-build" for each "Build Kit" and CMake recommends as "out-of-source" builds. Although I currently build with a Qt 5.5.0 GCC 64-bit kit I occasionally run a 5.0.2 (and if I'm playing with my 4.x backport a 4.86 one as well) over the code to check compilation. :geek:

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#2283

Re: Ubuntu setup

Post by Belgarath »

Reviving a dead post! 8-)

I recently installed Ubuntu and I wanted to compile Mudlet, but I ran into to errors following the same wiki guidelines. I uploaded the log to Pastebin here. Some guidance would be appreciated!

Editor: corrected URL as it was referring to pastebin.co not pastebin.com !

User avatar
SlySven
Posts: 935
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Ubuntu setup

Post by SlySven »

Nyyrazzilyss wrote:While it does appear to be running/my package did install successfully, I am seeing some errors in the gui / a constant error message 'QBackingStore:flush() called with non-exposed window, behavior is undefined' ...
I recently discover that that is a side effect of use the Qt libraries at 5.0.2 version which is a very old version of the Qt5.x that the current C.I. uses - if you google it I think you will find other affected things, if you can lay you hands on a more up to date version I think those go away.

Post Reply