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
0
votes
0 answers

Open MPI and gfortran require different compiler flags?

I have a serial program that uses the ssyevr lapack routine to diagonalize matricies. It runs fine but is a little slow. Recently, I downloaded OpenMPI through MacPorts with the intention of utilizing the dual core processor (with shared memory) to…
0
votes
1 answer

Rcpp Makevars related warning

I am the mantainer of few R packages that use Rcpp for some core calculations. Wishing to try a new feature of the Rcpp package as described in Rcpp 0.12.18 Rbloggers To do so I did the following: I created a Makevars and Makevars.win in my scr…
Giorgio Spedicato
  • 2,413
  • 3
  • 31
  • 45
0
votes
1 answer

Link Boost headers without -I flag ( MinGW Distro from nuwen.net )

I Have MinGW Distro with GCC comiler and Boost Libs (download from nuwen.net). I need link some Boost headers. And GCC don't looking for headers in "C:\MinGW\include" folder. It looking for only in this folders: g++ ./server.cpp -v -c #include…
lazzlo
  • 25
  • 4
0
votes
0 answers

Same path as both a system and normal include CMake

Problem: When using the following target_include_directories call on the same path, CMake is overwriting the normal,-I flag with the -isystem flag. Call: add_library(lib SHARED libSource.cpp) target_include_directories(lib PUBLIC…
Alpha234
  • 1
  • 5
0
votes
0 answers

gfortran: -fimplicit-none does not bypass error

I'm trying to compile a Fortran code where implicit none is used. This is the code I'm trying to compile module qe_p_psi ! ! Get the or from Quantum Espresso ! Get the mapping of the projectors index ! use kinds, …
kensaii
  • 314
  • 5
  • 16
0
votes
1 answer

How can I pass a string as a preprocessor token?

I am trying to pass a string as a parameter when compiling to this code: #include #define MY_STRING #STRING_IN int main(int argc, char** argv) { std::cout << MY_STRING; } It is compiled with the flag: -DSTRING_IN=foo I get the…
463035818_is_not_an_ai
  • 109,796
  • 11
  • 89
  • 185
0
votes
3 answers

Any way to tell g++ to use another binary for compiling?

This question may sound a little absurd. Facts: I have a program written in C++. It uses lot of in-house libs. I don't have read permission to the libs. So I have to build with a given tool which does have access to the lib headers and…
nakiya
  • 14,063
  • 21
  • 79
  • 118
0
votes
1 answer

CMake + CUDA + separable compilation -> "nvcc doesn't know what to do with ' ' "

I use CMake for a project of mine involving CUDA. Recently I have had to turn on "separable compilation" of the some of my CUDA code: set(CUDA_SEPARABLE_COMPILATION ON) but then, building started to fail. As an example, the following would…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
0
votes
0 answers

CPLEX 12.8 requires -ldl in the linker flags

My question is about this issue with CPLEX 12.8 (unlike the previous versions, it requires -ldl linker flag). I use Code Blocks (for C++) in Ubuntu 16.04 and already tried to add -ldl flag in the Linker setting (Other linker options). Unfortunately…
rasul
  • 1,009
  • 9
  • 14
0
votes
1 answer

Is there a way to make a c++ compiler flag as default

Just like we specify input flags in the settings of the project in Xcode Can I make few flags like -O3 or -fopenmp as default flags in command line when I use Terminal. So that I dont have to type them everytime I compile some c++ fies. Is there a…
dpr
  • 1
0
votes
1 answer

Why does CMake skips the -I Flag from the g++ command line

I have a working C project and just added some CPP stuff. For includes I use include_directories("./src/") but the resulting commandline that is called from the generated makefile only contains "./src/" instead of the expected -I"./src/" Whats going…
Tarion
  • 16,283
  • 13
  • 71
  • 107
0
votes
1 answer

link gfortran with Intel MKL

I have an application that is written in Fortran and call Intel PARDISO for parallelization. Linking directly with PARDISO doesn't seem like a possibility because the current gfortran I'm using is 5.4.0. What compiler options/flags do you use to…
kensaii
  • 314
  • 5
  • 16
0
votes
1 answer

How to build a C++ make project using specific LDFLAGS (Mac OSX)

I have a project that needs to be built using cmake and make. However, I want the project to use libc++ (since its written in C++11) so I need to set the right linker flags. Is there a way I can pass the following flags via command line? …
ohbrobig
  • 939
  • 2
  • 13
  • 34
0
votes
0 answers

CMake-generated semicolons between compiler flags cause errors

In the Vc project, OptimizeForArchitecture.cmake is used to optimize compilation for specific architectures. In my project, I used the old version of the above file. After I update it to the newest version, the compilation flags in flags.make files…
chaosink
  • 1,329
  • 13
  • 27
0
votes
1 answer

Compiler flag checked twice in CMake CHECK_CXX_COMPILER_FLAG

I use a custom macro to check and add a compiler flag to the compilation in CMAKE. The code I use for this is that: MACRO(CheckAndAddFlag flag) # We cannot check for -Wno-foo as this won't throw a warning so we must check for the -Wfoo option…
Flamefire
  • 5,313
  • 3
  • 35
  • 70