Go to Post No FIRST event is complete without Darude's Sandstorm. - sonichammer7476 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 16-05-2013, 13:38
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
GCC 4.8 Toolchain

Hi all,

Since it appears that CD has cleaned out old topics, I'm opening a new thread so that people with issues with the GCC 4.8 toolchain can get support.

Please post any future questions regarding this project in this thread.

Features:

- GCC 4.8, with all it's awesomeness including caret diagnostics, improved error messages, better optimizations, etc.

- C++11 support. While this is a 4.8 feature, it deserves its own bullet point. Note that this is not yet enabled by default on all platforms due to some issues with updating WPILib.

- Native builds for linux, with alpha native builds for OSX and Windows (including a .msi made using WIX, so you know it's legit)

- All-around awesomeness

If you want to help out with development, please do! Read the wiki, look at the code, and post here!

A few links:

FirstForge page for the project, including wiki with a decent amount of information to get up to speed on the project:

http://firstforge.wpi.edu/sf/projects/c--11_toochain

Wiki page on that project page that details how to get and install. Note that, being territorial, I'm going to recommend my repos over Patricks . In all seriousness though, mine are stable for cRIO development, but Patrick's repos offer various features in different stages of development, which I'll pull in once I'm convinced they're stable.

http://firstforge.wpi.edu/sf/wiki/do.../BinaryInstall

Wiki page on how to build and install with FRCMake (the IMHO easiest and best way to build these projects):

http://firstforge.wpi.edu/sf/wiki/do...iki/UsingCMake

Link to the Windows Installer:

http://firstforge.wpi.edu/sf/frs/do/...tallers.alpha0

Note that once you install the windows installer, you have FRCMake et al installed automatically.

Link to the old topic to find old discussion - it's long but well worth reading if you want to learn more (second only to the wiki):

http://www.chiefdelphi.com/forums/sh...d.php?t=109385

WPILib repository (open development, unlike closed-off upstream):

https://github.com/rbmj/wpilib

All of the code/buildscripts can be found either on the team's bitbucket:

https://bitbucket.org/frc-cpp11

or some is still on my github page:

https://github.com/rbmj/

As always, help is appreciated. Enjoy!
__________________
FRC 612 '12
USNA '16

Last edited by rbmj : 16-05-2013 at 13:44.
  #2   Spotlight this post!  
Unread 17-05-2013, 12:24
Kimmeh's Avatar
Kimmeh Kimmeh is offline
Student at Kettering University
AKA: Kimberly
FRC #0068 (Truck Town Thunder)
Team Role: Mentor
 
Join Date: Sep 2008
Rookie Year: 2009
Location: Michigan
Posts: 334
Kimmeh has a reputation beyond reputeKimmeh has a reputation beyond reputeKimmeh has a reputation beyond reputeKimmeh has a reputation beyond reputeKimmeh has a reputation beyond reputeKimmeh has a reputation beyond reputeKimmeh has a reputation beyond reputeKimmeh has a reputation beyond reputeKimmeh has a reputation beyond reputeKimmeh has a reputation beyond reputeKimmeh has a reputation beyond repute
Send a message via Yahoo to Kimmeh
Re: GCC 4.8 Toolchain

Quote:
Originally Posted by rbmj View Post
Since it appears that CD has cleaned out old topics
I have nothing to comment on the rest of the post, but on the main page of the subforum, there's a box titled "Display Options" Perhaps the thread you're looking for hasn't been posted in for over a month?
__________________
[2014 - Present] 68 Truck Town Thunder| Mentor |2014 - Great Lakes Bay Winner, Curie Quarterfinalists, District Chairman's Award, MCS Chairman's Award, Industrial Design Award, Entrepreneurship Award
[2014 - Present] 5046 Jacked Up Jackets| Mentor |
[2010 - 2013] 3421 Tachyon TECs| Mentor |2010 - Rookie Inspiration Award; 2013 - Coopertition Award , Kettering Quarterfinalists - 2nd Seed, Livonia Quarterfinalists - 2nd Seed Captain
[2009 - 2010] 2604 Metal and Soul| Student | 2010 - Gracious Professionalism Award, UL Industrial Safety Award
  #3   Spotlight this post!  
Unread 18-05-2013, 02:49
Anupam Goli's Avatar
Anupam Goli Anupam Goli is offline
PCH Q&A co-founder/Scouting Mentor
AKA: noops
FRC #1648 (G3 Robotics)
Team Role: Mentor
 
Join Date: Dec 2010
Rookie Year: 2008
Location: Atlanta, Georgia
Posts: 1,242
Anupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond repute
Re: GCC 4.8 Toolchain

Quote:
Originally Posted by Kimmeh View Post
I have nothing to comment on the rest of the post, but on the main page of the subforum, there's a box titled "Display Options" Perhaps the thread you're looking for hasn't been posted in for over a month?
The old thread was a bit cluttered anyway, the new main post has all of the links in one place, i say keep this thread.
__________________
Team 1002: 2008-2012
Team 1648: 2012-2016
Georgia Tech Class of 2016
  #4   Spotlight this post!  
Unread 19-05-2013, 12:08
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: GCC 4.8 Toolchain

Quote:
Originally Posted by Kimmeh View Post
I have nothing to comment on the rest of the post, but on the main page of the subforum, there's a box titled "Display Options" Perhaps the thread you're looking for hasn't been posted in for over a month?
Ah. I didn't happen to see that box. Though the purpose of that box seems rather dubious given that the forum is paginated... appears redundant to me. Maybe I'm just bitter because it made me look stupid.

Links in one place is also rather good. After a thread gets to ten pages long it starts to get hard to sift through everything...

I apologize to the community for the double post.
__________________
FRC 612 '12
USNA '16
  #5   Spotlight this post!  
Unread 14-09-2013, 18:46
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
Re: GCC 4.8 Toolchain

This is a bit of an old thread, but I figured I'd try asking here first. Does the Windows installer support C++11? I tried to compile an old project with
Code:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
in my CMakeLists.txt, but compiling caused screens and screens of errors, from my code, but also from WPILib (Mostly "error: 'constexpr' needed for in-class initialization of static data member") and from "mingw\powerpc-wrs-vxworks\include\c++\4.8.0\bits\" (Mostly "error: unable to find numeric literal operator 'operator"" xLU'" from random.tcc). Have I made a mistake, or does the windows installer not yet support C++11?
  #6   Spotlight this post!  
Unread 15-09-2013, 11:23
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: GCC 4.8 Toolchain

The current builds do not. When I get around to it I'll rebuild it with C++11 support.

If you build from source with the latest version of everything, you should not have this problem.
__________________
FRC 612 '12
USNA '16
  #7   Spotlight this post!  
Unread 15-09-2013, 11:58
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
Re: GCC 4.8 Toolchain

Cool. Now I just need to figure out how I'm gonna do that crazy build process for Windows.
  #8   Spotlight this post!  
Unread 15-09-2013, 13:01
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: GCC 4.8 Toolchain

It's quite crazy. Hopefully it all makes sense to you. I'm going to work on making those crazy makefiles a bit more readable. If you need any help let me know - or request edits to the documentation that I can pull.

Basically, you set up a cross mingw on linux and get the toolchain working there. Because building GCC through cygwin sucks, you end up building everything on linux and then packing it all up on windows (as I did *not* want to mess with wine). I recommend going onto a machine with a dual boot and mounting the NTFS partition from linux and then running the install there.

If the build process looks strange, that's because it is. There's some bugs in the GCC build that prevent the target libraries (i.e. libgcc and libstdc++ for vxworks) from building through mingw. It's due to some stupid configure issues for a canadian cross where it tries to run the host compiler to build the target libraries even though it's not native to the build platform. What it's supposed to do is build two compilers, but it doesn't seem to do this by default. The solution: Just do the whole build process twice.

I ran into a lot of issues (wix in particular liked to crash), but the build process is fairly stable, if long and involved. Again, if you need any help, I'm here.
__________________
FRC 612 '12
USNA '16
  #9   Spotlight this post!  
Unread 15-09-2013, 14:20
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
Re: GCC 4.8 Toolchain

In the FIRSTForge wiki's requirements for building for windows, one of the linux requirements is "Working linux toolchain", does that mean just a working GCC install, or a working install of the powerpc-wrs-vxworks toolchain?
  #10   Spotlight this post!  
Unread 15-09-2013, 18:20
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: GCC 4.8 Toolchain

Quote:
Originally Posted by MaraschinoPanda View Post
In the FIRSTForge wiki's requirements for building for windows, one of the linux requirements is "Working linux toolchain", does that mean just a working GCC install, or a working install of the powerpc-wrs-vxworks toolchain?
Yes.

You need to have gcc-powerpc-wrs-vxworks installed because part of the build process is building wpilib on linux. This is built with frcmake et al, so you need to have all of that installed. I didn't want to have the build process install things halfway through/have to run as root, so I just made it a predependency.

Since the linux binaries work and are relatively stable, I don't see this as a big problem. Additionally, building from source under linux is now (relatively) easy - no more patching and crap, and the everything is documented.
__________________
FRC 612 '12
USNA '16
  #11   Spotlight this post!  
Unread 17-09-2013, 13:18
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: GCC 4.8 Toolchain

I updated the wiki to make it slightly more clear.

Building on windows is still a mess. Maybe when I get a bit more motivation and rebuild everything I'll make those make files a bit less ugly.

My build virtual machines were on an external hard drive that broke a couple of months ago, so that might take a while - I have a lot less free time than I would like.

The next release should have a few incremental improvements, but no major changes. Biggest improvements will include a removal of some ugly symlink cruft on linux (WARNING- may break existing installations, but will make distributing libraries much nicer), an upgrade to gcc-4.8.1 including a small vxworks-specific patch for thread specific data finalizers (I doubt anybody used this), and hopefully a more stable windows build. Patrick got debugging functioning but I don't know how he did it, can't test it (no cRIO), and therefore won't release it until he says it's ready to go. Those who can actually work through these things, feel free to look at the repos and test things out.

At the end of this, I'm hoping that a community can develop where teams can have their own libraries and share them with the first community such that I can incorporate some other team's library by doing a 'sudo aptitude install frcfoobar' and then adding 'find_package(frcfoobar)' to my CMakeLists.txt and be done.

I personally find using CMake to be much nicer than the existing IDE-based toolchains (a CMakeLists.txt that will work for 99% of teams is <10 lines long, but gives you a much nicer build experience IMHO), but if anybody is scared by a 10 line text file, I can work on better IDE integration (otherwise it doesn't seem worth the effort to me - you can still use eclipse to edit the files if you want). I do ask how you're a c++ programmer if you can't deal with a short and simple text file though to each his own.
__________________
FRC 612 '12
USNA '16
  #12   Spotlight this post!  
Unread 17-09-2013, 17:56
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
Re: GCC 4.8 Toolchain

Alright, so I have made several attempts to build, and have come to an error I really don't understand:
Code:
In file included from /home/will/frc-cpp11/windows-toolchain-environment/win32/gcc-4.8.0/libgcc/libgcc2.c:27:0:
/home/will/frc-cpp11/windows-toolchain-environment/win32/gcc-4.8.0/libgcc/../gcc/tsystem.h:87:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                   ^
I definitely have the standard library, I can find stdio.h with the locate command (actually I can find several), but this still keeps happening. Any insights?

By the way, you might want to recommend against building in a VM shared folder, as it makes symlinks not work correctly and broke my build.
  #13   Spotlight this post!  
Unread 17-09-2013, 23:44
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: GCC 4.8 Toolchain

Quote:
Originally Posted by MaraschinoPanda View Post
Alright, so I have made several attempts to build, and have come to an error I really don't understand:
Code:
In file included from /home/will/frc-cpp11/windows-toolchain-environment/win32/gcc-4.8.0/libgcc/libgcc2.c:27:0:
/home/will/frc-cpp11/windows-toolchain-environment/win32/gcc-4.8.0/libgcc/../gcc/tsystem.h:87:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                   ^
I definitely have the standard library, I can find stdio.h with the locate command (actually I can find several), but this still keeps happening. Any insights?
You should have stdio.h in /usr/powerpc-wrs-vxworks/sys-include. If that is true then something else is going on, in which case I'll look into it. I can't make promises on when that will happen though - I'm a double major at USNA, so free time isn't exactly plentiful.

Quote:
By the way, you might want to recommend against building in a VM shared folder, as it makes symlinks not work correctly and broke my build.
I was not aware of this; thanks for pointing that out.

If you're trying to build w/o windows, it *is* theoretically possible. However I haven't tried 1) because I have windows and it isn't too big of a pain and 2) I've heard rumors that wix sometimes builds bad msi-s when run through wine.
__________________
FRC 612 '12
USNA '16

Last edited by rbmj : 17-09-2013 at 23:48.
  #14   Spotlight this post!  
Unread 21-09-2013, 02:03
William Kunkel William Kunkel is offline
Programming Lead
AKA: Kunkel
FRC #0422 (Mech Tech Dragons)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Richmond, VA
Posts: 94
William Kunkel is an unknown quantity at this point
Re: GCC 4.8 Toolchain

Sorry for the lack of response, I've been a bit busy. I tried a few other things (building as root, creating a new vm in virtualbox instead of vmware because vmware was being buggy), but this problem still recurs. The file is definitely where it ought to be, but the build can't seem to find it. Additionally, the windows-toolchain-environment repo seems to have some permissions issues, for example prepare.sh does not have execute permissions, so I've tried building after running
Code:
chmod -R a+rwx .
in the directory as well. It fixed the permissions issues, but the issue with stdio.h remains.
  #15   Spotlight this post!  
Unread 23-09-2013, 11:25
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: GCC 4.8 Toolchain

Quote:
Originally Posted by MaraschinoPanda View Post
Sorry for the lack of response, I've been a bit busy. I tried a few other things (building as root, creating a new vm in virtualbox instead of vmware because vmware was being buggy), but this problem still recurs. The file is definitely where it ought to be, but the build can't seem to find it. Additionally, the windows-toolchain-environment repo seems to have some permissions issues, for example prepare.sh does not have execute permissions, so I've tried building after running
Code:
chmod -R a+rwx .
in the directory as well. It fixed the permissions issues, but the issue with stdio.h remains.
I've never run into this problem because I've always cloned onto an NTFS partition - thanks for the bug report.

I've always found it easier to make linux deal with windows than windows deal with linux. Windows doesn't play nice...
__________________
FRC 612 '12
USNA '16
Closed Thread


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 03:25.

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