top of page
goworgalarreu

Mingw For Mac: What You Need to Know Before You Start



Downloads are archive files (.zip or .7z). No installation is required,just extract the archive and start using the programs in mingw32\bin or mingw64\bin.This allows for a relocatable compiler suite and allows having multiple versions on the same system.


It consists of a command line terminal calledmintty, bash, version control systems like git andsubversion, tools like tar and awk and even build systems like autotools, allbased on a modified version of Cygwin. Despite some ofthese central parts being based on Cygwin, the main focus of MSYS2 is to providea build environment for native Windows software and the Cygwin-using parts arekept at a minimum. MSYS2 provides up-to-date native builds for GCC, mingw-w64,CPython, CMake, Meson, OpenSSL, FFmpeg, Rust, Ruby, just to name a few.




Mingw For Mac



I'd like to cross-compile some open-source libraries (libiconv, gettext, glib2) for windows using mingw on Mac OS X. I've installed mingw on Mac with MacPorts. But now I'm not sure what to give to the configure script so that it will work. The cross-compilation tutorials I've seen all talk about makefiles, but no one mentions what to give autoconf-based projects.


Install the Mingw-w64 toolchain (pacman -S --needed base-devel mingw-w64-x86_64-toolchain). Run the pacman command in a MSYS2 terminal. Accept the default to install all the members in the toolchain group.


If you have Visual Studio or WSL installed, you may need to change compilerPath to match the preferred compiler for your project. For example, if you installed Mingw-w64 version 8.1.0 using the i686 architecture, Win32 threading, and sjlj exception handling install options, the path would look like this: C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw64\bin\g++.exe.


You must follow the steps on the MSYS2 website and use the MSYS CLI to install Mingw-w64, which contains those tools. You will also need to install the full Mingw-w64 toolchain (pacman -S --needed base-devel mingw-w64-x86_64-toolchain) to get the gdb debugger.


Click on All Packages on the top left section of the window. In the right section of the window scroll down and click on mingw32-autotools and select Mark for Installation. This will automatically select multiple packages.


If you ">>cd /mingw" then you are actually in "C:\MinGW" - Yes, we actually went back a couple directories from "root". Why? Look at the "fstab" file in "C:\MinGW\msys\1.0\etc". /mingw is mounted to C:\MinGW. So you could play around with the mounting in this file if you wanted.


Windows XP / Windows 7 InstructionsBelow are instructions to install a free minimal FORTRAN compilationenvironment for Microsoft Windows users. There are two free products to install, the compiler itself (mingw) and a graphical front-end (Code::Blocks). 1. Download mingw from here: -get-inst/ 2. Double click on the installation file. It is recommended that you not change the default install location, which is c:\mingw.During the installation be sure to select the Fortran Compiler in the component selection window as shown in the image below. 3. Download Code::Blocks for Fortran for Windows 32bit from this link: 4. Note that this version of Code::Blocks for Fortran does not require an actual installation. Simply unzip the downloaded package, then run the codeblocks.exe file directly from the resulting folder. You will be presented with the following options. Please check the option as shown in the image below. 5. To create a new fortran program click on file>New>File>Select Fortran Source>Hit Go and follow the instructions in the dialog box. 6. To open an existing fortran source file select File>Open> and navigate to the fortran source file. Mac OSX InstructionsBelow is the link to the instructions to download and install GCC 4.7,4.8 compiler suite. This compiler can be invoked using the OSX Terminal program. Note that the GCC 4.7,4.8 suite contains the required gfortran compiler. It can be downloaded by clicking on the link located just underneath the Computaion Tools :: C/Fortran section of the page.Link: www.hpc.sourceforge.net Below is the link to the instructions to download and install Photran, an Eclipse-based integrated IDE for fortran.Link: Florida State University Tallahassee, FL 32306


MinGW-w64 [mingw-w64.sourceforge.net] is a fork with the original aim to also support generation of 64 bit binaries. By now it also supports a much larger part of the Win32 API. The MinGW-w64 project does host several different binary packages, done by different people.


There are binary installers targetting MinGW for both Qt 4 and Qt 5. Up to Qt 4.8.6, Qt 4 ones are built with a MinGW.org toolchain using gcc 4.4. Newer Qt 4.8 binary packages ship with a mingw-w64 based toolchain. For Qt 5, a newer MinGW-w64 toolchain is actually required.


  • Right Click on Start > System > Search for View Advanced System Settings > Environment Variables, Add new user variable HOME with %USERPROFILE% - this will make Msys2 start in the windows directory (if you do this after installing Msys2, move files from C:\msys64\home\pisan to C:\Users\pisan manually -stuff/wiki/Set-up-Windows-dev-environment-with-MSYS2

  • Install Git for Windows -scm.com/downloads

  • Install MSys2 on default directory C:\msys64 Follow the instructions on the web page, especially about 'pacman -Syu' to update package database and core system

  • pacman -S --needed mingw-w64-x86_64-emacs mingw64/mingw-w64-x86_64-gcc python3 mingw64/mingw-w64-x86_64-putty mingw64/mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-cppcheck msys/unzip python3-pip mingw32/mingw-w64-i686-make msys/git

  • pip install --upgrade pip

  • pip install cpplint

  • Run c:\msys64\mingw64.exe to get started and pin it to the taskbar for future

  • Make sure the compilers are installed, try 'which g++' to find the location of g++

  • You can configure Putty under Windows as well as ssh under Msys2 to use public/private keys to allow login without using password. Run C:\Program Files\PuTTY\puttygen.exe to generate a private key. Save it to your windows machine. Copy the "public key" (starts with ssh-rsa ....). On the linux server, such as uw1-320-01.uwb.edu, edit the file /.ssh/authorized_keys and paste the "public key" to this file. Configure Putty on windows to use your netid as the auto-login username (under Connection > Data) and Connection > SSH > Auth should have the private key file for authentication. You can now login to uw1-320-01 without entering a password. Repeat editing the authorized_keys file for each of the CSS Linux machines as needed.


The x-build-dependencies process takes several hours, mostly to cross-build QT. It also requires several gigabytes of disk space. If you have multiple CPUs you can speed up things by running export NUMCPU=x before running the dependency build script. By default it builds the dependencies in $HOME/openscad_deps/mxe. You can override the mxe installation path by setting the BASEDIR environment variable before running the scripts. The OpenSCAD binaries are built into a separate build path, openscad/mingw32.


MinGW is a port of GCC to Windows. It is free of charge and simple to use (well, as simple as toolchains ever get). It produces standalone Windows executables which may be distributed in any manner. MinGW's official website mingw-w64.org provides various builds, but I maintain my own distro because I demand complete control. (It's a long story, but mingw-w64 forked from mingw.org. Although my distro was based on mingw.org for many years, I now consider mingw-w64 to be the one true MinGW.) 2ff7e9595c


0 views0 comments

Recent Posts

See All

Komentáře


bottom of page