Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Tobias WEBER
Takin MnSi module
Commits
cf126442
Verified
Commit
cf126442
authored
Jun 27, 2020
by
Tobias WEBER
Browse files
mingw takin plugin building
parent
e085c5ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
cf126442
...
...
@@ -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
...
...
NOTES
View file @
cf126442
...
...
@@ -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
src/takin/takin.cpp
View file @
cf126442
...
...
@@ -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
...
...
src/takin/takin_grid.cpp
View file @
cf126442
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment