Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contextual profile vogr #9

Open
wants to merge 140 commits into
base: contextualProfile
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
89c54ee
Try avoiding unnecessary analysis state recomputation
JanJecmen Jun 17, 2021
353fa1d
Revert "add compilation times and execution-time"
vogr Jun 17, 2021
608b22e
Print compilation context and version called with PIR_DEBUG=ShowWarnings
vogr Jun 16, 2021
0781011
Log compilation times
vogr Jun 17, 2021
e6c7f10
Log compilation times in a second table, make data in first table tidier
vogr Jun 17, 2021
bdf7377
Add hashable FunctionVersion object
vogr Jun 17, 2021
26d2b15
Re-add compileFlag functionnality
vogr Jun 17, 2021
37d72f6
update to llvm 12
o- Jun 21, 2021
313ac07
tweaking passes
o- Jun 21, 2021
324ab3b
Merge pull request #1067 from reactorlabs/llvm12
o- Jun 21, 2021
4bf6f1e
trying to work around CI timeouts and crashes
o- Jun 22, 2021
2fc1a85
constant symbols must be quoted in constantfolding
o- Jun 22, 2021
3d47888
split test
o- Jun 22, 2021
a145f99
cppcheck :(
o- Jun 22, 2021
c60a77a
prevent fetch-llvm from re-downloading file
o- Jun 22, 2021
60adcb6
Merge pull request #1069 from reactorlabs/fixFetchLLVM
o- Jun 22, 2021
6217485
only quote if needed
o- Jun 22, 2021
b5685ba
move a test
o- Jun 22, 2021
0801efd
Merge pull request #1068 from reactorlabs/ciTimeoutCrash
o- Jun 23, 2021
41fd119
Merge pull request #1065 from reactorlabs/sa-opt
o- Jun 23, 2021
fe30ea7
Rir proms (#1064)
skrynski Jun 23, 2021
7ad7923
make the visitor deterministic
o- Jun 23, 2021
86aa09b
ensure that when moving environments the context position is updated
o- Jun 23, 2021
3e5da68
Run ASan and UBsan and fix issues (#1063)
o- Jun 23, 2021
e3b9053
fixing perf regression
o- Jun 23, 2021
f8abf1b
missing suppliedvars
o- Jun 23, 2021
5d5c346
another issue with overriding the argslist
o- Jun 24, 2021
c617b59
even more deterministic by starting every visitor with a fresh rand
o- Jun 24, 2021
863fa3c
Merge pull request #1072 from reactorlabs/fixScopeResolutionEnv
o- Jun 24, 2021
0e4a147
cache sub-analysis in scope resolution
o- Jun 24, 2021
1bb882d
more cleverly reusing already computed state in scope analysis
o- Jun 23, 2021
c0379d0
locally recompute scope analysis if opt made changes
o- Jun 24, 2021
21b876a
don't recurse after fixed-point is reached
o- Jun 24, 2021
f5a47f0
fix tracking of changes in scope analysis
o- Jun 24, 2021
1e72586
Merge pull request #1073 from reactorlabs/arglistFixes
o- Jun 24, 2021
533d9c2
Merge pull request #1071 from reactorlabs/deterministicVisitor
o- Jun 24, 2021
32037ac
some more tricks with builtins
o- Jun 10, 2021
cab040c
enable fake arglist for as many builtins as possible
o- Jun 14, 2021
9495261
wip
o- Jun 16, 2021
bccd46d
wip
o- Jun 18, 2021
2553532
find more builtins to block
o- Jun 21, 2021
5931b62
another one
o- Jun 21, 2021
d36eaaa
flexclust regression
o- Jun 22, 2021
85673ad
retry if it fails
o- Jun 22, 2021
9d14d21
make range analysis converge faster
o- Jun 24, 2021
4ceac00
rewrite and fix range analysis
o- Jun 30, 2021
1b16e80
Merge pull request #1074 from reactorlabs/scopeAnalysisCacheSub
o- Jun 30, 2021
626064e
bugfix
o- Jun 30, 2021
1ce0bae
speedup safebuiltin list query
o- Jun 30, 2021
85913b8
Merge pull request #1075 from reactorlabs/rangeConverge
o- Jun 30, 2021
e7afbb5
Merge pull request #1060 from reactorlabs/builtinTricks
o- Jun 30, 2021
c347ce5
update benchmarks
o- Jul 1, 2021
2d0b133
Merge pull request #1077 from reactorlabs/updateBM2
o- Jul 1, 2021
73723d7
trying to shrink our containersizes (#1078)
o- Jul 5, 2021
3c4b5be
more cleanup of bm container
o- Jul 6, 2021
8aff6e9
GnuR with modification to consider for RIR compilation functions
vogr Jun 8, 2021
f75d5ca
not sure about this "fix"
o- Jul 5, 2021
c0b8306
workaround
o- Jul 5, 2021
17eaf20
fix fake cons cell leaking
o- Jul 8, 2021
abbab38
fix memory leak of temp names array
o- Jul 8, 2021
7233463
temp fix for remove not clearing the bindings cache
o- Jul 8, 2021
f85efcb
remove broken ColonCastRHS constantfolding
o- Jul 9, 2021
c1219d5
update gnur
o- Jul 9, 2021
357a0a5
more robust fake cons-cells
o- Jul 9, 2021
40284c8
missing protect
o- Jul 9, 2021
46e6013
block more builtins
o- Jul 12, 2021
8e70ea0
Revert "temp fix for remove not clearing the bindings cache"
o- Jul 14, 2021
036bf29
properly fix binding cache when variable is removed
o- Jul 14, 2021
aff4510
introduce PIR_OPT_LEVEL
o- Jul 14, 2021
ab5dd8e
Revert "Revert "temp fix for remove not clearing the bindings cache""
o- Jul 14, 2021
d8b01c0
this should not happen anymore
o- Jul 14, 2021
6b6801a
see what breaks
o- Jul 14, 2021
1b531de
fix pidigits regression
o- Jul 14, 2021
f763c24
Revert "this should not happen anymore"
o- Jul 15, 2021
8419699
disable these asserts
o- Jul 15, 2021
2c3c155
more bugfixes
o- Jul 15, 2021
bf7c247
fix class<-
o- Jul 15, 2021
c5bfc70
make tests pass for all opt levels
o- Jul 15, 2021
74eea65
don't promise wrap constant args
o- Jul 15, 2021
f0d8e0d
fix typechecks for non-attribute objects
o- Jul 15, 2021
e3debea
prevent double evaluating $ lhs
o- Jul 15, 2021
8c3f35c
fix some regressions
o- Jul 15, 2021
1b25c21
missing cf
o- Jul 16, 2021
9df4ce0
improve $ support
o- Jul 16, 2021
cf746cd
trying a different strategy for attrib/obj types
o- Jul 16, 2021
3b4f167
protect fix
o- Jul 16, 2021
9d2e965
more debugging
o- Jul 16, 2021
9956b1d
more protect
o- Jul 16, 2021
c652afa
debugging
o- Jul 16, 2021
dbdfc72
fix for loop for factors
o- Jul 19, 2021
42a295c
this should fix no-segv error
o- Jul 19, 2021
b6724ca
Added documentation to use rr within a docker container
skrynski Jul 20, 2021
fb247aa
Merge pull request #1080 from reactorlabs/docs-rr-inside-docker
skrynski Jul 20, 2021
4a99eea
fighting timeouts
o- Jul 20, 2021
e4a93ff
small fixes
o- Jul 21, 2021
6be898f
fix another issue with rm/remove(...)
o- Jul 21, 2021
9b5d94d
fix for uncached envs
o- Jul 21, 2021
ffcd090
speeding up tests
o- Jul 22, 2021
50d02a9
fix for loop sequence conversion in pir
o- Jul 22, 2021
7fa7f15
fix switch and for loops
o- Jul 22, 2021
30c3b14
fix ci
o- Jul 22, 2021
9c88897
fix cppcheck
o- Jul 27, 2021
5e6b11f
fast isFactor check
o- Jul 27, 2021
d0f751c
yet again binding caches...
o- Jul 27, 2021
b61586a
lessen regression due to slower isFactor
o- Jul 28, 2021
3c4b339
faster tests
o- Jul 28, 2021
2d16814
fixing more tests
o- Jul 28, 2021
4ae1885
random guess
o- Jul 28, 2021
d7592b5
Merge pull request #1050 from reactorlabs/gnur-rir-for-precompiled
o- Jul 30, 2021
0dfab1a
shrink the size of Instructions
o- Jul 28, 2021
30d8551
some static usemethod support
o- Jul 16, 2021
6065231
new approach
o- Jul 19, 2021
ddfb204
fix
o- Jul 22, 2021
3066d01
Merge pull request #1082 from reactorlabs/shrinkInstructions
o- Jul 30, 2021
53dd7c1
prevent inliner from inining generic methods
o- Jul 30, 2021
4b2521e
ensure builtins are always compiled to callBuiltin
o- Jul 30, 2021
ab4e683
try to ensure that speculation gets placed before and not after noop …
o- Jul 30, 2021
bda8703
fix boxing in as.vector
o- Jul 30, 2021
01fa23e
undo speculation heuristic changes due to regressions
o- Jul 31, 2021
e858909
remove unneccessary cp when inlining
o- Jul 31, 2021
819c913
checkpoint at entry is only really needed for reflective proms
o- Jul 31, 2021
723743c
fix
o- Jul 31, 2021
9887ef7
Merge pull request #1079 from reactorlabs/useMethodStep1
o- Jul 31, 2021
22446da
after pir optimizations compile and lower all closures in the module
o- Jul 28, 2021
d916e4e
avoid recompiling static calls inlining is unlikely
o- Jul 28, 2021
d894043
only lower functions which are not compiled yet
o- Jul 29, 2021
ee7daef
increase threshold because of regressions
o- Jul 29, 2021
38516f3
lazily compile to native
o- Jul 29, 2021
b6d620e
fixes
o- Jul 29, 2021
c26e2c9
simplify heuristic
o- Jul 30, 2021
5b747d2
avoid leaking the std::string memory in Code objs
o- Jul 30, 2021
f9193c6
ensure string is terminated
o- Jul 30, 2021
4a59ca2
fixing regressions
o- Jul 30, 2021
53184eb
again code handle length
o- Jul 31, 2021
891de07
memory leak
o- Jul 31, 2021
5ea41f8
now another test crashes the sanitizer...
o- Aug 1, 2021
4f4bccf
Merge pull request #1081 from reactorlabs/avoidRecompilation
o- Aug 2, 2021
b3e7e85
Merge pull request #1084 from reactorlabs/speculationImprovement
o- Aug 2, 2021
a01766d
Save profiling file at the same location every time, overwriting older
vogr Aug 3, 2021
ca34876
Merge branch 'master' into contextualProfile-vogr
vogr Aug 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ benchmarks/
*.DS_Store
external/*
!external/custom-r
.history
profile
.history
121 changes: 93 additions & 28 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ stages:
- Benchmark
- Report

cache:
paths:
- apt-cache/

variables:
REBENCH_OPTIONS: "-df $CI_PROJECT_DIR/benchmarks.data -R"
REBENCH_RUN: "/opt/rbenchmarking/Setup/run.sh /opt/rbenchmarking/rebench.conf /opt/rbenchmarking/Benchmarks /opt/rir/build/release"
Expand Down Expand Up @@ -62,23 +66,24 @@ cpp_check:
needs:
- rir_container
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get -o dir::cache::archives=apt-cache install -y -qq cppcheck
- /opt/rir/tools/cppcheck

# Run check-all in release mode (additionally check pir types)
test_release_1:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_INLINER_INLINE_UNLIKELY: 1
PIR_MAX_INPUT_SIZE: 10000
PIR_INLINER_MAX_SIZE: 10000
PIR_LLVM_OPT_LEVEL: 1
PIR_LLVM_OPT_LEVEL: 0
PIR_OPT_LEVEL: 1
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- RIR_CHECK_PIR_TYPES=1 bin/tests
- RIR_CHECK_PIR_TYPES=1 bin/gnur-make-tests check-devel || $SAVE_LOGS
Expand All @@ -93,16 +98,17 @@ test_release_2:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_INLINER_INLINE_UNLIKELY: 1
PIR_MAX_INPUT_SIZE: 5000
PIR_INLINER_MAX_SIZE: 5000
PIR_LLVM_OPT_LEVEL: 1
PIR_LLVM_OPT_LEVEL: 0
PIR_OPT_LEVEL: 0
PIR_MAX_INPUT_SIZE: 4000
PIR_WARMUP: 5
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- bin/gnur-make-tests check-recommended || $SAVE_LOGS
- ../../tools/check-gnur-make-tests-error
Expand All @@ -123,6 +129,7 @@ tests_debug:
except:
- schedules
script:
- /opt/rir/container/build-releaseassert.sh
- cd /opt/rir/build/releaseassert
- export UNSOUND_OPTS=off
- R_ENABLE_JIT=0 ./bin/tests
Expand All @@ -136,13 +143,16 @@ tests_debug2:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 0
PIR_OPT_LEVEL: 0
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- cd /opt/rir/build/releaseassert
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- ./bin/gnur-make-tests check-devel || $SAVE_LOGS
- ../../tools/check-gnur-make-tests-error
artifacts:
Expand All @@ -164,7 +174,12 @@ tests_fullverify:
except:
- schedules
script:
- curl 10.200.14.25:8080/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz > /opt/rir/external/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
- mkdir -p /opt/rir/build/fullverifier
- cd /opt/rir/build/fullverifier
- /opt/rir/tools/fetch-llvm.sh
- cmake -DCMAKE_BUILD_TYPE=fullverifier ../..
- make -j6
- bin/tests

# Test particular features, like deoptimization and serialization
Expand All @@ -179,18 +194,15 @@ test_features_1:
except:
- schedules
script:
- cd /opt/rir/build/releaseassert
# - PIR_ENABLE_PROFILER=1 ./bin/tests
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- PIR_DEOPT_CHAOS=1000 PIR_INLINER_MAX_INLINEE_SIZE=800 bin/gnur-make-tests check || $SAVE_LOGS
- PIR_WARMUP=2 PIR_DEOPT_CHAOS=400 ./bin/gnur-make-tests check || $SAVE_LOGS
- RIR_SERIALIZE_CHAOS=1 FAST_TESTS=1 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=0 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=1 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=2 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=3 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=4 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=5 ./bin/tests
- PIR_WARMUP=2 PIR_DEOPT_CHAOS=500 ./bin/gnur-make-tests check || $SAVE_LOGS
- PIR_GLOBAL_SPECIALIZATION_LEVEL=0 FAST_TESTS=1 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=1 FAST_TESTS=1 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=2 FAST_TESTS=1 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=3 FAST_TESTS=1 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=4 FAST_TESTS=1 ./bin/tests
- PIR_GLOBAL_SPECIALIZATION_LEVEL=5 FAST_TESTS=1 ./bin/tests
artifacts:
paths:
- logs
Expand All @@ -208,6 +220,7 @@ test_features_2:
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- ./bin/gnur-make-tests check || $SAVE_LOGS
artifacts:
Expand All @@ -216,8 +229,31 @@ test_features_2:
when: on_failure
expire_in: 1 week

test_features_3:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 0
PIR_OPT_LEVEL: 0
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- PIR_DEOPT_CHAOS=1000 bin/gnur-make-tests check || $SAVE_LOGS
- RIR_SERIALIZE_CHAOS=1 FAST_TESTS=1 ./bin/tests
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week


# Run ubsan and gc torture
test_sanitize1:
test_gctorture1:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
Expand All @@ -228,26 +264,32 @@ test_sanitize1:
except:
- schedules
script:
- cd /opt/rir/build/releaseassert
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- R_GCTORTURE=5000 ./bin/gnur-make-tests check || $SAVE_LOGS
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week

test_sanitize2:
test_gctorture2:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
PIR_LLVM_OPT_LEVEL: 0
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- cd /opt/rir/build/release
- PIR_INLINER_MAX_INLINEE_SIZE=2000 ./bin/tests
- PIR_INLINER_MAX_INLINEE_SIZE=1500 PIR_DEOPT_CHAOS=100 ./bin/tests
- /opt/rir/container/build-releaseassert.sh
- cd /opt/rir/build/releaseassert
- PIR_TEST_CLEAR_TEMPS=1 R_GCTORTURE=50 bin/tests
- PIR_TEST_CLEAR_TEMPS=1 R_GCTORTURE=60 bin/tests

# Test with inlining big functions
test_big_inline:
Expand All @@ -256,23 +298,46 @@ test_big_inline:
GIT_STRATEGY: none
PIR_MAX_INPUT_SIZE: 5000
PIR_INLINER_MAX_SIZE: 5000
PIR_INLINER_INLINE_UNLIKELY: 1
PIR_INLINER_MAX_INLINEE_SIZE: 400
PIR_LLVM_OPT_LEVEL: 0
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- /opt/rir/container/install-test-deps.sh
- cd /opt/rir/build/release
- PIR_INLINER_MAX_INLINEE_SIZE=2000 ./bin/tests
- PIR_INLINER_MAX_INLINEE_SIZE=1500 PIR_DEOPT_CHAOS=100 ./bin/tests
- PIR_INLINER_MAX_INLINEE_SIZE=400 PIR_INLINER_INLINE_UNLIKELY=1 ./bin/gnur-make-tests check || $SAVE_LOGS
- ./bin/gnur-make-tests check || $SAVE_LOGS
artifacts:
paths:
- logs
when: on_failure
expire_in: 1 week

# Test with asan and ubsan
test_sanitize:
image: registry.gitlab.com/rirvm/rir_mirror:$CI_COMMIT_SHA
variables:
GIT_STRATEGY: none
stage: Run tests
needs:
- rir_container
except:
- schedules
script:
- curl 10.200.14.25:8080/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz > /opt/rir/external/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz
- mkdir /opt/rir/build/sanitize
- cd /opt/rir/build/sanitize
- /opt/rir/tools/fetch-llvm.sh
- CC=$(ls ../../external/clang*/bin/clang) CXX=$(ls ../../external/clang*/bin/clang) cmake -DCMAKE_BUILD_TYPE=sanitize ../..
- make -j6
# R_LD_PRELOAD is a feature of the test-runner. To repro this without the testrunner use LD_PRELOAD instead.
- LSAN_OPTIONS="symbolize=1" ASAN_SYMBOLIZER_PATH=$(ls /opt/rir/external/clang*/bin/llvm-symbolizer) R_LD_PRELOAD=$(ls /opt/rir/external/clang*/lib/clang/12.0.0/lib/linux/libclang_rt.asan-x86_64.so) bin/tests
# sometimes leak sanitizer segfaults
retry: 1

# Test the benchmarks container before deploying
test_benchmarks:
image: registry.gitlab.com/rirvm/rir_mirror/benchmark:$CI_COMMIT_SHA
Expand Down Expand Up @@ -342,7 +407,7 @@ benchmark_llvm:
paths:
- benchmarks.data
expire_in: 24 month
retry: 2
retry: 1

benchmark_gnur:
image: registry.gitlab.com/rirvm/rir_mirror/benchmark-baseline
Expand Down
9 changes: 6 additions & 3 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
"${workspaceFolder}/external/llvm-11/include/**",
"${workspaceFolder}/external/llvm-11.0.1.src/include/**"
],
"defines": ["ENABLE_SLOWASSERT"],
"defines": [
"ENABLE_SLOWASSERT"
],
"compilerPath": "/usr/bin/g++-8",
"cStandard": "c11",
"cppStandard": "c++14",
"intelliSenseMode": "gcc-x64"
"intelliSenseMode": "gcc-x64",
"compileCommands": "${workspaceFolder}/build/debug/compile_commands.json"
}
],
"version": 4
}
}
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@
"cfenv": "cpp",
"csignal": "cpp",
"__functional_base_03": "cpp",
"__memory": "cpp",
"typeindex": "cpp",
"variant": "cpp"
"__memory": "cpp"
}
}
4 changes: 2 additions & 2 deletions .ycm_extra_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def Settings( **kwargs ):
'-DENABLE_SLOWASSERT',
'-I'+DirectoryOfThisScript()+'/rir/src',
'-isystem'+DirectoryOfThisScript()+'/external/custom-r/include',
'-isystem'+DirectoryOfThisScript()+'/external/llvm-11/include',
'-isystem'+DirectoryOfThisScript()+'/external/llvm-11.0.1.src/include',
'-isystem'+DirectoryOfThisScript()+'/external/llvm-12/include',
'-isystem'+DirectoryOfThisScript()+'/external/llvm-12.0.0.src/include',
'-Wall',
'-Wuninitialized',
'-Wundef',
Expand Down
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(R_HOME ${CMAKE_SOURCE_DIR}/external/custom-r)
set(R_LIBRARY_TREE ${CMAKE_SOURCE_DIR}/packages)
set(R_ROOT_DIR ${R_HOME})
set(R_INCLUDE_DIR ${R_HOME}/include)
set(LLVM_DIR ${CMAKE_SOURCE_DIR}/external/llvm-11)
set(LLVM_DIR ${CMAKE_SOURCE_DIR}/external/llvm-12)

