Verified Commit cf126442 authored by Tobias WEBER's avatar Tobias WEBER
Browse files

mingw takin plugin building

parent e085c5ad
......@@ -87,7 +87,7 @@ prepare:
# -----------------------------------------------------------------------------
# Takin plugin modules
# -----------------------------------------------------------------------------
lib/skxmod.so: src/core/skx.o src/core/fp.o src/core/heli.o src/core/magsys.o src/takin/takin.o \
lib/skxmod.so: src/takin/takin.o src/core/skx.o src/core/fp.o src/core/heli.o src/core/magsys.o \
ext/takin/tools/monteconvo/sqwbase.o ext/tlibs2/libs/log.o
@echo "Linking Takin module $@..."
$(CXX) $(STD) $(OPT) $(DEFS) $(LIBDIRS) $(LIBDEFS) -shared -o $@ $+ -llapacke
......
......@@ -4,3 +4,13 @@ Manual compilation of takin external plugins:
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
Manual compilation of Takin plugins:
x86_64-w64-mingw32-g++ -std=c++17 -O2 -shared -fPIC -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__ -o lib/skxmod.dll 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
x86_64-w64-mingw32-g++ -std=c++17 -O2 -shared -fPIC -DNO_REDEFINITIONS -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 -I/usr/include/qt5 -I/usr/include/x86_64-linux-gnu/qt5/ -L/usr/x86_64-w64-mingw32/sys-root/mingw/bin/ -o lib/skxmod_grid.dll src/takin/takin_grid.cpp ext/takin/tools/monteconvo/sqwbase.cpp ext/tlibs2/libs/log.cpp ext/tlibs/log/log.cpp ext/tlibs/math/rand.cpp -lboost_system-x64 -lboost_filesystem-x64 -lQt5Core
Grid test:
g++ -std=c++17 -DDO_TEST -fPIC -o grid_tst -Isrc -Iext -Iext/takin -I/usr/include/qt5 -I/usr/include/x86_64-linux-gnu/qt5/ -DNO_REDEFINITIONS src/takin/takin_grid.cpp ext/takin/tools/monteconvo/sqwbase.cpp ext/tlibs2/libs/log.cpp -lboost_system -lQt5Core
......@@ -5,11 +5,11 @@
* @license GPLv2 (see 'LICENSE' file)
*/
#ifndef PLUGIN_APPLI
#include <boost/dll/alias.hpp>
#else
#ifdef PLUGIN_APPLI
#include "takin/tools/monteconvo/sqw_proc.h"
#include "takin/tools/monteconvo/sqw_proc_impl.h"
#else
#include <boost/dll/alias.hpp>
#endif
#include "takin/tools/monteconvo/sqwbase.h"
......@@ -344,8 +344,24 @@ 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);
#ifndef __MINGW32__
BOOST_DLL_ALIAS(sqw_info, takin_sqw_info);
BOOST_DLL_ALIAS(sqw_construct, takin_sqw);
#else
// hack because BOOST_DLL_ALIAS does not seem to work with Mingw
extern "C" __declspec(dllexport)
std::tuple<std::string, std::string, std::string> takin_sqw_info()
{
return sqw_info();
}
extern "C" __declspec(dllexport)
std::shared_ptr<SqwBase> takin_sqw(const std::string& strCfgFile)
{
return sqw_construct(strCfgFile);
}
#endif
#else
......
......@@ -3,8 +3,6 @@
* @author Tobias Weber <tweber@ill.fr>
* @date nov-18
* @license GPLv2 (see 'LICENSE' file)
*
* Test: g++ -std=c++17 -DDO_TEST -fPIC -o grid_tst -I. -I../ext -I../ext/takin -I /usr/include/qt5 -I /usr/include/x86_64-linux-gnu/qt5/ -DNO_REDEFINITIONS takin/takin_grid.cpp ../ext/takin/tools/monteconvo/sqwbase.cpp ../ext/tlibs2/libs/log.cpp -lboost_system -lQt5Core
*/
#include "tools/monteconvo/sqwbase.h"
......@@ -470,7 +468,25 @@ 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);
#ifndef __MINGW32__
BOOST_DLL_ALIAS(sqw_info, takin_sqw_info);
BOOST_DLL_ALIAS(sqw_construct, takin_sqw);
#else
// hack because BOOST_DLL_ALIAS does not seem to work with Mingw
extern "C" __declspec(dllexport)
std::tuple<std::string, std::string, std::string> takin_sqw_info()
{
return sqw_info();
}
extern "C" __declspec(dllexport)
std::shared_ptr<SqwBase> takin_sqw(const std::string& strCfgFile)
{
return sqw_construct(strCfgFile);
}
#endif
// ----------------------------------------------------------------------------
#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