Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.43 KB

File metadata and controls

50 lines (34 loc) · 1.43 KB

Sprachen: English | 简体中文 | 繁體中文 | 日本語 | 한국어 | Français | Deutsch | Español | Italiano | Русский | العربية

← NeverC Beispiele

Linux Math + zlib Beispiel

Mathematische Bibliotheksfunktionen und zlib-Kompression. Verwendet -lm und -lz.

NeverC bündelt ein Linux-Sysroot (Ubuntu 22.04, glibc 2.35) in runtime/linux/.

Erstellung

cd examples/linux-math
neverc make          # debug: -g (Standard beim ersten Build)
neverc make release  # release: -O2 --strip
neverc make debug    # zurück zu debug

Das Makefile speichert PROFILE, sodass spätere neverc make-Aufrufe dieselbe debug/release-Auswahl behalten. Release nutzt NeverCs integriertes --strip: Debug-Metadaten und unnötige statische Symbolnamen entfallen, benötigte Loader-/Dynamik-ABI-Namen bleiben. Siehe Release-Builds.

AArch64:

neverc make TARGET=aarch64-linux-gnu

Manuelle Erstellung

neverc --target=x86_64-linux-gnu -Wall -lm -lz -o math-demo main.c

Ausführung

chmod +x math-demo
./math-demo

Funktionen

  • Trigonometrie: sin/cos/tan
  • Spezielle Funktionen: exp, tgamma, erf
  • zlib Kompression/Dekompression, CRC32