Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ grammatical problems #1911

Closed
liuguangzhong opened this issue Jul 9, 2019 · 3 comments
Closed

C++ grammatical problems #1911

liuguangzhong opened this issue Jul 9, 2019 · 3 comments

Comments

@liuguangzhong
Copy link

环境

  • 操作系统: Ubuntu 16.04
  • Anaconda版本: Anaconda3.7 64位
  • vn.py版本: master(下载日期)

Issue类型

三选一:Bug

预期程序行为

oes编译通过

实际程序行为

creating build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp
copying vnpy/api/ctp/vnctp/vnctp.h -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp
creating build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd
copying vnpy/api/ctp/vnctp/vnctpmd/dllmain.cpp -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd
copying vnpy/api/ctp/vnctp/vnctpmd/stdafx.cpp -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd
copying vnpy/api/ctp/vnctp/vnctpmd/stdafx.h -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd
copying vnpy/api/ctp/vnctp/vnctpmd/targetver.h -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd
copying vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd
copying vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.h -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd
creating build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd
copying vnpy/api/ctp/vnctp/vnctptd/dllmain.cpp -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd
copying vnpy/api/ctp/vnctp/vnctptd/stdafx.cpp -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd
copying vnpy/api/ctp/vnctp/vnctptd/stdafx.h -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd
copying vnpy/api/ctp/vnctp/vnctptd/targetver.h -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd
copying vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd
copying vnpy/api/ctp/vnctp/vnctptd/vnctptd.h -> build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd
copying vnpy/api/apex/FixApi.dll -> build/lib.linux-x86_64-3.7/vnpy/api/apex
copying vnpy/trader/ui/ico/about.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/connect.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/contract.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/database.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/editor.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/email.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/exit.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/forum.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/restore.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/test.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/trader/ui/ico/vnpy.ico -> build/lib.linux-x86_64-3.7/vnpy/trader/ui/ico
copying vnpy/app/risk_manager/ui/rm.ico -> build/lib.linux-x86_64-3.7/vnpy/app/risk_manager/ui
copying vnpy/app/script_trader/ui/script.ico -> build/lib.linux-x86_64-3.7/vnpy/app/script_trader/ui
copying vnpy/app/cta_backtester/ui/backtester.ico -> build/lib.linux-x86_64-3.7/vnpy/app/cta_backtester/ui
copying vnpy/app/data_recorder/ui/recorder.ico -> build/lib.linux-x86_64-3.7/vnpy/app/data_recorder/ui
copying vnpy/app/algo_trading/ui/algo.ico -> build/lib.linux-x86_64-3.7/vnpy/app/algo_trading/ui
copying vnpy/app/csv_loader/ui/csv.ico -> build/lib.linux-x86_64-3.7/vnpy/app/csv_loader/ui
copying vnpy/app/cta_strategy/ui/cta.ico -> build/lib.linux-x86_64-3.7/vnpy/app/cta_strategy/ui
copying vnpy/app/rpc_service/ui/rpc.ico -> build/lib.linux-x86_64-3.7/vnpy/app/rpc_service/ui
running build_ext
building 'vnpy.api.ctp.vnctptd' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/vnpy
creating build/temp.linux-x86_64-3.7/vnpy/api
creating build/temp.linux-x86_64-3.7/vnpy/api/ctp
creating build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp
creating build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd
gcc -pthread -B /home/caros/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ivnpy/api/ctp/include -Ivnpy/api/ctp/vnctp -I/home/caros/anaconda3/include/python3.7m -c vnpy/api/ctp/vnctp/vnctptd/vnctptd.cpp -o build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd/vnctptd.o -std=c++17 -O3 -Wno-delete-incomplete -Wno-sign-compare
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -shared -B /home/caros/anaconda3/compiler_compat -L/home/caros/anaconda3/lib -Wl,-rpath=/home/caros/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctptd/vnctptd.o -Lvnpy/api/ctp/libs -Lvnpy/api/ctp -Wl,-R$ORIGIN -lthostmduserapi_se -lthosttraderapi_se -o build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctptd.cpython-37m-x86_64-linux-gnu.so -lstdc++
building 'vnpy.api.ctp.vnctpmd' extension
creating build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd
gcc -pthread -B /home/caros/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ivnpy/api/ctp/include -Ivnpy/api/ctp/vnctp -I/home/caros/anaconda3/include/python3.7m -c vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.cpp -o build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.o -std=c++17 -O3 -Wno-delete-incomplete -Wno-sign-compare
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -shared -B /home/caros/anaconda3/compiler_compat -L/home/caros/anaconda3/lib -Wl,-rpath=/home/caros/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/vnpy/api/ctp/vnctp/vnctpmd/vnctpmd.o -Lvnpy/api/ctp/libs -Lvnpy/api/ctp -Wl,-R$ORIGIN -lthostmduserapi_se -lthosttraderapi_se -o build/lib.linux-x86_64-3.7/vnpy/api/ctp/vnctpmd.cpython-37m-x86_64-linux-gnu.so -lstdc++
building 'vnpy.api.oes.vnoes' extension
creating build/temp.linux-x86_64-3.7/vnpy/api/oes
creating build/temp.linux-x86_64-3.7/vnpy/api/oes/vnoes
creating build/temp.linux-x86_64-3.7/vnpy/api/oes/vnoes/generated_files
gcc -pthread -B /home/caros/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DBRIGAND_NO_BOOST_SUPPORT=1 -Ivnpy/api/oes/vnoes/include -Ivnpy/api/oes/vnoes/include/oes -I/home/caros/anaconda3/include/python3.7m -c vnpy/api/oes/vnoes/generated_files/module.cpp -o build/temp.linux-x86_64-3.7/vnpy/api/oes/vnoes/generated_files/module.o -std=c++17 -O3 -Wno-delete-incomplete -Wno-sign-compare
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from vnpy/api/oes/vnoes/include/autocxxpy/property_helper.hpp:14:0,
                 from vnpy/api/oes/vnoes/include/autocxxpy/autocxxpy.hpp:6,
                 from vnpy/api/oes/vnoes/generated_files/module.cpp:8:
vnpy/api/oes/vnoes/include/autocxxpy/base/type.h:18:20: error: ‘auto’ parameter not permitted in this context
     template <auto method>
                    ^
vnpy/api/oes/vnoes/include/autocxxpy/base/type.h:19:78: error: template argument 1 is invalid
     using function_constant = std::integral_constant<decltype(method), method>;
                                                                              ^
vnpy/api/oes/vnoes/include/autocxxpy/base/type.h:19:78: note: invalid template non-type parameter
In file included from vnpy/api/oes/vnoes/include/autocxxpy/autocxxpy.hpp:6:0,
                 from vnpy/api/oes/vnoes/generated_files/module.cpp:8:
vnpy/api/oes/vnoes/include/autocxxpy/property_helper.hpp: In function ‘constexpr auto autocxxpy::default_setter_wrap(char (class_type::*)[size])’:
vnpy/api/oes/vnoes/include/autocxxpy/property_helper.hpp:176:58: error: ‘string_view’ in namespace ‘std’ does not name a type
         return [member](class_type &instance, const std::string_view &value) {
                                                          ^
vnpy/api/oes/vnoes/include/autocxxpy/property_helper.hpp:178:10: error: expected ‘)’ before ‘;’ token
         };
          ^
vnpy/api/oes/vnoes/include/autocxxpy/property_helper.hpp: In lambda function:
vnpy/api/oes/vnoes/include/autocxxpy/property_helper.hpp:178:10: error: expected ‘{’ before ‘;’ token
In file included from vnpy/api/oes/vnoes/include/autocxxpy/calling_wrapper.hpp:3:0,
                 from vnpy/api/oes/vnoes/include/autocxxpy/autocxxpy.hpp:7,
                 from vnpy/api/oes/vnoes/generated_files/module.cpp:8:
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp: At global scope:
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp:10:20: error: ‘auto’ parameter not permitted in this context
     template <auto method>
                    ^
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp:23:20: error: ‘auto’ parameter not permitted in this context
     template <auto method>
                    ^
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp:24:70: note: invalid template non-type parameter
     using value_invoke_result_t = typename value_invoke_result<method>::type;
                                                                      ^
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp:26:20: error: ‘auto’ parameter not permitted in this context
     template <auto method>
                    ^
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp:40:73: error: template argument 1 is invalid
         using type = boost::callable_traits::class_of_t<decltype(method)>;
                                                                         ^
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp:43:20: error: ‘auto’ parameter not permitted in this context
     template <auto method>
                    ^
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp:44:70: note: invalid template non-type parameter
     using value_invoke_result_t = typename value_invoke_result<method>::type;
                                                                      ^
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp:46:20: error: ‘auto’ parameter not permitted in this context
     template <auto method>
                    ^
vnpy/api/oes/vnoes/include/autocxxpy/utils/functional.hpp:47:76: note: invalid template non-type parameter
     using class_of_member_method_t = typename class_of_member_method<method>::type;
                                                                            ^
In file included from vnpy/api/oes/vnoes/include/autocxxpy/calling_wrapper.hpp:7:0,
                 from vnpy/api/oes/vnoes/include/autocxxpy/autocxxpy.hpp:7,
                 from vnpy/api/oes/vnoes/generated_files/module.cpp:8:
vnpy/api/oes/vnoes/include/autocxxpy/wrappers/c_function_callback.hpp: In function ‘constexpr auto autocxxpy::wrap_c_function_callback()’:
vnpy/api/oes/vnoes/include/autocxxpy/wrappers/c_function_callback.hpp:65:12: error: expected ‘(’ before ‘constexpr’
         if constexpr (check_not_out_of_bound<index, size<args_t>::value>())
            ^
vnpy/api/oes/vnoes/generated_files/module.cpp:46:1: error: expected ‘}’ at end of input
 }
 ^
vnpy/api/oes/vnoes/generated_files/module.cpp: At global scope:
vnpy/api/oes/vnoes/generated_files/module.cpp:46:1: error: expected ‘}’ at end of input
error: command 'gcc' failed with exit status 1
----------------------------------------

ERROR: Command "/home/caros/anaconda3/bin/python -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-req-build-c4n1ypqi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-sb6dnin7/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-c4n1ypqi/

重现步骤

针对Bug类型Issue,请提供具体重现步骤以及报错截图

Screenshot from 2019-07-09 21-23-39

@vnpy
Copy link
Owner

vnpy commented Jul 10, 2019

@nanoric 请看下

@nanoric
Copy link
Contributor

nanoric commented Jul 10, 2019

gcc版本太低,需要gcc7+才能编译oes。
两种解决方案:
1、安装gcc7或者gcc8
https://gist.github.com/jlblancoc/99521194aba975286c80f93e47966dc5

2、不编译oes:

VNPY_BUILD_OES=0 python setup.py build

@vnpy
Copy link
Owner

vnpy commented Jul 10, 2019

或者使用Ubuntu 18.04,默认GCC就是7+

@vnpy vnpy closed this as completed Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants