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

Compile and ship Csmith as part of python package. #348

Merged
merged 2 commits into from
Aug 3, 2021

Conversation

ChrisCummins
Copy link
Contributor

Currently, when the csmith dataset is first used, the source code is
downloaded, unpacked and compiled on the local machine. This can cause
issues for systems without a standard toolchain for building C code,
or for other systems with limitations on running arbitrary code, for
example, in Google's Colab notebook environments.

This patch adds csmith to the set of compiled C code used to build the
CompilerGym package. It adds the generated binaries and headers to the
pip wheel so that pip install compiler_gym will ship with a working
Csmith binary.

Fixes #345.

Currently, when the csmith dataset is first used, the source code is
downloaded, unpacked and compiled on the local machine. This can cause
issues for systems without a standard toolchain for building C code,
or for other systems with limitations on running arbitrary code, for
example, in Google's Colab notebook environments.

This patch adds csmith to the set of compiled C code used to build the
CompilerGym package. It adds the generated binaries and headers to the
pip wheel so that `pip install compiler_gym` will ship with a working
Csmith binary.

Fixes facebookresearch#345.
@ChrisCummins ChrisCummins added this to the v0.1.10 milestone Jul 30, 2021
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 30, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jul 30, 2021

Codecov Report

Merging #348 (63acf99) into development (0c30aeb) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #348      +/-   ##
===============================================
- Coverage        85.88%   85.83%   -0.06%     
===============================================
  Files               87       87              
  Lines             4796     4750      -46     
===============================================
- Hits              4119     4077      -42     
+ Misses             677      673       -4     
Impacted Files Coverage Δ
compiler_gym/envs/llvm/datasets/csmith.py 88.23% <100.00%> (-1.15%) ⬇️
compiler_gym/bin/service.py 78.43% <0.00%> (-0.42%) ⬇️
compiler_gym/datasets/dataset.py 84.92% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c30aeb...63acf99. Read the comment docs.

@ChrisCummins ChrisCummins merged commit 949b6c8 into facebookresearch:development Aug 3, 2021
@ChrisCummins ChrisCummins deleted the csmith-bin branch August 3, 2021 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[llvm] generator://csmith-v0 dataset does not work in Google Colab environment
3 participants