<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">Matthias -- thanks for the response! That tip worked great for creating the .bc files. For posterity, this is the exact command I used:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)"><br></div><div class="gmail_default"><font face="monospace, monospace"><font color="#000000">cmake -DCMAKE_C_COMPILER=/path/to/<wbr>llvm/build/bin/clang -DCMAKE_CXX_COMPILER=/path/to/<wbr>llvm/build/bin/clang++ -DCMAKE_C_FLAGS=--save-temps=<wbr>obj -DCMAKE_CXX_FLAGS=--save-<wbr>temps=obj ..</font><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">So now, I've got a bunch of .bc files sitting around in my build folder. For the SingleSource benchmarks, this is great, but eventually for bigger benchmarks I'll need to get them linked all together. Does anyone have any clever ideas on how to do this other than just manually running `llvm-link` to manually link all of them? Even that may not be feasible for bigger benchmarks.</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">Though I've used CMake/make for a while now, I'm unfamiliar with the order in which it actually compiles and links. However, I was thinking I might be able to force the "compile" step to take C/C++ files and produce .bc files, and the "link" step to take .bc files and link them together to produce a single .bc (instead of linking .o files to make a binary). I thought this might be achieved through manipulation of CMAKE_C[++]_FLAGS and other settings.</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">Gus</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 26, 2018 at 1:04 PM, Matthias Braun <span dir="ltr"><<a href="mailto:mbraun@apple.com" target="_blank">mbraun@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">There is no immediate support for this in the test-suite cmake buildsystem. There is something in the Makefile system indeed, but it lacks documentation and I'm not aware of any examples of how to use it.<div><br></div><div>I would recommend to use `CMAKE_C_FLAGS=--save-temps=<wbr>obj cmake ...` in the test-suite. The --save-temps=obj flag will make clang place a bitcode file next to each .o file. </div><div><br></div><div>- Matthias</div><div><br></div><div><div><div><div><blockquote type="cite"><div><div class="h5"><div>On Feb 26, 2018, at 9:42 AM, Gus Smith via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-1983655396528867539Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hello all.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I'm in need of a benchmark that can be compiled to IR or bytecode. I found the test-suite project (<a href="https://llvm.org/docs/TestSuiteMakefileGuide.html" target="_blank">https://llvm.org/docs/<wbr>TestSuiteMakefileGuide.html</a>) and thought a benchmark in that project might work. However, I'm having trouble figuring out how to actually compile any of the benchmarks to IR or bytecode. Using cmake and make I can compile them to binaries, but at no point do I see any bytecode being produced.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">The Makefiles in this project have rules for compiling and linking bytecode. Are there options I need to be passing to cmake or make?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Alternatively, are there other known benchmarks (and associated makefiles) that compile to IR/bytecode? I can go through the work of setting up benchmarks to compile to bc/IR, but I figured someone has likely already done this!</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks for the help,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Gus Smith, Penn State</div></div></div></div>
______________________________<wbr>_________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br></div></blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><b style="background-color:rgb(255,255,255)"><font color="#000000" size="4">Gus Smith</font></b><div><div><span style="font-size:12.8px"><font color="#000000">Penn State University</font></span></div><div><span style="color:rgb(0,0,0);font-size:12.8px">M.S./B.S. Computer Science and Engineering '18</span><br></div></div><div><br></div><div><span style="color:rgb(0,0,0)">Microsystems Design Lab - Researcher</span></div><div><span style="font-size:small;color:rgb(0,0,0);font-family:arial,helvetica,sans-serif"><br></span></div><div><div><span style="background-color:rgb(255,255,255)"><font color="#000000">(570)817-9340 | </font></span><a href="mailto:hfs5022@psu.edu" target="_blank">hfs5022@psu.edu</a> <br></div></div></div></div></div></div></div></div></div></div></div>
</div>