Compiling Fortran Code on OSX for Windows 64 - compilation

I am trying to compile some Fortran files into a Windows 64-bit executable on a Mac with macOS Sierra. I have already succesfully compiled the Fortran code to run on OSX with GFortran, but now also want to do it for a computer running Windows 64-bit.
I am really not very familiar with compilers, so am finding the documentation out there quite confusing. I understand that some cross-compilers exist and that MinGW could possibly help me achieve my goal.
Any advice on specifically how I should go about this and whether it is even possible would be greatly appreciated. Many thanks!

Related

Setting up QtCreator cross compiler for ARM on Windows

I need to develop Qt and command line software for the BeagleBone Black and Raspberry Pi-2. Ideally I wish to use QtCreator as I am accustomed to it, but in any case I need to use QtDesigner for GUI work.
I have spent days trawling through articles, going around in circles and getting nowhere.
The Raspberry Pi-2 has Raspbian/Jessie installed together with Qt 5.2.3. I can design, compile and run Qt desktop applications on this. Of course compilation is slow and not really usable for development work.
To try and keep matters simple, I downloaded qt-opensource-windows-x86-android-5.3.2.exe and installed that on my Windows 7 (64-bit) system. My belief is that this Qt install is the same version as the Qt on the Pi-2 and already contains the ARM7 library files required for cross-compiling. All that should be needed is a cross-compiler for Windows/ARM?
Windows/QtCreator complained in Tools > Options > Qt Versions about the Qt 5.3 for Android armv7 stating "No compiler can produce code for this Qt version...".
For a Windows/ARM cross-compiler I downloaded and installed Yagarto (yagarto-bu-2.23.1_gcc-4.7.2-c-c++_nl-1.20.0_gdb-7.5.1_eabi_20121222.exe). I figured I then just need to set the QtCreator compiler path in Tools > Options > Compilers and then things would start working. This is not the case.
Clearly I am missing something important and have managed to become confused by the number of not-quite-relevant articles I have read.
Is Yagarto the cross-compiler I need in this situation?
How do I define the compiler in QtCreator and get rid of the error?
Is there an easier way to set-up this stuff?
Thank you.
Details:
QtCreator 3.2.1 (Qt 5.3.2)
Windows 7 64-bit service pack 1
Edit:
I have just tried again using the GCC ARM Embedded ToolChain and GNU Make for Windows. The result is the same in that I cannot seem to configure the settings for QtCreator ARM7 and make it happy.

How to compile for 32bit on Qt 5.3.0

I have a question: how can i compile the program to work for 32bit using Qt creator 5.3.0. My windows is win 7 eterprise 64bit. (Please give full explanation because i`m not that good at operating systems, i only like algorithmics :D ). Thanks alot.

Build GTK with Windows SDK

how can I compile gtk (itself) with Windows SDK ?
Building in Visual Studio is still quite a lot of work. I've done it, but I don't have reproducible steps for you right now. However, if you have a Linux machine around and are willing to cross-compile I have written up directions on how to build GTK+ for Win32 by cross-compiling.
http://live.gnome.org/Cross%20compiling%20GTK%2B%20for%20Win32
It's also possible to build using MSYS in the command-line on Windows, but that's also a major pain in the ass to get setup. It's also really, really slow. Cross-compiling from Linux is, at a minimum, ten times faster. I'm not 100% sure but it seems to be because if you build using the standard build system then there is a lot of process spawning, which is quite expensive in Win32 compared to Linux.
However, if you want to go this way then install MSYS and pull down the source for glib, atk, cairo, pango, and gtk+.. then try to build using the standard Linux way:
1/ untar the source tarball
2/ in the source's root directory do: ./configure
3/ make
There will undoubtedly be other dependencies that you need to install, such as libpng and libjpeg.
Try the HexChat builds. They use Visual Studio 2010 and come with some prepared scripts and solutions to make your life much easier. Oh and you get binary downloads as well.
http://gtk.hexchat.org/
GTK can be compiled under Cygwin or Microsoft Visual C++.
Did you try this installation method? Look the Microsoft Windows section...
Hope it helps!

qt application 64 bit windows

Is it possible to compile a 64 bit executable in qt windows?
Is it the same process as with 32 bit or any different?
Have a look at this wiki page. I describes how to build the Qt binaries from source for different configurations.
I'm not sure if I understand your question completely, but I can tell you about my project and see if it helps your situation.
We have:
Visual Studio 2008 C++ project
Contains both Win32 and x64 platforms (in other words, it can be 32-bits or 64-bits)
We save the original Qt libraries that came with the Qt installer in one directory (e.g. Qt/lib/x32), and re-built Qt as 64-bits and save that in another directory (e.g. Qt/lib/x64).
When it comes to linking, we just ensure that we link with the correct library (32-bit platform links to 32-bit Qt, and so on).
This has worked quite well for us.
So if I had to guess the answer to your question.
Yes, it's possible to compile a 64-bit executable in Qt on Windows. It's the same process, except you have to tell the qmake a little bit different parameter. See Frank Bollack link above on how to build it.
Note, if you app is 64-bit (x64), and you try to link 32-bit Qt (the one that came with the installer), it will not link.
Hope this helps.
There is also an (inofficial) installer of the qt-libraries etc. for 64-bit Windows. You might want to have a look at that:
http://code.google.com/p/qt-msvc-installer/
(Just in case you don't want to spend a few hours compiling qt yourself... :D)

GNU CC and Windows

I'm a bit confused about the options for using GNU CC on Windows.
If I want to primarily develop console applications (as opposed to GUI apps) what do I need? Where do Cygwin and MinGW figure? For example, if I use the NetBeans IDE C/C++ option, that requires installation of Cygwin.
Are there any options which would allow Console application development without Cygwin?
Both MinGW & Cygwin give you the gcc compiler but if you use MinGW you don't need to install Cygwin because it uses native Windows libraries rather than Cygwin libraries
Cygwin is more than just compilers, it tries to provide a UNIX programming environment by building a lot of UNIX libraries on top of Windows SDK.
You could install CodeBlocks IDE oder DevCPP ide. If you do not require special posix api's then you do not need to install cygwin.
You really really should check out Visual C++ Express. It makes developing on windows A LOT easier. I it is free and the Visual C++ is the preferred way to develop windows apps. ANd yes, you can make console applications too.
That clarifies things. I'm not particularly interested in a *nix-like environment. I was more interested in getting a GNU C compiler that conforms closely with C99 (which I believe the latest GCC compiler does) and using it as a C learning exercise (hence console rather than GUI apps)
It appears to me that NetBeans IDE/Cygwin option installs an earlier version of the compiler.
So, it appears that MinGW is what I am looking for if I want to use GNU C. Incidentally, the free Pelles C compiler/IDE has a very full C99 implementation.
You can use vc express for concole apps if you wish, or really any compiler for win platform.
MinGW can support many languages as well as GNU C Compiler. It also comes with msys package that you can simulate UNIX environment. Cygwin does the same thing as msys does. I'd advice you to install MinGW with full msys support.

Resources