compilation

Running the C# compiler from a C# program

左心房为你撑大大i 提交于 2019-12-06 13:57:34
问题 I am trying to build a C# program that converts a different language into C# code. I have the program working fine, converting the code and writing it to a .cs file. I want to have this file automatically be compiled, and run, however I cannot figure out how to do this with C#. I can do it manually by simply running a batch file I wrote, and I attempted to run this batch file from C# using the System.Diagnostics.Process class. When it ran it gave an error within the batch code itself, saying

gcc/g++: error when compiling large file

China☆狼群 提交于 2019-12-06 13:47:20
I have a auto-generated C++ source file, around 40 MB in size. It largely consists of push_back commands for some vectors and string constants that shall be pushed. When I try to compile this file, g++ exits and says that it couldn't reserve enough virtual memory (around 3 GB). Googling this problem, I found that using the command line switches --param ggc-min-expand=0 --param ggc-min-heapsize=4096 may solve the problem. They, however, only seem to work when optimization is turned on. 1) Is this really the solution that I am looking for? 2) Or is there a faster, better (compiling takes ages

How can I compile first 2 pages of 24 pages in a Latex document?

非 Y 不嫁゛ 提交于 2019-12-06 13:34:36
My work has over 24 pages in Latex. I need only the abstract and introduction in pdf. How can you compile only the first two pages? I'd just make a new file with only the abstract and introduction and compile that. Actually, if this is not just a one-time thing, I'd use three files: absintro.tex : \begin{abstract} ... \end{abstract} ...introduction... onlyabsintro.tex : ... \begin{document} \include{absintro.tex} \end{document} fullreport.tex : ... \begin{document} \include{absintro.tex} ...other stuff... \end{document} (Obviously the filenames can be whatever you want, this just shows the

How to generate the machine code of Thumb instructions?

断了今生、忘了曾经 提交于 2019-12-06 13:21:40
I searched Google for generating machine code of ARM instructions, such as this one Converting very simple ARM instructions to binary/hex The answer referenced ARM7TDMI-S Data Sheet (ARM DDI 0084D). The diagram of data processing instructions is good enough. Unfortunately, it's for ARM instructions, not for Thumb/Thumb-2 instructions. Take the B instruction as an example. ARM Architecture Reference Manual - ARMv7-A and ARMv7-R edition section A8.8.18, Encoding T4: For the assembly code: B 0x50 How can I encode the immediate value 0x50 into the 4-byte machine code? Or if I want to write a C

Compile parameters for MIPS based codesourcery toolchain?

怎甘沉沦 提交于 2019-12-06 13:14:47
I installed codesourcery cross compile toolchain for mips32 architecture on my WIN 7 machince. I want to first compile a simple 'factorial' binary for my router which is based on MIPS32. From little search on the internet, I found it is based on MIPS32 big-endian. #cat /proc/cpuinfo system type : 96338W2 processor : 0 cpu model : BCM6338 V1.0 BogoMIPS : 239.20 wait instruction : no microsecond timers : yes tlb_entries : 32 extra interrupt vector : yes hardware watchpoint : no unaligned access : 1269919 VCED exceptions : not available VCEI exceptions : not available # cat /proc/version Linux

Xcode, is it possible to intercept and change code on build without updating the file? If so, how?

女生的网名这么多〃 提交于 2019-12-06 13:12:53
问题 I need a way to intercept the code before it goes into the compiler, change it, AND have it remain the same in the file / in Xcode afterwards. I thought build scripts were a sort of stream interception but that doesn't seem to be the case. Another method might be to run a script both before and after build. Are there any implications with this I should be aware of? ----- EDIT ----- Why? I have an idea for an auto-logging system based on a certain comment syntax. I want to be able, on build,

GCC optimization levels. Which is better?

狂风中的少年 提交于 2019-12-06 13:01:19
问题 I am focusing on the CPU/memory consumption of compiled programs by GCC. Executing code compiled with O3 is it always so greedy in term of resources ? Is there any scientific reference or specification that shows the difference of Mem/cpu consumption of different levels? People working on this problem often focus on the impact of these optimizations on the execution time, compiled code size, energy. However, I can't find too much work talking about resource consumption (by enabling

How does clang manage to compile this code with undefined behavior into this machine code?

你说的曾经没有我的故事 提交于 2019-12-06 12:52:23
It's a variation of code from this tweet , just shorter one and not causing any damage to noobs. We have this code: typedef int (*Function)(); static Function DoSmth; static int Return7() { return 7; } void NeverCalled() { DoSmth = Return7; } int main() { return DoSmth(); } You see that NeverCalled() is never called in the code, don't you? Here's what Compiler Explorer shows when clang 3.8 is selected with -Os -std=c++11 -Wall Code emitted is: NeverCalled(): retq main: movl $7, %eax retq as if NeverCalled() was actually called before DoSmth() and set the DoSmth function pointer to Return7()

mysql-python: building a completely standalone _mysql.so on Mac OS X?

自闭症网瘾萝莉.ら 提交于 2019-12-06 12:23:11
问题 I'm running a database server in a Linux VM (Ubuntu 9.10) under VMware Fusion, but coding Django on the Mac side. Installing mysql-python requires that MySQL is installed on the Mac for compiling _mysql.so into site-packages . However, after this is done, I have no further use for MySQL on the Mac side, and would rather just delete it. Of course, this is not possible when _mysql.so requires /usr/local/mysql/lib/libmysqlclient_r.16.dylib . There is a "static" option in mysql-python's site.cfg

Building Android source: error when executing mm?

南笙酒味 提交于 2019-12-06 12:07:03
问题 Update I got this working. How I am not sure. I did no config changes at all. What I did was: Modify Dialog in frameworks/base/core/java/android/app . Went to my root ( /path/to/source/ ). Then I did mmm frameworks/base/ . Everything worked. Then I tried exactly what I had already tried below: Modify ScrollView (I actually never said which file I was modifying) in frameworks/base/core/java/android/widget . I ch 'ed to frameworks/base/core/java/android/widget . Then I did mm . This time I had