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

Functionality without boost? #15

Open
MatthiasKauer opened this issue Apr 12, 2013 · 3 comments
Open

Functionality without boost? #15

MatthiasKauer opened this issue Apr 12, 2013 · 3 comments

Comments

@MatthiasKauer
Copy link

Hi,
I tried this library assuming that it was header-only as advertised and ran straight into compilation problems when trying the main.cpp.
I removed the THREADING and SYSTEM_IDS as well as the boost libs from the Makefile and now I can build and all the threads pass.

Is there some documentation as to what I am missing out if I use the library in this way?

ifdef CPPLOG_SYSTEM_IDS seems to relate to printing process / thread ids.

ifdef CPPLOG_THREADING runs the logger in its own thread.

Can I still use the library without boost-thread using, say OpenMPI? What kind of shortcomings do I need to expect?

Best,
Matthias

@MatthiasKauer
Copy link
Author

[–]andrew-d[S] 1 point 1 year ago

If you #define CPPLOG_NO_THREADING and CPPLOG_NO_SYSTEM_IDS, it doesn't depend on Boost any more - though you lose the ability to track process/thread IDs and the use of BackgroundLogger.

I found this on the related reddit thread: http://www.reddit.com/r/programming/comments/krd8f/show_proggit_a_simple_headeronly_mitlicensed_c/
so I guess I won't lose too much.

Could you still comment on the MPI interaction? (although for projects where I use that, I probably shouldn't be so picky about installing/building boost)

@andrew-d
Copy link
Owner

Hi there,

I've never tested it with MPI, but if you #define the two variables, cpplog will only use standard C++ code. If you want all your logs to show up on the root process, you may have to write a custom logger, however. If you want to do this, see OstreamLogger for a really simple example of how to do that. I'm not super familiar with MPI, but perhaps write a logger that will check if it's process 0 and use MPI_Isend or MPI_Ibsend to send log messages to the main process?

@MatthiasKauer
Copy link
Author

Hi, thanks for the comment.
To clarify, you would assume that if I don't take care of it, I'd end up with one logfile per thread started, right?

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

2 participants