[GCC] 4.1.1 is different

G++4.1.1严苛编译
本文讨论了G++4.1.1版本对于代码编译的严格性提升,旧的松散代码不再能通过编译,这促使开发者重新审视C++编程的严谨性。
G++ 4.1.1 is a lot more stricter, and makes more sense. My old sloppy code no longer compiles, and thank goodness -- they made me believe that C++ is hopeless. 
PowerShell 7 环境已加载 (版本: 7.5.2) PowerShell 7 环境已加载 (版本: 7.5.2) PS C:\Users\Administrator\Desktop> cd E:\PyTorch_Build\pytorch PS E:\PyTorch_Build\pytorch> python -m venv rtx5070_env PS E:\PyTorch_Build\pytorch> .\rtx5070_env\Scripts\activate (rtx5070_env) PS E:\PyTorch_Build\pytorch> # 1. 运行修复脚本 (rtx5070_env) PS E:\PyTorch_Build\pytorch> .\complete_install_fix.ps1 尝试从备用源下载: https://pilotfiber.dl.sourceforge.net/project/openblas/v0.3.27/OpenBLAS-0.3.27-x64.zip ❌ 下载失败: The variable '$localZip' cannot be retrieved because it has not been set. 尝试从备用源下载: https://cfhcable.dl.sourceforge.net/project/openblas/v0.3.27/OpenBLAS-0.3.27-x64.zip ❌ 下载失败: The variable '$localZip' cannot be retrieved because it has not been set. 尝试从备用源下载: https://superb-sea2.dl.sourceforge.net/project/openblas/v0.3.27/OpenBLAS-0.3.27-x64.zip ❌ 下载失败: The variable '$localZip' cannot be retrieved because it has not been set. 尝试从GitHub直接下载... InvalidOperation: E:\PyTorch_Build\pytorch\complete_install_fix.ps1:25 Line | 25 | Invoke-WebRequest -Uri $githubRaw -OutFile $localZip | ~~~~~~~~~ | The variable '$localZip' cannot be retrieved because it has not been set. InvalidOperation: E:\PyTorch_Build\pytorch\complete_install_fix.ps1:35 Line | 35 | [System.IO.Compression.ZipFile]::ExtractToDirectory($localZip, $newIn … | ~~~~~~~~~ | The variable '$localZip' cannot be retrieved because it has not been set. Find-BLASBinary: E:\PyTorch_Build\pytorch\complete_install_fix.ps1:38 Line | 38 | $blasFile = Find-BLASBinary -SearchPath $newInstallPath | ~~~~~~~~~~~~~~~ | The term 'Find-BLASBinary' is not recognized as a name of a cmdlet, function, script file, or executable | program. Check the spelling of the name, or if a path was included, verify that the path is correct and try | again. ⚠️ 二进制分发版无效,尝试从源码编译... Chocolatey v2.5.0 3 validations performed. 2 success(es), 1 warning(s), and 0 error(s). Validation Warnings: - A pending system reboot request has been detected, however, this is being ignored due to the current Chocolatey configuration. If you want to halt when this occurs, then either set the global feature using: choco feature enable --name="exitOnRebootDetected" or pass the option --exit-when-reboot-detected. Installing the following packages: cmake By installing, you accept licenses for the packages. Downloading package from source 'https://community.chocolatey.org/api/v2/' Progress: Downloading cmake.install 4.1.1... 100% cmake.install v4.1.1 [Approved] cmake.install package files install completed. Performing other installation steps. Installing 64-bit cmake.install... cmake.install has been installed. The install of cmake.install was successful. Software installed as 'msi', install location is likely default. Downloading package from source 'https://community.chocolatey.org/api/v2/' Progress: Downloading cmake 4.1.1... 100% cmake v4.1.1 [Approved] cmake package files install completed. Performing other installation steps. The install of cmake was successful. Deployed to 'C:\ProgramData\chocolatey\lib\cmake' Chocolatey installed 2/2 packages. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log). Chocolatey v2.5.0 3 validations performed. 2 success(es), 1 warning(s), and 0 error(s). Validation Warnings: - A pending system reboot request has been detected, however, this is being ignored due to the current Chocolatey configuration. If you want to halt when this occurs, then either set the global feature using: choco feature enable --name="exitOnRebootDetected" or pass the option --exit-when-reboot-detected. Installing the following packages: mingw By installing, you accept licenses for the packages. Downloading package from source 'https://community.chocolatey.org/api/v2/' Progress: Downloading mingw 13.2.0... 100% mingw v13.2.0 [Approved] mingw package files install completed. Performing other installation steps. Downloading mingw 64 bit from 'https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev0/x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev0.7z' Progress: 100% - Completed download of C:\Users\Administrator\AppData\Local\Temp\chocolatey\mingw\13.2.0\x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev0.7z (69.57 MB). Download of x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev0.7z (69.57 MB) completed. Hashes match. Extracting C:\Users\Administrator\AppData\Local\Temp\chocolatey\mingw\13.2.0\x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev0.7z to C:\ProgramData\chocolatey\lib\mingw\tools\install... C:\ProgramData\chocolatey\lib\mingw\tools\install Testing path: C:\ProgramData\mingw64\mingw32\bin Testing path: C:\ProgramData\mingw64\mingw64\bin PATH environment variable does not have C:\ProgramData\mingw64\mingw64\bin in it. Adding... Environment Vars (like PATH) have changed. Close/reopen your shell to see the changes (or in powershell/cmd.exe just type `refreshenv`). The install of mingw was successful. Deployed to 'C:\ProgramData\chocolatey\lib\mingw\tools\install' Chocolatey installed 1/1 packages. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log). Cloning into 'OpenBLAS'... remote: Enumerating objects: 81610, done. remote: Counting objects: 100% (42/42), done. remote: Compressing objects: 100% (26/26), done. remote: Total 81610 (delta 15), reused 21 (delta 6), pack-reused 81568 (from 2) Receiving objects: 100% (81610/81610), 59.50 MiB | 6.03 MiB/s, done. Resolving deltas: 100% (65602/65602), done. Updating files: 100% (12531/12531), done. Directory: E:\PyTorch_Build\pytorch\OpenBLAS Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 2025/9/2 0:29 build CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! mingw32-make: E:\PyTorch_Build\pytorch\build_openblas_from_source.ps1:14 Line | 14 | mingw32-make -j8 | ~~~~~~~~~~~~ | The term 'mingw32-make' is not recognized as a name of a cmdlet, function, script file, or executable program. | Check the spelling of the name, or if a path was included, verify that the path is correct and try again. mingw32-make: E:\PyTorch_Build\pytorch\build_openblas_from_source.ps1:15 Line | 15 | mingw32-make install | ~~~~~~~~~~~~ | The term 'mingw32-make' is not recognized as a name of a cmdlet, function, script file, or executable program. | Check the spelling of the name, or if a path was included, verify that the path is correct and try again. (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # 2. 验证环境 (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> Write-Host "当前OpenBLAS_HOME: $env:OpenBLAS_HOME" 当前OpenBLAS_HOME: E:\Libs\OpenBLAS_Build (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # 3. 检查文件 (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> dir "$env:OpenBLAS_HOME" -Recurse | Where-Object { $_.Name -like "*blas*" } (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # 4. 测试PyTorch配置 (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> python -c "import os; print('USE_OPENBLAS:', os.environ.get('USE_OPENBLAS')); print('路径验证:', os.path.exists(os.path.join(os.environ['OpenBLAS_HOME'], 'bin', 'openblas.dll')))" USE_OPENBLAS: None 路径验证: False (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # 1. 保存修复后的脚本 (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # 将上述两个脚本保存为: (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # - fixed_complete_install_fix.ps1 (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # - fixed_build_openblas_from_source.ps1 (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # 2. 启动自动安装流程 (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> .\fixed_complete_install_fix.ps1 .\fixed_complete_install_fix.ps1: The term '.\fixed_complete_install_fix.ps1' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # 3. 设置电源选项(防止休眠) (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> powercfg -change -standby-timeout-ac 0 (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> powercfg -change -hibernate-timeout-ac 0 (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> # 4. 启用远程监控(可选) (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> $webhook = "https://webhook.site/your-unique-url" (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> $status = "开始编译OpenBLAS" (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build> Invoke-RestMethod -Uri $webhook -Method Post -Body $status Invoke-RestMethod: Error: Token "your-unique-url" not found - Webhook.site Webhook.site Error Token "your-unique-url" not found The URL was deleted, or expired automatically. To avoid URLs expiring automatically, you can upgrade to a Webhook.site subscription. Upgrade Now Home   Control Panel   Create Account   Contact Support   Login (rtx5070_env) PS E:\PyTorch_Build\pytorch\OpenBLAS\build>
09-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值