Giter Site home page Giter Site logo

CPPFLAGS vs CXXFLAGS about s2 HOT 4 CLOSED

jeroen avatar jeroen commented on May 25, 2024
CPPFLAGS vs CXXFLAGS

from s2.

Comments (4)

rubak avatar rubak commented on May 25, 2024

Thanks for pointing this out. I will try to clean up CPPFLAGS so it doesn't include stuff like -pthread etc.

from s2.

rubak avatar rubak commented on May 25, 2024

I have looked a bit more into this and I think I can clean things a bit. However, the pthreads section of Writing R Extensions states that one should use

PKG_CPPFLAGS = -pthread
PKG_LIBS = -pthread

Reading on the web it seems your comment about this belonging to CFLAGS/CXXFLAGS is more appropriate. Do you think I should notify somebody on r-devel so they can update that section?

from s2.

jeroen avatar jeroen commented on May 25, 2024

Hmm if it written in WRE than I stand corrected. But the other flags -g -o definitely don't belong in the preprocessor.

from s2.

rubak avatar rubak commented on May 25, 2024

OK. You are definitely right about the -g -o flags. However, as I tried to say before, I also think you in principle are right about the -pthread flag belonging to the compiler and not in the preprocessor as WRE states, but I don't know if it is worth the trouble to point this out to R core if things work fine the way they do it now (if it ain't broke -- don't fix it)?

In the gcc man page it sounds like -pthread is a compiler flag that automatically set flags for both the preprocessor and the linker:

-pthread
Adds support for multithreading with the pthreads library. This option sets flags for both the preprocessor and linker.

And according to this SO answer clang will only accept the flag when compiling and not when linking.

from s2.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.