compile script for mingw64

本文详细介绍了如何从源码构建Mingw-w64交叉编译环境的过程,包括下载必要的源码包如binutils、gcc及mingw-w64等,并配置环境使其能够为Windows平台生成可执行文件。
#! /bin/sh

#cd /d/opensource
#wget mingw-w64
#wget gcc
#wget binutils

#make -p /d/opensource
#cd /d/opensource/
#cvs -z9 -d:pserver:anoncvs@sourceware.org:/cvs/src co binutils
#svn co svn://gcc.gnu.org/svn/gcc/trunk gcc-trunk
#svn co https://mingw-w64.svn.sourceforge.net/svnroot/mingw-w64/trunk mingw-w64-trunk

mkdir /d/portable/sysroot
mkdir -p /d/build/binutils-build
mkdir -p /d/build/mingw-w64-headers-build
mkdir -p /d/build/mingw-w64-crt-build
mkdir -p /d/build/gcc-build

cd /d/build/binutils-build
../../opensource/binutils-src/configure    \
    --target=x86_64-w64-mingw32 \
    --enable-targets=x86_64-w64-mingw32,i686-w64-mingw32 \
    --with-sysroot=/d/portable/sysroot --prefix=/d/portable/sysroot
make
make install
export PATH="$PATH:/d/portable/sysroot/bin"

cd ../mingw-w64-headers-build
../../opensource/mingw-w64-trunk/mingw-w64-headers/configure \
    --build=i686-pc-mingw32 --host=x86_64-w64-mingw32 \
    --prefix=/d/portable/sysroot
make install
#copy include
cp -a /d/portable/sysroot/include             /d/portable/sysroot/x86_64-w64-mingw32
mkdir -p /d/portable/sysroot/x86_64-w64-mingw32/lib
cp -a /d/portable/sysroot/x86_64-w64-mingw32/lib    /d/portable/sysroot/x86_64-w64-mingw32/lib64
cp -a /d/portable/sysroot/x86_64-w64-mingw32        /d/portable/sysroot/mingw

cd ../gcc-build
../../opensource/gcc-4.7.2-src/configure \
    --target=x86_64-w64-mingw32 --enable-targets=all \
    --with-sysroot=/d/portable/sysroot --prefix=/d/portable/sysroot
make all-gcc
make install-gcc

cd ../mingw-w64-crt-build
../../opensource/mingw-w64-trunk/mingw-w64-crt/configure \
    --host=x86_64-w64-mingw32 --enable-lib32 \
    --with-sysroot=/d/portable/sysroot --prefix=/d/portable/sysroot
make
make install

