testing takin external plugin system

parent 372f63cb
......@@ -58,7 +58,7 @@ STD = -std=c++17
LIBDEFS = -fPIC
DEFS = -DDEF_SKX_ORDER=7 -DDEF_HELI_ORDER=7 \
-DNO_MINIMISATION -DNO_REDEFINITIONS \
-D__HACK_FULL_INST__
-D__HACK_FULL_INST__ #-DPLUGIN_APPLI
INCS = -Isrc -Iext -Iext/takin $(SYSINCS)
# -----------------------------------------------------------------------------
......
Manual compilation of takin external plugins:
x86_64-w64-mingw32-g++ -std=c++17 -O2 -Isrc -Iext -Iext/takin -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/qt5 -L/usr/x86_64-w64-mingw32/sys-root/mingw/bin/ -DDEF_SKX_ORDER=7 -DDEF_HELI_ORDER=7 -DNO_MINIMISATION -DNO_REDEFINITIONS -D__HACK_FULL_INST__ -DPLUGIN_APPLI -o takinmod_skx.exe src/takin/takin.cpp src/core/skx.cpp src/core/heli.cpp src/core/fp.cpp src/core/magsys.cpp ext/takin/tools/monteconvo/sqwbase.cpp ext/tlibs2/libs/log.cpp ext/tlibs/log/log.cpp ext/tlibs/math/rand.cpp -llapacke -lboost_system-x64 -lboost_filesystem-x64
g++ -std=c++17 -O2 -Isrc -Iext -Iext/takin -I/usr/local/include -I/usr/include/lapacke -I/usr/local/opt/lapack/include -L/usr/x86_64-w64-mingw32/sys-root/mingw/bin/ -DDEF_SKX_ORDER=7 -DDEF_HELI_ORDER=7 -DNO_MINIMISATION -DNO_REDEFINITIONS -D__HACK_FULL_INST__ -DPLUGIN_APPLI -o takinmod_skx src/takin/takin.cpp src/core/skx.cpp src/core/heli.cpp src/core/fp.cpp src/core/magsys.cpp ext/takin/tools/monteconvo/sqwbase.cpp ext/tlibs2/libs/log.cpp ext/tlibs/log/log.cpp ext/tlibs/math/rand.cpp -llapacke -lboost_system -lboost_filesystem -lrt -lpthread
......@@ -5,7 +5,12 @@
* @license GPLv2 (see 'LICENSE' file)
*/
#include <boost/dll/alias.hpp>
#ifndef PLUGIN_APPLI
#include <boost/dll/alias.hpp>
#else
#include "takin/tools/monteconvo/sqw_proc.h"
#include "takin/tools/monteconvo/sqw_proc_impl.h"
#endif
#include "takin/tools/monteconvo/sqwbase.h"
#include "takin/libs/version.h"
......@@ -317,11 +322,16 @@ SqwBase* SqwMod::shallow_copy() const
// ----------------------------------------------------------------------------
// exported symbols
// takin interface
static const char* pcModIdent = "skxmod";
static const char* pcModName = "MnSi Magnon Dynamics";
#ifndef PLUGIN_APPLI
// exported symbols
std::tuple<std::string, std::string, std::string> sqw_info()
{
return std::make_tuple(TAKIN_VER, pcModIdent, pcModName);
......@@ -336,4 +346,29 @@ std::shared_ptr<SqwBase> sqw_construct(const std::string& strCfgFile)
// exports from so file
BOOST_DLL_ALIAS(sqw_info, takin_sqw_info);
BOOST_DLL_ALIAS(sqw_construct, takin_sqw);
#else
int main(int argc, char** argv)
{
if(argc <= 2)
{
std::cout << "#\n# This is a Takin plugin module.\n#\n";
std::cout << "module_ident: " << pcModIdent << "\n";
std::cout << "module_name: " << pcModName << "\n";
std::cout << "required_takin_version: " << TAKIN_VER << "\n";
std::cout.flush();
return 0;
}
const char* pcCfgFile = argv[1];
const char* pcSharedMem = argv[2];
SqwProc<SqwMod> proc(pcCfgFile, SqwProcStartMode::START_CHILD, pcSharedMem);
return 0;
}
#endif
// ----------------------------------------------------------------------------
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment