Python: Unable to install TA-lib in Oracle AArch64 VM ubuntu - python-3.x

I unable to Ta-lib, a module for technical analysis in python3 in an always free ARM 64(AArch64) Amepere processor with Ubuntu 20 from Oracle cloud. To verify if the steps I followed are correct, I manage to install successfully in a X64 VM with AMD processor. Thus, I tink AArch64 may need some tweak to install Ta-lib.
The steps I used are below (https://sachsenhofer.io/install-ta-lib-ubuntu-server/)
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar -xzf ta-lib-0.4.0-src.tar.gz
cd ta-lib/
./configure
make
sudo make install
The error I found in my Ubuntu terminal for ./configure as below
<pre>
ta-lib-0.4.0-src.tar.gz 100%[=====================================================================================================>] 1.27M --.-KB/s in 0.03s
2021-09-02 09:32:28 (47.0 MB/s) - ‘ta-lib-0.4.0-src.tar.gz’ saved [1330299/1330299]
<font color="#55FF55"><b>ubuntu#algo3</b></font>:<font color="#5555FF"><b>~</b></font>$ tar -xzf ta-lib-0.4.0-src.tar.gz
<font color="#55FF55"><b>ubuntu#algo3</b></font>:<font color="#5555FF"><b>~</b></font>$ cd ta-lib/
<font color="#55FF55"><b>ubuntu#algo3</b></font>:<font color="#5555FF"><b>~/ta-lib</b></font>$ sudo ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... ./config.guess: unable to guess system type
This script, last modified 2006-07-02, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches#gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2006-07-02
uname -m = aarch64
uname -r = 5.8.0-1037-oracle
uname -s = Linux
uname -v = #38~20.04.1-Ubuntu SMP Fri Jul 16 00:56:44 UTC 2021
/usr/bin/uname -p = aarch64
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = aarch64
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = aarch64
UNAME_RELEASE = 5.8.0-1037-oracle
UNAME_SYSTEM = Linux
UNAME_VERSION = #38~20.04.1-Ubuntu SMP Fri Jul 16 00:56:44 UTC 2021
configure: error: cannot guess build type; you must specify one
<font color="#55FF55"><b>ubuntu#algo3</b></font>:<font color="#5555FF"><b>~/ta-lib</b></font>$
</pre>

It turns out having an installed x86_64 version of TA-Lib will interfere with the installation of the arm64 version of TA-Lib.
please uninstall the x86_64 version of TA-Lib using brew uninstall ta-lib first before installing the arm64 version of TA-Lib.
Some possible debugging:
➜ which brew
/opt/homebrew/bin/brew
➜ brew --prefix ta-lib
/opt/homebrew/opt/ta-lib
➜ file $(brew --prefix ta-lib)/lib/libta_lib.dylib
/opt/homebrew/opt/ta-lib/lib/libta_lib.dylib: Mach-O 64-bit dynamically linked shared library arm64
➜ which python3
/opt/homebrew/bin/python3
➜ file /opt/homebrew/lib/python3.9/site-packages/talib/_ta_lib.cpython-39-darwin.so
/opt/homebrew/lib/python3.9/site-packages/talib/_ta_lib.cpython-39-darwin.so: Mach-O 64-bit bundle arm64
➜ ~ python3
Python 3.9.2 (default, Mar 26 2021, 15:28:17)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import talib
>>> talib.__ta_version__
b'0.4.0 (Nov 25 2020 22:11:03)'

checking build system type... ./config.guess: unable to guess system type
This script, last modified 2006-07-02, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
Just download the newsest config.guess config.sub from the source and repeat the configure & make install progress. ta-lib will install successfully.
ta-lib-config --version
0.4.0

Related

Install gcc on a computing cluster without root privilege and no c compiler installed

Currently I realise that my computing cluster do not have gcc, g++, gfortran and therefore I cannot compile c file or install python libraries with gcc support. I do not have the root privilege of the computing cluster, I cannot use "yum install" or "sudo apt install" to install gcc. So I download the gcc-11.1.0 tar.gz file in my local computer and then upload to the cluster and install it. When I ./configure the gcc, the error messages appear:
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libhsail-rt support... yes
checking for libphobos support... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
I do know that the error comes from no c compiler in the cluster. That is the reason why I want to install gcc to have a c compiler. So I got stuck in the loop where install gcc needs c compiler but I don't have a c compiler such that I download gcc. My problem is that how can I install a c compiler without root privilege and except downloading gcc? I appreciate any comment.
There are vast multiple solutions you can take. For example:
Use docker, if available.
Download whole chroot of your favorite distribution. And chroot into it.
If you can't chroot, use proot.
If you can't proot, run the interpreter from chroot explicitly with the executable path and arguments from chroot and setup LD_LIBRARY_PATH (and maybe some LD_PRELOAD).
if the remote pc does not allow network connection, download stuff to chroot by chroot-ing into it on your pc, then copy it to the remote.
use nix package manager
use pkgsrc package manger
download gcc source to your computer, download dependencies from the remote (glibc, interpreter, headers, maybe some more) to your computer and cross-compile gcc to destination environment and copy the result
just get what distribution is running on the remote and download packaged gcc executable from that distribution package manager repositories
I recommend nix, if it does not work, proot to your favorite Linux distribution.
You would want to research: PATH environment variable, dynamic linker/loader, and man ld.so and LD_* variables configuration, thus how chroot (and docker) works, about user namespaces (thus how proot works).

on macOS compile for armv7l running linux

I want to build https://github.com/relan/exfat for my router on my macbook
# uname -a
Linux RT-N18U 2.6.36.4brcmarm #1 PREEMPT Fri Jan 12 18:35:32 CST 2018 armv7l GNU/Linux
I found following solutions with the corresponding hurdles
https://github.com/tpoechtrager/osxcross - how to set the target?
https://github.com/multiarch/crossbuild - how to build an autoconf project?
During 2nd solution, I get the following error
$ docker run --rm -v ~/workspace/exfat/:/workdir -e CROSS_TRIPLE=armv7l multiarch/crossbuild autoreconf --install
configure.ac:32: installing './ar-lib'
configure.ac:29: installing './compile'
configure.ac:28: installing './install-sh'
configure.ac:28: installing './missing'
dump/Makefile.am: installing './depcomp'
$ docker run --rm -v ~/workspace/exfat/:/workdir -e CROSS_TRIPLE=armv7l multiarch/crossbuild ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
...
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
./configure: line 4080: syntax error near unexpected token `FUSE,'
./configure: line 4080: `PKG_CHECK_MODULES(FUSE, fuse)'

gcc on my linux system is installed, still giving failure in installation

When I tried to install libxml2 on my linux server, it is giving me following error. Gcc on my machine is installed as well as fully updated, still it gives me error that your C compiler is not working, can anyone give me suggestion how to overcome it.
[root#localhost libxml2-2.8.0]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/root/tmpdir/libxml2-2.8.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
Just a few comments, not necessarily a solution... Do not use root for everyday usage (for me compiling libxml2 is an everyday situation). I would advise to create a "normal" user, and use it to work on your computer. configure, make with that user, and then sudo make install.
Then, depending on your Linux, I am almost sure there is a package for libxml2 and libxml2-devel. Try to install that, instead of manually compiling. This install by compile approach after some time tends to bring chaos to your computer...
Edit: To answer your comment:
get the RPM: wget ftp://rpmfind.net/linux/fedora/linux/development/rawhide/x86_64/os/Packages/l/libxml2-2.9.1-2.fc20.x86_64.rpm
(up here be sure about your architecture, select the correct one, last column)
install the RPM: [sudo] yum --nogpgcheck localinstall libxml2-2.9.1-2.fc20.x86_64.rpm
you might or might not need sudo... if you run this as root you will not need it.
As in your output C compiler cannot create executables
Can you compile simple c file using gcc
in the configure file it checks the following
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
does gcc without -o option provide executable file

XSP Configure fails due to mono module dependancy

I have mono installed in my RHEL 5 machine which is visible as follows:
which mono
/usr/local/bin/mono
mono -V
Mono JIT compiler version 2.10.2 (tarball Wed Oct 16 10:33:49 CDT 2013)
Copyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
When i try to run the configure script for xsp, it fails since it could not find mono.
./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... (cached) gawk
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for MONO_MODULE... configure: error: Package requirements (mono >= 2.10.0) were not met:
No package 'mono' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables MONO_MODULE_CFLAGS
and MONO_MODULE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I tried to resolve this by adding the mono.pc file path to PKG_CONFIG_PATH.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
But the issue didn't get resolved and i got the same error nonetheless.
Please help me in finding a resolution for this issue.
Try following this guide: Setting up a Build Environment (with MONO_PREFIX=/usr/local and forget about the gnome parts).
Check the correct location of pkgconfig in your mono installation.I was running with the same error until i found that it was under
/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/pkgconfig/

problems with ./configure for libtorrent on linux

Hell I have been having an extremely tough time installing libtorrent and am unsure what the problems are. I have seen plenty similar errors online but the solutions were not helpful and I am pretty sure the error message is just too vague for comparison.
When I run ./configure I get
**
Building libtorrent-rasterbar 0.16.5
Checking for a C/C++ compiler to use:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether g++ understands -c and -o together... yes
.
..
.
Checking for boost libraries:
checking for boostlib >= 1.36... yes
checking whether the Boost::System library is available... yes
configure: error: Boost.System library not found. Try using --with-boost-system=lib
**
I then use the suggestion and the difference is that the bottom says
**
Checking for boost libraries:
checking for boostlib >= 1.36... yes
checking whether the Boost::System library is available... yes
checking for exit in -llib... no
checking for exit in -lboost_system-lib... no
configure: error: Could not link against boost_system-lib !
**
the config.log file has an error
**
configure:16572: result: no
configure:16537: checking for exit in -lboost_system-lib
configure:16562: gcc -o conftest -lpthread -g -O2 -fvisibility=hidden -I/usr/include -L/usr/lib conftest.c -lboost_system-lib -lpthread >&5
conftest.c:33: warning: conflicting types for built-in function 'exit'
/usr/bin/ld: cannot find -lboost_system-lib
collect2: ld returned 1 exit status
**
Any insight would be enormously appreciated
after installing
apt-get install libboost-system-dev
apt-get install libboost-filesystem-dev libboost-thread-dev
Checking features to be enabled:
checking whether encryption support should be enabled... yes
configure: encryption support: now checking for the OpenSSL library...
checking for pkg-config... /usr/bin/pkg-config
checking for openssl/ssl.h in /usr/local/ssl... no
checking for openssl/ssl.h in /usr/lib/ssl... no
checking for openssl/ssl.h in /usr/ssl... no
checking for openssl/ssl.h in /usr/pkg... no
checking for openssl/ssl.h in /usr/local... no
checking for openssl/ssl.h in /usr... no
checking whether compiling and linking against OpenSSL works... no
configure: error: OpenSSL library not found. Try using --with-openssl=DIR or disabling encryption at all.
You need to install libboost-system.
If you are using Debian/Ubuntu, use apt-get as follows.
$ apt-get install libboost-system-dev
You may also need to install ...
$ apt-get install libboost-filesystem-dev libboost-thread-dev
The easiest way to install all the dependencies is with apt-get.
sudo apt-get build-dep python-libtorrent
I know this is a bit old, but to solve your OpenSSL problem you need to install the OpenSSL libraries with sudo apt-get install libssl-dev.
For CentOS users, you will want to install boost-devel.
# yum install boost-devel
But I still got the same error. Just want to point out one more thing, the CentOS 6.4 I work with had an old gcc compiler:
# g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Installing a newer version of gcc helped me to get rid of that particular error. I used g++ (GCC) 4.8.2 version and this time calling the following command worked:
# ./configure --with-boost-libdir=/usr/lib64
After this point you might still run into not finding openssl headers like the OP posted here, this post will help to overcome the error. You may have to install openssl-devel (for CentOS) or libssl-dev (for Debian), or you can run with
# ./configure --with-boost-libdir=/usr/lib64 --without-ssl
If you have openssl headers installed in your system, you don't need to use --with-openssl flag, or at least I didn't need to use it.
Although this is old post, hope it will help someone else like me.
To avoid OpenSSL issues you can build "libtorrent-rasterbar" disabling OpenSSL encryption.
For instance:
./configure --disable-debug --disable-encryption --prefix=/opt/libtorrent-rasterbar
And then "make" + "make install"
Regards
The accepted answer didn't work for me. What did work was editing the configure script file and removing those lines from it:
if test -z "$BOOST_SYSTEM_LIB"; then :
as_fn_error $? "Boost.System library not found. Try using --with-boost-system=lib" "$LINENO" 5
fi
Those lines seemed to check that the BOOST_SYSTEM_LIB environment variable exists and is not empty.
For Arch users (ex. Manjaro) install the boost pkg from pacman. Search for "boost" and install from Official Repo(extra).

Resources