compilation

Compiling Regular Expressions in Python

萝らか妹 提交于 2019-12-05 15:59:40
I'm working through Doug Hellman's "The Python Standard Library by Example" and came across this: "1.3.2 Compiling Expressions re includes module-level functions for working with regular expressions as text strings, but it is more efficient to compile the expressions a program uses frequently." I couldn't follow his explanation for why this is the case. He says that the "module-level functions maintain a cache of compiled expressions" and that since the "size of the cache" is limited, "using compiled expressions directly avoids the cache lookup overhead." I'd greatly appreciate it if someone

How to compile AndroidAnnotations with Google Android Gradle Plugin?

主宰稳场 提交于 2019-12-05 15:59:37
I compile a android project with google android gradle plugin and android annotations, It seems that the java compile source code before android annotations generate some source files. What's wrong with this? Thanks! I compile: git clone git@github.com:sinojelly/androidannotations-dagger-example.git -b google-android-gradle-plugin The build.gradle is: buildscript { repositories { mavenLocal() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4.2' classpath 'com.googlecode.androidannotations:androidannotations:2.7.1' classpath 'com.googlecode.androidannotations

Do different JDK Updates produce different Java byte code?

我怕爱的太早我们不能终老 提交于 2019-12-05 15:44:26
问题 A hypothetical scenario: I've got a project whose source compliance level is specified to 1.5. Now I compile this project with two different JDKs: At first with JDK 6 Update 7 and then with JDK 6 Update 20. Do these two different JDKs produce different Java byte code, although they only differ in their Update version? 回答1: The generated code usually only differs in case of compiler bug fixes. However the JLS does not specify a 1:1 mapping from source code to the generated byte code, so you

Find programmatically if under C++ or C++/CLI

≯℡__Kan透↙ 提交于 2019-12-05 14:58:48
问题 I would like my C++/CLI headers to compile even when under another platform. Of course I am not expecting to compile them but just ignore them. Would this be appropriate ? (_MSC_VER) #ifdef _MSC_VER using namespace System; namespace ENMFP { public ref struct Data { }; } #endif Thanks ! 回答1: You can use the __cplusplus_cli predefined macro documented here: #ifdef __cplusplus_cli using namespace System; namespace ENMFP { public ref struct Data { // ... }; } #endif // __cplusplus_cli 来源: https:/

symbol(s) not found for architecture x86_64 os x lion

◇◆丶佛笑我妖孽 提交于 2019-12-05 14:31:37
When trying to compile a simple c++ test.cpp code with opencv 2.3.1 as as third library, I get the following error message: Undefined symbols for architecture x86_64: "_cvLoadImage", referenced from: _main in test.cpp.o ld: symbol(s) not found for architecture x86_64 For info, am using CMake for linking, and gcc 4.2.1 i686-apple-darwin11 obtained from Xcode 4.2. OpenCV had been installed using CMake: ccmake ../sourcecode Note please that I get a similar message when trying to compile SoQt (coin3D), after commands ./configure & sudo make: . . . "typeinfo for QWidget", referenced from: typeinfo

What are the available tools to compile .NET projects to standalone native binaries?

走远了吗. 提交于 2019-12-05 13:43:30
What tools do you know to compile .NET projects to native binaries that run without .NET Framework, so far I've found : Xenocode Postbuild for .NET , which costs $1599. Salamander .NET Linker , which costs $1249. Mono Ahead-of-Time compilation (AOT) , free. Thanks to JaredPar and Reed Copsey Native Image Generator (Ngen.exe) , free, doesn't do what I'm talking about, it does pre-JIT compiling, the resulting executable-file DOES need .NET framework to work. Do you know any other products to add to the list? It's limited, but Mono AOT ($0) does this, as well. Add the Mono project to your list.

Compile wix project using “Any CPU” instead of “X86”

家住魔仙堡 提交于 2019-12-05 13:34:55
问题 When I compile a wix project, and wix launch the compilation via MSbuild of all the existing projects, can I use "Any CPU" instead of "X86" or "64 bit" ? If not, how can I compile the projects using "Any CPU" ? 回答1: If your question is whether you can compile WIXPROJ for Any CPU then the answer is no. "WiX projects will not be built when building the 'Any CPU' platform because Windows Installer packages are CPU-specific. " The TargetPlatform setting in your WIXPROJ defines the way Windows

Checking file size in makefile, stopping if file is too short

百般思念 提交于 2019-12-05 13:17:04
Is there a way to check if the size of a particular file is less than some constant? I'm assuming things about size in the makefile and want to make sure I'll get an error if my assumptions are not met. Something like assert, but in makefile. if filesize(file) > C then error else continue compilation Put this in your rule, somewhere before the compilation: test -n "$$(find filename -a -size +NNNc)" where filename is the filename and NNN is the size in octets. This returns false and halts make when the size is less than or equal to NNN . My approach for this, is probably not the most pretty

How to check that a method always returns a value

≡放荡痞女 提交于 2019-12-05 13:14:44
I wrote a compiler which is already working decently. It checks that all non-void methods do have at least one return statement, but it does not check whether all code paths within a non-void method return a value. So, for example, if I have the following code: int function(bool a) { if(a){ return 5; } } It will compile "fine" and if a is false, control will drop off the function and keep executing whatever is defined under the function. Is there some algorithm I can use to perform this check so that I always know if a method is always returning a value? Or will I need to reinvent the wheel?

c compiler cannot create executable on mac

只愿长相守 提交于 2019-12-05 12:59:52
Everytime I try to install a package or software on my mac (Maverick) from a config file, it automatically fails when checking the C compiler. It says "configure: error: C compiler cannot create executables". Besides, Homebrew works perfectly. I attached an example of config.log. I haven't found any satisfaction in the related previous posts, I apologize if the issue was solved. ## ----------- ## ## Core tests. ## ## ----------- ## configure:2530: checking for gcc configure:2546: found /usr/local/bin/gcc configure:2557: result: gcc configure:2786: checking for C compiler version configure:2795