openlibm | High quality system independent , portable , open source | Math library
kandi X-RAY | openlibm Summary
kandi X-RAY | openlibm Summary
OpenLibm is an effort to have a high quality, portable, standalone C mathematical library (libm). It can be used standalone in applications and programming language implementations. The project was born out of a need to have a good libm for the Julia programming language that worked consistently across compilers and operating systems, and in 32-bit and 64-bit environments.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of openlibm
openlibm Key Features
openlibm Examples and Code Snippets
Community Discussions
Trending Discussions on openlibm
QUESTION
I have a centOS machine that I do not have sudo access.
I needed to use librosa
python package so I have installed Anaconda and installed the package through conda.
However, when I import this package I get ImportError: /lib64/libm.so.6: version 'GLIBC_2.23' not found
.
Therefore, I attempted to resolve this issue by installing different library files including
- https://anaconda.org/conda-forge/openlibm
- https://anaconda.org/asmeurer/glibc
- https://anaconda.org/groakat/libc
Unfortunately, all of these didn't work out. Some even cause every command to segfault.
Does anyone know any other package or tricks I can try?
Thank you
...ANSWER
Answered 2019-Jul-29 at 07:07CentOS already comes with libm.so.6
preinstalled, but the version is too old. It is 2.17 in CentOS 7 and 2.12 in CentOS 6. The software you are trying to use has been built for at least glibc 2.23, or later version. You will have to obtain a copy of the software built for the CentOS version you use, or build the software yourself from source.
QUESTION
I'm porting a C and C++ library that currently works on iOS to be used on an Android application. I'm down to these last 3 linker errors (obfuscated for privacy reasons):
/Users/fer662/projects/xxx/jni/xxx_preprocessing.c:10184: error: undefined reference to 'cexp' /Users/fer662/projects/xxx/jni/xxx_preprocessing.c:10184: error: undefined reference to 'cpowf' /Users/fer662/projects/xxx/jni/xxx_preprocessing.c:10285: error: undefined reference to 'cabs'
Now I understand these normally come from linking with libm.so (-lm), but i'm doing that already. If I go and check the offending so with nm:
nm -g /Users/fer662/Library/Android/sdk/ndk-bundle/platforms/android-22/arch-x86/usr/lib/libm.so | grep cpow
Nothing comes back. It DOES hoever, if I use api 28
...ANSWER
Answered 2018-Dec-14 at 19:50tl;dr: yes, static linking libm.a should be fine
Check the libm.map.txt file: https://android.googlesource.com/platform/bionic/+/master/libm/libm.map.txt#289
These functions weren't added to Android until O.
Also, in the static library it does show, even on api 22
The static library isn't an API 22 static library. It's actually a ToT build from AOSP. If you're going to static link something, there's no point in using something old.
The reason it (there's actually only one version of libc.a/libm.a per ABI) is duplicated into each API directory is because build systems made for old NDKs expect it. If you look at the unified toolchain in r19 (toolchains/llvm/prebuilts/$HOST), you'll see that there's only one copy per ABI.
The inconsistency is puzzling. Shouldn't it be missing from the header altogether if not supported? Why does the static lib have it and the dylib not?
The header has an ifdef guard that hides it: https://android.googlesource.com/platform/prebuilts/ndk/+/dev/platform/sysroot/usr/include/complex.h#237
If you had a declaration for these functions and you think you were building for API 22, there's something wrong with your build system.
Would it make sense to statically link against it? And if so, how would I do it, taking into account the right path for the current api version?
In general for these sorts of problems this isn't a good solution since the Zygote has already loaded a libc, and loading another one can lead to all sorts of issues since they can conflict. Additionally, much of libc's networking is actually dispatched to netd, and the protocol between libc and netd has changed in the past (and is unfortunately not a versioned protocol).
Building with libc.a is only viable with standalone executables (think strace and gdbserver) rather than apps, and even then only if you don't need networking.
That said, libm.a is much simpler. The complex interactions that make libc.a unusable for apps don't affect libm. The only time you'll end up actually running code in libm is when the compiler somehow failed to inline the operation. Static linking libm.a into your application should be fine.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install openlibm
Use make USEGCC=1 to build with GCC. This is the default on Linux and Windows.
Use make USECLANG=1 to build with clang. This is the default on OS X, FreeBSD, and OpenBSD.
Use make ARCH=wasm32 to build the wasm32 library with clang. Requires clang-8.
Architectures are auto-detected. Use make ARCH=i386 to force a build for i386. Other supported architectures are i486, i586, and i686. GCC 4.8 is the minimum requirement for correct codegen on older 32-bit architectures.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page