Author Topic: libpinproc build errors and other Linux stuff.  (Read 1921 times)

Toyguy

  • Full Member
  • ***
  • Posts: 32
    • View Profile
libpinproc build errors and other Linux stuff.
« on: November 03, 2014, 10:49:08 PM »
I'm trying to setup a linux laptop just for pinball and am working though the Wiki Linux setup docs.  I am using the dev branches as the PD-LED support apparently needs them.  When I do libpinproc, the cmake works fine.  The make command, however, tosses a few errors like this:

/home/dave/P-ROC/libpinproc/utils/pinprocfw/pinprocfw.cpp: In function 'int checkPROCFile()':
/home/dave/P-ROC/libpinproc/utils/pinprocfw/pinprocfw.cpp:2191:66: warning: too many arguments for format [-Wformat-extra-args]
          fprintf(stderr, "\nERROR: board type mismatch.", board_id);

There are four of these.  Are these significant enough to cause a bad build?  The process completes but I wasn't sure what the outcome should be.  In the bin folder, I now have:

pinproctest
pinprocfw
libpinproc.so.2.0
libpinproc.so -> symlink to the one above

Does that seem right?

Also, anyone have any suggestions on good folder layouts, etc?  I have everything as sub-folders under ~/P-ROC.  Are there any specific folders I need to create by hand?  As an example, I believe my windows install has a 'shared' folder where the Linux install does not.  Is it good practice to just replicate the Windows file system layout on Linux too?

Thanks!

Dave


Rosh

  • P3 Developers
  • *
  • Posts: 667
  • Josh Kugler
    • View Profile
Re: libpinproc build errors and other Linux stuff.
« Reply #1 on: November 03, 2014, 11:08:53 PM »
pinprocfw is the utility for the updating the firmware, so probably not a show stopper to get going. I think I updated the firmware once, a very long time ago.

The shared folder is useful, if you are going to be working on more than one game at a time and you want to only keeps fonts, etc. in one place.  I can argue for and against it.

Gerry Stellenberg

  • Administrator
  • *****
  • Posts: 2397
    • View Profile
    • PinballControllers.com
Re: libpinproc build errors and other Linux stuff.
« Reply #2 on: November 03, 2014, 11:24:12 PM »
The shared folder is actually a separate git repository "proc-shared".  It's got some fonts, some dmd files, some sample yaml files, and a couple of simple sounds the service_mode_only scripts uses.  I always used it for the fonts.

- Gerry

Toyguy

  • Full Member
  • ***
  • Posts: 32
    • View Profile
Re: libpinproc build errors and other Linux stuff.
« Reply #3 on: November 04, 2014, 12:50:08 AM »
OK, another problem.  Attempting to run anything, such as procgame or 'python starter.py' from its directory, gives an ImportError: libpinproc.so.2.0: cannot open shared object file: no such file or directory.

That file does exist in ~/P-ROC/libpinproc/bin

What drives the paths that these components use to look for stuff?

Thanks!
Dave

spootdev

  • Full Member
  • ***
  • Posts: 36
    • View Profile
Re: libpinproc build errors and other Linux stuff.
« Reply #4 on: November 04, 2014, 10:44:11 AM »
Did you "make install" as a superuser?  Might need to "ldconfig" as well as superuser.

Which linux are you using?

Toyguy

  • Full Member
  • ***
  • Posts: 32
    • View Profile
Re: libpinproc build errors and other Linux stuff.
« Reply #5 on: November 04, 2014, 12:20:56 PM »
Thanks spoot - I think you called that one.  Looks like I forgot to sudo the make install for libpinproc.  After doing so, I can now run procgame and get the usage menu.  I can also run 'python creature.py' and the on-screen DMD comes up for that one.  When I try and do "python starter.py" to run the simple starter example, however, I get an error that indicates 'No module named pygame'

Is this something that needs to be installed independently?

On a side note, I also installed Pyglet - perhaps I should not have?  If so, can I remove it somehow?

Thanks!  We're getting close! 

Toyguy

  • Full Member
  • ***
  • Posts: 32
    • View Profile
Re: libpinproc build errors and other Linux stuff.
« Reply #6 on: November 04, 2014, 12:21:42 PM »
Oh, I should have answered the Linux question too - I am using Ubuntu 14.04 LTS.

Rosh

  • P3 Developers
  • *
  • Posts: 667
  • Josh Kugler
    • View Profile
Re: libpinproc build errors and other Linux stuff.
« Reply #7 on: November 04, 2014, 03:21:44 PM »
if pyglet is installed, then the framework will use that rather than pygame for the display (and keystrokes), but it will still use pygame for audio.   You could remove it if you wanted to, or you can modify the appropriate place in the framework to ignore it, but typically if you doing a straight DMD and doing development on a desktop then pyglet is probably preferred.  If you decide to move to the VGA version of the framework, it only uses pygame.

if you did not install pygame you probably need to, doubt that is auto installed by ubuntu. 

sudo apt-get install python-pygame

Gerry Stellenberg

  • Administrator
  • *****
  • Posts: 2397
    • View Profile
    • PinballControllers.com
Re: libpinproc build errors and other Linux stuff.
« Reply #8 on: November 04, 2014, 03:23:15 PM »
Those not comfortable installing everything manually (and even those who are) might consider just using Gabe's automated installer script for linux, adapted from Compy's original installer script.  It pretty much does everything you need (including installing pygame).  If memory serves, it even asks if you want to install master or dev branches (if not, you could simply edit the download lines in the script):

https://missionpinball.com/blog/2014/04/linux-installer-script-for-libpinproc-and-pypinproc/debian-toolkit/

- Gerry

Toyguy

  • Full Member
  • ***
  • Posts: 32
    • View Profile
Re: libpinproc build errors and other Linux stuff.
« Reply #9 on: November 04, 2014, 10:16:44 PM »
OK, so installing pygame manually took care of that issue.  Now when I try running JD.py, which works fine on my desktop Win7 machine, I now get this:

Traceback (most recent call last):
  File "jd.py", line 977, in <module>
    if __name__ == '__main__': main()
  File "jd.py", line 972, in main
    game = Game()
  File "jd.py", line 670, in __init__
    self.setup()
  File "jd.py", line 723, in setup
    self.service_mode = procgame.service.ServiceMode(self,100,font_tiny7,[self.deadworld_test])
  File "build/bdist.linux-x86_64/egg/procgame/service.py", line 93, in __init__
  File "build/bdist.linux-x86_64/egg/procgame/service.py", line 288, in __init__
  File "build/bdist.linux-x86_64/egg/procgame/service.py", line 308, in __init__
TypeError: range() integer end argument expected, got float.

Any thoughts on this one?  Can't see why I would suddenly be getting type errors with the same code.  That said, my Win7 machine is Python 2.6.6 and the Linux box is 2.7.6.  Any issues with 2.7.x?

Thanks much!

Toyguy

  • Full Member
  • ***
  • Posts: 32
    • View Profile
Re: libpinproc build errors and other Linux stuff.
« Reply #10 on: November 05, 2014, 11:22:20 PM »
It does indeed seem to be a change in the behavior of Python 2.7 as regards the range() function.  It cannot take a non-integer argument.  I don't particularly need to fix it, I was interested in making sure my installation was not broken in some obscure way.  Time to build an electronics board now and get some stuff wired up.

tomlogic

  • Wizard
  • *****
  • Posts: 113
    • View Profile
    • PinMAME for P-ROC/Linux
Re: libpinproc build errors and other Linux stuff.
« Reply #11 on: November 08, 2014, 02:08:19 PM »
/home/dave/P-ROC/libpinproc/utils/pinprocfw/pinprocfw.cpp: In function 'int checkPROCFile()':
/home/dave/P-ROC/libpinproc/utils/pinprocfw/pinprocfw.cpp:2191:66: warning: too many arguments for format [-Wformat-extra-args]
          fprintf(stderr, "\nERROR: board type mismatch.", board_id);

These errors should be simple to fix and get pushed back into the code repository.

It's just a warning that you're calling a printf-style function and the argument count doesn't match the number of format specifiers (like %s, %d, %f) in the format string.  In this case, it's passing in board_id but not displaying it.  To quiet that warning, you could just add a "%x" somewhere to the format string.  Like so:

Code: [Select]
fprintf(stderr, "\nBoard (%x) and image (%x) are incompatible\n\n", file_board_id, board_id);
For portability, you should technically use the macro PRIx32 from inttypes.h (which you probably need to #include at the top of the file).

Code: [Select]
fprintf(stderr, "\nBoard (%" PRIx32 ") and image (%" PRIx32 ") are incompatible\n\n", file_board_id, board_id);
-Tom