Ask Your Question
3

How can one incorporate personalized C++ compiler flags into a conda-build flow?

asked 2021-07-23 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-04-07 02:00:00 +0000

qstack gravatar image

To incorporate personalized C++ compiler flags into a conda-build flow, follow these steps:

  1. Add the personalized C++ compiler flags to the CXXFLAGS environment variable. You can do this by setting it in your shell configuration file such as .bashrc.

  2. In your meta.yaml file, include the following sections:

build:
  script: |
    #!/bin/bash

    export CXXFLAGS="${CXXFLAGS} ${MY_CXXFLAGS}"
    $PYTHON setup.py install

This script includes the personalized C++ flags by adding the MY_CXXFLAGS variable to the CXXFLAGS environment variable.

  1. In your conda_build_config.yaml file, include the following:
variables:
  MY_CXXFLAGS: "-march=native -O3 -funroll-loops"

This sets the MY_CXXFLAGS variable to the personalized C++ compiler flags you want to use.

  1. Run the conda build command to build your package with the personalized C++ compiler flags.

With these steps, you can incorporate personalized C++ compiler flags into your conda-build flow.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-07-23 11:00:00 +0000

Seen: 14 times

Last updated: Apr 07 '23