# Problem with Cython

**URL:** <https://brian.discourse.group/t/problem-with-cython/360>\
**Category:** Support\
**Tags:** compilation, clang, cython, macos\
**Created:** [10 April 2021 14:29 UTC](https://brian.discourse.group/t/problem-with-cython/360 "2021-04-10T14:29:52Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![adam](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/adam/32/197_2.png) [@adam](https://brian.discourse.group/u/adam)\
**Post date:** [6 September 2021 18:33 UTC](https://brian.discourse.group/t/problem-with-cython/360/18 "2021-09-06T18:33:07Z")

</div>

🎉 Minor breakthrough 🎉  
using `export | grep clang` I was able to identify some other environment variables.

```auto
CC=x86_64-apple-darwin13.4.0-clang
CLANG=/Users/adam/opt/anaconda3/envs/neuroenv/bin/x86_64-apple-darwin13.4.0-clang
CLANGXX=/Users/adam/opt/anaconda3/envs/neuroenv/bin/x86_64-apple-darwin13.4.0-clang++
CXX=x86_64-apple-darwin13.4.0-clang++

```

So i updated `$CONDA_PREFIX/etc/conda/activate.d/env_vars.sh` to replace these with `gcc` and `g++` and now the brian2 tests (include Cython related ones) pass!

> **successful test report**
>
> ```auto
> brian2.test()
> Running tests in /Users/adam/opt/anaconda3/envs/neuroenv_braindev/lib/python3.8/site-packages/brian2 for targets numpy, cython (excluding long tests)
> Running Brian version 2.4.2.post0.dev317 from '/Users/adam/opt/anaconda3/envs/neuroenv_braindev/lib/python3.8/site-packages/brian2'
> Testing codegen-independent code
> Resetting to default preferences
> 
> Running doctests
> .......................................... [100%]
> 42 passed in 23.06s
> Running tests that do not use code generation
> ................................................................................................................................................................................... [49%]
> ................................................................................................................................................................................... [98%]
> ...... [100%]
> 364 passed, 321 deselected in 238.90s (0:03:58)
> Running tests for target numpy:
> ....s...............................ssssss......................................................................................................................................... [66%]
> ............................................................................................ [100%]
> 264 passed, 7 skipped, 414 deselected in 329.04s (0:05:29)
> Running tests for target cython:
> ....s..............................s......s...s......s...............................................s...........s................................................................. [66%]
> ..............................................................ss............................ [100%]
> 262 passed, 9 skipped, 414 deselected in 316.08s (0:05:16)
> OK: 4/4 test suite(s) did complete successfully.
> True
> 
> ```

I’ve written a quick markdown guide that retraces the steps I used:

# **[override\_CXX\_in\_conda\_env.md](https://gist.github.com/awillats/65fdb6a7d5f2d563710cd50c5686d03e)**

i’m going to go back through and see

- whether setting CC, CLANG were necessary
- whether this means I can now use cython as a codegen target within brian

---

_[View the full topic](https://brian.discourse.group/t/problem-with-cython/360)._
