Go to Post They knew that the number of gracious, professional, make-your-grandmother-so-proud-she-will-puke moments of exemplary behavior by the teams would far outshine any minor mistakes or incidents of less-than-perfect decorum. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-01-2015, 22:28
Spectare Spectare is offline
Team Hacker
AKA: Benjamin Pylko
FRC #3181 (Pittsford Panthers)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Rochester, New York
Posts: 16
Spectare is an unknown quantity at this point
Code without Eclipse!

Do you, like me, have an irrational aversion to IDEs? Do you just want to stick to your gedit, vi, or nano? Well, never fear, I have come to the rescue! After a few hours of digging through the Eclipse plugins and the FRC toolchain, I have created something to replace Eclipse: a makefile. Simply head over to https://github.com/brpylko/FRCMakeProject, download the repository as a zip archive, and you're ready to start coding. I've tried this on Ubuntu, but it should work on all Linux distros. I have no idea if it will work on Mac OS, but I'm sure it won't work on Windows. If you have any problems/suggestions, open an issue on GitHub.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-01-2015, 13:41
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Code without Eclipse!

Quote:
Originally Posted by Spectare View Post
Do you, like me, have an irrational aversion to IDEs? Do you just want to stick to your gedit, vi, or nano? Well, never fear, I have come to the rescue! After a few hours of digging through the Eclipse plugins and the FRC toolchain, I have created something to replace Eclipse: a makefile. Simply head over to https://github.com/brpylko/FRCMakeProject, download the repository as a zip archive, and you're ready to start coding. I've tried this on Ubuntu, but it should work on all Linux distros. I have no idea if it will work on Mac OS, but I'm sure it won't work on Windows. If you have any problems/suggestions, open an issue on GitHub.
Nice job, looks good. FYI we explicitly set up gcc to be as standard as possible so in theory every standard compliant enviroment should be able to compile with
arm-frc-linux-gnueabi-g++ -I${HOME}/wpilib/cpp/current/include file.cpp -o file.o
and link with
arm-frc-linux-gnueabi-g++ -L${HOME}/wpilib/cpp/current/lib -lwpi files.o -o FRCUserProgram

There is even a CMake toolchain file distributed with the ubuntu toolchains in the package frcmake (nothing prevents it from being distributed with windows and mac but that would require re-building the toolchains, while ubuntu it was a single package addition): https://bitbucket.org/byteit101/tool...ake?at=default Note it doesn't have a deploy target but I'll gladly accept pull requests.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #3   Spotlight this post!  
Unread 05-01-2015, 19:15
Spectare Spectare is offline
Team Hacker
AKA: Benjamin Pylko
FRC #3181 (Pittsford Panthers)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Rochester, New York
Posts: 16
Spectare is an unknown quantity at this point
Re: Code without Eclipse!

I don't really have any experience with CMake, that's why I wrote a makefile. If I have time I'll learn and submit a pull request with deploy capabilities.

So does the FRC toolchain just use the armel gcc with links to NI libraries? I haven't delved deep into gcc before but that's what it looked like when I was browsing your repository.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-01-2015, 20:06
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Code without Eclipse!

Quote:
Originally Posted by Spectare View Post
I don't really have any experience with CMake, that's why I wrote a makefile. If I have time I'll learn and submit a pull request with deploy capabilities.
You should, CMake is awesome. WPILib is compiled with it as it is actually a build system generator. Tell it your sources and what you want to happen, and then anyone can compile it using standard makefiles, mingw/msys makefiles, nmake, eclipse, netbeans, qt creator, or another build system.

Quote:
Originally Posted by Spectare View Post
So does the FRC toolchain just use the armel gcc with links to NI libraries? I haven't delved deep into gcc before but that's what it looked like when I was browsing your repository.
Its a near-stock GCC build for the armel target on linux. The only thing NI-specific is the build of the linux-headers and eglibc library, but are otherwise mostly stock. Before I got everything worked out, I was able to successfully run with pure stock linux-headers and eglibc sources, but that caused some warnings when debugging. GDB and binutils are pure stock, no patches applied. The only patch on GCC is to change the output name of libstdc++ so we can use the latest C++14 features while the system still uses the old version it was tested against: https://bitbucket.org/byteit101/tool...ame?at=default This makes upgrades very easy so we won't be stuck with ancient versions of GCC like Windriver with GCC 3.4.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #5   Spotlight this post!  
Unread 05-01-2015, 21:07
Spectare Spectare is offline
Team Hacker
AKA: Benjamin Pylko
FRC #3181 (Pittsford Panthers)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Rochester, New York
Posts: 16
Spectare is an unknown quantity at this point
Re: Code without Eclipse!

Quote:
Originally Posted by byteit101 View Post
You should, CMake is awesome. WPILib is compiled with it as it is actually a build system generator. Tell it your sources and what you want to happen, and then anyone can compile it using standard makefiles, mingw/msys makefiles, nmake, eclipse, netbeans, qt creator, or another build system.
I'm sure I can write off learning CMake as an important programming activity somehow...

Quote:
Originally Posted by byteit101 View Post
The only patch on GCC is to change the output name of libstdc++ so we can use the latest C++14 features while the system still uses the old version it was tested against
So the roboRIO supports C++14? I'll have to update my makefile accordingly if so.
Reply With Quote
  #6   Spotlight this post!  
Unread 06-01-2015, 12:37
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Code without Eclipse!

Quote:
Originally Posted by Spectare View Post
So the roboRIO supports C++14? I'll have to update my makefile accordingly if so.
The toolchain supports C++14. GCC 4.9.1 supports most of C++14. flag -std=c++1y. Its in the default eclipse config, though there aren't any C++14-specific features in WPILib.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #7   Spotlight this post!  
Unread 06-01-2015, 15:16
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: Code without Eclipse!

That's awesome! So for a novice person to the in-depths of the roboRIO, how would you "deploy" it? Just ssh into it and replace the image with the one generated?
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
Reply With Quote
  #8   Spotlight this post!  
Unread 06-01-2015, 17:39
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 147
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
Re: Code without Eclipse!

Quote:
Originally Posted by Sparkyshires View Post
That's awesome! So for a novice person to the in-depths of the roboRIO, how would you "deploy" it? Just ssh into it and replace the image with the one generated?
By deploy it, do you mean the robot program? Take a look at the ~/wpilib/cpp/current/ant directory. The build.xml there is the ant script we use to deploy the program. Basically, we run a command on the robot to stop the currently running program. We then replace the /home/lvuser/FRCUserProgram and the /home/lvuser/robotCommand files. The FRCUserProgram is the generated code, and robotCommand is the script in the ~/wpilib/cpp/current/ant folder. We then run a command to exec that script. That script is what takes care of setting up stdout to go to a log file and output over netconsole so you can see it in RioLog. The relevant ant task you're looking for is deploy, along with some properties in the build.properties file.
You might also be able to just use ant to call that script, as I'm not sure how make does with ssh and scp.
Reply With Quote
  #9   Spotlight this post!  
Unread 06-01-2015, 18:46
Spectare Spectare is offline
Team Hacker
AKA: Benjamin Pylko
FRC #3181 (Pittsford Panthers)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Rochester, New York
Posts: 16
Spectare is an unknown quantity at this point
Re: Code without Eclipse!

Quote:
Originally Posted by byteit101 View Post
The toolchain supports C++14.
Yeah, that's what I meant .

I also just remembered: what does the "-t" option for the robot kill script actually do? I know it says something like start the program as a text program, but I don't know what that means.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:05.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi