Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
barry cho
Hikyuu
Commits
15c96aba
Commit
15c96aba
authored
6 years ago
by
fasiondog
Browse files
Options
Download
Email Patches
Plain Diff
update xmake for macosx
parent
63e033cb
master
develop
pybind
simd
1.2.3
1.2.1
1.2.0
1.1.9
1.1.8
1.1.7
1.1.6
1.1.5
1.1.3
1.1.2
1.1.1
1.1.0
1.0.9
No related merge requests found
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
.gitignore
+2
-0
.gitignore
.travis.yml
+2
-2
.travis.yml
hikyuu_cpp/hikyuu/xmake.lua
+21
-10
hikyuu_cpp/hikyuu/xmake.lua
hikyuu_cpp/importdata/importdata.cpp
+0
-5
hikyuu_cpp/importdata/importdata.cpp
hikyuu_cpp/importdata/importdata.h
+2
-3
hikyuu_cpp/importdata/importdata.h
hikyuu_cpp/importdata/xmake.lua
+12
-2
hikyuu_cpp/importdata/xmake.lua
hikyuu_cpp/unit_test/xmake.lua
+1
-1
hikyuu_cpp/unit_test/xmake.lua
hikyuu_pywrap/xmake.lua
+31
-8
hikyuu_pywrap/xmake.lua
hikyuu_pywrap/xmake_on_load.lua
+26
-20
hikyuu_pywrap/xmake_on_load.lua
scripts/before_install.lua
+5
-1
scripts/before_install.lua
scripts/before_run.lua
+19
-12
scripts/before_run.lua
scripts/on_install.lua
+18
-9
scripts/on_install.lua
with
139 additions
and
73 deletions
+139
-73
.gitignore
+
2
-
0
View file @
15c96aba
...
...
@@ -25,3 +25,5 @@ hikyuu.code-workspace
/build
*~
.DS_Store
hikyuu_cpp/hikyuu/version.h
This diff is collapsed.
Click to expand it.
.travis.yml
+
2
-
2
View file @
15c96aba
...
...
@@ -4,8 +4,8 @@ os:
-
linux
compiler
:
-
g
cc
-
clang
-
g
++
-
clang
++
before_install
:
-
sudo apt-get install -y libhdf5-dev libhdf5-serial-dev
...
...
This diff is collapsed.
Click to expand it.
hikyuu_cpp/hikyuu/xmake.lua
+
21
-
10
View file @
15c96aba
...
...
@@ -3,7 +3,9 @@ target("hikyuu")
-- set version for release
set_config_header
(
"version.h"
,
{
prefix
=
"HKU"
})
add_deps
(
"hikyuu_utils"
)
if
is_plat
(
"windows"
)
then
add_cxflags
(
"-wd4819"
)
add_cxflags
(
"-wd4251"
)
--template dll export warning
...
...
@@ -15,26 +17,35 @@ target("hikyuu")
add_rpathdirs
(
"$ORIGIN"
)
add_cxflags
(
"-Wno-sign-compare"
)
end
add_deps
(
"hikyuu_utils"
)
if
is_plat
(
"windows"
)
then
add_defines
(
"SQLITE_API=__declspec(dllimport)"
)
add_defines
(
"HKU_API=__declspec(dllexport)"
)
add_defines
(
"PY_VERSION_HEX=0x03000000"
)
end
if
is_plat
(
"windows"
)
then
add_deps
(
"sqlite3"
)
add_packages
(
"hdf5"
)
add_packages
(
"mysql"
)
else
if
is_arch
(
"x86_64"
)
then
end
if
is_plat
(
"linux"
)
then
add_includedirs
(
"/usr/include/hdf5"
)
add_includedirs
(
"/usr/include/hdf5/serial"
)
if
is_arch
(
"x86_64"
)
then
add_linkdirs
(
"/usr/lib/x86_64-linux-gnu"
)
add_linkdirs
(
"/usr/lib/x86_64-linux-gnu/hdf5/serial"
)
end
add_includedirs
(
"/usr/include/hdf5"
)
add_includedirs
(
"/usr/include/hdf5/serial"
)
end
if
is_plat
(
"macosx"
)
then
add_linkdirs
(
"/usr/local/opt/iconv/lib"
)
add_links
(
"iconv"
)
add_includedirs
(
"/usr/local/opt/hdf5/include"
)
add_linkdirs
(
"/usr/local/opt/hdf5/lib"
)
add_includedirs
(
"/usr/local/opt/mysql-client/include"
)
add_linkdirs
(
"/usr/local/opt/mysql-client/lib"
)
end
if
is_plat
(
"linuxe"
)
or
is_plat
(
"macosx"
)
then
add_links
(
"sqlite3"
)
add_links
(
"hdf5"
)
add_links
(
"hdf5_hl"
)
...
...
This diff is collapsed.
Click to expand it.
hikyuu_cpp/importdata/importdata.cpp
+
0
-
5
View file @
15c96aba
...
...
@@ -25,13 +25,8 @@
#include
<iconv.h>
#endif
#if defined(BOOST_MSVC)
#include
<hdf5.h>
#include
<hdf5_hl.h>
#else
#include
<hdf5/serial/hdf5.h>
#include
<hdf5/serial/hdf5_hl.h>
#endif
#include
"sqlite3callback.h"
#include
"importdata.h"
...
...
This diff is collapsed.
Click to expand it.
hikyuu_cpp/importdata/importdata.h
+
2
-
3
View file @
15c96aba
...
...
@@ -16,11 +16,10 @@
#if defined(BOOST_MSVC)
#pragma warning(disable:4251)
#include
<H5Cpp.h>
#else
#include
<hdf5/serial/H5Cpp.h>
#endif
#include
<H5Cpp.h>
#if !(defined(WIN32) && defined(_WIN32))
#include
<sys/time.h>
#endif
...
...
This diff is collapsed.
Click to expand it.
hikyuu_cpp/importdata/xmake.lua
+
12
-
2
View file @
15c96aba
...
...
@@ -20,8 +20,18 @@ target("importdata")
add_linkdirs
(
"/usr/lib/x86_64-linux-gnu"
)
add_linkdirs
(
"/usr/lib/x86_64-linux-gnu/hdf5/serial"
)
end
add_includedirs
(
"/usr/include/hdf5"
)
add_includedirs
(
"/usr/include/hdf5/serial"
)
add_includedirs
(
"/usr/include/hdf5"
)
-- for ubuntu 14.04
add_includedirs
(
"/usr/include/hdf5/serial"
)
-- for ubuntu 16.04
end
if
is_plat
(
"macosx"
)
then
add_includedirs
(
"/usr/local/opt/hdf5/include"
)
add_linkdirs
(
"/usr/local/opt/hdf5/lib"
)
add_linkdirs
(
"/usr/local/opt/iconv/lib"
)
add_links
(
"iconv"
)
end
if
is_plat
(
"linux"
)
or
is_plat
(
"macosx"
)
then
add_links
(
"sqlite3"
)
add_links
(
"hdf5"
)
add_links
(
"hdf5_hl"
)
...
...
This diff is collapsed.
Click to expand it.
hikyuu_cpp/unit_test/xmake.lua
+
1
-
1
View file @
15c96aba
...
...
@@ -31,7 +31,7 @@ target("unit-test")
add_deps
(
"hikyuu"
)
if
is_plat
(
"linux"
)
then
if
is_plat
(
"linux"
)
or
is_plat
(
"macosx"
)
then
add_links
(
"boost_unit_test_framework"
)
--add_links("boost_system")
add_shflags
(
"-Wl,-rpath=$ORIGIN"
,
"-Wl,-rpath=$ORIGIN/../lib"
)
...
...
This diff is collapsed.
Click to expand it.
hikyuu_pywrap/xmake.lua
+
31
-
8
View file @
15c96aba
...
...
@@ -25,10 +25,13 @@ target("_hikyuu")
add_deps
(
"hikyuu"
)
if
is_plat
(
"windows"
)
then
set_filename
(
"_hikyuu.pyd"
)
else
end
if
is_plat
(
"linux"
)
then
set_filename
(
"_hikyuu.so"
)
end
if
is_plat
(
"macosx"
)
then
set_filename
(
"_hikyuu.dylib"
)
end
add_files
(
"./*.cpp"
)
target
(
"_indicator"
)
...
...
@@ -36,9 +39,13 @@ target("_indicator")
add_deps
(
"hikyuu"
)
if
is_plat
(
"windows"
)
then
set_filename
(
"_indicator.pyd"
)
else
end
if
is_plat
(
"linux"
)
then
set_filename
(
"_indicator.so"
)
end
if
is_plat
(
"macosx"
)
then
set_filename
(
"_indicator.dylib"
)
end
add_files
(
"./indicator/*.cpp"
)
target
(
"_trade_manage"
)
...
...
@@ -46,8 +53,12 @@ target("_trade_manage")
add_deps
(
"hikyuu"
)
if
is_plat
(
"windows"
)
then
set_filename
(
"_trade_manage.pyd"
)
else
set_filename
(
"_trade_manage.so"
)
end
if
is_plat
(
"linux"
)
then
set_filename
(
"_trade_manage.os"
)
end
if
is_plat
(
"macosx"
)
then
set_filename
(
"_trade_manage.dylib"
)
end
add_files
(
"./trade_manage/*.cpp"
)
...
...
@@ -56,8 +67,12 @@ target("_trade_sys")
add_deps
(
"hikyuu"
)
if
is_plat
(
"windows"
)
then
set_filename
(
"_trade_sys.pyd"
)
else
end
if
is_plat
(
"linux"
)
then
set_filename
(
"_trade_sys.so"
)
end
if
is_plat
(
"macosx"
)
then
set_filename
(
"_trade_sys.dylib"
)
end
add_files
(
"./trade_sys/*.cpp"
)
...
...
@@ -66,8 +81,12 @@ target("_trade_instance")
add_deps
(
"hikyuu"
)
if
is_plat
(
"windows"
)
then
set_filename
(
"_trade_instance.pyd"
)
else
end
if
is_plat
(
"linux"
)
then
set_filename
(
"_trade_instance.so"
)
end
if
is_plat
(
"macosx"
)
then
set_filename
(
"_trade_instance.dylib"
)
end
add_files
(
"./trade_instance/*.cpp"
)
...
...
@@ -76,8 +95,12 @@ target("_data_driver")
add_deps
(
"hikyuu"
)
if
is_plat
(
"windows"
)
then
set_filename
(
"_data_driver.pyd"
)
else
end
if
is_plat
(
"linux"
)
then
set_filename
(
"_data_driver.so"
)
end
if
is_plat
(
"macosx"
)
then
set_filename
(
"_data_driver.dylib"
)
end
add_files
(
"./data_driver/*.cpp"
)
This diff is collapsed.
Click to expand it.
hikyuu_pywrap/xmake_on_load.lua
+
26
-
20
View file @
15c96aba
...
...
@@ -5,28 +5,34 @@ function main(target)
pydir
=
path
.
directory
(
pydir
)
target
:
add
(
"includedirs"
,
pydir
..
"/include"
)
target
:
add
(
"linkdirs"
,
pydir
..
"/libs"
)
else
target
:
add
(
"rpathdirs"
,
"$ORIGIN"
,
"$ORIGIN/lib"
,
"$ORIGIN/../lib"
)
return
end
if
is_plat
(
"macosx"
)
then
local
ldflag
=
os
.
iorun
(
"python3-config --ldflag"
)
local
libs
=
os
.
iorun
(
"python3-config --libs"
)
target
:
add
(
"shflags"
,
ldflag
,
libs
)
end
target
:
add
(
"rpathdirs"
,
"$ORIGIN"
,
"$ORIGIN/lib"
,
"$ORIGIN/../lib"
)
-- get python include directory.
local
pydir
=
os
.
iorun
(
"python3-config --includes"
)
local
lcPos
=
string.find
(
pydir
,
"
\n
"
)
pydir
=
(
string.sub
(
pydir
,
1
,
lcPos
-
1
))
target
:
add
(
"cxflags"
,
pydir
)
-- get python include directory.
local
pydir
=
os
.
iorun
(
"python3-config --includes"
)
local
lcPos
=
string.find
(
pydir
,
"
\n
"
)
pydir
=
(
string.sub
(
pydir
,
1
,
lcPos
-
1
))
target
:
add
(
"cxflags"
,
pydir
)
-- get suffix configure for link libboost_pythonX.so
local
suffix
=
get_config
(
"boost_python_suffix"
)
if
suffix
==
nil
then
raise
(
"You need to config --boost_python_suffix specify libboost_python suffix"
)
end
-- get suffix configure for link libboost_pythonX.so
local
suffix
=
get_config
(
"boost_python_suffix"
)
if
suffix
==
nil
then
raise
(
"You need to config --boost_python_suffix specify libboost_python suffix"
)
end
suffix
=
string.upper
(
suffix
)
if
suffix
==
"3X"
then
local
ver
=
os
.
iorun
(
"python3 --version"
)
local
boost_python_lib
=
"boost_python"
..
string.sub
(
ver
,
8
,
8
)
..
string.sub
(
ver
,
10
,
10
)
target
:
add
(
"links"
,
boost_python_lib
)
else
target
:
add
(
"links"
,
"boost_python"
..
suffix
)
end
suffix
=
string.upper
(
suffix
)
if
suffix
==
"3X"
then
local
ver
=
os
.
iorun
(
"python3 --version"
)
local
boost_python_lib
=
"boost_python"
..
string.sub
(
ver
,
8
,
8
)
..
string.sub
(
ver
,
10
,
10
)
target
:
add
(
"links"
,
boost_python_lib
)
else
target
:
add
(
"links"
,
"boost_python"
..
suffix
)
end
end
This diff is collapsed.
Click to expand it.
scripts/before_install.lua
+
5
-
1
View file @
15c96aba
...
...
@@ -15,7 +15,11 @@ function main(target)
if
is_plat
(
"windows"
)
then
os
.
exec
(
"xcopy /S /Q /Y /I hikyuu_python "
..
installdir
)
else
end
if
is_plat
(
"linux"
)
then
os
.
exec
(
"cp -f -r -T hikyuu_python "
..
installdir
)
end
if
is_plat
(
"macosx"
)
then
os
.
exec
(
"cp -f -r hikyuu_python "
..
installdir
)
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/before_run.lua
+
19
-
12
View file @
15c96aba
...
...
@@ -27,23 +27,30 @@ function main(target)
if
is_plat
(
"windows"
)
then
os
.
cp
(
"$(env BOOST_LIB)/boost_date_time*.dll"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/boost_filesystem*.dll"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
--os.cp("$(env BOOST_LIB)/boost_python3*.dll", "$(buildir)/$(mode)/$(plat)/$(arch)/lib/")
os
.
cp
(
"$(env BOOST_LIB)/boost_serialization*.dll"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/boost_system*.dll"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/boost_unit_test_framework*.dll"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(projectdir)/hikyuu_extern_libs/pkg/hdf5.pkg/lib/release/$(plat)/$(arch)/*.dll"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(projectdir)/hikyuu_extern_libs/pkg/mysql.pkg/lib/release/$(plat)/$(arch)/*.dll"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
else
local
boostlib
=
val
(
"env BOOST_LIB"
)
if
boostlib
~=
""
then
os
.
cp
(
"$(env BOOST_LIB)/libboost_date_time*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_filesystem*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
--os.cp("$(env BOOST_LIB)/libboost_python3*.so.*", "$(buildir)/$(mode)/$(plat)/$(arch)/lib/")
os
.
cp
(
"$(env BOOST_LIB)/libboost_serialization*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_system*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_unit_test_framework*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
end
end
if
is_plat
(
"linux"
)
then
os
.
cp
(
"$(env BOOST_LIB)/libboost_date_time*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_filesystem*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_serialization*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_system*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_unit_test_framework*.so.*"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
end
if
is_plat
(
"macosx"
)
then
os
.
cp
(
"$(env BOOST_LIB)/libboost_date_time*.dylib"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_filesystem*.dylib"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_serialization*.dylib"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_system*.dylib"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_unit_test_framework*.dylib"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
-- macOSX下unit_test_framework依赖于timer和chrono
os
.
cp
(
"$(env BOOST_LIB)/libboost_timer*.dylib"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_chrono*.dylib"
,
"$(buildir)/$(mode)/$(plat)/$(arch)/lib/"
)
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/on_install.lua
+
18
-
9
View file @
15c96aba
...
...
@@ -49,16 +49,25 @@ function main(target)
os
.
cp
(
"$(env BOOST_LIB)/boost_system*.dll"
,
installdir
..
"/"
)
os
.
cp
(
"$(projectdir)/hikyuu_extern_libs/pkg/hdf5.pkg/lib/release/$(plat)/$(arch)/*.dll"
,
installdir
..
"/"
)
os
.
cp
(
"$(projectdir)/hikyuu_extern_libs/pkg/mysql.pkg/lib/release/$(plat)/$(arch)/*.dll"
,
installdir
..
"/"
)
return
end
if
is_plat
(
"linux"
)
then
os
.
cp
(
"$(env BOOST_LIB)/libboost_date_time*.so.*"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_filesystem*.so.*"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_python3*.so.*"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_serialization*.so.*"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_system*.so.*"
,
installdir
..
"/"
)
return
end
else
local
boostlib
=
val
(
"env BOOST_LIB"
)
if
boostlib
~=
""
then
os
.
cp
(
"$(env BOOST_LIB)/libboost_date_time*.so.*"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_filesystem*.so.*"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_python3*.so.*"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_serialization*.so.*"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_system*.so.*"
,
installdir
..
"/"
)
end
if
is_plat
(
"macosx"
)
then
os
.
cp
(
"$(env BOOST_LIB)/libboost_date_time*.dylib"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_filesystem*.dylib"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_python3*.dylib"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_serialization*.dylib"
,
installdir
..
"/"
)
os
.
cp
(
"$(env BOOST_LIB)/libboost_system*.dylib"
,
installdir
..
"/"
)
return
end
end
end
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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
Menu
Projects
Groups
Snippets
Help