ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

Mismatch of func declaration

Open piotr5151 opened this issue 4 years ago • 13 comments

I have a problem to install ta-lib wrapper in linux machine over ta-lib compiled from source code. I found out a mismatch between functions.

there is an error: /usr/include/ta-lib/ta_abstract.h:155:52: note: expected ‘const TA_FuncHandle **’ {aka ‘const unsigned int **’} but argument is of type ‘TA_FuncHandle **’ {aka ‘unsigned int **’}

I've checked the files and indeed ta_abstract.h declares the function as const, but talib/_ta_lib.c declares as non-const. There are 3 more mistakes in the file.

piotr5151 avatar Jan 08 '22 17:01 piotr5151

Which are the other 3 mistakes?

mrjbq7 avatar Jan 08 '22 17:01 mrjbq7

Does this prevent it from working? Or is it just a warning?

mrjbq7 avatar Jan 08 '22 17:01 mrjbq7

It is error not warning and pip cannot compile the wrapper.

piotr5151 avatar Jan 08 '22 19:01 piotr5151

Which compiler are you using?

I’ve not seen that error preventing builds before. We run tests on macOS, linux, and windows.

On Jan 8, 2022, at 11:34 AM, piotr5151 @.***> wrote:

 It is error not warning and pip cannot compile the wrapper.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.

mrjbq7 avatar Jan 08 '22 20:01 mrjbq7

That might be bcs of a new gcc compiler version. I faced with an error which recently was only a warning in some other project (can't remember which) bcs of that. upd: and mine was gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0 (Kubuntu 21.10)

trufanov-nok avatar Jan 08 '22 22:01 trufanov-nok

I looked through and added const in all the places I recognized.

Can you try latest git master and see if it works for you?

If it doesn't can you attach some output so I can see what is failing?

mrjbq7 avatar Jan 09 '22 01:01 mrjbq7

https://github.com/mrjbq7/ta-lib/commit/863d88a5a6ebd90b98faa58d3b42d3130aeb9165

mrjbq7 avatar Jan 09 '22 01:01 mrjbq7

unfortunately it doesn't work ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/ta-wrapper/ta-lib/setup.py'"'"'; __file__='"'"'/ta-wrapper/ta-lib/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-84symm7a cwd: /ta-wrapper/ta-lib/ Complete output (65 lines): running bdist_wheel running build running build_py running build_ext x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/homebrew/include -I/opt/homebrew/opt/ta-lib/include -I/usr/local/lib/python3.8/dist-packages/numpy/core/include -I/usr/include/python3.8 -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.8/talib/_ta_lib.o In file included from /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1969, from /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/arrayobject.h:4, from talib/_ta_lib.c:689: /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] 17 | #warning "Using deprecated NumPy API, disable it with " \ | ^~~~~~~ talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_348_ta_getFuncInfo’: talib/_ta_lib.c:38706:104: warning: passing argument 2 of ‘TA_GetFuncInfo’ from incompatible pointer type [-Wincompatible-pointer-types] 38706 | __pyx_v_retCode = TA_GetFuncInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), (&__pyx_v_info)); | ~^~~~~~~~~~~~~~ | | | TA_FuncInfo ** {aka struct TA_FuncInfo **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:211:48: note: expected ‘const TA_FuncInfo **’ {aka ‘const struct TA_FuncInfo **’} but argument is of type ‘TA_FuncInfo **’ {aka ‘struct TA_FuncInfo **’} 211 | const TA_FuncInfo **funcInfo ); | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~ talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_350_ta_getInputParameterInfo’: talib/_ta_lib.c:38977:127: warning: passing argument 3 of ‘TA_GetInputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types] 38977 | __pyx_v_retCode = TA_GetInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); | ~^~~~~~~~~~~~~~ | | | TA_InputParameterInfo ** {aka struct TA_InputParameterInfo **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:442:68: note: expected ‘const TA_InputParameterInfo **’ {aka ‘const struct TA_InputParameterInfo **’} but argument is of type ‘TA_InputParameterInfo **’ {aka ‘struct TA_InputParameterInfo **’} 442 | const TA_InputParameterInfo **info ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_352_ta_getOptInputParameterInfo’: talib/_ta_lib.c:39227:130: warning: passing argument 3 of ‘TA_GetOptInputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types] 39227 | __pyx_v_retCode = TA_GetOptInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); | ~^~~~~~~~~~~~~~ | | | TA_OptInputParameterInfo ** {aka struct TA_OptInputParameterInfo **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:446:74: note: expected ‘const TA_OptInputParameterInfo **’ {aka ‘const struct TA_OptInputParameterInfo **’} but argument is of type ‘TA_OptInputParameterInfo **’ {aka ‘struct TA_OptInputParameterInfo **’} 446 | const TA_OptInputParameterInfo **info ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_354_ta_getOutputParameterInfo’: talib/_ta_lib.c:39473:128: warning: passing argument 3 of ‘TA_GetOutputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types] 39473 | __pyx_v_retCode = TA_GetOutputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); | ~^~~~~~~~~~~~~~ | | | TA_OutputParameterInfo ** {aka struct TA_OutputParameterInfo **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:450:70: note: expected ‘const TA_OutputParameterInfo **’ {aka ‘const struct TA_OutputParameterInfo **’} but argument is of type ‘TA_OutputParameterInfo **’ {aka ‘struct TA_OutputParameterInfo **’} 450 | const TA_OutputParameterInfo **info ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ talib/_ta_lib.c: In function ‘__pyx_f_5talib_7_ta_lib___ta_getFuncHandle’: talib/_ta_lib.c:40072:126: warning: passing argument 2 of ‘TA_GetFuncHandle’ from incompatible pointer type [-Wincompatible-pointer-types] 40072 | __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetFuncHandle, TA_GetFuncHandle(__pyx_v_function_name, (&__pyx_v_handle)), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 751, __pyx_L1_error) | ~^~~~~~~~~~~~~~~~ | | | TA_FuncHandle ** {aka unsigned int **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:155:52: note: expected ‘const TA_FuncHandle **’ {aka ‘const unsigned int **’} but argument is of type ‘TA_FuncHandle **’ {aka ‘unsigned int **’} 155 | const TA_FuncHandle **handle ); | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~ x86_64-linux-gnu-gcc: fatal error: Killed signal terminated program cc1 compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

piotr5151 avatar Jan 12 '22 16:01 piotr5151

This doesn’t look like the warnings are breaking it.

It looks like you don’t have enough memory and compile fails. Are you using 1GB?

I’ve seen this before;

x86_64-linux-gnu-gcc: fatal error: Killed signal terminated program cc1 compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

On Jan 12, 2022, at 8:11 AM, piotr5151 @.***> wrote:

 unfortunately it doesn't work ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/ta-wrapper/ta-lib/setup.py'"'"'; file='"'"'/ta-wrapper/ta-lib/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-84symm7a cwd: /ta-wrapper/ta-lib/ Complete output (65 lines): running bdist_wheel running build running build_py running build_ext x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/homebrew/include -I/opt/homebrew/opt/ta-lib/include -I/usr/local/lib/python3.8/dist-packages/numpy/core/include -I/usr/include/python3.8 -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.8/talib/_ta_lib.o In file included from /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1969, from /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/arrayobject.h:4, from talib/_ta_lib.c:689: /usr/local/lib/python3.8/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] 17 | #warning "Using deprecated NumPy API, disable it with " \ | ^~~~~~~ talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_348_ta_getFuncInfo’: talib/_ta_lib.c:38706:104: warning: passing argument 2 of ‘TA_GetFuncInfo’ from incompatible pointer type [-Wincompatible-pointer-types] 38706 | __pyx_v_retCode = TA_GetFuncInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), (&__pyx_v_info)); | ~^~~~~~~~~~~~~~ | | | TA_FuncInfo ** {aka struct TA_FuncInfo **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:211:48: note: expected ‘const TA_FuncInfo **’ {aka ‘const struct TA_FuncInfo **’} but argument is of type ‘TA_FuncInfo **’ {aka ‘struct TA_FuncInfo **’} 211 | const TA_FuncInfo **funcInfo ); | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~ talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_350_ta_getInputParameterInfo’: talib/_ta_lib.c:38977:127: warning: passing argument 3 of ‘TA_GetInputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types] 38977 | __pyx_v_retCode = TA_GetInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); | ~^~~~~~~~~~~~~~ | | | TA_InputParameterInfo ** {aka struct TA_InputParameterInfo **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:442:68: note: expected ‘const TA_InputParameterInfo **’ {aka ‘const struct TA_InputParameterInfo **’} but argument is of type ‘TA_InputParameterInfo **’ {aka ‘struct TA_InputParameterInfo **’} 442 | const TA_InputParameterInfo **info ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_352_ta_getOptInputParameterInfo’: talib/_ta_lib.c:39227:130: warning: passing argument 3 of ‘TA_GetOptInputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types] 39227 | __pyx_v_retCode = TA_GetOptInputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); | ~^~~~~~~~~~~~~~ | | | TA_OptInputParameterInfo ** {aka struct TA_OptInputParameterInfo **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:446:74: note: expected ‘const TA_OptInputParameterInfo **’ {aka ‘const struct TA_OptInputParameterInfo **’} but argument is of type ‘TA_OptInputParameterInfo **’ {aka ‘struct TA_OptInputParameterInfo **’} 446 | const TA_OptInputParameterInfo **info ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ talib/_ta_lib.c: In function ‘__pyx_pf_5talib_7_ta_lib_354_ta_getOutputParameterInfo’: talib/_ta_lib.c:39473:128: warning: passing argument 3 of ‘TA_GetOutputParameterInfo’ from incompatible pointer type [-Wincompatible-pointer-types] 39473 | __pyx_v_retCode = TA_GetOutputParameterInfo(__pyx_f_5talib_7_ta_lib___ta_getFuncHandle(__pyx_v_function_name), __pyx_v_idx, (&__pyx_v_info)); | ~^~~~~~~~~~~~~~ | | | TA_OutputParameterInfo ** {aka struct TA_OutputParameterInfo **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:450:70: note: expected ‘const TA_OutputParameterInfo **’ {aka ‘const struct TA_OutputParameterInfo **’} but argument is of type ‘TA_OutputParameterInfo **’ {aka ‘struct TA_OutputParameterInfo **’} 450 | const TA_OutputParameterInfo **info ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ talib/_ta_lib.c: In function ‘__pyx_f_5talib_7_ta_lib___ta_getFuncHandle’: talib/_ta_lib.c:40072:126: warning: passing argument 2 of ‘TA_GetFuncHandle’ from incompatible pointer type [-Wincompatible-pointer-types] 40072 | __pyx_t_1 = __pyx_f_5talib_7_ta_lib__ta_check_success(__pyx_n_s_TA_GetFuncHandle, TA_GetFuncHandle(__pyx_v_function_name, (&__pyx_v_handle)), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 751, __pyx_L1_error) | ~^~~~~~~~~~~~~~~~ | | | TA_FuncHandle ** {aka unsigned int **} In file included from talib/_ta_lib.c:684: /usr/include/ta-lib/ta_abstract.h:155:52: note: expected ‘const TA_FuncHandle **’ {aka ‘const unsigned int **’} but argument is of type ‘TA_FuncHandle **’ {aka ‘unsigned int **’} 155 | const TA_FuncHandle **handle ); | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~ x86_64-linux-gnu-gcc: fatal error: Killed signal terminated program cc1 compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.

mrjbq7 avatar Jan 12 '22 17:01 mrjbq7