From c588d92fa29a921c273b44f5e1cd178083deefea Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 13 Nov 2025 00:29:48 +0100 Subject: [PATCH] file path for building updated --- .github/workflows/ci.yml | 46 ++++++++++++++++---------------- tests/test_branching_stencils.py | 4 +-- tests/test_compile.py | 4 +-- tests/test_compile_aarch64.py | 6 +++-- tests/test_compile_div.py | 4 +-- tests/test_compile_math.py | 12 ++++----- tests/test_ops_aarch64.py | 7 +++-- tests/test_ops_x86.py | 4 +-- tools/build.bat | 22 ++++++++------- tools/build.sh | 4 +-- tools/build_stencils.bat | 18 ++++++++++--- tools/create_stencil_doc.sh | 6 ++--- tools/crosscompile.sh | 10 ++++--- tools/get_binaries.py | 6 ++--- tools/inspect.bat | 12 ++++----- tools/inspect.sh | 6 ++--- tools/make_example.py | 6 ++--- tools/nativecompile.sh | 2 +- 18 files changed, 100 insertions(+), 79 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92ea5ef..280efe6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/upload-artifact@v4 with: name: cross-runner - path: bin/coparun-* + path: build/runner/coparun-* build-ubuntu: needs: [build_stencils] @@ -50,7 +50,7 @@ jobs: #- uses: actions/download-artifact@v4 # with: # name: cross-runner - # path: bin + # path: build/runner - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -70,9 +70,9 @@ jobs: - name: Compile coparun run: | - mkdir -p bin - gcc -O3 -DENABLE_BASIC_LOGGING -o bin/coparun src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c - # aarch64-linux-gnu-gcc -O3 -static -DENABLE_BASIC_LOGGING src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c -o bin/coparun-aarch64 + mkdir -p build/runner + gcc -O3 -DENABLE_BASIC_LOGGING -o build/runner/coparun src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c + # aarch64-linux-gnu-gcc -O3 -static -DENABLE_BASIC_LOGGING src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c -o build/runner/coparun-aarch64 - name: Generate debug asm files if: strategy.job-index == 0 @@ -82,24 +82,24 @@ jobs: python tools/make_example.py echo "- Patch code..." - bin/coparun bin/test.copapy bin/test.copapy.bin - #qemu-aarch64 bin/coparun-aarch64 bin/test-arm64.copapy bin/test-arm64.copapy.bin + build/runner/coparun build/runner/test.copapy build/runner/test.copapy.bin + #qemu-aarch64 build/runner/coparun-aarch64 build/runner/test-arm64.copapy build/runner/test-arm64.copapy.bin - objdump -D -b binary -m i386:x86-64 --adjust-vma=0x1000 bin/test.copapy.bin > bin/test.copapy.asm + objdump -D -b binary -m i386:x86-64 --adjust-vma=0x1000 build/runner/test.copapy.bin > build/runner/test.copapy.asm echo '

test.copapy.asm

' >> $GITHUB_STEP_SUMMARY - python tools/clean_asm.py bin/test.copapy.asm >> $GITHUB_STEP_SUMMARY + python tools/clean_asm.py build/runner/test.copapy.asm >> $GITHUB_STEP_SUMMARY - #aarch64-linux-gnu-objdump -D -b binary -m aarch64 --adjust-vma=0x1000 bin/test-arm64.copapy.bin > bin/test-arm64.copapy.asm + #aarch64-linux-gnu-objdump -D -b binary -m aarch64 --adjust-vma=0x1000 build/runner/test-arm64.copapy.bin > build/runner/test-arm64.copapy.asm #echo '

test-arm64.copapy.asm

' >> $GITHUB_STEP_SUMMARY - #python tools/clean_asm.py bin/test-arm64.copapy.asm >> $GITHUB_STEP_SUMMARY + #python tools/clean_asm.py build/runner/test-arm64.copapy.asm >> $GITHUB_STEP_SUMMARY - objdump -d -x src/copapy/obj/stencils_x86_64_O3.o > bin/stencils_x86_64_O3.asm + objdump -d -x src/copapy/obj/stencils_x86_64_O3.o > build/runner/stencils_x86_64_O3.asm echo '

stencils_x86_64_O3.asm

