Won't build correctly under Fedora 13

Added by Rob I over 1 year ago

Sorry if this is not all relevant to just Jamplus.

I'm trying to build a new version of LuaPlus for a project I'm working on because the current version I have contains text relocations that don't play nice with SELINUX in F13. I've so far done the following:
  • Using git clone, obtained the latest source
  • Via the terminal, entered the src directory
  • Edited the Makefile to set the platform to Linux
  • Run ./jmake.sh.

The script runs ok upto the point where it needs to run $jam -sBUILD_J=yes. It complains that the command -sBUILD_J=yes can't be found. Running the previous find statement doesn't return anything. Running it from the parent directory returns ./bin/linuxx86/jam. Running the $jam ... command using this in place of the variable builds but no output called j is produced.

I've managed to build LuaPlus with the jam executable mentioned above but it comes up with several errors at the beginning. It still contained text relocations so I've edited the build file to contain a C.AddFlags line containing -fPIC and after rebuilding the rest of the project (again, text relocations) and the created LuaPlus library does at least seem to be working, although not extensively tested.

On a side note, the previous version of LuaPlus I was using I bult by creating a VS solution on windows and opening it in CodeBlocks on Linux.


Replies (12)

RE: Won't build correctly under Fedora 13 - Added by Joshua Jensen over 1 year ago

Okay, so it appears jmake.sh is a leftover from one of the Jam patch trees I pulled in from the Perforce Public Depot. We use jmake.bat on Windows, but we don't use jmake.sh at all.

I verified the following steps on Ubuntu. I don't have Fedora installed, so if there are problems, let me know.

~$ cd jamplus/src
~/jamplus/src$ make linux
~/jamplus/src$ cd ~/luaplus51-all
~/luaplus51-all$ ~/jamplus/bin/linuxx86/jam
~/luaplus51-all$ export LUA_BIN=~/luaplus51-all/bin.gcc.linux32
~/luaplus51-all$ cd ~/jamplus/src
~/luaplus51-all$ make linux

This builds up JamPlus with full support for workspace generation and all component of LuaPlus that are available on Linux.

I need to update this page with full build instructions: http://jamplus.org/git/jamplus/docs/html/building.html

I have also updated the GCC builds of JamPlus to use the -fPIC option. I've also uploaded a snapshot of both the JamPlus binaries and LuaPlus binaries (at http://luaplus.org) for Linux, if either are useful.

JamPlus has support for CodeBlocks generation. I haven't tested it in a while. I should do so and make sure all still works.

Thanks!

Josh

RE: Won't build correctly under Fedora 13 - Added by Rob I over 1 year ago

OK, fresh git clone performed.

JamPlus seems to build OK on the first build.

The start of LuaPlus build begins:

don't know how to make <lua-discount>basename.c
don't know how to make <lua-discount>Csio.c
don't know how to make <lua-discount>css.c
don't know how to make <lua-discount>docheader.c
don't know how to make <lua-discount>dumptree.c
don't know how to make <lua-discount>ematch.c
don't know how to make <lua-discount>generate.c
don't know how to make <lua-discount>ldiscount.c
don't know how to make <lua-discount>markdown.c
don't know how to make <lua-discount>mkdio.c
don't know how to make <lua-discount>resource.c
don't know how to make <lua-discount>toc.c
don't know how to make <lua-discount>xml.c

Is this normal?

Had to pull in:
readline-devel (can't remember why)
openssl-devel (luacrypto, luasec module)
libuuid-devel (uuid module)
pcre-devel (pcre module)

Got an SELINUX violation again during the build process because luaplus_1100.so required text relocation, so I added the following to the LuaPlusDefines section at the top of LUAPLUS.jamrules and rebuilt LuaPlus from the start again. I know this is a bit of a hack because it doesn't take into account that the user may not be using GCC to compile under Linux.

@rule LuaPlusDefines TARGET {
if $(OS) = LINUX {
C.Defines $(TARGET): LUA_USE_LINUX ;)
C.AddFlags $(TARGET) : -fPIC ; // New line to avoid SELINUX violation
}
}@

Then performed the following:

~/luaplus51-all$ export LUA_BIN=~/luaplus51-all/bin.gcc.linux32
~/luaplus51-all$ cd ~/jamplus/src
~/luaplus51-all$ make linux

Finally I rerun to see if the previous "don't know how to make" statements would go away with no luck.

~/luaplus51-all$ ~/jamplus/bin/linuxx86/jam

The final status report was that it found 1956 targets, couldn't find 13 targets and couldn't make 15 targets because of the "don't know how to make..." stuff above.

Going back to JamPlus, I've tried running the test suite using test/runtests-linux. It reckons 152/152 tests passed but there are countless failure notices with stack traces and errors about missing files.

RE: Won't build correctly under Fedora 13 - Added by Rob I over 1 year ago

Guess inline quote was a bad idea :p

RE: Won't build correctly under Fedora 13 - Added by Joshua Jensen over 1 year ago

The files for lua-discount don't seem to be checked in. They aren't on any of my machines, so I'll have to download them. In the meantime, I fixed up the module detection to not attempt a build if the Src/Modules/modulename/ directory doesn't exist.

I haven't had a clean Linux VM in a while. I need to install one. It would help me identify and fix the readline-devel, openssl-devel, libbuuid-devel, and pcre-devel issues. I want the module to be ignored if all the files aren't present. The build does for some, but it fails on others. I'm not sure if I can get away with not having readline-devel present, because the lua executable requires it.

