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

static link TA-LIB on Linux

Open elsejj opened this issue 1 year ago • 5 comments

Static linking TA-LIB makes ta-lib-python a self-contained package that does not require TA-LIB to be installed on the target system. This makes it easier to deploy ta-lib-python.

This patch adds several Makefile targets.

  • The new talib_static target downloads and compiles a static version of TA-LIB to the current directory, for use by other build targets.
  • Targets with the suffix _static added to existing build targets link to the static version of TA-LIB.

To support building ta-lib-python with a static version of TA-LIB, the setup.py script has been updated to add a new variable named lib_talib_static_lib. This variable is set to the file name of the static library if the environment variable TA_LINK_STATIC is enabled. The corresponding settings are then made during build_extensions to link the static library.

elsejj avatar Dec 04 '23 05:12 elsejj

Stay tune for release 0.6.0 of TA-Lib.

Multiple new downloadable assets will now include both shared and static libraries, and the autotools + cmake have been "modernized" for building from source on most platforms.

See https://github.com/TA-Lib/ta-lib/tree/main/dist

mario4tier avatar Dec 07 '24 05:12 mario4tier

@mrjbq7 For 0.6.0 there is a src.tar.gz specifically for "autotools source building". (created with "make dist" and now maintained by Github action)

My question is: Would also a similar "CMake source building" asset be useful to this effort here?

(Just trying to prioritize which TA-Lib packaging to work on. If we do not need a "CMake source" asset, then I will just keep working on generating various pre-compiled installation package, with more focus on Windows/MacOS).

mario4tier avatar Dec 08 '24 20:12 mario4tier

My question is: Would also a similar "CMake source building" asset be useful to this effort here?

probably the autotools is sufficient? the one thing i need to work on is bundling the static library into the python module so that it doesn't require a compiler to install, or the previously installed TA-Lib C library.

mrjbq7 avatar Dec 08 '24 20:12 mrjbq7

My question is: Would also a similar "CMake source building" asset be useful to this effort here?

probably the autotools is sufficient? the one thing i need to work on is bundling the static library into the python module so that it doesn't require a compiler to install, or the previously installed TA-Lib C library.

Ok, so I will keep working on static lib packaging (for various OS+arch). I made great progress recently with CPack for Github CI... trying hard to have the 0.6.0 release be our first one to have all its assets produced at the "push of a button".

mario4tier avatar Dec 08 '24 21:12 mario4tier

Update: 0.6.1 is now released.

homebrew was able to build for many macOS variant with autotools.

For windows, a new static lib (.zip) and dead easy .msi are available (x86 64 bits only for now).

mario4tier avatar Dec 24 '24 01:12 mario4tier

Fixed in 0.6.5.

mrjbq7 avatar Aug 07 '25 22:08 mrjbq7