compiler-flags

No rule to make target 'openmp'?

感情迁移 提交于 2019-12-11 11:58:23
问题 The following is defined in the makefile: CXX = g++ CXXFLAGS = -std=c++11 I would like to compile my code with OpenMP directives without changing the original makefile (which runs perfectly). The manual suggests a way to do this, is by changing it on the command line. However, when I run, make CXXFLAGS=-std=c++11 -fopenmp the error mentioned before pops up. Can someone help me understand what I'm doing wrong? 回答1: The problem here is the space between -std=c++11 and -fopenmp . It splits these

What is the NO_PERF flag in reactive extensions source code doing

家住魔仙堡 提交于 2019-12-11 11:07:35
问题 In the ReactiveExtensions source code there are huge swathes of codes switching between different implementations such as https://github.com/Reactive-Extensions/Rx.NET/blob/master/Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/QueryLanguage.StandardSequenceOperators.cs and a snippet #if !NO_PERF return new Distinct<TSource, TSource>(source, x => x, EqualityComparer<TSource>.Default); #else return Distinct_(source, x => x, EqualityComparer<TSource>.Default); #endif what is the intention of

What does the -fPIC compilation flag does?

落花浮王杯 提交于 2019-12-11 01:47:23
问题 What the -fpic flag does? I want to install a library (OpenSFM) and it is stated that it will need the Ceres Solver built and installed with the -fPIC compilation flag. The problem is I already installed the Ceres Solver without the -fPIC flag and other library already depended on it. How can I solve this? 回答1: A good explaination for -fPIC can be found here. I think the main question here is whether if you can still go ahead and install OpenSfM without rebuilding Ceres Solver. As far as I

Enabling flags (Wall, pedantic) for C/C++ compilation within Eclipse

依然范特西╮ 提交于 2019-12-10 21:37:07
问题 I am using Eclipse to write C/C++ programs. I would like to compile my code using the -Wall and -pedantic flags. How do I enable these flags within Eclipse so they are used by default whenever I compile a C/C++ program? 回答1: Go to Eclipse -> Project Explorer -> your project -> context menu -> Properties. A dialog appears. In the left pane, open "C/C++ Build" -> Settings. In the right pane, ensure that tab "Tool Settings" is selected -> Under "GCC C++ Compiler" select "Warnings" -> check the

How to add SIMD-related compiler flags in visual studio 2010

核能气质少年 提交于 2019-12-10 18:29:27
问题 I found this list of flags: http://www.ncsa.illinois.edu/UserInfo/Resources/Software/Intel/Compilers/10.0/main_for/mergedProjects/optaps_for/common/optaps_dsp_targ.htm and I'd like to try and add some of them to my project. I can't seem to find the way to do it on a visual studio 2010 platform :( Does anyone know how to do it? Thanks!!! 回答1: The /arch flag in Visual Studio allows you to specify the target processor architecture, and includes support for SSE2, amongst others. This MSDN page

Set Java compiler compliance level

ε祈祈猫儿з 提交于 2019-12-10 02:45:21
问题 I need to compile a Java program on the command line, and I am trying to set the compiler level to a lower one (1.6). I tried like this but it didn't work: javac -1.6 Hello.java 回答1: Use -source and -target options: javac -target 1.6 -source 1.6 Hello.java 回答2: Use: javac -source 1.6 -target 1.6 Hello.java This information comes from running javac -help : Usage: javac <options> <source files> where possible options include: -g Generate all debugging info -g:none Generate no debugging info -g:

How can I pass the output of a command as a compiler flag through a Qt project file?

醉酒当歌 提交于 2019-12-09 20:22:30
问题 I'm trying to add the output of "git describe" to the about window of my application, so it's easier to find out what version of the application people use. I can do it by adding the following compiler flag: -DAPP_VERSION="$(git describe HEAD)" But since the project is based on qmake, I would like to find a way to put this into the Qt project file. Is this possible? And if so, how? edit: I tried adding the following: QMAKE_CXXFLAGS += -DAPP_VERSION="$(git describe HEAD)" But it just gave me "

How do I set unicode as character set in the ALL_BUILD and ZERO_CHECK Visual Studio 2013 projects that are generated by Cmake?

一曲冷凌霜 提交于 2019-12-08 15:24:25
问题 I am currently using CMake to create a bunch of Visual Studio 2013 projects and it works. However, the automatically created ZERO_CHECK and ALL_BUILD projects are set to use MBCS by default although I want them to use the Unicode character set. I did specify the use of the Unicode character set for my projects with the following : ADD_DEFINITIONS(-DUNICODE) ADD_DEFINITIONS(-D_UNICODE) and it worked. I tried to set the c++ compiler flags with something like : SET(CMAKE_CXX_FLAGS "${CMAKE_CXX

How to add compiler flags on codeblocks

限于喜欢 提交于 2019-12-08 05:57:12
问题 I've been trying to compile a simple multithreaded piece of code I found online in an effort to learn how to multithread. To run this piece of code I need to use the compiler flags: -pthread and -std=c++0x . But whenever I try to add the flags the build log doesn't show them being used. I've tried some generic tips online to get these to work, but none of them worked. Can someone help? I've tried other advice online to add compiler flags to code blocks, but when I do that and check the build

Influencing function cloning/duplication/constant propagation in gcc

会有一股神秘感。 提交于 2019-12-07 06:40:18
问题 When running gcc with optimizations-on, it clones (duplicates) C functions when it considers that the function is in a hot path or there's constants propagating to the function arguments. More specifically, this seems to be controlled by the fipa-cp-clone option. Is there any way to influence this? For instance mark one parameter with some attribute, as a compile-time constant (like you can do in C++ with a template parameter) which will cause the function to be cloned? 回答1: What matters is