move all targets to build.bqn with Singeli & REPLXX enabled by default
This commit is contained in:
parent
9ae4cfb5d0
commit
a3e8a1388d
97
README.md
97
README.md
@ -4,53 +4,74 @@
|
|||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
1. `make REPLXX=1`
|
1. `make`
|
||||||
- Third-party packages and other ways to run BQN are listed [here](https://mlochbaum.github.io/BQN/running.html)
|
- Third-party packages and other ways to run BQN are listed [here](https://mlochbaum.github.io/BQN/running.html)
|
||||||
- Add `CC=cc` if `clang` isn't installed
|
- Add `CC=cc` if `clang` isn't installed
|
||||||
- Add `FFI=0` if your system doesn't have libffi (if `pkg-config` doesn't exist, extra configuration may be necessary to allow CBQN to find libffi)
|
- Add `FFI=0` if your system doesn't have libffi (if `pkg-config` doesn't exist, extra configuration may be necessary to allow CBQN to find libffi)
|
||||||
- Use `gmake` on BSD (a `NO_LDL=1` make arg may be useful if the linker complains about `-ldl`)
|
- Use `gmake` on BSD
|
||||||
- Remove `REPLXX=1` if it causes issues (will remove line editing/coloring/name completion in the REPL)
|
- Add `REPLXX=0` if C++ is unavailable (will remove line editing/coloring/name completion in the REPL)
|
||||||
- Run `sudo make install` afterwards to install into `/usr/local/bin/bqn` (a `PREFIX=/some/path` argument will install to `/some/path/bin/bqn`); `sudo make uninstall` to uninstall
|
- Run `sudo make install` afterwards to install into `/usr/local/bin/bqn` (a `PREFIX=/some/path` argument will install to `/some/path/bin/bqn`); `sudo make uninstall` to uninstall
|
||||||
- `make clean` if anything breaks and you want a clean build slate
|
- `make clean` if anything breaks and you want a clean build slate
|
||||||
2. `./BQN somefile.bqn` to execute a file, or `./BQN` for a REPL (or `rlwrap ./BQN` if replxx wasn't enabled)
|
2. `./BQN somefile.bqn` to execute a file, or `./BQN` for a REPL
|
||||||
|
|
||||||
## Configuration options
|
## Configuration options
|
||||||
|
|
||||||
- Builds with more performance:
|
The default configuration enables REPLXX & Singeli, and, if not done before, implicitly runs `make for-build` to build a CBQN for running `build/src/build.bqn` and compiling Singeli.
|
||||||
- `make o3n-singeli` - native for the current processor (i.e. `-march=native`); on x86-64 this assumes & uses AVX2 (and, if available, also BMI2)
|
|
||||||
- `make o3-singeli` - generic build for the current architecture; on x86-64 this uses SSE2 (i.e. 128-bit vectors (AVX2 being 256-bit), among other things), on aarch64 - NEON. (on other architectures this also works and provides some performance improvements, but won't include any more SIMD optimizations)
|
|
||||||
Therefore, on x86-64, `o3n-singeli` is highly recommended, but on aarch64 `o3-singeli` is enough.
|
|
||||||
- `make o3-singeli has=avx2` - generic build for any x86-64 CPU that supports AVX2 (won't utilize BMI2 though; `has='avx2 bmi2'` to assume both AVX2 & BMI2)
|
|
||||||
- `make o3n-singeli has=slow-pdep` - build tuned for AMD Zen 1/Zen 2 CPUs, which have BMI2, but their pdep/pext instructions are extremely slow
|
|
||||||
- Target architecture is decided from `uname` - override with `target_arch=...` (valid values being `x86-64`, `aarch64`, `generic`). For native builds, targeted extensions are decided by `/proc/cpuinfo` (or `sysctl machdep.cpu` on macOS), and C macro checks.
|
|
||||||
|
|
||||||
- Build flags:
|
### Builds with more performance
|
||||||
- `CC=...` - choose a different C compiler (default is `clang`)
|
|
||||||
- `CXX=...` - choose a different C++ compiler (default is `c++`)
|
|
||||||
- `f=...` - add extra C compiler flags for CBQN file compilation
|
|
||||||
- `lf=...` - add extra linking flags
|
|
||||||
- `CCFLAGS=...` - add flags for all CC/CXX/linking invocations
|
|
||||||
- `REPLXX=0`/`REPLXX=1` - enable/disable replxx (default depends on the target and may change in the future)
|
|
||||||
- `REPLXX_FLAGS=...` - override replxx build flags (default is `-std=c++11 -Os`)
|
|
||||||
- `CXXFLAGS=...` - add additional CXX flags
|
|
||||||
- `FFI=0` - disable libffi usage
|
|
||||||
- `j=8` to override the default parallel job count
|
|
||||||
- `OUTPUT=path/to/somewhere` - change output location; for `emcc-o3` it will be the destination folder of `BQN.js` and `BQN.wasm`, for everything else - the filename
|
|
||||||
- For build targets which use build.bqn (currently all the `-singeli` & `shared-` ones), `target_arch` and `target_os` options can be added, specifying the target architecture/OS (mostly just changing library loading defaults/Singeli configuration; if cross-compiling, further manual configuration will be necessary)
|
|
||||||
- Alternatively, `build/build` (aka build.bqn) can be invoked manually, though note that it has slightly different argument naming (see `build/build --help`), doesn't have predefined build types (i.e. `make o3ng-singeli` is `build/build replxx singeli native g`), and may be slightly less stable
|
|
||||||
|
|
||||||
- More build types:
|
(TL;DR: use `make o3n` for local builds on x86-64, but `make` is fine on other architectures)
|
||||||
- `make o3` - `-O3`; currently the default build
|
|
||||||
- `make shared-o3` - produce a shared library `libcbqn.so`/`libcbqn.dylib`/`cbqn.dll`
|
The default target (`make o3`) will target optimizations for the current architecture, but not any further extensions the specific CPU may have.
|
||||||
- `make o3g` - `-O3 -g`
|
|
||||||
- `make o3g-singeli` / `make o3ng-singeli` - Singeli builds with `-g`
|
Thus, performance can be significantly improved by targeting the specific CPU via `make o3n` (with the usual drawback of `-march=native` of it not producing a binary portable to other CPUs of the same architecture).
|
||||||
- `make debug` - unoptimized build with extra assertion checks (also includes `-g`)
|
|
||||||
- `make debug1` - debug build without parallel compilation. Useful if everything errors, and you don't want error messages from multiple threads to be printed at the same time.
|
On x86-64, a native build will enable usage of AVX2 (i.e. ability to use 256-bit SIMD vectors instead of 128-bit ones, among other things), and BMI2 if available. But, on aarch64, NEON is always available, so a native build won't give significant benefits.
|
||||||
- `make c` - a build with minimal default settings, for manual customizing
|
|
||||||
- `make shared-c` - like `make c` but for a shared library
|
To produce a binary utilizing AVX2 not specific to any processor, it's possible to do `make o3 has=avx2`. (`has='avx2 bmi2'` for targeting both AVX2 & BMI2)
|
||||||
- `make single-(o3|o3g|debug|c)` - compile everything as a single translation unit. Won't have incremental/parallel compilation, and isn't supported for many configurations
|
|
||||||
- `make emcc-o3` - build with Emscripten `emcc`
|
Additionally, on AMD Zen 1 & Zen 2, `make o3n has=slow-pdep` will further improve certain builtins (Zen 1/2 support BMI2, but their implementation of `pdep`/`pext` is so slow that not using it for certain operations is very beneficial).
|
||||||
- `make wasi-o3` - build targeting WASI
|
|
||||||
|
CBQN currently does not utilize AVX-512 or SVE, or have any SIMD optimizations specific to any architectures other than x86-64 and aarch64.
|
||||||
|
|
||||||
|
For native builds, targeted extensions are determined by `/proc/cpuinfo` (or `sysctl machdep.cpu` on macOS) and C macros defined as a result of `-march=native`.
|
||||||
|
|
||||||
|
### Build flags
|
||||||
|
|
||||||
|
`CC=...` - choose a different C compiler (default is `clang`)
|
||||||
|
`CXX=...` - choose a different C++ compiler (default is `c++`)
|
||||||
|
`OUTPUT=path/to/somewhere` - change output location; for `emcc-o3` it will be the destination folder of `BQN.js` and `BQN.wasm`, for everything else - the filename
|
||||||
|
`target_arch=(x86-64|aarch64|generic)` - target architecture. Inferred from `uname` by default. Used for deciding target optimizations.
|
||||||
|
`target_os=(linux|bsd|macos|windows)` - target OS. Inferred from `uname` by default. Used for determining default output names and slight configuration changes.
|
||||||
|
`j=8` - override the default parallel job count (default is the output of `nproc`)
|
||||||
|
`notui=1` - display build progress in a plain-text format
|
||||||
|
`version=...` - specify the version to report in `--version` (default is commit hash)
|
||||||
|
|
||||||
|
`REPLXX=0` - disable REPLXX (as a result of which C++ won't be used)
|
||||||
|
`singeli=0` - disable usage of Singeli
|
||||||
|
`FFI=0` - disable `•FFI`, thus not depending on libffi
|
||||||
|
|
||||||
|
`f=...` - add extra C compiler flags for CBQN file compilation
|
||||||
|
`lf=...` - add extra linking flags (`LDFLAGS` is a synonym)
|
||||||
|
`CCFLAGS=...` - add flags for all CC/CXX/linking invocations
|
||||||
|
`REPLXX_FLAGS=...` - override replxx build flags (default is `-std=c++11 -Os`)
|
||||||
|
`CXXFLAGS=...` - add additional CXX flags
|
||||||
|
|
||||||
|
Alternatively, `build/build` (aka build.bqn) can be invoked manually, though note that it has slightly different argument naming (see `build/build --help`) and doesn't have predefined build types (i.e. `make o3ng` is done as `build/build replxx singeli native g`)
|
||||||
|
|
||||||
|
### More build types
|
||||||
|
|
||||||
|
- `make o3` - the default build
|
||||||
|
- `make o3g` - effectively `make o3 f=-g` (custom `f=...` can still be added on)
|
||||||
|
- `make c` - `make o3` but without `-O3`
|
||||||
|
- `make shared-o3` - produce a shared library `libcbqn.so`/`libcbqn.dylib`/`cbqn.dll`
|
||||||
|
- `make shared-c` - like `make c` but for a shared library
|
||||||
|
- `make emcc-o3` - build with Emscripten `emcc`
|
||||||
|
- `make wasi-o3` - build targeting WASI
|
||||||
|
- `make wasi-reactor-o3` - build producing a WASI Reactor
|
||||||
|
- `make debug` - unoptimized build with extra assertion checks (also includes `-g`)
|
||||||
|
|
||||||
|
All of the above will go through build.bqn. If that causes problems, `make o3-makeonly` or `make c-makeonly` can be used. These still enable REPLXX by default, but do not support Singeli. Furthermore, these targets don't support some of the build flags that the others do.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@ -108,7 +129,7 @@ You must manually set up a cross-compilation environment. It's possible to pass
|
|||||||
|
|
||||||
A `target_arch=(x86-64|aarch64|generic)` make argument must be present (`generic` will work always, but a more specific argument will enable significant optimizations), as the default is to choose based on `uname`.
|
A `target_arch=(x86-64|aarch64|generic)` make argument must be present (`generic` will work always, but a more specific argument will enable significant optimizations), as the default is to choose based on `uname`.
|
||||||
|
|
||||||
Furthermore, most build targets will need a non-cross-compiled version of CBQN at build time to run Singeli and/or the build system. For those, a `make for-build` will need to be ran before the primary build, configured to not cross-compile. (this step only needs a C compiler (default is `CC=cc` here), and doesn't need libffi, nor a C++ compiler).
|
Furthermore, all build targets (except `-makeonly` ones) will need a non-cross-compiled version of CBQN at build time to run build.bqn and (if enabled) Singeli. For those, a `make for-build` will need to be ran before the primary build, configured to not cross-compile. (this step only needs a C compiler (default is `CC=cc` here), and doesn't need libffi, nor a C++ compiler).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@ -216,9 +216,9 @@ po ← { # parsed options
|
|||||||
{𝕊: "Target: "∾os∾" "∾arch∾ 1↓ ∾", "⊸∾¨ has∾native/⋈"native"} _verboseLog@
|
{𝕊: "Target: "∾os∾" "∾arch∾ 1↓ ∾", "⊸∾¨ has∾native/⋈"native"} _verboseLog@
|
||||||
|
|
||||||
{𝕊:
|
{𝕊:
|
||||||
Log⍟((0=≠has) ∧ @≡GetOpt"native") ∾⟨
|
Log⍟((¬compat) ∧ (0=≠has) ∧ @≡GetOpt"native") ∾⟨
|
||||||
"Note: on x86-64, a generic build doesn't include many optimizations; ",
|
"Note: on x86-64, a generic build doesn't include many optimizations; ",
|
||||||
compat⊑"add an argument of 'native' or 'has=avx2' if possible; add 'native=0' to hide"‿"use 'make o3n-singeli' (targets the current CPU, assumes AVX2) or 'make o3-singeli has=avx2' if possible"
|
compat⊑"add an argument of 'native' or 'has=avx2' if possible; add 'native=0' to hide"‿"use 'make o3n' (targets the current CPU, assumes AVX2) or 'make o3 has=avx2' if possible"
|
||||||
⟩
|
⟩
|
||||||
}⍟⊢ (arch≡"x86-64") ∧ singeli ∧ ¬avx2
|
}⍟⊢ (arch≡"x86-64") ∧ singeli ∧ ¬avx2
|
||||||
|
|
||||||
|
|||||||
128
makefile
128
makefile
@ -2,34 +2,16 @@ SHELL = /usr/bin/env bash
|
|||||||
MAKEFLAGS+= --no-print-directory --no-builtin-rules --no-builtin-variables
|
MAKEFLAGS+= --no-print-directory --no-builtin-rules --no-builtin-variables
|
||||||
# note: do not manually define any i_… arguments, or incremental compiling will not work properly!
|
# note: do not manually define any i_… arguments, or incremental compiling will not work properly!
|
||||||
|
|
||||||
# various configurations
|
default: o3
|
||||||
o3:
|
|
||||||
@"${MAKE}" i_singeli=0 i_t=o3 i_f="-O3" run_incremental_0
|
# targets that only use the makefile
|
||||||
o3g:
|
for-build: # for running the build system & Singeli
|
||||||
@"${MAKE}" i_singeli=0 i_t=o3g i_f="-O3 -g" run_incremental_0
|
|
||||||
o3n:
|
|
||||||
@"${MAKE}" i_singeli=0 i_t=o3n i_f="-O3 -march=native" run_incremental_0
|
|
||||||
debug:
|
|
||||||
@"${MAKE}" i_singeli=0 i_t=debug i_f="-g -DDEBUG" run_incremental_0
|
|
||||||
debug1:
|
|
||||||
@"${MAKE}" i_singeli=0 i_t=debug1 i_f="-g -DDEBUG" manualJobs=1 run_incremental_0
|
|
||||||
rtperf:
|
|
||||||
@"${MAKE}" i_singeli=0 i_t=rtperf i_f="-O3 -DRT_PERF" run_incremental_0
|
|
||||||
rtverify:
|
|
||||||
@"${MAKE}" i_singeli=0 i_t=rtverify i_f="-DDEBUG -O3 -DRT_VERIFY" run_incremental_0
|
|
||||||
heapverify:
|
|
||||||
@"${MAKE}" i_singeli=0 i_t=heapverify i_f="-DDEBUG -g -DHEAP_VERIFY" run_incremental_0
|
|
||||||
wasi-o3:
|
|
||||||
@"${MAKE}" to-bqn-build REPLXX=0 i_build_opts="wasi"
|
|
||||||
wasi-reactor-o3:
|
|
||||||
@"${MAKE}" to-bqn-build REPLXX=0 i_build_opts="wasi" i_SHARED=1
|
|
||||||
emcc-o3:
|
|
||||||
@"${MAKE}" to-bqn-build REPLXX=0 i_build_opts="emcc"
|
|
||||||
for-build:
|
|
||||||
@"${MAKE}" i_singeli=0 i_CC=cc REPLXX=0 i_t=forbuild i_f="-O2 -DFOR_BUILD" i_FFI=0 i_SHARED=0 i_PIE= i_CC_PIE= i_EXPORT=0 i_OUTPUT_DEF=build/obj2/for_build2 run_incremental_0
|
@"${MAKE}" i_singeli=0 i_CC=cc REPLXX=0 i_t=forbuild i_f="-O2 -DFOR_BUILD" i_FFI=0 i_SHARED=0 i_PIE= i_CC_PIE= i_EXPORT=0 i_OUTPUT_DEF=build/obj2/for_build2 run_incremental_0
|
||||||
for-bootstrap:
|
for-bootstrap: # for bootstrapping bytecode
|
||||||
@"${MAKE}" i_t=for_bootstrap i_f='-DNATIVE_COMPILER -DONLY_NATIVE_COMP -DFORMATTER=0 -DNO_RT -DNO_EXPLAIN' run_incremental_0 i_USE_BC_SUBMODULE=0 BYTECODE_DIR=bytecodeNone
|
@"${MAKE}" i_t=for_bootstrap i_f='-DNATIVE_COMPILER -DONLY_NATIVE_COMP -DFORMATTER=0 -DNO_RT -DNO_EXPLAIN' run_incremental_0 i_USE_BC_SUBMODULE=0 BYTECODE_DIR=bytecodeNone
|
||||||
c:
|
o3-makeonly:
|
||||||
|
@"${MAKE}" i_singeli=0 i_t=o3 i_f="-O3" run_incremental_0
|
||||||
|
c-makeonly:
|
||||||
@"${MAKE}" custom=1 run_incremental_0
|
@"${MAKE}" custom=1 run_incremental_0
|
||||||
|
|
||||||
i_notui=0
|
i_notui=0
|
||||||
@ -41,6 +23,11 @@ ifeq ($(origin REPLXX),command line)
|
|||||||
else
|
else
|
||||||
i_REPLXX_1 = 1
|
i_REPLXX_1 = 1
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(origin singeli),command line)
|
||||||
|
i_singeli_1 = "$(singeli)"
|
||||||
|
else
|
||||||
|
i_singeli_1 = 1
|
||||||
|
endif
|
||||||
|
|
||||||
to-bqn-build:
|
to-bqn-build:
|
||||||
ifeq ($(origin builddir),command line)
|
ifeq ($(origin builddir),command line)
|
||||||
@ -55,38 +42,53 @@ endif
|
|||||||
LD_LIBS="$(LD_LIBS)" NO_LDL="$(NO_LDL)" no_fPIC="$(no_fPIC)" \
|
LD_LIBS="$(LD_LIBS)" NO_LDL="$(NO_LDL)" no_fPIC="$(no_fPIC)" \
|
||||||
c="$(build_c)" debug="$(debug)" $(i_build_opts) $(build_opts) \
|
c="$(build_c)" debug="$(debug)" $(i_build_opts) $(build_opts) \
|
||||||
os="$(target_os)" arch="$(target_arch)" has="$(has)" \
|
os="$(target_os)" arch="$(target_arch)" has="$(has)" \
|
||||||
shared="$(i_SHARED)" singeli="$(i_singeli)" replxx="$(REPLXX)" FFI="$(FFI)"
|
shared="$(i_SHARED)" singeli="$(i_singeli_1)" replxx="$(i_REPLXX_1)" FFI="$(FFI)"
|
||||||
|
|
||||||
o3-temp:
|
# targets that go to build.bqn
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1)
|
o3:
|
||||||
o3n-temp:
|
@"${MAKE}" to-bqn-build
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) i_build_opts="native"
|
o3g:
|
||||||
debug-temp:
|
@"${MAKE}" to-bqn-build i_build_opts="g"
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) build_c=1 i_build_opts="heapverify debug"
|
o3n:
|
||||||
heapverify-temp:
|
@"${MAKE}" to-bqn-build i_build_opts="native"
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) build_c=1 i_build_opts="heapverify debug"
|
o3ng:
|
||||||
|
@"${MAKE}" to-bqn-build i_build_opts="native g"
|
||||||
|
c:
|
||||||
|
@"${MAKE}" to-bqn-build build_c=1
|
||||||
|
|
||||||
o3-singeli:
|
debug:
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) singeli=1
|
@"${MAKE}" to-bqn-build build_c=1 i_build_opts="debug"
|
||||||
o3g-singeli:
|
heapverify:
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) singeli=1 i_build_opts="g"
|
@"${MAKE}" to-bqn-build build_c=1 i_build_opts="debug heapverify"
|
||||||
|
rtverify:
|
||||||
o3n-singeli:
|
@"${MAKE}" to-bqn-build i_build_opts="debug rtverify"
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) singeli=1 i_build_opts="native"
|
|
||||||
o3ng-singeli:
|
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) singeli=1 i_build_opts="native g"
|
|
||||||
|
|
||||||
debugn-singeli:
|
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) singeli=1 i_build_opts="native debug o3=0"
|
|
||||||
heapverifyn-singeli:
|
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) singeli=1 i_build_opts="native debug o3=0 heapverify"
|
|
||||||
rtverifyn-singeli:
|
|
||||||
@"${MAKE}" to-bqn-build REPLXX=$(i_REPLXX_1) singeli=1 i_build_opts="native rtverify"
|
|
||||||
|
|
||||||
|
debugn:
|
||||||
|
@"${MAKE}" to-bqn-build build_c=1 i_build_opts="native debug"
|
||||||
|
heapverifyn:
|
||||||
|
@"${MAKE}" to-bqn-build build_c=1 i_build_opts="native debug heapverify"
|
||||||
|
rtverifyn:
|
||||||
|
@"${MAKE}" to-bqn-build i_build_opts="native rtverify"
|
||||||
|
|
||||||
|
wasi-o3:
|
||||||
|
@"${MAKE}" to-bqn-build REPLXX=0 i_build_opts="wasi"
|
||||||
|
wasi-reactor-o3:
|
||||||
|
@"${MAKE}" to-bqn-build REPLXX=0 i_build_opts="wasi" i_SHARED=1
|
||||||
|
emcc-o3:
|
||||||
|
@"${MAKE}" to-bqn-build REPLXX=0 i_build_opts="emcc"
|
||||||
shared-o3:
|
shared-o3:
|
||||||
@"${MAKE}" to-bqn-build i_SHARED=1
|
@"${MAKE}" to-bqn-build REPLXX=0 i_SHARED=1
|
||||||
shared-c:
|
shared-c:
|
||||||
@"${MAKE}" to-bqn-build i_SHARED=1 i_build_opts=c
|
@"${MAKE}" to-bqn-build REPLXX=0 i_SHARED=1 i_build_opts=c
|
||||||
|
|
||||||
|
# mappings of old names
|
||||||
|
o3-singeli: o3
|
||||||
|
o3g-singeli: o3g
|
||||||
|
o3n-singeli: o3n
|
||||||
|
o3ng-singeli: o3ng
|
||||||
|
debugn-singeli: debugn
|
||||||
|
heapverifyn-singeli: heapverifyn
|
||||||
|
rtverifyn-singeli: rtverifyn
|
||||||
|
|
||||||
# compiler setup
|
# compiler setup
|
||||||
i_CC := clang
|
i_CC := clang
|
||||||
@ -149,7 +151,7 @@ ifeq ($(origin LD_LIBS),command line)
|
|||||||
i_LIBS_LD := $(LD_LIBS)
|
i_LIBS_LD := $(LD_LIBS)
|
||||||
custom = 1
|
custom = 1
|
||||||
endif
|
endif
|
||||||
ifeq ($(REPLXX),1)
|
ifeq ($(i_REPLXX_1),1)
|
||||||
i_PIE += -fPIE
|
i_PIE += -fPIE
|
||||||
i_CC_PIE := -fPIE
|
i_CC_PIE := -fPIE
|
||||||
endif
|
endif
|
||||||
@ -173,7 +175,7 @@ endif
|
|||||||
ifeq ($(origin LDFLAGS),command line)
|
ifeq ($(origin LDFLAGS),command line)
|
||||||
custom = 1
|
custom = 1
|
||||||
endif
|
endif
|
||||||
ifeq ($(REPLXX),1)
|
ifeq ($(i_REPLXX_1),1)
|
||||||
i_f+= -DREPLXX_STATIC=1
|
i_f+= -DREPLXX_STATIC=1
|
||||||
custom = 1
|
custom = 1
|
||||||
REPLXX_DIR = $(shell if [ -d build/replxxLocal ]; then echo build/replxxLocal; else echo build/replxxSubmodule; fi)
|
REPLXX_DIR = $(shell if [ -d build/replxxLocal ]; then echo build/replxxLocal; else echo build/replxxSubmodule; fi)
|
||||||
@ -203,7 +205,7 @@ endif
|
|||||||
ifeq ($(WINDOWS), 1)
|
ifeq ($(WINDOWS), 1)
|
||||||
i_f+= -DNO_MMAP
|
i_f+= -DNO_MMAP
|
||||||
i_lf+= -lpthread
|
i_lf+= -lpthread
|
||||||
ifeq ($(REPLXX), 1)
|
ifeq ($(i_REPLXX_1), 1)
|
||||||
i_f+= -DUSE_REPLXX_IO
|
i_f+= -DUSE_REPLXX_IO
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -229,7 +231,7 @@ ifeq ($(custom),)
|
|||||||
else
|
else
|
||||||
@[ -x "$$(command -v sha256sum)" ] && hashInput="sha256sum"; \
|
@[ -x "$$(command -v sha256sum)" ] && hashInput="sha256sum"; \
|
||||||
[ -x "$$(command -v shasum)" ] && hashInput="shasum -a 256"; \
|
[ -x "$$(command -v shasum)" ] && hashInput="shasum -a 256"; \
|
||||||
printf "%s\0%s\0%s\0%s\0%s\0%s\0%s\0%s\0%s" "${i_CC}" "${ALL_CC_FLAGS}" "${ALL_LD_FLAGS}" "${REPLXX}" "${REPLXX_FLAGS}" "${CXXFLAGS}" "${i_CXX}" "${BYTECODE_DIR}" "${REPLXX_DIR}" "${SINGELI_DIR}" | $$hashInput | grep -oE '[0-9a-z]{64}' | head -c32
|
printf "%s\0%s\0%s\0%s\0%s\0%s\0%s\0%s\0%s" "${i_CC}" "${ALL_CC_FLAGS}" "${ALL_LD_FLAGS}" "${i_REPLXX_1}" "${REPLXX_FLAGS}" "${CXXFLAGS}" "${i_CXX}" "${BYTECODE_DIR}" "${REPLXX_DIR}" "${SINGELI_DIR}" | $$hashInput | grep -oE '[0-9a-z]{64}' | head -c32
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
@printf "%s" "$(force_build_dir)"
|
@printf "%s" "$(force_build_dir)"
|
||||||
@ -238,13 +240,13 @@ endif
|
|||||||
|
|
||||||
# simple non-incremental builds
|
# simple non-incremental builds
|
||||||
single-o3:
|
single-o3:
|
||||||
$(i_CC) $(ALL_CC_FLAGS) -O3 -o ${i_OUTPUT_BIN} src/opt/single.c $(ALL_LD_FLAGS)
|
$(i_CC) $(ALL_CC_FLAGS) -DSINGLE_BUILD -O3 -o ${i_OUTPUT_BIN} src/opt/single.c $(ALL_LD_FLAGS)
|
||||||
single-o3g:
|
single-o3g:
|
||||||
$(i_CC) $(ALL_CC_FLAGS) -O3 -g -o ${i_OUTPUT_BIN} src/opt/single.c $(ALL_LD_FLAGS)
|
$(i_CC) $(ALL_CC_FLAGS) -DSINGLE_BUILD -O3 -g -o ${i_OUTPUT_BIN} src/opt/single.c $(ALL_LD_FLAGS)
|
||||||
single-debug:
|
single-debug:
|
||||||
$(i_CC) $(ALL_CC_FLAGS) -DDEBUG -g -o ${i_OUTPUT_BIN} src/opt/single.c $(ALL_LD_FLAGS)
|
$(i_CC) $(ALL_CC_FLAGS) -DSINGLE_BUILD -DDEBUG -g -o ${i_OUTPUT_BIN} src/opt/single.c $(ALL_LD_FLAGS)
|
||||||
single-c:
|
single-c:
|
||||||
$(i_CC) $(ALL_CC_FLAGS) -o ${i_OUTPUT_BIN} src/opt/single.c $(ALL_LD_FLAGS)
|
$(i_CC) $(ALL_CC_FLAGS) -DSINGLE_BUILD -o ${i_OUTPUT_BIN} src/opt/single.c $(ALL_LD_FLAGS)
|
||||||
|
|
||||||
# actual build
|
# actual build
|
||||||
run_incremental_0:
|
run_incremental_0:
|
||||||
@ -254,7 +256,7 @@ endif
|
|||||||
ifeq ($(verbose),1)
|
ifeq ($(verbose),1)
|
||||||
@echo "build directory: $$("${MAKE}" builddir)"
|
@echo "build directory: $$("${MAKE}" builddir)"
|
||||||
@echo " bytecode: build/$(BYTECODE_DIR)"
|
@echo " bytecode: build/$(BYTECODE_DIR)"
|
||||||
ifeq ($(REPLXX),1)
|
ifeq ($(i_REPLXX_1),1)
|
||||||
@echo " replxx: $(REPLXX_DIR)"
|
@echo " replxx: $(REPLXX_DIR)"
|
||||||
else
|
else
|
||||||
@echo " replxx: not used"
|
@echo " replxx: not used"
|
||||||
@ -378,7 +380,7 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
# replxx
|
# replxx
|
||||||
ifeq ($(REPLXX),1)
|
ifeq ($(i_REPLXX_1),1)
|
||||||
i_CXX := c++
|
i_CXX := c++
|
||||||
ifeq ($(origin CXX),command line)
|
ifeq ($(origin CXX),command line)
|
||||||
i_CXX := $(CXX)
|
i_CXX := $(CXX)
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
#define MM_C 1
|
#define MM_C 1
|
||||||
|
#if SINGLE_BUILD
|
||||||
|
#undef USE_REPLXX
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../core.h"
|
#include "../core.h"
|
||||||
#include "../load.c"
|
#include "../load.c"
|
||||||
|
|||||||
@ -7,7 +7,6 @@ make && ./BQN -p 2+2 || exit
|
|||||||
make single-debug && ./BQN -p 2+2 || exit
|
make single-debug && ./BQN -p 2+2 || exit
|
||||||
make heapverify && ./BQN -p 2+2 || exit
|
make heapverify && ./BQN -p 2+2 || exit
|
||||||
make rtverify && ./BQN -p 2+2 || exit
|
make rtverify && ./BQN -p 2+2 || exit
|
||||||
make rtperf && ./BQN -p 2+2 | head -2 || exit
|
|
||||||
build/build f='-DDEBUG -DDEBUG_VM' c && ./BQN -p 2+2 2>&1 | tail -2 || exit
|
build/build f='-DDEBUG -DDEBUG_VM' c && ./BQN -p 2+2 2>&1 | tail -2 || exit
|
||||||
build/build f='-DWARN_SLOW' c && ./BQN -p 2+2 2> /dev/null || exit
|
build/build f='-DWARN_SLOW' c && ./BQN -p 2+2 2> /dev/null || exit
|
||||||
build/build f='-DMM=0 -DENABLE_GC=0' c && ./BQN -p 2+2 || exit
|
build/build f='-DMM=0 -DENABLE_GC=0' c && ./BQN -p 2+2 || exit
|
||||||
|
|||||||
@ -5,8 +5,8 @@ if [ "$#" -ne 1 ]; then
|
|||||||
fi
|
fi
|
||||||
make f='-DDEBUG -DHEAP_VERIFY -DJIT_START=0' single-c
|
make f='-DDEBUG -DHEAP_VERIFY -DJIT_START=0' single-c
|
||||||
echo 'alljit+heapverify:' && ./BQN -M 1000 "$1/test/this.bqn" -noerr bytecode header identity literal namespace prim simple syntax token under undo unhead || exit
|
echo 'alljit+heapverify:' && ./BQN -M 1000 "$1/test/this.bqn" -noerr bytecode header identity literal namespace prim simple syntax token under undo unhead || exit
|
||||||
echo 'singeli:';make o3n-singeli && ./BQN -M 1000 "$1/test/this.bqn" || exit
|
echo 'native vfy:';make heapverifyn && ./BQN -M 1000 "$1/test/this.bqn" -noerr bytecode header identity literal namespace prim simple syntax token under undo unhead || exit
|
||||||
echo 'singeli sse2:';build/build singeli native=0 && ./BQN -M 1000 "$1/test/this.bqn" || exit
|
echo 'native:';make o3n && ./BQN -M 1000 "$1/test/this.bqn" || exit
|
||||||
echo 'singeli vfy:';make heapverifyn-singeli && ./BQN -M 1000 "$1/test/this.bqn" -noerr bytecode header identity literal namespace prim simple syntax token under undo unhead || exit
|
echo 'sse2:';build/build singeli native=0 && ./BQN -M 1000 "$1/test/this.bqn" || exit
|
||||||
echo '32-bit:';make f='-DDEBUG -m32' single-c FFI=0 && ./BQN -M 1000 "$1/test/this.bqn" || exit
|
echo '32-bit:';make f='-DDEBUG -m32' single-c FFI=0 && ./BQN -M 1000 "$1/test/this.bqn" || exit
|
||||||
echo '(expected one failed test: 0.3‿1.01‿π(⋆⁼⌜≡÷˜⌜○(⋆⁼))0‿2‿5.6‿∞)'
|
echo '(expected one failed test: 0.3‿1.01‿π(⋆⁼⌜≡÷˜⌜○(⋆⁼))0‿2‿5.6‿∞)'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user