Skip to content

Instantly share code, notes, and snippets.

@evacchi
Created July 10, 2015 16:16
Show Gist options
  • Save evacchi/e2ebde0823e8917d7f1b to your computer and use it in GitHub Desktop.
Save evacchi/e2ebde0823e8917d7f1b to your computer and use it in GitHub Desktop.
Grappa DYLIB Minimal
// grappa_exe.cpp
namespace PyGrappa {
extern "C" void run();
};
int main(int argc, char **argv){
PyGrappa::run();
}
// ---------------------------------------
// libpygrappa.cpp
#include <Grappa.hpp>
#include <sstream>
using namespace Grappa;
namespace PyGrappa {
extern "C" void run(){
int argc = 1;
char * arg = "foo";
char ** argv = &arg;
Grappa::init(&argc, &argv);
Grappa::run([]
{
Grappa::on_all_cores([]{
std::cout << "Hello world from Core " << Grappa::mycore() << " of " << Grappa::cores()
<< " (locale " << Grappa::mylocale() << ")"<< "\n";
});
});
Grappa::finalize();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment