SandyCrak
Posts: 3
Joined: Thu Sep 27, 2018 5:55 pm

Help with compiling code from Github

Thu Sep 27, 2018 7:17 pm

I really need some help and advice as my programming knowledge is minimal, can I build software from Github (source code) on the pi then run it on the pi?
...I'll give you some background to this. I've been trying to make a laser tag host for the Nerf/Hasbro/Tiger laser taggers which use the ltto protocol. I found instructions to build the infra-red transmitter/receiver and used the Lazer Swarm software (http://www.lazerswarm.com/) to succeffully run the host on a windows PC (hooray!)
Every since getting my first Pi, I have been trying to find a way to get the software to run on the Pi3. My understanding is that if I have the source code (I can locate this on Github) then it can be built/compiled (sorry, I don't know the correct term) on the Pi, then run on the Pi.

Is my understanding correct, or am I barking up the wrong tree? Any advice feedback is welcome, just be gentle with me and assume I know practically nothing about building software.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20908
Joined: Sat Jul 30, 2011 7:41 pm

Re: Help with compiling code from Github

Thu Sep 27, 2018 8:10 pm

If the code was written specifically for a Windows machine, then probably no. If it was written for a Linux machine, probably yes. If it was written to cope with both systems, then probably yes.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
DougieLawson
Posts: 34166
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Help with compiling code from Github

Thu Sep 27, 2018 8:17 pm

Give us a URL for the stuff on github and we'll have a better chance of helping you.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

B.Goode
Posts: 6544
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Help with compiling code from Github

Thu Sep 27, 2018 8:32 pm

From the Lazer Swarm website:
System Requirements:

A computer running Windows 7, 8.1, or 10

Your Raspberry Pi does not meet that requirement.

Perhaps you should be seeking support from the developer/maintainer of the software to produce a more portable cross-platform implementation.

(Or perhaps it is portable already but they don't want to advertise the fact because they can't cope with the inevitable requests for support.)

SandyCrak
Posts: 3
Joined: Thu Sep 27, 2018 5:55 pm

Re: Help with compiling code from Github

Thu Sep 27, 2018 10:08 pm

DougieLawson wrote:
Thu Sep 27, 2018 8:17 pm
Give us a URL for the stuff on github and we'll have a better chance of helping you.
This is the Github site with the source code: https://github.com/astrospark/LazerTagHost

User avatar
DougieLawson
Posts: 34166
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Help with compiling code from Github

Thu Sep 27, 2018 10:18 pm

You might get that running under Mono (if you're lucky) or you're going to have to re-write the C# code as C or C++.

There's an article in an old MagPi magazine about getting Mono running.
https://www.raspberrypi.org/magpi/issues/30/
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

SandyCrak
Posts: 3
Joined: Thu Sep 27, 2018 5:55 pm

Re: Help with compiling code from Github

Fri Sep 28, 2018 3:37 pm

DougieLawson wrote:
Thu Sep 27, 2018 10:18 pm
You might get that running under Mono (if you're lucky) or you're going to have to re-write the C# code as C or C++.

There's an article in an old MagPi magazine about getting Mono running.
https://www.raspberrypi.org/magpi/issues/30/
Thanks Dougie, I did try Mono and the the program ran, started to draw the screen, then failed with a bunch of error messages, which I have interpreted as 'not compatible'.
For your comment about re-writing the C# code: With my very basic programming knowledge, where would I start with this? There doesn't appear to be tons of source code, so I imagine that this would be quite feasible assuming I knew what I was doing. I just don't know where to start...

User avatar
DougieLawson
Posts: 34166
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Help with compiling code from Github

Fri Sep 28, 2018 4:55 pm

Go and ask the author.

There's loads of C# code in his/her repo. You just need to understand what it's doing and what messages it exchanges with the Arduino.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Return to “General programming discussion”