-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Windows build scripts #1241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Windows build scripts #1241
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
ff55ad3
Windows build scripts
peterjc123 88da673
var name
peterjc123 20a5638
.
peterjc123 04e9fff
.
peterjc123 b8a819d
.
peterjc123 639de07
.
peterjc123 f8a776b
Change urls
peterjc123 8ceea35
.
peterjc123 90d8cbe
Test MS agent
peterjc123 74e463c
Switch base image
peterjc123 3bce981
.
peterjc123 e40c28c
.
peterjc123 f765bee
.
peterjc123 b4a1662
.
peterjc123 8f2891a
.
peterjc123 5df6237
Simple rename
peterjc123 f668bde
.
peterjc123 436f8bb
2019
peterjc123 3e426b1
.
peterjc123 3622b72
.
peterjc123 cd66f12
.
peterjc123 b60e51d
.
peterjc123 7d2d403
.
peterjc123 f91cbb7
.
peterjc123 942004c
.
peterjc123 8128262
.
peterjc123 3e2593e
Extract before run
peterjc123 fa42db1
.
peterjc123 3a53cc4
.
peterjc123 52b8bf7
.
peterjc123 72bddbf
.
peterjc123 b40c983
.
peterjc123 5575d63
.
peterjc123 aad9b82
Use fb links
peterjc123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ requirements: | |
- setuptools | ||
{{ environ.get('CONDA_PYTORCH_BUILD_CONSTRAINT') }} | ||
{{ environ.get('CONDA_CUDATOOLKIT_CONSTRAINT') }} | ||
{{ environ.get('CONDA_CPUONLY_FEATURE') }} | ||
|
||
run: | ||
- python | ||
|
@@ -31,7 +32,7 @@ build: | |
- FORCE_CUDA | ||
- NVCC_FLAGS | ||
features: | ||
{{ CONDA_CPUONLY_FEATURE }} | ||
{{ environ.get('CONDA_CPUONLY_FEATURE') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice catch, I wonder how this ever worked lol |
||
|
||
test: | ||
imports: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
:: Set env vars that tell distutils to use the compiler that we put on path | ||
SET DISTUTILS_USE_SDK=1 | ||
SET MSSdk=1 | ||
|
||
SET "VS_VERSION=15.0" | ||
SET "VS_MAJOR=15" | ||
SET "VS_YEAR=2017" | ||
|
||
set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out" | ||
set "MSYS2_ENV_CONV_EXCL=CL" | ||
|
||
:: For Python 3.5+, ensure that we link with the dynamic runtime. See | ||
:: http://stevedower.id.au/blog/building-for-python-3-5-part-two/ for more info | ||
set "PY_VCRUNTIME_REDIST=%PREFIX%\\bin\\vcruntime140.dll" | ||
|
||
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [15^,16^) -property installationPath`) do ( | ||
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( | ||
set "VSINSTALLDIR=%%i\" | ||
goto :vswhere | ||
) | ||
) | ||
|
||
:vswhere | ||
|
||
:: Shorten PATH to avoid the `input line too long` error. | ||
SET MyPath=%PATH% | ||
|
||
setlocal EnableDelayedExpansion | ||
|
||
SET TempPath="%MyPath:;=";"%" | ||
SET var= | ||
FOR %%a IN (%TempPath%) DO ( | ||
IF EXIST %%~sa ( | ||
SET "var=!var!;%%~sa" | ||
) | ||
) | ||
|
||
set "TempPath=!var:~1!" | ||
endlocal & set "PATH=%TempPath%" | ||
|
||
:: Shorten current directory too | ||
FOR %%A IN (.) DO CD "%%~sA" | ||
|
||
:: other things added by install_activate.bat at package build time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
blas_impl: | ||
- mkl # [x86_64] | ||
c_compiler: | ||
- vs2017 # [win] | ||
cxx_compiler: | ||
- vs2017 # [win] | ||
python: | ||
- 3.5 | ||
- 3.6 | ||
# This differs from target_platform in that it determines what subdir the compiler | ||
# will target, not what subdir the compiler package will be itself. | ||
# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32 | ||
# code on win-64 miniconda. | ||
cross_compiler_target_platform: | ||
- win-64 # [win] | ||
target_platform: | ||
- win-64 # [win] | ||
vc: | ||
- 14 | ||
zip_keys: | ||
- # [win] | ||
- vc # [win] | ||
- c_compiler # [win] | ||
- cxx_compiler # [win] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
set YEAR=2017 | ||
set VER=15 | ||
|
||
mkdir "%PREFIX%\etc\conda\activate.d" | ||
COPY "%RECIPE_DIR%\activate.bat" "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
|
||
IF "%cross_compiler_target_platform%" == "win-64" ( | ||
set "target_platform=amd64" | ||
echo SET "CMAKE_GENERATOR=Visual Studio %VER% %YEAR% Win64" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
IF "%VSDEVCMD_ARGS%" == "" ( | ||
echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x64 >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
) ELSE ( | ||
echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x64 %VSDEVCMD_ARGS% >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 %VSDEVCMD_ARGS% >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
) | ||
echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
) else ( | ||
set "target_platform=x86" | ||
echo SET "CMAKE_GENERATOR=Visual Studio %VER% %YEAR%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo CALL "VC\Auxiliary\Build\vcvars32.bat" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" | ||
echo popd | ||
) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up: this script is no longer used by the Linux/OS X binary builds (I didn't delete it because Windows still needs it), instead
packaging/build_conda.sh
is what is used. It would pretty awesome if we could also unify these packaging scripts, but I only really want to do it if we can keep the packaging on the shorter side. In the meantime, you can rename / simplify this script so that it is Windows only.