Skip to content

Commit

Permalink
Added batch compile helper. Updated documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
acpopescu committed Apr 16, 2023
1 parent 59a7c3a commit e8a8e1f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __pycache__/
# Distribution / packaging
.Python
build/
build_*/
develop-eggs/
dist/
downloads/
Expand Down
37 changes: 37 additions & 0 deletions buildall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 11.6
#Remove-Item -Recurse -Force ./build
Remove-Item -Recurse -Force ./build_11.6_0
Remove-Item -Recurse -Force ./build_11.6_1
Remove-Item -Recurse -Force ./build_11.7_0
Remove-Item -Recurse -Force ./build_11.7_1

$Funcs = {
function configure([string]$cuda_version, [string]$no_cuda_blast)
{
cmake -S . -B "./build_${cuda_version}_${no_cuda_blast}" -G "Visual Studio 17 2022" -T "cuda=${cuda_version}" -D "NO_CUBLASLT=${no_cuda_blast}"
}
function build([string]$cuda_version, [string]$no_cuda_blast)
{
cmake --build "./build_${cuda_version}_${no_cuda_blast}" --target libbitsandbytes_cuda --config Release
}
function build_with_cpu([string]$cuda_version, [string]$no_cuda_blast)
{
cmake --build "./build_${cuda_version}_${no_cuda_blast}" --target libbitsandbytes_cuda --config Release
cmake --build "./build_${cuda_version}_${no_cuda_blast}" --target libbitsandbytes_cpu --config Release
}
}


$j1 = Start-Job -ScriptBlock { configure "11.6" "0"; build_with_cpu "11.6" "0"} -InitializationScript $Funcs
$j2 = Start-Job -ScriptBlock { configure "11.6" "1"; build "11.6" "1" } -InitializationScript $Funcs
$j3 = Start-Job -ScriptBlock { configure "11.7" "0"; build "11.7" "0" } -InitializationScript $Funcs
$j4 = Start-Job -ScriptBlock { configure "11.7" "1"; build "11.7" "1" } -InitializationScript $Funcs

Get-Job | Wait-Job

Receive-Job $j1
Receive-Job $j2
Receive-Job $j3
Receive-Job $j4


5 changes: 5 additions & 0 deletions compile_from_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ mamba env activate mycompileenv
```
At this point - select your visual studio installation - aka hit 1

3. you can now build with Conda 11.6 and 11.7 by & `./buildall.ps1` Feel free to customize the script as per your needs.


### Manual configuration with cmake-gui

3. Go into your bitsandbytes folder and run `cmake-gui -S . -B ./build`
5. Hit Configure
6. Set `cuda=11.7`, nothing, or other version in the `Optional toolset to use` when selecting the generator to . You can leave it blank. If you don't see the generate, delete the `build` folder and run cmake-gui again with the above command line.
Expand Down

0 comments on commit e8a8e1f

Please sign in to comment.