set(R_COMMAND ${R_HOME}/bin/R)

Expand Down Expand Up @@ -54,8 +54,8 @@ set(CMAKE_C_FLAGS_DEBUG "-O0 -DENABLE_SLOWASSERT")
set(CMAKE_C_FLAGS_DEBUGOPT "-Og -DENABLE_SLOWASSERT")
set(CMAKE_C_FLAGS "-std=gnu99")

set(CMAKE_CXX_FLAGS_SANITIZE "${CMAKE_CXX_FLAGS_DEBUGOPT} -fsanitize=undefined -fno-sanitize=alignment -fsanitize-undefined-trap-on-error -fstack-protector")
set(CMAKE_C_FLAGS_SANITIZE "${CMAKE_C_FLAGS_DEBUGOPT} -fsanitize=undefined -fno-sanitize=alignment -fsanitize-undefined-trap-on-error -fstack-protector")
set(CMAKE_CXX_FLAGS_SANITIZE "${CMAKE_CXX_FLAGS_RELEASE} -g2 -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address -fsanitize=leak -fno-sanitize=alignment -shared-libasan -fvisibility=default")
set(CMAKE_C_FLAGS_SANITIZE "${CMAKE_C_FLAGS_RELEASE} -g2 -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address -fsanitize=leak -fno-sanitize=alignment -shared-libasan -fvisibility=default")

