Skip to content

Conversation

@ngoldbaum
Copy link
Contributor

@ngoldbaum ngoldbaum commented Feb 29, 2024

Unfortunately conda environment files don't support classifiers (conda/conda#8089) so I added a second windows-specific environment.yml file.

I was able to get the csp build to start but hit the error described in #109 (comment), so more work needs to happen to get windows builds working.

Here's how I set up my dev environment:

  • Install miniforge using the windows x86_64 installer.

    • Make sure to select the option to add miniforge to your default PATH. If you don't check this you need to use the miniforge command prompt or activate the miniforge environment manually. I'm not sure how to activate the environment manually, presumably the scripts are buried in the miniforge install somewhere in Program Files.
  • Install visual studio 2022.

  • Open a visual studio command prompt or run C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat amd64. You might need slightly different syntax for powershell.

  • clone csp:

    $ git clone https://github.com/Point72/csp.git
    $ cd csp
    $ git submodule update --init --recursive
    
  • Install the windows development environment and activate it

    $ mamba env create -n csp -f dev-environment-win.yml
    $ conda activate csp
    

    Note that you should see some output printed to the terminal after activating, including something at the end printing out how vcvars64.bat is getting run. If you don't see that something is wrong with your visual studio install. For me this didn't work until I manually ran vcvarsall.bat amd64 once.

  • Build dependencies using vcpkg

    cd vcpkg && .\bootstrap-vcpkg.bat && .\vcpkg install
    cd ..
    

    Note that this is the same as make dependencies-win in the makefile, but that doesn't work right now because the path separator is incorrect. There's also a check at the top of the makefile for the number of processors that errors on windows. So the makefile needs some work if we want to support it on windows.

  • Build csp itself

    python setup.py build build_ext --inplace
    

And then you should hit the same error as me.

Signed-off-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
@ngoldbaum ngoldbaum marked this pull request as draft February 29, 2024 04:34
@ngoldbaum ngoldbaum mentioned this pull request Feb 29, 2024
@robambalu
Copy link
Collaborator

small step missing before building, need to cd back to top level from ./vcpkg

@timkpaine timkpaine added the part: build Issues and PRs related to the build process label Mar 4, 2024
@czgdp1807
Copy link
Contributor

I noticed that executing python setup.py build build_ext --inplace directly without going for any of the previous steps, the build starts without any issues. Like this command itself calls vcpkg. However I had to install cmake and skbuild from conda separately (after setting up csp environment using the .yml in this PR).

@robambalu robambalu added the tag: wip PRs that are a work in progress - converted to drafts label Apr 10, 2024
@timkpaine timkpaine closed this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part: build Issues and PRs related to the build process tag: wip PRs that are a work in progress - converted to drafts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants