Questions tagged [compiler-flags]

Parameters that may be passed to a compiler affecting how compilation is carried out. These can have a variety of effects on the paths searched for external dependencies, optimization level, how source code is interpreted, code checks that are performed and preprocessor directives.

Parameters that may be passed to a compiler affecting how compilation is carried out. These can have a variety of effects on the paths searched for external dependencies, optimization level, how source code is interpreted, code checks that are performed and preprocessor directives.

479 questions
3
votes
1 answer

Where is the complete documentation of Clang flags?

The references I know are here: http://clang.llvm.org/docs/ClangCommandLineReference.html http://clang.llvm.org/docs/DiagnosticsReference.html But I can't find flags like -msse4.1, so is there a complete list of supported flags on clang.llvm.org, or…
jw_
  • 1,663
  • 18
  • 32
3
votes
1 answer

Is gcc flags repetition and ordering important?

I see some of gcc flags repeated when building C extension for python. When I run: python setup.py build_ext The running build command looks like this: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64…
Mas Bagol
  • 4,377
  • 10
  • 44
  • 72
3
votes
0 answers

gcc force not to use DSP

Is it possible to force a tricore-gcc (which has mostly the same flags as gcc) compiler to not use special instructions? I want to measure the run time of code on a microcontroller which has DSP capabilities. uint32_t c[100],b[100],a[100]; for(int…
jonnyx
  • 345
  • 2
  • 16
3
votes
2 answers

Compiler flag to reveal functions like strdup

I've been given some starter code for a project I have to complete in a class I'm taking. The code compiles fine on the university computers however when I try to compile the code on my own computer I get errors due the function call strdup. From…
Ian Burris
  • 6,325
  • 21
  • 59
  • 80
3
votes
1 answer

How do the various ways of setting GHC options in haskell-stack work together

While setting up a deploy pipeline for optimised builds of a server application, I ran into some trouble getting the GHC options right with stack-1.6.5. In particular, from the docs it doesn't get clear to me how the various ways to specify GHC…
htmue
  • 31
  • 3
3
votes
1 answer

gfortran gives undefined reference to `dacosd_` even with `-dec-math`

I'm trying to compile a Fortran application using gfortran, linking with Intel MKL libraries. undefined reference to `dacosd_' There is a acos or acosd (inverse cosine in degree), I'm almost there but I can't compile using -fall-intrinsics or…
kensaii
  • 314
  • 5
  • 16
3
votes
1 answer

Why isn't NVRTC optimizing out my integer division and modulo operations?

I compiled a kernel in NVRTC: __global__ void kernel_A(/* args */) { unsigned short idx = threadIdx.x; unsigned char warp_id = idx / 32; unsigned char lane_id = idx % 32; /* ... */ } I know integer division and modulo are very…
Kh40tiK
  • 2,276
  • 19
  • 29
3
votes
1 answer

In CMake, how do I add to a compiler flag only if it isn't used already?

I'm using CMake, and I want to add a compilation flag to some flags variable. For example, I want to add -DFOO to the CMAKE_CXX_FLAGS_RELEASE variable. Right now, I use: set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DFOO" ) ... but if…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
3
votes
1 answer

gcc arguments: -pthread. What does it do?

I'm getting started with multi-thread programming using gcc under Debian 8. I've successfully written and run a multi-threaded test app (foobar.c), but I'm confused by the Makefile (copied from an example). In particular, the command that works is …
DontPanic
  • 2,164
  • 5
  • 29
  • 56
3
votes
2 answers

Gfortran -Wuninitialized flag misses variable in do loop

Consider the following code: PROGRAM TEST IMPLICIT NONE REAL:: noninit noninit = noninit + 1 END PROGRAM TEST If compiled with gfortran -Wall TEST.f90 a warning is correctly produced that ‘noninit’ is used uninitialized in this function…
1QuickQuestion
  • 417
  • 6
  • 16
3
votes
1 answer

List of Xcode compiler flags

I know there are many compiler flags and how to use them. At times while seeing a third-party code we encounter a new flag and fail to understand why the hell this flag is used? How no warnings are shown even though there is retain-cycle in an…
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
3
votes
1 answer

Adding Metadata to gcc generated executable

Is there a way to compile a c or c++ project with gcc on Windows in which you can set the output executable to have Metadata stating the author, license, etc similar to a visual Studio project?
3
votes
1 answer

How to specify custom compiler flags for Visual Studio Compiler

With the GCC you can use -D to pass for example a value to a macro that you defined in your code. But I can't find any information on how to do this for the VSC. Does anybody know? So an example for the GCC case would like like…
lo tolmencre
  • 3,804
  • 3
  • 30
  • 60
3
votes
2 answers

How to define Eq instance of List without GADTs or Datatype Contexts

I am using Glasgow Haskell Compiler, Version 7.8.3, stage 2 booted by GHC version 7.6.3. I attempted to use the following data definition for a List type in Haskell: data Eq a => List a = Nil | Cons a (List a) However, the -XDatatypeContexts flag…
Timothy Swan
  • 623
  • 3
  • 9
  • 21
3
votes
1 answer

Alternative to python-config callable from within Python

I want to have a Python script build a Python C extension module for whichever version of the Python interpreter with which the script is being run. To this purpose, I want to dynamically acquire the relevant C compiler flags – one way to accomplish…
Wrzlprmft
  • 4,234
  • 1
  • 28
  • 54