-lmathlib
Description
For the same mathematical function, mathlib supports scalar and vector implementation modes. This option enables the mathlib scalar math library. GCC for openEuler does not maintain mathlib. The open-source mathlib library is used.
Usage
The mathlib depends on the libm. Therefore, the libm must be linked after mathlib is used.
-L/opt/aarch64/compiler/gcc-12.3.1-2025.12-aarch64-linux/lib64 -lmathlib -lm
Result
After the application software is compiled, you can run the ldd command to check whether the executable file successfully calls the mathlib library. Taking a.out as an example, run the following command:
1 | ldd a.out
|
If the information in the red box in the following figure is displayed, the calling is successful. If not, check whether the mathlib library path is loaded to the default path of the system. For details about the configuration method, see the preceding description.
