Installation of GFortran in Windows 10
This article explains how to install GFortran in Windows 10. GFortran is a free Fortran compiler. The users can use it with no charge. GFortran is a product of an “open source” project to develop a collection of free compilers (GCC).
The compiler is the most useful when combining with other commands of Linux/Unix. Because Windows does not have the commands by default, programmers developed some packages to have the commands in Windows. Msys2 is one of them, and it includes the free compilers, and GFortran developers recommend it for Windows users.
Here is a procedure for the installation of Msys2 as of January 2020.
Msys2 and Mingw-w64
Installation
Step 1: Visit the official GFortran Wiki to find the link to Msys2 website. It shows a link to Mingw-w64, the name of the project that develops MSYS2. Go to the Mingw-w64 web page.
Step 2: Visit the Mingw-w64 project site, and you find the “Download” link. Go to “Download”.
Step 3: This page shows all the packages that this project maintains. Choose Msys2.
Step 4: The page shows a link to Msys2 website in Github. Go to the website.
Step 5: Get Msys2 installer on this website. Download a file with msys2-x86_64-xxxxxxxx.exe (xxxxxxxx is replaced with the date which is released). If you know your system is 32bit, download msys2-i686-xxxxxxxx.exe.
Step 6: Run the installer and follow the instruction to set up the program.
Step 7: Invoke Msys2 window. The program runs automatically for the first time. After that, you can run it from the menu. Choose MSYS2 MinGW 64-bit (32-bit if needed).
Step 8: Make sure that you see a Msys window.
Step 9: Msys2 consists of many dependent programs. Each program is prepared as a package. If the package is modified, you can download it through the internet. This process is automated by a command pacman .
For the first time, you have to date the built-in packages through the internet. In the Msys2 windows, type the following command.
pacman -Syu
It will ask you whether you allow downloading the updated packages. You can type y for yes. If it fails, close the window and try again.
Step 10: GFortran is also provided as a package. Type the following command in the window to install GFortran.
pacman -Su gcc-fortran
As above, it will ask you if you want to install the package. Type y , and wait for a while to finish the installation. After this step, you can use GFortran in this window.
You can confirm the successful installation with the following command.
gfortran
Directory structure
The Msys2 window runs Bash, and you can use most Linux commands in the window. Also, when you create some files, you can access the files with Windows Explorer.
The home directory is somewhere on your computer. You can access the drive C, use /c/ . For example, the real home directory in Windows is /c/Users/your_name if your account name is your_name . Using this rule, you can change the directory to Documents, type cd /c/Users/your_name/Documents .
Установка GFortran#
GFortran – название проекта GNU Fortran project. Главная wiki-страница предлагает множество полезных ссылок на статьи о GFortran, а также о Fortran в целом. В данном руководстве процесс установки GFortran в Windows, Linux, macOS и OpenBSD представлен в удобном для новичков формате на основе информации с сайта GFortranBinaries.
Windows#
Три источника предлагают быстрый и простой способ установки компилятора GFortran в Windows:
- http://www.equation.com предоставляет 32 и 64-битные x86-совместимые исполняемые файлы для компилятора GCC версии 12.1.
- TDM GCC предоставляет 32 и 64-битные x86-совместимые исполняемые файлы для компилятора GCC версии 10.3.
- MinGW-w64 предоставляет 64-битный x86-совместимый исполняемый файл для GCC версии 12.2.
Во всех вышеперечисленных вариантах процесс установки прост – просто скачайте программу установки и следуйте указаниям мастера установки.
Unix-подобная разработка в Windows#
Для тех кто знаком с unix-подобной средой разработки, в Windows доступно несколько вариантов эмуляции, каждый из которых предоставляет пакеты для компилятора gfortran:
- Cygwin: среда выполнения, которая предоставляет POSIX-совместимое окружение в Windows.
- MSYS2: набор Unix-подобных средств разработки, основанных на современных версиях Cygwin и MinGW-w64.
- Windows Subsystem for Linux (WSL): официальный уровень совместимости для запуска бинарных исполняемых файлов Linux в Windows. С помощью Windows Subsystem for Linux GUI можно запускать текстовые редакторы и другие графические программы.
Всё вышеперечисленные варианты предоставляют доступ к распространённым командным оболочкам, таким как bash, и инструментам разработки, включая GNU coreutils, Make, CMake, autotools, git, grep, sed, awk, ssh и др.
Мы рекомендуем окружение WSL тем, кто ищет Unix-подобную среду разработки.
Linux#
Дистрибутивы на основе Debian (Debian, Ubuntu, Mint и др.)#
Проверьте, установлен ли у вас компилятор gfortran, выполнив в командной строке
which gfortran
Если в результате выполнения команды в окне ввода команд ничего не отобразилось, тогда компилятор gfortran не установлен. Для его установки наберите команду:
sudo apt install gfortran
чтобы проверить, какая версия была установлены, наберите команду:
gfortran --version
Вы можете установить несколько версий вплоть до версии 10 (в дистрибутиве Ubuntu 22.04), указав номер версии после «gfortran», например:
sudo apt install gfortran-8
Чтобы установить новые версии на старые версии выпусков дистрибутива Ubuntu, вам сначала нужно добавить следующий репозиторий, обновить список пакетов, а затем установить компилятор:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install gfortran-10
Наконец, вы можете переключаться между различными версиями компилятора или установить версию по умолчанию с помощью команды update-alternatives (см. manpage). Существует множество онлайн-уроков по использованию этой команды. Хорошо структурированное руководство на примере языков C и C++ можно найти здесь. Вы можете применить ту же логику, заменив названия gcc и g++ на gfortran .
Дистрибутивы на основе RPM (Red Hat Enterprise Linux, CentOS, Fedora, openSUSE)#
sudo yum install gcc-gfortran
Начиная с Fedora 22 и Red Hat Enterprise Linux 8, dnf – менеджер пакетов по умолчанию:
sudo dnf install gcc-gfortran
Дистрибутивы на основе Arch (Arch Linux, EndeavourOS, Manjaro и др.)#
sudo pacman -S gcc-fortran
macOS#
Xcode#
Если у вас установлен Xcode, то откройте окно ввода команд и наберите:
xcode-select --install
Готовые бинарные сборки#
Посетите fxcoudert/gfortran-for-macOS для установки готовых бинарных сборок (исполняемых файлов).
Homebrew#
brew install gcc
Fink#
Ссылка на пакет GNU-gcc
MacPorts#
Поиск доступных версий gcc:
port search gcc
Установка gcc определённой версии:
sudo port install gcc10
OpenBSD#
pkg_add g95
В OpenBSD исполняемый файл компилятора GFortran называется egfortran . Чтобы проверить установлен ли он, выполните команду:
egfortran -v
OpenCoarrays#
OpenCoarrays – проект программного обеспечения с открытым исходным кодом, который предоставляет бинарный интерфейс приложения (ABI), используемый внешним интерфейсом GNU Compiler Collection (GCC) Fortran для сборки исполняемых приложений, которые используют возможности параллельного программирования стандарта Fortran 2018. Поскольку OpenCoarrays не является отдельным компилятором, мы упоминаем его здесь, в разделе о gfortran.
Хотя вы можете скомпилировать в gfortran совершенно корректный код с использованием комассивов (coarrays), но сгенерированные исполняемые файлы будут работать только в одном образе – image (image – термин языка Fortran для параллельного процесса), то есть, в последовательном режиме выполнения. OpenCoarrays позволяет выполнять код параллельно на машинах с общей и распределённой памятью, подобно интерфейсу MPI:
cafrun -n
Процесс его установки описан на официальном сайте в понятной и исчерпывающей форме.
Подчеркнём, что его установка напрямую в Windows невозможна. Она возможна только через WSL.
so the DOM is not blocked —>
© Copyright 2020-2024, Fortran Community.
Как установить фортран на win 10
Support for Getting Started questions related to download, Installation and licensing for Intel oneAPI Toolkits and software development tools.
Success! Subscription added.
Success! Subscription removed.
Sorry, you must verify to complete this action. Please click the verification link in your email. You may re-send via your profile.
- Intel Community
- Developer Software Forums
- oneAPI Registration, Download, Licensing and Installation
- Can’t install Fortran Compiler 2023.2 on Windows 10
1296 Discussions
Can’t install Fortran Compiler 2023.2 on Windows 10
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
04-24-2024 01:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can’t seem to install the Intel Fortran 2023.2 compiler on Windows 10 (w_HPCKit_p_2023.2.0.49441_offline), I only get a blank window (even no window decorations) after the prerequisites check; the oneAPI installer has frozen completely and can only be killed from the task manager.
On the command line (bootstrapper.exe) I get an error:
Installer failed with error Failed to create package manager database location.
What is going wrong and how can I solve that?
I tried EVERYTHING in that thread in various combinations including:
REGSVR32 /U C:\ProgramData\Microsoft\VisualStudio\Setup\x86\Microsoft.VisualStudio.Setup.Configuration.Native.dll REGSVR32 /U C:\ProgramData\Microsoft\VisualStudio\Setup\x64\Microsoft.VisualStudio.Setup.Configuration.Native.dll
as an admin, renaming those dlls uninstalling EVERYTHING regarding Visual Studio and previous Intel Fortran/Parallel Studio and whatnot – same result: after the check of requirements a completely blank «IntelⓇ oneAPI HPC Toolkit» window appears (no window decorations, no possibility to interact or even close the program other than killing it). Now I’m left with no Fortran Compiler and no Visual Studio installation.
How to install LAPACK for Fortran on Windows 10
I’m trying to use LAPACK in a Fortran project, but I can’t get CMake to find my LAPACK dll. I have very little experience with Fortran, Cmake and linking dll’s. I use this template for my project. In the main CMakeLists.txt file, I enabled the option INCLUDE($/SetUpLAPACK.cmake) but I get the following error
Could NOT find BLAS (missing: BLAS_LIBRARIES)
when trying to compile the project. I have tried to put the libblas.dll and liblapack.dll (I got them from this website) in different folders which are on in the PATH. I also tried putting them directly in the folder where the executables should be generated, but I still get the same error. So my question is: How can I properly install LAPACK on my system, so that the compiler can find it and successfully compile the project? I use gfortran (MinGW64) and Windows 10/11.