diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93e01a9c..9935fdd3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,8 +61,11 @@ jobs: path: output - name: Benchmark run: python3 scripts/run_tests.py benchmark - # - name: GCC Build Test - # run: g++ -o pocketpy --std=c++17 src/main.cpp + - name: GCC Build Test + run: | + SRC=$(find src/ -name "*.cpp") + g++ -o main --std=c++17 src/main.cpp $SRC + python3 scripts/run_tests.py - name: C Binding Test run: bash run_c_binding_test.sh build_macos: diff --git a/README.md b/README.md index 0d786043..51047a75 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,6 @@ To compile it with your project, these flags must be set: + RTTI is not required + If clang is used, `-stdlib=libc++` must be set -!!! -For maximum performance, we recommend to use `clang++` with `-O2` flag. -!!! - ### Example ```cpp diff --git a/amalgamate.py b/amalgamate.py index f93d16e3..9cb58f25 100644 --- a/amalgamate.py +++ b/amalgamate.py @@ -81,10 +81,10 @@ with open("amalgamated/main.cpp", "wt", encoding='utf-8') as f: f.write(text) if sys.platform in ['linux', 'darwin']: - ok = os.system("clang++ -o pocketpy amalgamated/main.cpp --std=c++17 -stdlib=libc++ -ldl") + ok = os.system("clang++ -o main amalgamated/main.cpp --std=c++17 -stdlib=libc++ -ldl") if ok == 0: print("Test build success!") - os.remove("pocketpy") + os.remove("main") print("amalgamated/pocketpy.h") diff --git a/build.sh b/build.sh index 9bfa7d49..f038301b 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ python3 prebuild.py SRC=$(find src/ -name "*.cpp") -clang++ -std=c++17 -fno-rtti -O2 -stdlib=libc++ -Wfatal-errors -o pocketpy src2/main.cpp $SRC -Iinclude -ldl \ No newline at end of file +clang++ -std=c++17 -fno-rtti -O2 -stdlib=libc++ -Wfatal-errors -o main src2/main.cpp $SRC -Iinclude -ldl \ No newline at end of file diff --git a/run_profile.sh b/run_profile.sh index 414d19e0..1f3aca0e 100644 --- a/run_profile.sh +++ b/run_profile.sh @@ -1,6 +1,6 @@ python3 prebuild.py SRC=$(find src/ -name "*.cpp") -clang++ -pg -O1 -std=c++17 -fno-rtti -stdlib=libc++ -Wfatal-errors -o pocketpy $SRC -Iinclude +clang++ -pg -O1 -std=c++17 -fno-rtti -stdlib=libc++ -Wfatal-errors -o main $SRC -Iinclude time ./main benchmarks/fib.py mv benchmarks/gmon.out . gprof pocketpy gmon.out > gprof.txt diff --git a/run_tests.sh b/run_tests.sh index 968e31bc..bb62e150 100644 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,6 +1,6 @@ python3 prebuild.py SRC=$(find src/ -name "*.cpp") -clang++ -std=c++17 -fno-rtti --coverage -O1 -stdlib=libc++ -Wfatal-errors -o pocketpy src2/main.cpp $SRC -Iinclude +clang++ -std=c++17 -fno-rtti --coverage -O1 -stdlib=libc++ -Wfatal-errors -o main src2/main.cpp $SRC -Iinclude python3 scripts/run_tests.py rm -rf .coverage mkdir .coverage