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.

Optional compile flags

See original GitHub issue

In response to #920, and following the discussion in #949, we need some way to make the compile flags optional during setup. The -march=native is the probable cause of issues with the conda-forge build #647, and also causes problems for some installing in a cluster environment.

However, for most people installing on a local machine, -march=native is likely to have significant performance advantages. The suggestion is then to have some cmd line option to choose compile flags where the default is ‘optimal’, which would include -march=native.

@Ericgig we can discuss this next week

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
slavoutichcommented, Feb 14, 2019

I might oppose to the fact that it should be default. The reason is that majority of people don’t read the documentation and don’t know what “segfault: illegal instruction” means. It might better to note somewhere that CFLAGS="-march=native" pip install qutip will lead to 30% increased performance in certain scenarios.

0reactions
jakelishmancommented, Mar 29, 2021

For future posterity: we simply can never issue -march=native commands to build wheels for distribution via pip or conda; we have to have these appeal to the lowest common denominator instruction set. We have hard-coded SSE2 instructions in zspmv.cpp, but these are ancient, and that’s probably the baseline we need to support at least for now (it’s been working without issue for a few years now). Computing clusters don’t have the latest and greatest hardware, but usually are just a weird amalgam of other bits.

The CFLAGS changes were merged already, so I’m closing this now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CPP/C++ Compiler Flags and Options
cpp c++ compiler flags command line options. ... This option is better for incremental compilation when using multiple files.
Read more >
Option Summary (Using the GNU Compiler Collection (GCC))
Here is a summary of all the options, grouped by type. Explanations are in the following sections. Overall Options. See Options Controlling the...
Read more >
Recommended compiler and linker flags for GCC
This article walks through a list of recommended build flags for when you compile your C or C++ programs with GCC. Do you...
Read more >
The Best and Worst GCC Compiler Flags For Embedded
In this article we will explore some of the best and worst compiler flags for GCC (and Clang). Our focus will be on...
Read more >
cc Compiler Options - Oracle Help Center
The following table summarizes the cc compiler options by functionality. ... -flags. Prints a brief summary of each available compiler option.
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