cp -a /d/portable/sysroot/lib                /d/portable/sysroot/x86_64-w64-mingw32
cp -a /d/portable/sysroot/lib32                /d/portable/sysroot/x86_64-w64-mingw32
cp -a /d/portable/sysroot/x86_64-w64-mingw32/lib/*    /d/portable/sysroot/x86_64-w64-mingw32/lib64
cp -a /d/portable/sysroot/x86_64-w64-mingw32/*        /d/portable/sysroot/mingw

cd ../gcc-build
make
make install
 
这个开头有问题吗?它还在编译 我需要做什么吗?还是让它继续?”PowerShell 7 环境已加载 (版本: 7.5.2) PS C:\Users\Administrator\Desktop> cd E:\PyTorch_Build\pytorch PS E:\PyTorch_Build\pytorch> Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass PS E:\PyTorch_Build\pytorch> .\fixed_build_openblas.ps1 TOPDIR: E:\PyTorch_Build\pytorch\fixed_build_openblas.ps1:33 Line | 33 | @@ -15,6 +15,8 @@ include $(TOPDIR)/Makefile.system | ~~~~~~ | The term 'TOPDIR' 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. BUILD_DOUBLE: E:\PyTorch_Build\pytorch\fixed_build_openblas.ps1:38 Line | 38 | ifeq ($(BUILD_DOUBLE), 1) | ~~~~~~~~~~~~ | The term 'BUILD_DOUBLE' 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. 补丁应用失败,继续尝试编译 -- The C compiler identification is GNU 13.2.00 MB (144.6 MB/s) ] -- The ASM compiler identification is GNU -- Found assembler: C:/ProgramData/mingw64/mingw64/bin/as.exe -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/ProgramData/mingw64/mingw64/bin/gcc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done CMake Warning at CMakeLists.txt:122 (message): CMake support is experimental. It does not yet support all build options and may not produce the same Makefiles that OpenBLAS ships with. -- Looking for stdatomic.h -- Looking for stdatomic.h - found -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Targeting the CORE2 architecture. -- GEMM multithread threshold set to 4. -- Disabling Advanced Vector Extensions 2 (AVX2). -- Disabling Advanced Vector Extensions 512 (AVX512). -- Multi-threading enabled with 20 threads. -- Looking for a Fortran compiler -- Looking for a Fortran compiler - C:/ProgramData/mingw64/mingw64/bin/gfortran.exe -- The Fortran compiler identification is GNU 13.2.0 -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Check for working Fortran compiler: C:/ProgramData/mingw64/mingw64/bin/gfortran.exe - skipped -- Running getarch -- GETARCH results: CORE=CORE2 LIBCORE=core2 NUM_CORES=20 CORE2=1 L1_DATA_SIZE=32768 L1_DATA_LINESIZE=64 L2_SIZE=1048576 L2_LINESIZE=64 DTB_DEFAULT_ENTRIES=256 DTB_SIZE=4096 HAVE_CMOV=1 HAVE_MMX=1 HAVE_SSE=1 HAVE_SSE2=1 HAVE_SSE3=1 HAVE_SSSE3=1 MAKEFLAGS += -j 20 -- Compiling a 64-bit binary. -- Building Single Precision -- Building Double Precision -- Building Complex Precision -- Building Double Complex Precision -- E:/PyTorch_Build/pytorch/OpenBLAS/build/interface/CMakeFiles/scopy.c“
09-03
error[E0463]: can't find crate for `core` | = note: the `x86_64-pc-windows-msvc` target may not be installed = help: consider downloading the target with `rustup target add x86_64-pc-windows-msvc` error[E0463]: can't find crate for `std` | = note: the `x86_64-pc-windows-msvc` target may not be installed = help: consider downloading the target with `rustup target add x86_64-pc-windows-msvc` For more information about this error, try `rustc --explain E0463`. error: could not compile `smallvec` (lib) due to 1 previous error warning: build failed, waiting for other jobs to finish... error: could not compile `serde_core` (build script) due to 1 previous error error: could not compile `writeable` (lib) due to 1 previous error error: could not compile `litemap` (lib) due to 1 previous error error: could not compile `cfg-if` (lib) due to 1 previous error error: could not compile `unicode-ident` (lib) due to 1 previous error error: could not compile `quote` (build script) due to 1 previous error error: could not compile `zerocopy` (build script) due to 1 previous error error: could not compile `proc-macro2` (build script) due to 1 previous error error: could not compile `itoa` (lib) due to 1 previous error error: could not compile `stable_deref_trait` (lib) due to 1 previous error error: could not compile `icu_normalizer_data` (build script) due to 1 previous error error: could not compile `serde` (build script) due to 1 previous error error: could not compile `windows-link` (lib) due to 1 previous error error: could not compile `icu_properties_data` (build script) due to 1 previous error error: could not compile `memchr` (lib) due to 1 previous error
11-02
【博士论文复现】【阻抗建模、验证扫频法】光伏并网逆变器扫频与稳定性分析(包含锁相环电流环)(Simulink仿真实现)内容概要:本文档是一份关于“光伏并网逆变器扫频与稳定性分析”的Simulink仿真实现资源,重点复现博士论文中的阻抗建模与扫频法验证过程,涵盖锁相环和电流环等关键控制环节。通过构建详细的逆变器模型,采用小信号扰动方法进行频域扫描,获取系统输出阻抗特性,并结合奈奎斯特稳定判据分析并网系统的稳定性,帮助深入理解光伏发电系统在弱电网条件下的动态行为与失稳机理。; 适合人群:具备电力电子、自动控制理论基础,熟悉Simulink仿真环境,从事新能源发电、微电网或电力系统稳定性研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①掌握光伏并网逆变器的阻抗建模方法;②学习基于扫频法的系统稳定性分析流程;③复现高水平学术论文中的关键技术环节,支撑科研项目或学位论文工作;④为实际工程中并网逆变器的稳定性问题提供仿真分析手段。; 阅读建议:建议读者结合相关理论教材与原始论文,逐步运行并调试提供的Simulink模型,重点关注锁相环与电流控制器参数对系统阻抗特性的影响,通过改变电网强度等条件观察系统稳定性变化,深化对阻抗分析法的理解与应用能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值