' >> $GITHUB_STEP_SUMMARY - python tools/clean_asm.py bin/stencils_x86_64_O3.asm >> $GITHUB_STEP_SUMMARY + python tools/clean_asm.py build/runner/stencils_x86_64_O3.asm >> $GITHUB_STEP_SUMMARY - #aarch64-linux-gnu-objdump -d -x src/copapy/obj/stencils_arm64_O3.o > bin/stencils_arm64_O3.asm + #aarch64-linux-gnu-objdump -d -x src/copapy/obj/stencils_arm64_O3.o > build/runner/stencils_arm64_O3.asm #echo '

stencils_arm64_O3.asm

' >> $GITHUB_STEP_SUMMARY - #python tools/clean_asm.py bin/stencils_arm64_O3.asm >> $GITHUB_STEP_SUMMARY + #python tools/clean_asm.py build/runner/stencils_arm64_O3.asm >> $GITHUB_STEP_SUMMARY - name: Run tests with pytest run: pytest @@ -114,7 +114,7 @@ jobs: if: strategy.job-index == 0 with: name: runner-linux - path: bin/* + path: build/runner/* build-arm64: needs: [build_stencils] @@ -134,15 +134,15 @@ jobs: run: | docker run --rm -v $PWD:/app -w /app --platform linux/arm64 ghcr.io/nonannet/arm64_test:1 \ bash -lc "pip install . && \ - mkdir -p bin && \ - gcc -O3 -DENABLE_LOGGING -o bin/coparun src/coparun/runmem.c \ + mkdir -p build/runner && \ + gcc -O3 -DENABLE_LOGGING -o build/runner/coparun src/coparun/runmem.c \ src/coparun/coparun.c src/coparun/mem_man.c && \ pytest" - uses: actions/upload-artifact@v4 with: name: runner-linux-arm64 - path: bin/* + path: build/runner/* build-windows: needs: [build_stencils] @@ -177,11 +177,11 @@ jobs: - name: Compile coparun shell: cmd run: | - mkdir bin + mkdir build\runner call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 - cl /DENABLE_BASIC_LOGGING /O2 src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:bin\coparun.exe + cl /DENABLE_BASIC_LOGGING /O2 src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:build\runner\coparun.exe call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 - cl /DENABLE_BASIC_LOGGING /O2 src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:bin\coparun-x86.exe + cl /DENABLE_BASIC_LOGGING /O2 src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:build\runner\coparun-x86.exe - name: Run tests with pytest run: pytest @@ -196,7 +196,7 @@ jobs: if: strategy.job-index == 0 with: name: runner-win - path: bin/* + path: build/runner/* release-stencils: needs: [build_stencils, build-ubuntu, build-windows, build-arm64] diff --git a/tests/test_branching_stencils.py b/tests/test_branching_stencils.py index 22a6794..8751d1f 100644 --- a/tests/test_branching_stencils.py +++ b/tests/test_branching_stencils.py @@ -39,9 +39,9 @@ def test_compile(): print('* Data to runner:') #il.print() - il.to_file('bin/test.copapy') + il.to_file('build/runner/test.copapy') - result = run_command(['bin/coparun', 'bin/test.copapy', 'bin/test.copapy.bin']) + result = run_command(['build/runner/coparun', 'build/runner/test.copapy', 'build/runner/test.copapy.bin']) print('* Output from runner:\n--') print(result) print('--') diff --git a/tests/test_compile.py b/tests/test_compile.py index 1843b87..ed12b56 100644 --- a/tests/test_compile.py +++ b/tests/test_compile.py @@ -74,9 +74,9 @@ def test_compile(): print('* Data to runner:') il.print() - il.to_file('bin/test.copapy') + il.to_file('build/runner/test.copapy') - result = run_command(['bin/coparun', 'bin/test.copapy']) + result = run_command(['build/runner/coparun', 'build/runner/test.copapy']) print('* Output from runner:\n--') print(result) print('--') diff --git a/tests/test_compile_aarch64.py b/tests/test_compile_aarch64.py index 15fdf42..1f2dd33 100644 --- a/tests/test_compile_aarch64.py +++ b/tests/test_compile_aarch64.py @@ -69,12 +69,14 @@ def test_compile(): print('* Data to runner:') il.print() - il.to_file('bin/test-arm64.copapy') + il.to_file('build/runner/test-arm64.copapy') if not check_for_qemu(): warnings.warn("qemu-aarch64 not found, aarch64 test skipped!", UserWarning) + elif not os.path.isfile('build/runner/coparun-aarch64'): + warnings.warn("aarch64 runner not found, aarch64 test skipped!", UserWarning) else: - command = ['bin/coparun-aarch64', 'bin/test-arm64.copapy'] + command = ['build/runner/coparun-aarch64', 'build/runner/test-arm64.copapy'] result = run_command(qemu_command + command) print('* Output from runner:\n--') print(result) diff --git a/tests/test_compile_div.py b/tests/test_compile_div.py index 535f66f..9f1dcc2 100644 --- a/tests/test_compile_div.py +++ b/tests/test_compile_div.py @@ -42,9 +42,9 @@ def test_compile(): print('* Data to runner:') il.print() - il.to_file('bin/test.copapy') + il.to_file('build/runner/test.copapy') - result = run_command(['bin/coparun', 'bin/test.copapy']) + result = run_command(['build/runner/coparun', 'build/runner/test.copapy']) print('* Output from runner:') print(result) diff --git a/tests/test_compile_math.py b/tests/test_compile_math.py index 9be9a86..6712535 100644 --- a/tests/test_compile_math.py +++ b/tests/test_compile_math.py @@ -37,9 +37,9 @@ def test_compile_sqrt(): print('* Data to runner:') il.print() - il.to_file('bin/test.copapy') + il.to_file('build/runner/test.copapy') - result = run_command(['bin/coparun', 'bin/test.copapy']) + result = run_command(['build/runner/coparun', 'build/runner/test.copapy']) print('* Output from runner:\n--') print(result) print('--') @@ -71,9 +71,9 @@ def test_compile_log(): print('* Data to runner:') il.print() - il.to_file('bin/test.copapy') + il.to_file('build/runner/test.copapy') - result = run_command(['bin/coparun', 'bin/test.copapy']) + result = run_command(['build/runner/coparun', 'build/runner/test.copapy']) print('* Output from runner:\n--') print(result) print('--') @@ -105,9 +105,9 @@ def test_compile_sin(): print('* Data to runner:') #il.print() - il.to_file('bin/test.copapy') + il.to_file('build/runner/test.copapy') - result = run_command(['bin/coparun', 'bin/test.copapy']) + result = run_command(['build/runner/coparun', 'build/runner/test.copapy']) print('* Output from runner:\n--') print(result) print('--') diff --git a/tests/test_ops_aarch64.py b/tests/test_ops_aarch64.py index 65b7555..62b125a 100644 --- a/tests/test_ops_aarch64.py +++ b/tests/test_ops_aarch64.py @@ -119,13 +119,16 @@ def test_compile(): print('* Data to runner:') dw.print() - dw.to_file('bin/test-arm64.copapy') + dw.to_file('build/runner/test-arm64.copapy') if not check_for_qemu(): warnings.warn("qemu-aarch64 not found, aarch64 test skipped!", UserWarning) return + if not os.path.isfile('build/runner/coparun-aarch64'): + warnings.warn("aarch64 runner not found, aarch64 test skipped!", UserWarning) + return - command = ['bin/coparun-aarch64', 'bin/test-arm64.copapy'] + ['bin/test-arm64.copapy.bin'] + command = ['build/runner/coparun-aarch64', 'build/runner/test-arm64.copapy'] + ['build/runner/test-arm64.copapy.bin'] result = run_command(qemu_command + command) print('* Output from runner:\n--') print(result) diff --git a/tests/test_ops_x86.py b/tests/test_ops_x86.py index fb6f0ba..286d316 100644 --- a/tests/test_ops_x86.py +++ b/tests/test_ops_x86.py @@ -114,12 +114,12 @@ def test_compile(): print('* Data to runner:') dw.print() - dw.to_file('bin/test-x86.copapy') + dw.to_file('build/runner/test-x86.copapy') if platform.machine() != 'AMD64' and platform.machine() != 'x86_64': warnings.warn(f"Test skipped, {platform.machine()} not supported for this test.", UserWarning) else: - command = ['bin/coparun-x86', 'bin/test-x86.copapy', 'bin/test-x86.copapy.bin'] + command = ['build/runner/coparun-x86', 'build/runner/test-x86.copapy', 'build/runner/test-x86.copapy.bin'] try: result = run_command(command) diff --git a/tools/build.bat b/tools/build.bat index d23372d..5ee7d89 100644 --- a/tools/build.bat +++ b/tools/build.bat @@ -1,36 +1,38 @@ -python stencils/generate_stencils.py bin/stencils.c +mkdir build\stencils +mkdir build\runner +python stencils/generate_stencils.py build/stencils/stencils.c echo -------------x86_64 - 64 bit----------------- call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64 echo - Compile stencil test... -cl /Zi /Od stencils\test.c /Fe:bin\test.exe +cl /Zi /Od stencils\test.c /Fe:build\stencils\test.exe echo - Build runner for Windows 64 bit... -cl /Zi /Od /DENABLE_BASIC_LOGGING src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:bin\coparun.exe +cl /Zi /Od /DENABLE_BASIC_LOGGING src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:build\runner\coparun.exe REM Optimized: -REM cl /O2 src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:bin\coparun.exe +REM cl /O2 src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:build\runner\coparun.exe echo - Build stencils for 64 bit... -wsl gcc -fno-pic -c bin/stencils.c -O3 -o src/copapy/obj/stencils_x86_64_O3.o +wsl gcc -fno-pic -c build/stencils/stencils.c -O3 -o src/copapy/obj/stencils_x86_64_O3.o echo ---------------x86 - 32 bit--------------- call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86 echo - Build runner for Windows 32 bit... -cl /Zi /Od /DENABLE_BASIC_LOGGING src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:bin\coparun-x86.exe +cl /Zi /Od /DENABLE_BASIC_LOGGING src\coparun\runmem.c src\coparun\coparun.c src\coparun\mem_man.c /Fe:build\runner\coparun-x86.exe echo - Build runner for linux x86 32 bit... -wsl gcc -m32 -static -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -O3 -DENABLE_LOGGING src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c -o bin/coparun-i686 +wsl gcc -m32 -static -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -O3 -DENABLE_LOGGING src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c -o build/runner/coparun-i686 echo - Build stencils x86 32 bit... -wsl gcc -m32 -fno-pic -c bin/stencils.c -O3 -o src/copapy/obj/stencils_x86_O3.o +wsl gcc -m32 -fno-pic -c build/stencils/stencils.c -O3 -o src/copapy/obj/stencils_x86_O3.o echo --------------arm64 64 bit---------------- echo - Build stencils for aarch64... -wsl aarch64-linux-gnu-gcc -fno-pic -c bin/stencils.c -O3 -o src/copapy/obj/stencils_arm64_O3.o +wsl aarch64-linux-gnu-gcc -fno-pic -c build/stencils/stencils.c -O3 -o src/copapy/obj/stencils_arm64_O3.o echo ------------------------------ echo - Build runner for Aarch64... -wsl aarch64-linux-gnu-gcc -static -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -O3 -DENABLE_LOGGING src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c -o bin/coparun-aarch64 +wsl aarch64-linux-gnu-gcc -static -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -O3 -DENABLE_LOGGING src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c -o build/runner/coparun-aarch64 diff --git a/tools/build.sh b/tools/build.sh index 5eeed6c..73f697e 100644 --- a/tools/build.sh +++ b/tools/build.sh @@ -2,7 +2,7 @@ set -e set -v mkdir -p bin -SRC=bin/stencils.c +SRC=build/stencils/stencils.c DEST=src/copapy/obj python3 stencils/generate_stencils.py $SRC mkdir -p $DEST @@ -16,5 +16,5 @@ mkdir bin -p gcc -Wall -Wextra -Wconversion -Wsign-conversion \ -Wshadow -Wstrict-overflow -Werror -g -O3 \ -DENABLE_LOGGING - src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c -o bin/coparun + src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c -o build/runner/coparun #x86_64-w64-mingw32-gcc -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -Werror src/runner/runmem2.c -Wall -O3 -o bin/runmem2.exe diff --git a/tools/build_stencils.bat b/tools/build_stencils.bat index 94951dc..eaf261a 100644 --- a/tools/build_stencils.bat +++ b/tools/build_stencils.bat @@ -1,15 +1,25 @@ -python stencils/generate_stencils.py bin/stencils.c +python stencils/generate_stencils.py build/stencils/stencils.c echo -------------x86_64 - 64 bit----------------- echo - Build stencils for 64 bit... wsl mkdir -p build/stencil_objs -wsl gcc -fno-pic -c bin/stencils.c -O3 -o build/stencil_objs/stencils.lo +wsl rm build/stencil_objs/* + +wsl gcc -fno-pic -c build/stencils/stencils.c -O3 -o build/stencil_objs/stencils.lo cd build\stencil_objs -wsl ar x /usr/lib/x86_64-linux-musl/libc.a sinf.lo cosf.lo tanf.lo sqrtf.lo logf.lo expf.lo logf_data.lo __tandf.lo __cosdf.lo __sindf.lo __rem_pio2f.lo __math_invalidf.lo __stack_chk_fail.lo __math_divzerof.lo __math_oflowf.lo __rem_pio2_large.lo scalbn.lo floor.lo +wsl ar x ../../../musl/lib/libc.a sinf.lo cosf.lo tanf.lo asinf.lo acosf.lo atanf.lo atan2f.lo +wsl ar x ../../../musl/lib/libc.a sqrtf.lo logf.lo expf.lo sqrt.lo +wsl ar x ../../../musl/lib/libc.a logf_data.lo __tandf.lo __cosdf.lo __sindf.lo __rem_pio2f.lo __math_invalidf.lo __stack_chk_fail.lo __math_divzerof.lo __math_oflowf.lo __rem_pio2_large.lo scalbn.lo floor.lo exp2f_data.lo powf.lo powf_data.lo __math_uflowf.lo __math_xflowf.lo +wsl ar x ../../../musl/lib/libc.a fabsf.lo + +REM wsl ar t ../../../musl/lib/libc.a __math_xflowf.lo + wsl ld -r *.lo -o ../../src/copapy/obj/stencils_x86_64_O3.o cd .. cd .. -wsl objdump -d -x src/copapy/obj/stencils_x86_64_O3.o > bin/stencils_x86_64_O3.asm \ No newline at end of file +wsl objdump -d -x src/copapy/obj/stencils_x86_64_O3.o > build/stencils/stencils_x86_64_O3.asm + + diff --git a/tools/create_stencil_doc.sh b/tools/create_stencil_doc.sh index 822dd01..3cec1fb 100644 --- a/tools/create_stencil_doc.sh +++ b/tools/create_stencil_doc.sh @@ -6,6 +6,6 @@ objdump --disassembler-color=on -d -j .text src/copapy/obj/stencils_x86_64_O3.o | ansi2html -i > bin/stencils_x86_64_O3.html python3 tools/make_example.py -python3 tools/extract_code.py "bin/test.copapy" "bin/test.copapy.bin" -objdump --disassembler-color=on -D -b binary -m i386:x86-64 --adjust-vma=0x1000 bin/test.copapy.bin \ -| bin/test.copapy.asm | ansi2html -i > bin/test.copapy.html \ No newline at end of file +python3 tools/extract_code.py "build/runner/test.copapy" "build/runner/test.copapy.bin" +objdump --disassembler-color=on -D -b binary -m i386:x86-64 --adjust-vma=0x1000 build/runner/test.copapy.bin \ +| build/runner/test.copapy.asm | ansi2html -i > build/runner/test.copapy.html \ No newline at end of file diff --git a/tools/crosscompile.sh b/tools/crosscompile.sh index 7dfa5ef..a959b22 100644 --- a/tools/crosscompile.sh +++ b/tools/crosscompile.sh @@ -3,8 +3,8 @@ set -e set -v -mkdir -p bin -SRC=bin/stencils.c +mkdir -p build/stencils +SRC=build/stencils/stencils.c DEST=src/copapy/obj OPT=O3 FLAGS="-fno-pic" @@ -47,6 +47,10 @@ riscv64-linux-gnu-gcc-13 $FLAGS -$OPT -c $SRC -o $DEST/stencils_riscv64_$OPT.o # -------------- Cross compile runner -------------- +mkdir -p build/runner # Aarch64 -aarch64-linux-gnu-gcc-13 -static -O3 -DENABLE_LOGGING -o bin/coparun-aarch64 src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c +aarch64-linux-gnu-gcc-13 -static -O3 -DENABLE_LOGGING -o build/runner/coparun-aarch64 src/coparun/runmem.c src/coparun/coparun.c src/coparun/mem_man.c + + + diff --git a/tools/get_binaries.py b/tools/get_binaries.py index a5d228b..8aa2e94 100644 --- a/tools/get_binaries.py +++ b/tools/get_binaries.py @@ -38,11 +38,11 @@ def main() -> None: if name.endswith('.o'): dest = 'src/copapy/obj' elif name == 'coparun.exe' and os.name == 'nt': - dest = 'bin' + dest = 'build/runner' elif name == 'coparun' and os.name == 'posix': - dest = 'bin' + dest = 'build/runner' elif name.startswith('coparun-'): - dest = 'bin' + dest = 'build/runner' else: dest = '' diff --git a/tools/inspect.bat b/tools/inspect.bat index df48e7f..dae3260 100644 --- a/tools/inspect.bat +++ b/tools/inspect.bat @@ -1,15 +1,15 @@ python tools/make_example.py -REM wsl qemu-aarch64 bin/coparun-aarch64 bin/test-arm64.copapy bin/test-arm64.copapy.bin -REM wsl aarch64-linux-gnu-objdump -D -b binary -m aarch64 --adjust-vma=0x5000 bin/test-arm64.copapy.bin +REM wsl qemu-aarch64 build/runner/coparun-aarch64 build/runner/test-arm64.copapy build/runner/test-arm64.copapy.bin +REM wsl aarch64-linux-gnu-objdump -D -b binary -m aarch64 --adjust-vma=0x5000 build/runner/test-arm64.copapy.bin -REM wsl aarch64-linux-gnu-objdump -D -b binary -m aarch64 --adjust-vma=0x5000 bin/test-arm64.copapy2.bin +REM wsl aarch64-linux-gnu-objdump -D -b binary -m aarch64 --adjust-vma=0x5000 build/runner/test-arm64.copapy2.bin -bin\coparun bin/test.copapy bin/test.copapy.bin -wsl objdump -D -b binary -m i386:x86-64 --adjust-vma=0x500000 bin/test.copapy.bin +bin\coparun build/runner/test.copapy build/runner/test.copapy.bin +wsl objdump -D -b binary -m i386:x86-64 --adjust-vma=0x500000 build/runner/test.copapy.bin REM wsl aarch64-linux-gnu-objdump -d -x src/copapy/obj/stencils_arm64_O3.o -REM wsl objdump -D -b binary -m i386 --adjust-vma=0x5000 bin/test-x86.copapy.bin +REM wsl objdump -D -b binary -m i386 --adjust-vma=0x5000 build/runner/test-x86.copapy.bin diff --git a/tools/inspect.sh b/tools/inspect.sh index 640b9a3..f08b019 100644 --- a/tools/inspect.sh +++ b/tools/inspect.sh @@ -2,8 +2,8 @@ source tools/build.sh -objdump -d -j .text src/copapy/obj/stencils_x86_64_O3.o > bin/stencils_x86_64_O3.asm +objdump -d -j .text src/copapy/obj/stencils_x86_64_O3.o > build/stencils/stencils_x86_64_O3.asm python3 tools/make_example.py -python3 tools/extract_code.py "bin/test.copapy" "bin/test.copapy.bin" -objdump -D -b binary -m i386:x86-64 --adjust-vma=0x1000 bin/test.copapy.bin > bin/test.copapy.asm +python3 tools/extract_code.py "build/runner/test.copapy" "build/runner/test.copapy.bin" +objdump -D -b binary -m i386:x86-64 --adjust-vma=0x1000 build/runner/test.copapy.bin > build/runner/test.copapy.asm diff --git a/tools/make_example.py b/tools/make_example.py index 8865778..672f0e1 100644 --- a/tools/make_example.py +++ b/tools/make_example.py @@ -24,7 +24,7 @@ def compile_to_x86_64() -> None: print('* Data to runner:') dw.print() - dw.to_file('bin/test.copapy') + dw.to_file('build/runner/test.copapy') def compile_to_x86() -> None: @@ -48,7 +48,7 @@ def compile_to_x86() -> None: print('* Data to runner:') dw.print() - dw.to_file('bin/test-x86.copapy') + dw.to_file('build/runner/test-x86.copapy') def compile_to_aarch64() -> None: @@ -71,7 +71,7 @@ def compile_to_aarch64() -> None: print('* Data to runner:') dw.print() - dw.to_file('bin/test-arm64.copapy') + dw.to_file('build/runner/test-arm64.copapy') if __name__ == "__main__": diff --git a/tools/nativecompile.sh b/tools/nativecompile.sh index 5b35a31..2186983 100644 --- a/tools/nativecompile.sh +++ b/tools/nativecompile.sh @@ -3,7 +3,7 @@ set -e set -v mkdir -p bin -SRC=bin/stencils.c +SRC=build/stencils/stencils.c DEST=src/copapy/obj FLAGS="-fno-pic"