-fPIC is now automatically added to shared library builds. I didn't know about it, and the shared libraries built and ran fine for me.

All of the tests pass now on Linux except the filecache_luamd5callback one. The number of tests is definitely reported wrong when there are failures. Thanks for pointing that out.

These updates are checked in to the JamPlus and LuaPlus repositories. New Linux binaries have been posted for both.

Hopefully this gets you closer. Thanks for your patience, and let me know.

Josh

RE: Won't build correctly under Fedora 13 - Added by Rob I over 1 year ago

Sorry its taking me a bit longer to look into this as I've got a week of rubbish shifts at work this week. Start a little later but not late enough to get on with anything and then by the time you get home for dinner you've got to rush around to get back out again.

Time for a little digging though. Red Hat patched Lua to remove GNU readline from liblua-5.1.so so as to remove any licensing issues (GPL) with applications depending on Lua. It is needed though for /usr/bin/lua to work. I presume this is still the case in Fedora.

  • Mon Oct 16 2006 Hans de Goede <> 5.1.1-2 - Only link /usr/bin/lua with readline / do not link %{_libdir}/liblua-5.1.so with readline so that we don't cause any License troubles for packages linking against liblua-5.1.so, otherwise lua could drag the GPL only readline lib into the linking of non GPL apps.

Whatever the current situation may be, you seem to be correct about needing this. Just stick a little note on the build instructions saying its needed.

Where abouts did you make the change for -fPIC, I've looked through the repo but can't seem to find it. Just starting up my laptop so I can give it a try. I'll see if I can get some test logs as well.

RE: Won't build correctly under Fedora 13 - Added by Rob I over 1 year ago

Ok. Now get a message saying lua-discount won't be built because source doesn't exist.

Build seems to be OK, no text relocations found in luaplus_1100.so.

Now I'm trying to run the test suites. Not sure how to do the LuaPlus one but attached is the log (stdout and stderr) for the Jamplus suite.

testoutput.log - Jamplus output (18 KB)

RE: Won't build correctly under Fedora 13 - Added by Joshua Jensen over 1 year ago

I'll get a clean Linux VM soon and document the entire process for building the code.

Here is what I think is going on with the tests. JamPlus' executable is called 'jam'. I didn't ever change it from the original Perforce Jam name, and I don't want to type the longer 'jamplus'.

Anyway, JamPlus' Jambase does not refer to files called 'Jamfile' anywhere. It uses 'Jamfile.jam' with the extension. Your test suite log lists:

Jamfile: No such file or directory

The test suite is running an application in the PATH called 'jam'. I think your jamplus/bin/linuxx86 directory is not in the PATH. I think it is using an previously installed version of Perforce Jam or such. I'm going to attempt to update the test suite to access the proper 'jam' executable.

Try putting the jamplus/bin/linuxx86 directory in your PATH and see what happens.

Josh

RE: Won't build correctly under Fedora 13 - Added by Rob I over 1 year ago

Some more progress. Removed vanilla Jam from the system. Recloned the git repos and rebuilt as per the instructions above.

All the Jamfile errors are gone, some tests are now passing but there are still quite a few failures.

LuaPlus is currently failing tests due to an undefined symbol. I'm looking into this next. It may just be another dev package missing.

jamplus.log - Jamplus test output (15.9 KB)

RE: Won't build correctly under Fedora 13 - Added by Rob I over 1 year ago

Done a little more fiddling with path and installed packages and I've managed to get the test suite to run. The only failure is the one you mentioned previously but several other tests print some information suggesting they've encountered a problem.

What is the correct way to run the LuaPlus test suite?

jamplus.log (4.3 KB)

RE: Won't build correctly under Fedora 13 - Added by Joshua Jensen over 1 year ago

In LuaPlus, the Samples/TestScript and Samples/TestSuite projects have Jamfiles (get latest) that will allow building of the applications. TestSuite runs automatically and reports its results. TestScript was just an exercising of a lot of LuaPlus functionality and serves as an example of usage. If it doesn't crash on you, you're fine.

Josh

RE: Won't build correctly under Fedora 13 - Added by Rob I over 1 year ago

Come back to this after working on several other issues for a while.

Removed all old directories, got latest source and run the following.

~$ cd jamplus/src
~/jamplus/src$ make linux
~/jamplus/src$ cd ~/luaplus51-all
~/luaplus51-all$ ~/jamplus/bin/linuxx86/jam
~/luaplus51-all$ export LUA_BIN=~/luaplus51-all/bin.gcc.linux32
~/luaplus51-all$ cd ~/jamplus/src
~/luaplus51-all$ make linux

Running jamplus test using ./runtests-linux only passes 55 tests.
Building luaplus TestScript fails.
Building luaplus TestLuaPlusAll fails.

testlog.txt - Full jamplus test output (26.4 KB)

installed.txt - Installed packages (41 KB)

TestScript - LuaPlus TestScript log (27.8 KB)

TestLuaPlusAll - LuaPlus TestLuaPlusAll log (28 KB)

RE: Won't build correctly under Fedora 13 - Added by Joshua Jensen over 1 year ago

I'm going to download Fedora 13 tonight when I have more bandwidth at my disposal. I'm betting the getexecutablepath() is failing on that platform. Linux distributions have different ways of accomplishing the same thing.

I'll let you know.

(1-12/12)