Giter Site home page Giter Site logo

Scons error about issues HOT 8 OPEN

cevelop avatar cevelop commented on July 19, 2024
Scons error

from issues.

Comments (8)

marcelhuberfoo avatar marcelhuberfoo commented on July 19, 2024

You have to specify TEMP manually if you want to use it. Cevelop/Scons has a limited default environment. To use environment variables from your system/starting shell, pass it as shown in the following image (project settings).
cevelopissue58

The more pythonic way would be to access dictionaries using non-failing access methods and a reasonable fallback:

env = Environment(ENV={'PATH': os.environ['PATH'], 'TEMP' : os.environ.get('TEMP','/tmp')})

from issues.

aacirino avatar aacirino commented on July 19, 2024

Hi Marcel, the TEMP dir issue is solved, but then another problem surfaced. It seems that somehow Scons is truncating the compiler invocation:
scons: building associated VariantDir targets: Debug/src
o Debug/src/test.o -c -I/usr/local/include src/test.cpp
scons: src' is up to date. sh: o: command not found`

from issues.

marcelhuberfoo avatar marcelhuberfoo commented on July 19, 2024

Can you attach your SConstruct file? The current output does not help much.

from issues.

aacirino avatar aacirino commented on July 19, 2024

Sure. I didn't edit the file, it is as generated by Cevelop.

SConstruct.zip

from issues.

marcelhuberfoo avatar marcelhuberfoo commented on July 19, 2024

Thank you for the hint.
We probably need to update the default generated 'scons' files regarding the env variable access and python3 changes.

It looks as scons is not able to detect a default compiler for your macos/darwin environment. As the tools clang and clangxx are not default added to the tools list for any of the known scons platforms, they will not be found by default. See SConstruct lines 30 and 31 in the following image if you want to add clang/clangxx to your tools list.
The main thing is, that in a generated and managed cevelop/scons project, compiler name and settings will be taken from the cevelop project settings stored in SConfig.py. Check your SConfig.py file for a COMPILER_NAME entry which will be used in my SConstruct at line 36. I guess it will currently be empty if you did not set it or did not clean and build the scons project.
I did override my default detected g++ with clang++ and it compiled using clang++.
cevelopissue58cpppath

from issues.

aacirino avatar aacirino commented on July 19, 2024

Hi Marcel, it seems to me that the Scons generator doesn't use the project settings in the case of LLVM toolchain (or any toolchain other then standard GCC, perhaps). Please take a look at the original and edited SConfig files I've attached. The original just leaves blank the fields that should have been set with the settings I have in my project configuration. With the edited (correct) SCconfig in the command line I am able to build the project, the problem is that Cevelop will keep substituting the edited file with a new one, with empty fields.

As far as I can see, the Scons generator needs to be updated for the case of a LLVM toolchain, of for non default toolchains. It is weird, because the C/C++ Build -> Settings -> LLVM Clang++ -> Includes path is correctly passed on to the SConfig.py file, but, for instance, C/C++ Build -> Settings -> LLVM Clang++ linker -> Libraries -> Library search path is not, as well as other settings like the compiler name. That's a good question, to debug the generator and see why just one of the settings is being used.

SConfigs.zip
aacirino_settings

from issues.

aacirino avatar aacirino commented on July 19, 2024

Update:

In the SCons preferences setting SCons options to

CXX_FLAGS=-std=c++17
COMPILER_NAME=clang++
LIBRARY_PATHS=/usr/local/opt/llvm/lib

didn't help.

PS: shouldn't this issue be marked as open?

from issues.

aacirino avatar aacirino commented on July 19, 2024

Update:

I created a GCC toolchain project to test it with GCC 7.2 and SCons. Unfortunately the global LLVM preferences were injected in the GCC project even if I removed them from the project settings. Each time I built the project the LLVM would be copied to the project settings so that I was forced to remove the specific LLVM global settings to be able to compile with GCC.
The good news is that the project did build with GCC 7.2 and was then successfully converted to SCons that works as intended. Seems to me that having LLVM and GCC in Cevelop is causing the issues.

from issues.

Related Issues (20)

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.