MARK_AS_ADVANCED(
CMAKE_CXX_FLAGS_SANITIZE
Expand Down Expand Up @@ -119,11 +119,13 @@ add_custom_target(setup-build-dir

if(${MACOS_USE_GCC_9})
add_custom_target(dependencies
COMMAND ${CMAKE_SOURCE_DIR}/tools/sync.sh --macos_gcc9
COMMAND ${CMAKE_SOURCE_DIR}/tools/build-gnur.sh --macos_gcc9
COMMAND ${CMAKE_SOURCE_DIR}/tools/fetch-llvm.sh --macos_gcc9
)
else()
add_custom_target(dependencies
COMMAND ${CMAKE_SOURCE_DIR}/tools/sync.sh
COMMAND ${CMAKE_SOURCE_DIR}/tools/build-gnur.sh
COMMAND ${CMAKE_SOURCE_DIR}/tools/fetch-llvm.sh
)
endif()

Expand Down
25 changes: 18 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
FROM registry.gitlab.com/rirvm/rir_mirror/base
FROM ubuntu:20.04
ARG CI_COMMIT_SHA
ADD . /opt/rir
RUN echo $CI_COMMIT_SHA > /opt/rir_version && apt-get update && apt-get install -y lsb-release
RUN cd /opt/rir && tools/sync.sh && tools/build-gnur.sh custom-r && rm -rf external/custom-r/cache_recommended.tar .git && find external -type f -name '*.o' -exec rm -f {} \; &&\
mkdir -p /opt/rir/build/release && cd /opt/rir/build/release && cmake -DCMAKE_BUILD_TYPE=release -GNinja ../.. && ninja && bin/tests && \
mkdir -p /opt/rir/build/fullverifier && cd /opt/rir/build/fullverifier && cmake -DCMAKE_BUILD_TYPE=fullverifier -GNinja ../.. && ninja && \
mkdir -p /opt/rir/build/releaseassert && cd /opt/rir/build/releaseassert && cmake -DCMAKE_BUILD_TYPE=releaseslowassert -GNinja ../.. && ninja && \
rm -rf /opt/rir/external/libjit /opt/rir/external/llvm-11 /opt/rir/external/clang+llvm-* /opt/rir/external/*.tar.xz /opt/rir/build/*/CMakeFiles /opt/rir/external/custom-r/src/main
RUN echo $CI_COMMIT_SHA > /opt/rir_version && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq curl git gcc gfortran g++ libreadline-dev libx11-dev libxt-dev zlib1g-dev libbz2-dev liblzma-dev libpcre3-dev libcurl4-openssl-dev libcairo2-dev make libreadline8 libncurses-dev xz-utils cmake tcl-dev tk-dev && \
cd /opt/rir && \
tools/build-gnur.sh && \
rm -rf external/custom-r/cache_recommended.tar .git && \
find external -type f -name '*.o' -exec rm -f {} \; && \
apt-get clean
RUN mkdir -p /opt/rir/build/release && \
cd /opt/rir && \
(curl 10.200.14.25:8080/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz > external/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz || true) && \
tools/fetch-llvm.sh && \
cd /opt/rir/build/release && \
cmake -DCMAKE_BUILD_TYPE=release ../.. && \
make -j8 && \
rm -rf CMakeFiles /opt/rir/external/clang+llvm*
2 changes: 0 additions & 2 deletions container/base/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions container/base/README.md

This file was deleted.

Loading