Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a section on MakeFiles and compiling ROOT macros using g++ #194

Open
iwansmith opened this issue Nov 22, 2016 · 6 comments
Open

Adding a section on MakeFiles and compiling ROOT macros using g++ #194

iwansmith opened this issue Nov 22, 2016 · 6 comments

Comments

@iwansmith
Copy link
Contributor

Having recently gone through the process of converting a jumbled mess of macros into a working application, a section on writing a Makefile could be useful.

A quick braindump of this could include:

  • MakeFiles in general, and structuring a project.
  • Compiling with g++ root-config --cflags etc.
  • Some more advanced features e.g. using your own RooFit PDFs and ROOT dictionaries.

I'l happily start work on this when I have some time, but having only recently gone through this process a more experienced eye watching over would be useful.

@alexpearce
Copy link
Member

We just talked about this on Slack! 😄

I agree it could be useful. It would probably be more at home in analysis essentials. The problem is that we don't teach any C++/ROOT, so the compiling part wouldn't be relevant for the rest of the lessons.

But I think Makefiles in general are super helpful, like for defining analysis workflows. That could make a cool lesson.

And I'm not adverse to having a more general resource, even if it's not taught in the Starterkit.

@pseyfert
Copy link

Feel free to import from my blog ;) or on top of that, i would love to learn myself about auto dependency generation.

@henryiii
Copy link
Contributor

I personally use CMake most of the time, but it adds another layer of indirection (But for any sort of real application, or for using IDEs, etc, it’s essential). CMake 3+ and my additions to FindROOT make it pretty easy to work with. I’ll try to write up an example in a few weeks and put it on my blog and put the FindROOT in a reasonable location (It’s part of GooFit currently).

@rmatev
Copy link

rmatev commented Mar 15, 2017

@pseyfert, from the last section of the paper

...
He suggests using the LD_PRELOAD environment to insert special shared library that contains a replacement for the open(2) system call. This version of open() would actually write out make dependency information for every file the commands read during operation.

This is already done with strace! See https://github.com/SimonAlfie/fabricate. Unfortunately, the maintainers are not active and not too receptive of my ping. I'm still using it, though!

@pseyfert
Copy link

@rmatev good to know. though i was mostly interested in just getting the gcc -M... flags to get dependencies on header files within a project covered by gnu make, for cases like: "i just edited one .h file an hour ago, only compiled with make target1 and don't want to bother thinking about whether now target2.o needs to be recompiled".

@pseyfert
Copy link

thinking about it again, aren't auto dependency generation and cmake are out of scope …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants