question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

compiling with gcc from conda env

See original GitHub issue

Hello,

First of thank you for your amazing work with nuitka, can’t wait to the the next improvements !

I’ve had a small issue trying to compile from a conda environnement with nuita. the name of my compiler installed with conda is x86_64-conda-linux-gnu-cc

In nuitka/build/Backend.scons :

I had to change this (line 1075) :

# Tell compiler to create a shared library or program.
if module_mode:
    if "gcc" in the_cc_name or "g++" in the_cc_name:
        env.Append(CCFLAGS=["-shared"])
    elif clang_mode:
        pass
    elif msvc_mode:
        env.Append(CCFLAGS=["/LD"])  # Create a DLL.
    else:
        assert False, the_cc_name

to that :

# Tell compiler to create a shared library or program.
if module_mode:
    if any(val in the_cc_name for val in ("gcc", "g++", "gnu-cc")):
        env.Append(CCFLAGS=["-shared"])
    elif clang_mode:
        pass
    elif msvc_mode:
        env.Append(CCFLAGS=["/LD"])  # Create a DLL.
    else:
        assert False, the_cc_name

By the way, running the compilation with clang (installed from conda) worked straight away.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Sep 16, 2021

Nuitka already has this:

def isGccName(cc_name):
    return "gcc" in cc_name or "g++" in cc_name or "gnu-cc" in cc_name

Seems this is a place it’s not yet used.

0reactions
kayhayencommented, Oct 3, 2021

This is part of the 0.6.17 release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conda gcc does not replace system gcc - Stack Overflow
I am trying to compile some code within a Conda environment, where I previously installed the compiler package gcc_linux-64 .
Read more >
Anaconda compiler tools — conda-build 3.23.3+5.g16ab6a5b ...
Many build tools such as make and CMake search by default for a compiler named simply gcc , so we set environment variables...
Read more >
Gcc - :: Anaconda.org
GNU C native compiler (symlinks). Conda · Files · Labels · Badges ... conda install -c conda-forge gcc conda install -c "conda-forge/label/broken" gcc...
Read more >
Compiling code in a Conda environment - IGWN | Computing
To compile packages into a conda environment, it is recommended to install all of the build tools into that environment, including the necessary...
Read more >
Conda gcc/g++ did not replace system (linux) gcc - Super User
Those environment variables apply to the anaconda version of gcc whereas you are using the system gcc located at /usr/bin/gcc .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found