윈도우에서 컴파일러 경로 설정

이미지
컴파일러를 명령 프롬프트에서 이용하려면, 환경 변수 설정을 해야 한다. 제어판 설정에서 바꿀 수 있지만 보안상 추천되지 않고 환경 변수들이 서로 충돌할 수 있으므로 아래와 같이 임시적인 환경 변수 설정을 추천한다. 이 글에서 소개하는 컴파일러 환경 변수 설정 방법들은 현재 사용하고 있는 명령 프롬프트에서만 적용되며, 종료하고 다시 실행하는 경우 초기화 된다. 1. GNU 컴파일러 세트는 "gcc", "g++", "gfortran" 컴파일러로 구성되어 있으며, 설치된 경로에서 bin 폴더를 경로설정 하면 이용 할 수 있다. 예를 들어 다음과 같은 명령어를 실행하면 된다. 파이썬의 경우에도 비슷하게 "python" 인터프리터가 존재하는 폴더에 경로를 설정해 주면 이용가능하다. 명령 프롬프트 >>set path=%path%;C:\nm73g64\gfortran\mingw64\bin 파워쉘 >>$env:path=" C:\nm73g64\gfortran\mingw64\bin" 2. 마이크로 소프트의 "cl" 컴파일러, "csc" 컴파일러 또는 "vbc" 컴파일러의 경우 비주얼 스튜디오가 설치된 경로에서 "vcvars64.bat" 파일을 실행하면 사용 가능하도록 변수들이 설정된다. 만약 32-bit 환경으로 세팅하고 싶다면 "vcvars32.bat"를 모든 환경에 대해서 세팅하고 싶다면 "vcvarsall.bat" 파일을 실행하면 된다. 설정 파일의 경로들은 Visual Studio 마다 다른데 2017 버전의 경우 아래와 같다. >>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"

[Linux] Installing gcc, g++ and gfortran on bash

이미지
1. sudo apt-get update 2. sudo apt-get install gcc 3. sudo apt-get install g++ 4. sudo apt-get install gfortran

Module symbol file for module mpi is in a format not recognized by this compiler error message

Module symbol file for module mpi is in a format not recognized by this compiler error message   Technote (troubleshooting) Problem(Abstract) Compilation of Fortran code that uses Parallel Environment (PE) Fortran 90 type-checking module mpi.mod (via USE MPI statement) fails with XL Fortran Enterprise Edition for AIX, V11.1 and earlier versions. Symptom Consider Fortran source code that includes Parallel Environment (PE) Fortran 90 type-checking module mpi.mod:       program test                 use mpi                       print *, 'testing mpi'         stop                         end program test       Compiling this source code with XL Fortran Enterprise Edition for AIX, V11.1 or earlier version will cause compile time error: 1514-220 (S) Module symbol file for module mpi is in a format not recognized by this compiler. Please compile the module with this compiler. Cause The problem is caused by older version of XL Fortran compiler. Resolving

Compiling GCC 7 on macOS

In this tutorial, I will show you how to compile from source and install the current stable version of GCC with Graphite loop optimizations on your macOS computer. The instructions from this tutorial were tested with Xcode 8 and Sierra (macOS 10.12). Clang, the default compiler for macOS, supports only C, C++, Objective-C and Objective-C++. If you are interested in a modern Fortran compiler, e.g. you will need  gfortran  that comes with GCC. Another reason to have the latest stable version of GCC on your macOS is that it provides you with an alternative C and C++ compiler. Testing your code with two different compilers is always a good idea. In order to compile GCC from sources you will need a working C++ compiler. In the remaining of this article I will assume that you have installed the Command Line Tools for Xcode. At the time of this writing Apple’s Command Line Tools maps the  gcc  and  g++  to  clang  and  clang++ . If you don’t have the Command Line Tools installed, open a

[Vi/Vim] File explorer

이미지
The command  :Explore  opens the file explorer window. Select a file or directory name and press Enter to open that file or directory. (For example  :e /home/user displays the contents of that directory.) To return to the explorer window, press Ctrl-^ (usually Ctrl-6). You can also "edit" a directory to explore that directory. For example,  :e ..  lists files in the parent directory. Other approaches Edit In normal mode, type  :e  then press Space and Ctrl-D. That will list file names in the current directory. You can type a name and press Enter to edit that file. If, for example, you want a name that starts with "get" type  :e get  then press Tab repeatedly, or Ctrl-D to list all matches. Another possibility is to use a mapping like this: map <F2> :!ls<CR>:e 출처 - http://vim.wikia.com/wiki/File_explorer

[Vi/Vim] Using tab pages

이미지
This tip provides an introduction to opening, navigating, and working with tab pages. In Vim, each file is loaded into a buffer, which can be displayed in any number of windows, in any number of tabs. The easiest way to think about tab pages in Vim is to consider them to be viewports, layouts, or workspaces. In many editors (not Vim), each file is opened in a new tab, and one tab can show only one file, and one file cannot appear in more than one tab. Vim's tab pages do not have these limitations, and tabs are a convenient way to organize your work. See Quick tips for using tab pages for examples of how tabs can be used to their full potential. Trying to configure Vim to always have one file per tab will not be successful, and would remove much of the power of Vim. However, when you want to edit a file, it is easy to use :tabe instead of :e so that usually there is one file per tab. You can also launch files in new tabs under Windows and Unix . An alternative to one file p

[Vi/Vim] Copy, cut and paste

이미지
Here is how to cut-and-paste or copy-and-paste text using a visual selection in Vim. See Cut/copy and paste using visual selection for the main article. Cut and paste: Position the cursor where you want to begin cutting. Press v to select characters, or uppercase V to select whole lines, or Ctrl-v to select rectangular blocks (use Ctrl-q if Ctrl-v is mapped to paste). Move the cursor to the end of what you want to cut. Press d to cut (or y to copy). Move to where you would like to paste. Press P to paste before the cursor, or p to paste after. Copy and paste is performed with the same steps except for step 4 where you would press y instead of d : d stands for delete in Vim, which in other editors is usually called cut y stands for yank in Vim, which in other editors is usually called copy Copying and cutting in normal mode . In normal mode, one can copy (yank) with y{motion} , where {motion} is a Vim motion. For example, yw copies to the beginning