Hello Guest it is June 27, 2019, 07:13:58 AM

Author Topic: Lua Stats  (Read 1392 times)

0 Members and 1 Guest are viewing this topic.

Re: Lua Stats
« Reply #10 on: May 19, 2018, 12:01:34 AM »
Hi smurph,
I'm in trouble here.

I got the Cmake GUI working. I displays a long list of modules/components that can be included in the build and the destination of the code that is built.
The list includes BINDINGS_Lua and a check box. The checkbox is not checked and therefore no Lua bindings are included in the build.
If I check the box, hit <configure> the box gets unchecked again.

I have thrashed around trying to get that component to stay in the Cmake list to no avail.

I found one file CMakeCache.txt where you can manually edit the text file, I turned the BOOL associated with the Lua binding module from OFF to ON. I then
caused a 'make' instruction, but still no code resembling Lua bindings or .dll.

Is there something I'm missing, maybe a dependency issue that I'm overlooking?

Craig
My wife left with my best friend...
     and I miss him!

Offline smurph

*
  • *
  •  1,094 1,094
  • "That there... that's an RV."
    • View Profile
Re: Lua Stats
« Reply #11 on: May 19, 2018, 02:41:55 AM »
Well...  typically the configure process will show you what all is needed.  You may have to check the advanced checkbox in the cmake GUI to see everything.  The module documentation may also shed some light on what is needed. 

I would not modify CmakeCache.txt, as it is generated.  And usually, to modify a make file, you do it through the cmake interface.  You CAN change them, but be aware that the next time you either configure or generate, those changes will be overwritten. 

Anyway, since that checkbox goes away, I suspect it is looking for the LUA 5.2 headers and libraries.  You may have to point cmake to these directories if it doesn't automatically find them in the configure process.  Usually, one will "configure" and resolve all dependencies and repeat as necessary.  Then "generate" the make files.  If the configure process fails for some reason, it will show up in the log.  And possibly highlight the areas in the config list with red.

Steve
Re: Lua Stats
« Reply #12 on: May 19, 2018, 04:42:52 PM »
Hi Steve,
I apologize, this thread is getting further and further away from Mach4, its getting to be just a general computing problem.

I have in recent times used CodeBlocks IDE and written C code for TexasInstruments micros and so broadly familiar with compiling and linking,
although it took a lot of learning and experimenting.

I now perceive that Cmake is a method of bringing all those elements and settings together to build executable code. I like the idea...but like any program you have
to learn to use it properly.

At this stage I believe that I have presented Cmake with an outline of what and how I want it built....this is its default as I downloaded it, but I in fact want something
different and have yet to work out how to apply my choices to it. Such documentation there is, is very terse and I've not had much success yet.

When the cache is reloaded all items are red. Then hit <configure> and all items are no longer highlighted. I presume therefore that they all configured successfully.
When I look in the build directory I find in the Lua binding folder for instance three files of the type Cmake..., CTest.... and Makefile in addition to a CmakeFiles
folder. I presume therefore that the necessary make instructions have been configured and generated but they are ignored when 'making'.

I had a look in the source files and in the Lua bindings folder there is a 46KB file plplotluac.i and it apprears to contain C code which I guess must be the bindings itself.
I believe therefore that the source code is available to the compiler, as to whether it knows where to find it is another question.

Anyway, Rome wasn't built in a day....

In this particular case there is no need for my to include a graph plotting module to Mach other than interest. I do perceive however that users will have application for such modules,
if not this one, then something like it and I would like to be familiar with the procedure when it arises.

Craig
My wife left with my best friend...
     and I miss him!

Offline smurph

*
  • *
  •  1,094 1,094
  • "That there... that's an RV."
    • View Profile
Re: Lua Stats
« Reply #13 on: May 19, 2018, 09:04:21 PM »
Craig,

Well...  Configure may indeed be working properly.  The library looks like it have several bindings, LUA only being one of them.  If configure can't find the LUA headers and libraries, it may build just the other bindings, etc...  That is what I was thinking.  Cmake is a good concept but I don't think it can ever be implemented perfectly.  Too many pieces to the puzzle a lot of times. 

That plplotluac.i file is what we call an interface definition file.  The C code is generated from that .i file.  Normally, it is processed by LUA itself.  So you may need Lua.exe in the path.  And there may be a place in the configure portion to tell it where that is.  So maybe a REAL LUA installation is needed.

Steve
Re: Lua Stats
« Reply #14 on: May 19, 2018, 09:52:54 PM »
Hi Steve,
that's an interesting thought, maybe Cmake is looking for Lua on my PC but wont find it buried in Mach, and as you say the Lua embedded in Mach may not be REAL Lua
as far as Cmake is concerned.

The build as it stands has regular C, Cxx, and Fortran. Prior to me installing MinGW I had no compilers installed, my PC melted down at Christmas and much of what I had is lost.

When I <configure> in the results panel at the bottom of the Cmake screen I end up with a whole bunch of messages, mainly along the lines of 'such and such installed,
Lua OFF...' I didn't pick them as errors but rather just a report of what has actually occurred. I tried to highlight entries to see if in some way I could manipulate or expand them,
to no avail. It firms my opinion that they are just a report, the red font just gives me pause. I've taken the liberty of attaching the Cmake report as a text file.

The infuriating thing is that all the material appears to be present. There are Cmake files in the Lua bindings folder, which suggests that Cmake has correctly supplied the Makefile
instructions and yet when I issue a 'make' command they are ignored despite their presence. The one obvious location to 'turn them on' is ENABLE_Lua: BOOL and yet Cmake blithely
overrides my selection.

I have to remind myself...this is a hobby....cool it!

Craig
My wife left with my best friend...
     and I miss him!
Re: Lua Stats
« Reply #15 on: May 20, 2018, 01:40:32 AM »
Hi Steve,
I think you may have hit the nail on the head...I found this in the top level CMakeLists.txt:

Quote
# It is a fatal error if no working C compiler is available to build
# the PLplot core C library and core C examples.  All other compilers
# required by our bindings are optional in that if no working compiler
# of the kind needed is available, the associated bindings and
# examples are disabled.
enable_language(C)

The absence of a Lua compiler will cause exactly the symptom I describe, ie the <configure> process overwriting my choice to include Lua bindings on the basis that there is no Lua compiler.
I am undecided whether I should download and install a Lua compiler or if the Cmake condition would be satisfied if I pointed it to the Lua compiler embedded within Mach.
Are you aware of any differences between a 'real' Lua compiler verses the embedded version?

I have often said that a hobby is best judged by what you learn in the pursuit of it. I didn't anticipate delving into Cmake or compiler/linker setups...but I am learning.

Craig
My wife left with my best friend...
     and I miss him!