Skip to content

Commit

Permalink
Add CPU detection and a build system
Browse files Browse the repository at this point in the history
Also split the file
  • Loading branch information
Frechdachs committed Apr 13, 2020
1 parent 642b2fe commit 0d439e5
Show file tree
Hide file tree
Showing 9 changed files with 2,058 additions and 1,737 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@ We now have the original vector `x`.
## Compilation

### Linux

#### With Meson
```
$ meson build
$ ninja -C build
```

#### Manually
```
gcc -std=c99 -shared -fPIC -O2 -march=native descale.c -o libdescale.so
$ gcc -std=c99 -shared -fPIC -O2 -march=native -Isrc -DDESCALE_X86 src/descale.c src/x86/cpuinfo_x86.c src/x86/descale_avx2.c -o libdescale.so
```

### Cross-compilation for Windows
```
x86_64-w64-mingw32-gcc -std=c99 -shared -fPIC -O2 -march=native descale.c -s -o libdescale.dll
$ x86_64-w64-mingw32-gcc -std=c99 -shared -fPIC -O2 -march=native -Isrc -DDESCALE_X86 src/descale.c src/x86/cpuinfo_x86.c src/x86/descale_avx2.c -s -o libdescale.dll
```
Loading

0 comments on commit 0d439e5

Please sign in to comment.