initial upload
This commit is contained in:
5
examples/liblagrit/Makefile
Normal file
5
examples/liblagrit/Makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
LIBS:=-llagrit
|
||||
LIB_PATH:=../../build/lib
|
||||
|
||||
all:
|
||||
$(CXX) main.cxx -o liblagrit.exe -L${LIB_PATH} ${LIBS}
|
||||
14
examples/liblagrit/lagrit.h
Normal file
14
examples/liblagrit/lagrit.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef __LAGRIT_LIB_HPP__
|
||||
#define __LAGRIT_LIB_HPP__
|
||||
|
||||
/* Initializes LaGriT */
|
||||
extern "C" void initlagrit_(const char * mode,
|
||||
const char* log_file,
|
||||
const char * batch_file,
|
||||
unsigned int len_mode,
|
||||
unsigned int len_log_file,
|
||||
unsigned int len_batch_file);
|
||||
|
||||
extern "C" void dotask_(const char* cmd, unsigned int len_cmd);
|
||||
|
||||
#endif
|
||||
20
examples/liblagrit/main.cxx
Normal file
20
examples/liblagrit/main.cxx
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Simple example illustrating linking LaGriT
|
||||
* with an external C/C++ code.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "lagrit.h"
|
||||
|
||||
int main() {
|
||||
std::string mode("noisy");
|
||||
std::string log_file(" ");
|
||||
std::string batch_file(" ");
|
||||
|
||||
std::string task("cmo/create/mo1///tri; finish");
|
||||
|
||||
initlagrit(mode.c_str(), log_file.c_str(), batch_file.c_str(), mode.size(), log_file.size(), batch_file.size());
|
||||
dotask(task.c_str(), task.size());
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user