initial upload

This commit is contained in:
2025-12-17 11:00:57 +08:00
parent 2bc7b24a71
commit a09a73537f
4614 changed files with 3478433 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
LIBS:=-llagrit
LIB_PATH:=../../build/lib
all:
$(CXX) main.cxx -o liblagrit.exe -L${LIB_PATH} ${LIBS}

View 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

View 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;
}