Verify and/or Fix setting cflags/cppflags/ldflags during CmakeBRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: SeanTags: cmake, flags, compilation

BRL-CAD uses the CMake build system generator.  CMake generates build systems such as Makefile, MSVC, and XCode projects.  Our build system provides a lot of variables for setting compilation and linker flags -- one such is BRLCAD_FLAGS_DEBUG which turns on debugging symbols (-g for gcc).

This task is two-part.  The first is verifying whether setting any of the built-in CMAKE variables that set cflags/cppflags/ldflags will play nicely with our variables or whether our settings always override.  See the cmake documentation for details but CMAKE_C_FLAGS is one such flag.  In theory, running the following command should either append or replace our flag settings (ideally get appended to the end):

cmake path/to/srcdir -DCMAKE_C_FLAGS="-DCOWGOESMOO=1" -DBRLCAD_FLAGS_DEBUG=ON

If cmake completes successfully, you should see your added flag in the summary and when you run "make VERBOSE=1" you should see your flag getting used during compilation.

IF IT WORKS, provide a transcript of everything you tried including the entire output so we can confirm you tested everything correctly.

IF IT DOES NOT WORK, make it work by editing our CMake source files (see misc/CMake/*.cmake).

 

Uploaded Work
File name/URLFile sizeDate submitted
brlcad_cmake_result.zip5.4 KBDecember 18 2012 20:07 UTC
brlcad_cmake.patch16.4 KBDecember 19 2012 00:41 UTC
brlcad_cmake_fix.patch1.1 KBDecember 19 2012 05:00 UTC
compilerflags_cmake_fix_v2.patch1.1 KBDecember 19 2012 14:11 UTC
brlcad_cmake_result.log2.8 KBDecember 19 2012 16:28 UTC
Comments
gckingon December 16 2012 04:10 UTCTask Claimed

I would like to work on this task.

Sean on December 16 2012 05:02 UTCTask Assigned

This task has been assigned to gcking. You have 72 hours to complete this task, good luck!

gckingon December 18 2012 20:07 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 18 2012 20:59 UTCpatch format

So it looks like you got it working, but you need to submit your work in patch format.  See http://brlcad.org/wiki/Patches for assistance.


The claim you have on this task is why you cannot claim other tasks yet.  It shouldn't have even given you the option.


 

Sean on December 18 2012 20:59 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on December 18 2012 20:59 UTCDeadline extended

The deadline of the task has been extended with 0 days and 12 hours.

gckingon December 19 2012 00:42 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 19 2012 04:20 UTCclose, but bad patch

It looks like you copied your version of the CompileFlags.cmake file over an existing updated checkout.  That's bad... You clobbered a whole slew of changes.


Basically, you edited an old version of the file.  You have to manually run diff (not svn diff) against the original version of the file you started with or you need to redo your edits on a current svn checkout.


Read the patch before you submit it.  All of the + and - lines indicate changes YOU are making.  If those aren't lines you changed, then the patch is bogus.

Sean on December 19 2012 04:20 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Sean on December 19 2012 04:20 UTCDeadline extended

The deadline of the task has been extended with 0 days and 12 hours.

gckingon December 19 2012 05:01 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 19 2012 05:31 UTCnow it becomes more clear

Now it's more clear what you actually changed... :)


So that's looking good but a couple issues.  First, you shouldn't leave commented out code (it's dead code).  Second, you're eliminating a feature by commenting out the $ENV() lines -- those pull flag settings from environment variables.  They should probably be changed to append to end of the cmake flag variables.


 

Sean on December 19 2012 05:31 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

gckingon December 19 2012 13:52 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 19 2012 16:10 UTCcan you show it works?

That looks great -- can you demonstrate (again) that it works like you did in that first log?  Maybe set a CPP flag both in the environment and on the command-line so we can confirm it adds correctly to the summary list of flags.


 

gckingon December 19 2012 16:31 UTCtesting result

I set a CPP flag both in the envorionment and on the command-line, here is the result. 

Sean on December 19 2012 17:01 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on December 19 2012 17:03 UTCyou are

You are my hero.  Awesome work!  There will likely be a follow-on task to make one of the two of those flags get appended to the end of the list (probably the environment variable ones) instead of the beginning if you want a head start.


 

Sean on December 19 2012 17:08 UTCfollow-on task

A follow-on task has been posted:


http://www.google-melange.com/gci/task/view/google/gci2012/8106206


 

Sean on January 14 2013 15:07 UTCthank you

As GCI comes to a close, we wanted to take the time to say THANK YOU for all your efforts.  This comment interface closes after GCI is over, so you're encouraged to join our mailing list where we'll be announcing contributions from GCI participants like yourelf over the upcoming months: 


https://lists.sourceforge.net/lists/listinfo/brlcad-news


If you've provided your full name, we'll be sure to credit you in our authorship documentation and you'll see your name in a future announcement.  If you contact us at devs@brlcad.org or via IRC, we'll even let you know when your work is integrated and follow up with updates.  You're welcome and encouraged to contact us any time, especially if you have a question about how to continue participating in Open Source after GCI is over, but even if just to keep in touch.  Note that ongoing participation in Open Source is one of the most impressive skills to have on your resumé.  Take care, be well, and thank you again!