Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Rebuilding the WPILib? (http://www.chiefdelphi.com/forums/showthread.php?t=89131)

basicxman 14-01-2011 15:48

Rebuilding the WPILib?
 
So I'd like to keep my own development copy of the C++ WPILib, but I'm having some trouble getting it to build as a project in WindRiver. I gather the following needs to be done

1) Download source (done)
2) Import into WindRiver (done)
3) Build...?
4) Run the update script in %root%/Scripts

When I attempt to build the project, nothing happens.
When I attempt to open a workbench shell and use `make` to build the project, no errors occur but nothing happens.

At this point I'm tempted to just make my own Rakefile (ruby version of make) that uses the ccppc compiler and linked, but I'm wondering what the 'correct' way of building the WPI library is.

mikets 14-01-2011 19:47

Re: Rebuilding the WPILib?
 
Why do you need to rebuild WPILib unless you want to modify it? I keep my own copy of the WPILib sources too but for reference only. I did find some scenarios that I need to change the lib but I managed to do it without changing their sources. I either create a new object that inherits the WPILib object and overrides what I need to modify or I just make a copy of the source file and make it part of my project.

basicxman 14-01-2011 19:52

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by mikets (Post 1000237)
Why do you need to rebuild WPILib unless you want to modify it?

Sharing patches with the community is a bonus in my opinion. And why not? This should be something more than possible.

DjMaddius 15-01-2011 07:29

Re: Rebuilding the WPILib?
 
If i may ask, where can i find the sources to the WPIlib?

mikets 15-01-2011 08:44

Re: Rebuilding the WPILib?
 
c:\WindRiver\WPILib\WPILibC++Source20110106rev2242 .zip

gvarndell 15-01-2011 09:00

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by mikets (Post 1000570)
c:\WindRiver\WPILib\WPILibC++Source20110106rev2242 .zip

Isn't that only helpful if one has already downloaded the sources?
I think the question may have been about where to find the sources if you haven't downloaded them.

mikets 15-01-2011 11:41

Re: Rebuilding the WPILib?
 
Hmm, I just found it in that directory. So I am assuming it either came with the WindRiver software installation or the WorkBenchUpdate that I applied.

basicxman 15-01-2011 12:27

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by mikets (Post 1000649)
Hmm, I just found it in that directory. So I am assuming it either came with the WindRiver software installation or the WorkBenchUpdate that I applied.

It came with the workbench update for me. You can also find it on the WPILib project on FIRST Forge in the Subversion repo.

Back to the original task at hand - maybe Joe Hershberger could shed some light?

jhersh 17-01-2011 01:54

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by basicxman (Post 1000676)
Back to the original task at hand - maybe Joe Hershberger could shed some light?

Extract the WPILib source to C:\WindRiver\workspace\WPILib. In Workbench, go to File>>Import. Select General>>Existing Projects Into Workspace and click Next. Next to the Select root directory: field, click Browse. Select the C:\WindRiver\workspace\ path. Check the WPILib project in the list box and click finish. The project should now be in Workbench with any other projects you have.

Build like any other... right click on the project and select Build Project.

-Joe

jhersh 17-01-2011 01:58

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by gvarndell (Post 1000575)
Isn't that only helpful if one has already downloaded the sources?
I think the question may have been about where to find the sources if you haven't downloaded them.

New this year, the corresponding WPILib source code and reference documentation is installed with each update. You no longer have to hunt for it online only to find that we forgot to post it. You also won't find out-of-date reference doxygen help installed with the update. Each reference help file now includes the update revision number in the title page so you know which release it is documenting.

-Joe

basicxman 17-01-2011 11:31

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by jhersh (Post 1001695)
Extract the WPILib source to C:\WindRiver\workspace\WPILib. In Workbench, go to File>>Import. Select General>>Existing Projects Into Workspace and click Next. Next to the Select root directory: field, click Browse. Select the C:\WindRiver\workspace\ path. Check the WPILib project in the list box and click finish. The project should now be in Workbench with any other projects you have.

Build like any other... right click on the project and select Build Project.

-Joe

Thank you, interesting how it didn't work even when I changed the paths in the Makefile.

jwakeman 20-01-2011 12:02

Re: Rebuilding the WPILib?
 
Joe,

I followed your process for importing the project and it seemed to go smoothly however when I build the project no WPILib.a is produced. I can see WPILib.a as a build target for PPC603gnu and the build console is indicating that it is building the target but the WPILib.a doesn't appear under C:\windriver\workspace\WPILib\PPC603gnu. There is a Makefile in this directory. Please help if you can. Here is the build console output:

Build Started in Project 'WPILib': 2011-01-20 11:40:41
Generation of makefiles started.
Generation of makefiles finished (Elapsed Time: 00:02).
Platform: Wind River VxWorks 6.3
Command: make --no-print-directory BUILD_SPEC=PPC603gnu DEBUG_MODE=1 TRACE=1 clean all
Working Directory: C:/windriver/workspace/WPILib/PPC603gnu
make: removing targets and objects of C:/windriver/workspace/WPILib/PPC603gnu
make: built targets of C:/windriver/workspace/WPILib/PPC603gnu
Build Finished in Project 'WPILib': 2011-01-20 11:40:43 (Elapsed Time: 00:02)

Looking at this output myself now I guess it looks like it is only running a clean?? Do i need to add a build target to make it "make all" somehow?

Thanks!

jhersh 20-01-2011 13:04

Re: Rebuilding the WPILib?
 
Try deleting the build output dir and building again.

jwakeman 20-01-2011 14:07

Re: Rebuilding the WPILib?
 
1 Attachment(s)
Thanks for your reply. I deleted this directory C:\windriver\workspace\WPILib\PPC603gnu, right-clicked the project in the workbench and selected Build Project. The output dir was created again with the Makefile in it but no binary. I attached the Makefile if that helps...

jwakeman 20-01-2011 17:16

Re: Rebuilding the WPILib?
 
Solved. After a long day of troubleshooting I closed the workbench and re-opened it and whalah! it built. hahahahhahahahaha....not funny.

Anyway I did go through the process of importing the project trying to build, not building, closing the workbench and re-opening to fix it one more time to confirm that this does happen every time. Not sure if it just my machine but it probably would happen to others.

One more question. When building I see an error for each file that is compiled, "process_begin: CreateProcess((null), svnversion -n .., ...) failed." Its only a nuisance, the lib still gets built, but if there is an easy way to change a setting or something it would be nice.

basicxman 20-01-2011 17:26

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by jwakeman (Post 1004462)
One more question. When building I see an error for each file that is compiled, "process_begin: CreateProcess((null), svnversion -n .., ...) failed." Its only a nuisance, the lib still gets built, but if there is an easy way to change a setting or something it would be nice.

Install a Subversion client such as SlikSVN.

jhersh 20-01-2011 18:49

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by jwakeman (Post 1004462)
One more question. When building I see an error for each file that is compiled, "process_begin: CreateProcess((null), svnversion -n .., ...) failed." Its only a nuisance, the lib still gets built, but if there is an easy way to change a setting or something it would be nice.

You can either live with it or you can edit the compiler settings for the project to remove the call. That is how we automatically read the current SVN revision and build it into the library. If you are not using the SVN repo (instead using the packaged source) then this is your only option. If you are using the SVN server at FIRST Forge, then you just need to install SlikSVN.

-Joe

jwakeman 21-01-2011 00:23

Re: Rebuilding the WPILib?
 
I am using the packaged source because of this statement on the WPILib FAQ's on FirstForge:

Quote:

The source code on the SVN server does not include the source for the same revision that was released in an update. What's wrong?

This is just because we're not as fast at merging the source code to the public SVN repository. Check back soon and it should be up to date
I can't find where to turn off the SVN sync. I am looking in "Project->Properties->Build Properties" mostly (as well as the other items in Project->Properties) but I cannot find anything that says "repository" or svn or anything like that. Can you point me to the option? Thanks again for you help.

jhersh 21-01-2011 01:45

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by jwakeman (Post 1004763)
I am using the packaged source because of this statement on the WPILib FAQ's on FirstForge:



I can't find where to turn off the SVN sync. I am looking in "Project->Properties->Build Properties" mostly (as well as the other items in Project->Properties) but I cannot find anything that says "repository" or svn or anything like that. Can you point me to the option? Thanks again for you help.

In Project Properties->Build Properties->Build Tools tab->Build Tool: C++-Compiler->Build spec specific settings->Command: you need to remove the following text:

Code:

-D'SVN_REV="$(shell svnversion -n ..)"'
-Joe

jhersh 21-01-2011 01:48

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by jwakeman (Post 1004763)
I am using the packaged source because of this statement on the WPILib FAQ's on FirstForge:
Quote:

The source code on the SVN server does not include the source for the same revision that was released in an update. What's wrong?

This is just because we're not as fast at merging the source code to the public SVN repository. Check back soon and it should be up to date

That is not a statement of fact. It is a FAQ. Sorry if that's misleading. It's saying that if you discover that the SVN source is not up to date at some point, you have other options. It is up to date right now.

-Joe

jwakeman 21-01-2011 09:32

Re: Rebuilding the WPILib?
 
Instead of removing the text you mentioned completely I changed it to:

Code:

-D'SVN_REV="UNCONTROLLED"'
This is to avoid a compilation error because SVN_REV needs to be defined. Regarding the svn repository, this repository only gets updated each time a release is made. It is not a development repository, correct?

jhersh 21-01-2011 14:30

Re: Rebuilding the WPILib?
 
Quote:

Originally Posted by jwakeman (Post 1004899)
Instead of removing the text you mentioned completely I changed it to:

Code:

-D'SVN_REV="UNCONTROLLED"'

Sounds good.

Quote:

Originally Posted by jwakeman (Post 1004899)
This is to avoid a compilation error because SVN_REV needs to be defined. Regarding the svn repository, this repository only gets updated each time a release is made. It is not a development repository, correct?

Correct. This is the public repository that is synced to the development repository when a release is made. This allows teams to see the history of the library, create patches against specific revisions, blame a developer for a bug, and look at revision comments for specific changes.

-Joe


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

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