Windows Fortran 64bit - compilation

I am using the latest gfortran from MinGW and it seems I'm not getting my code compiled and run in 64bit. Is there a flag or compiler I should be using to take advantage of my 64bit version of Windows 10?

Related

GCC/G++-11 on windows

Hey I'm trying to compile a program that requires GCC and g++ 11. I've tried msys2 but it only goes up to GCC 10.04
And some of my libraries are supposed to be built on a mingw like environment. So is there any other way of running that program on a windows machine?
Get the latest MinGW-w64 GCC build from https://winlibs.com/

Is it possible to integrate nvcc with gcc/g++ in windows?

I would linke to know if it is possible to use gcc/g++ as the c/c++ compiler in windows based CUDA? Furthermore, how can I compile fortran together with nvcc?
I am running CUDA 10.2 and the mingw gcc 8.1.0.
No it is not possible. The only supported host compiler for use with CUDA on windows is cl.exe, the compiler that ships with visual studio C++.
If you use the WSL2 environment on windows, then you can use gcc/g++ with CUDA in that linux-like environment.

How to compile and execute 32bit C program on 64bit Windows

I am using a 64bit Intel based machine and want to compile and run 32bit C code in my command prompt. I have bash installed via (Windows Subsystems for Linux) and am using gcc and have the gcc-multilib installed so I can compile using the -m32 tag. The program compiles fine but comes up with this error when I try to run:
bash: ./32test: cannot execute binary file: Exec format error
WSL only supports 64-bit ELF binaries.
https://github.com/Microsoft/BashOnWindows/issues/390
You can try to build with a native Windows compiler or in Cygwin instead.

How to Compile 32-bit Apps on 64-bit RHEL?

I'm trying to compile a 32-bit C application on RHEL 7 64-bit using gcc 4.8. I'm getting a compiler error /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory. What do I need to do to get 32 bit apps compiled and linked?
To get RHEL 7 64-bit to compile gcc 4.8 32-bit programs, you'll need to do two things.
Make sure all the 32-bit gcc 4.8 development tools are completely installed:
sudo yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686
Compile programs using the -m32 flag
gcc pgm.c -m32 -o pgm

not able to select GCC (x86 32bit) tool chain in Qt

Iam not able to select gcc 32bit as the tool chain to compile my qt application.
the following are the details.
QtCreator - 2.4.1 (64bit)
QtSDK - 4.8.0 (64bit)
Platform - OS X Mountain Lion 10.8.2
Xcode - 4.6.2
i wanted to compile my application with 32bit tool chain only. I can able to compile in
windows but in mac it is not. So please help me on this.
List of available tool chains as shown in Qt creator->Preferences->Build&Run are
GCC (x86 32bit)
GCC (x86 64bit)
GCC (ppc 32bit)
GCC (ppc 64bit)
But when i am trying to set tool chain under build settings of the project, it is listing only
as follows
GCC (x86 64bit)
GCC (ppc 64bit)
what i have to do to get 32 bit as well. Thanks in advance.
Create a Kit for this in Creator's settings. It's in Tools->Options->Build & Run. Then add that Kit in the settings of your project.
Unless of course the Qt libraries you've installed are 64-bit only. In that case, you obviously can't build 32-bit applications with them. If that's the case, you need to build Qt on your own for 32-bit.

Resources