Skip to content

Instantly share code, notes, and snippets.

View awillats's full-sized avatar
🔎

Adam Willats awillats

🔎
View GitHub Profile
@awillats
awillats / override_CXX_in_conda_env.md
Last active September 10, 2021 14:23
How to override CXX enviroment variables set by

Context

For whatever reason, the clang compilers used within my conda environments fail to compile standard .cpp files. However my OS's base g++ compiler can compile things. This walkthrough is intended to set environment variables within an conda environment NOT to use conda's suggestions, but instead to use the base compilers.

I tried this on a mac with OS: BigSur and an intel processor (there are reports that this also works on M1 macs). I'm using zsh as my terminal shell, but this should work with bash also. At the time of testing this the most recent version of Brian2 is 2.4.2, but I also tested a dev release 2.4.2.post0.dev149.

I'll use briandev_env as a standin for whatever conda environment name you have set up. These instructions assume you have gcc and g++ installed (see "Other commands") and that these are what you want to use even inside a conda environment.

activat