Skip to content

Instantly share code, notes, and snippets.

@phaustin
Created August 7, 2018 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phaustin/a69c5b00e1ee2ec589adf4f802bb126c to your computer and use it in GitHub Desktop.
Save phaustin/a69c5b00e1ee2ec589adf4f802bb126c to your computer and use it in GitHub Desktop.
upgrade to vs2017
Perhaps I didn't understand what you were doing. conda_build_config.yaml is for conda-build. If you do only steps 1 and 3, that should be fine for interactive use. However, we don't use that workflow at all currently (we only use conda-build to produce packages), so you may hit some snags, such as runtime dependencies being missing. It should be find on your students' computers, but if they try to ship their compiled stuff elsewhere, it may not work. In that case, you'll want them to use conda-build to produce packages. You'd remove your steps 1 and 3, write a conda recipe, and let conda-build take care of the compiler installation and environment activations.
@phaustin
Copy link
Author

phaustin commented Aug 7, 2018

Philip Austin @phaustin Jun 17 07:08
Hopefully quick question on conda/windows builds. I’m new to Windows, and need to use cython in a fall course I’m teaching to a mixed windows/macos cohort. I’ve got a setup.py that calls cmake to build the cython extension — no problem in a Unix bash shell with the new anaconda compilers. On windows however, I set my conda environment by launching an anaconda prompt, and a compiler environment by launching a developer command prompt for VS 2017. Is there some way to merge these, or should I be doing something different?

Mike Sarahan @msarahan Jun 17 08:27
There is a vs2017 package that we haven't released yet, because of problems we've seen with vs2017 and some packages. Those problems may not affect you, though - they've been pretty detailed things in heavy C++, like Qt. https://anaconda.org/c3i_test2/vs2017_win-64
It's just activate scripts, not actual compilers. It'll replace your developer command prompt step. You will need one further customization, though. Conda-build defaults to vs2008 for python 2.7, and vs2015 for python 3.5+. The conda_build_config.yaml file can be used to change that default. The easiest thing to do is to copy the file from https://github.com/AnacondaRecipes/aggregate/blob/master/conda_build_config.yaml and change the c_compiler and cxx_compiler entries. Note that they are "zipped" with other keys. zipped fields must all have the same length, so don't delete entries arbitrarily.
For Mac, you really need to be setting up the MacOS sdk
https://conda.io/docs/user-guide/tasks/build-packages/compiler-tools.html#macos-sdk

Philip Austin @phaustin Jun 17 08:47
Thanks, that’s a big help. The macOS build directions were very clear — no issues there.

Mike Sarahan @msarahan Jun 17 08:56
To be clear, you won't explicitly list that compiler in your recipe
you just use the same {{ compiler("c") }} jinja 2 stuff
but you change which package that finds by changing the setting in conda_build_config.yaml

Philip Austin @phaustin Jun 17 09:11
Thanks — so to summarize —
conda install vs2017_win-64
edit conda_build_config.yaml to update compilers to 2017
anaconda prompt now picks up vs2017_compiler_vars.bat and cl is available to cmake? Or do I need to do a conda activate xxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment