Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 388. Windows 환경에서 Octave 패키지 설치하는 방법 [링크 복사], [링크+제목 복사]
조회: 13912
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)
(시리즈 글이 7개 있습니다.)
개발 환경 구성: 335. Octave의 명령 창에서 실행한 결과를 복사하는 방법
; https://www.sysnet.pe.kr/2/0/11309

개발 환경 구성: 388. Windows 환경에서 Octave 패키지 설치하는 방법
; https://www.sysnet.pe.kr/2/0/11622

개발 환경 구성: 674. WSL 2 환경에서 GNU Octave 설치
; https://www.sysnet.pe.kr/2/0/13319

개발 환경 구성: 675. Windows Octave 8.1.0 - Python 스크립트 연동
; https://www.sysnet.pe.kr/2/0/13320

개발 환경 구성: 676. WSL/Linux Octave - Python 스크립트 연동
; https://www.sysnet.pe.kr/2/0/13321

개발 환경 구성: 677. Octave에서 Excel read/write를 위한 io 패키지 설치
; https://www.sysnet.pe.kr/2/0/13323

.NET Framework: 2108. C# - Octave의 "save -binary ..."로 생성한 바이너리 파일 분석
; https://www.sysnet.pe.kr/2/0/13324




Windows 환경에서 Octave 패키지 설치하는 방법

octave 패키지를 설치하려면 우선 python 2.7.10 버전이 설치되어 있어야 합니다.

python 2.7.10
; https://www.python.org/downloads/

제 경우에 gaussian 함수가 필요했는데,

Function File: gaussian (m)
Function File: gaussian (m, a)
; https://octave.sourceforge.io/signal/function/gaussian.html

위의 도움말 하단에 "Package: signal"이라고 되어 있으므로 이것을 설치해 보도록 하겠습니다. 방법은 "Help" / "Octave Packages" 메뉴를 통해 접근하는 다음의 글로 쉽게 알 수 있습니다.

About Octave Forge
; https://octave.sourceforge.io/

간단하게, Octave 내의 명령행 창에서 "pkg install" 명령어를 내리면 됩니다.

pkg install -forge package_name 

따라서, 제 경우에는 package_name을 "signal"로 해서 실행했는데,

>> pkg install -forge signal
error: the following dependencies were unsatisfied:
   signal needs control >= 2.4

의존성 해결이 안 되었군요. ^^ "control" 패키지가 필요하다고 하니 다시 다음과 같이 의존성이 있는 패키지를 설치해 주면 됩니다.

pkg install -forge control
pkg install -forge signal

참고로, 해당 패키지들은 tar.gz 파일 그대로 다운로드가 가능합니다.

Packages
; https://octave.sourceforge.io/packages.php

만약, signal 패키지(signal-1.4.0.tar.gz)를 다운로드했다면 Octave 프로그램 상단에 "Current Directory"를 tar.gz가 있는 폴더로 변경하거나, 반대로 tar.gz 파일을 "Current Directory"로 복사한 다음 파일명을 직접 입력해 설치할 수도 있습니다.

pkg install signal-1.4.0.tar.gz

(사실, pkg install -forge 명령어로 설치를 해도 "Current Directory"에 해당 파일을 다운로드하고 설치 후 삭제를 합니다.)




파이썬이 없거나, 파이썬 3.x 버전이 실행되도록 PATH에 설정되어 있는 경우에는 pkg install에서 다음과 같은 식의 오류 메시지를 볼 수 있습니다.

>> pkg install -forge signal
...[생략]...
tar: Archive entry has empty or unreadable filename ... skipping.
tar: Archive entry has empty or unreadable filename ... skipping.
tar: Error exit delayed from previous errors.
error: called from
    unpack at line 251 column 5
    untar at line 47 column 5
    install at line 81 column 9
    pkg at line 394 column 9

반드시 2.7.10 버전을 설치하시고 cmd.exe 창에서 "python.exe"를 실행해 본 후 2.7.10 인터프리터가 뜨는지 확인을 해야 합니다. 만약 3.x 버전이 뜬다면 PATH를 2.7.10으로 맞추고 octave.bat을 실행하면 됩니다.




함수를 실행했는데 다음과 같은 식으로 오류가 뜨면,

>> gaussian(9)
error: 'gaussian' undefined near line 1 column 1

해당 패키지가 설치되어 있지 않아서 그런 것입니다. 다음의 도움말을 통해,

List of Functions by Package
; https://octave.sourceforge.io/functions_by_package.php

원하는 함수를 구현한 패키지를 설치하면 됩니다. 하지만, 패키지의 함수를 실행하려면 명시적으로 로드를 해야 합니다.

>> gaussian(9)
error: 'gaussian' undefined near line 1 column 1

>> pkg load signal

>> gaussian(9)
ans =

  3.3546e-004
  1.1109e-002
  1.3534e-001
  6.0653e-001
  1.0000e+000
  6.0653e-001
  1.3534e-001
  1.1109e-002
  3.3546e-004

>> help gaussian
'gaussian' is a function from the file C:\Octave\OCTAVE~1.1\share\octave\packages\signal-1.4.0\gaussian.m
...[생략]...




설치 시 다음과 같은 오류가 발생할 수 있습니다.

>> pkg install -forge signal
medfilt1.cc: In member function 'void sorted_window::init(const double*, octave_idx_type, octave_idx_ty
pe, octave_idx_type)':
medfilt1.cc:91:42: error: 'bzero' was not declared in this scope
       bzero (buf, zeros * sizeof (double));
                                          ^
make: *** [medfilt1.oct] Error 1
make: Entering directory `/tmp/oct-ZNzODD/signal-1.4.0/src'
C:/Octave/OCTAVE~1.1/bin/mkoctfile-4.2.1.exe -Wall -Wno-deprecated-declarations  __fwht__.cc -o __fwht_
_.oct
C:/Octave/OCTAVE~1.1/bin/mkoctfile-4.2.1.exe -Wall -Wno-deprecated-declarations  __ultrwin__.cc -o __ul
trwin__.oct
C:/Octave/OCTAVE~1.1/bin/mkoctfile-4.2.1.exe -Wall -Wno-deprecated-declarations  -c cl2bp.cc -o cl2bp.o

C:/Octave/OCTAVE~1.1/bin/mkoctfile-4.2.1.exe -Wall -Wno-deprecated-declarations  -c cl2bp_lib.cc -o cl2
bp_lib.o
C:/Octave/OCTAVE~1.1/bin/mkoctfile-4.2.1.exe -Wall -Wno-deprecated-declarations  cl2bp.o cl2bp_lib.o -o
 cl2bp.oct
C:/Octave/OCTAVE~1.1/bin/mkoctfile-4.2.1.exe -Wall -Wno-deprecated-declarations  medfilt1.cc -o medfilt
1.oct
make: Leaving directory `/tmp/oct-ZNzODD/signal-1.4.0/src'

pkg: error running `make' for the signal package.
error: called from
    configure_make at line 95 column 9
    install at line 192 column 7
    pkg at line 394 column 9

검색해 보면, 이에 대한 이슈가 나옵니다.

bug #53849: [octave forge] (signal) error building medfilt1.cc on Windows
; https://savannah.gnu.org/bugs/?53849

따라서 "https://hg.mtmxr.com/octave-signal/archive/3cbff3de1ebc.tar.gz" 파일을 다운로드해 "signal-1.4.0.tar.gz" 파일명으로 변경 후 "pkg install" 명령어로 설치해 줍니다.

>> pkg install signal-1.4.0.tar.gz
For information about changes from previous versions of the signal package, run 'news signal'.




원래 pkg install이 링크로도 가능한 것 같은데, 제 경우 다음과 같이 오류가 발생했습니다.

>> pkg install  https://hg.mtmxr.com/octave-signal/archive/3cbff3de1ebc.tar.gz
warning: file https://hg.mtmxr.com/octave-signal/archive/3cbff3de1ebc.tar.gz does not exist

그래서 3cbff3de1ebc.tar.gz 파일을 다운로드해 다시 시도를 해봤지만,

>> pkg install octave-signal-3cbff3de1ebc.tar.gz
package name 'signal' doesn't correspond to its filename 'octave-signal-3cbff3de1ebc.tar'
error: called from
    install at line 119 column 11
    pkg at line 394 column 9

이번에는 파일 명이 잘못되었다고 합니다. 그래서 octave-signal-3cbff3de1ebc.tar 파일을 signal-1.4.0.tar.gz로 이름 변경 후 설치를 했고 정상적으로 동작을 했습니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 7/23/2018]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  3  4  5  6  7  [8]  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13432정성태10/31/20232455오류 유형: 878. 탐색기의 WSL 디렉터리 접근 시 "Attempt to access invalid address." 오류 발생
13431정성태10/31/20232790스크립트: 60. 파이썬 - 비동기 FastAPI 앱을 gunicorn으로 호스팅
13430정성태10/30/20232679닷넷: 2153. C# - 사용자가 빌드한 ICU dll 파일을 사용하는 방법
13429정성태10/27/20232961닷넷: 2152. Win32 Interop - C/C++ DLL로부터 이중 포인터 버퍼를 C#으로 받는 예제파일 다운로드1
13428정성태10/25/20233035닷넷: 2151. C# 12 - ref readonly 매개변수
13427정성태10/18/20233250닷넷: 2150. C# 12 - 정적 문맥에서 인스턴스 멤버에 대한 nameof 접근 허용(Allow nameof to always access instance members from static context)
13426정성태10/13/20233408스크립트: 59. 파이썬 - 비동기 호출 함수(run_until_complete, run_in_executor, create_task, run_in_threadpool)
13425정성태10/11/20233196닷넷: 2149. C# - PLinq의 Partitioner<T>를 이용한 사용자 정의 분할파일 다운로드1
13423정성태10/6/20233173스크립트: 58. 파이썬 - async/await 기본 사용법
13422정성태10/5/20233320닷넷: 2148. C# - async 유무에 따른 awaitable 메서드의 병렬 및 예외 처리
13421정성태10/4/20233396닷넷: 2147. C# - 비동기 메서드의 async 예약어 유무에 따른 차이
13420정성태9/26/20235585스크립트: 57. 파이썬 - UnboundLocalError: cannot access local variable '...' where it is not associated with a value
13419정성태9/25/20233220스크립트: 56. 파이썬 - RuntimeError: dictionary changed size during iteration
13418정성태9/25/20233925닷넷: 2146. C# - ConcurrentDictionary 자료 구조의 동기화 방식
13417정성태9/19/20233454닷넷: 2145. C# - 제네릭의 형식 매개변수에 속한 (매개변수를 가진) 생성자를 호출하는 방법
13416정성태9/19/20233259오류 유형: 877. redis-py - MISCONF Redis is configured to save RDB snapshots, ...
13415정성태9/18/20233756닷넷: 2144. C# 12 - 컬렉션 식(Collection Expressions)
13414정성태9/16/20233514디버깅 기술: 193. Windbg - ThreadStatic 필드 값을 조사하는 방법
13413정성태9/14/20233710닷넷: 2143. C# - 시스템 Time Zone 변경 시 이벤트 알림을 받는 방법
13412정성태9/14/20236992닷넷: 2142. C# 12 - 인라인 배열(Inline Arrays) [1]
13411정성태9/12/20233493Windows: 252. 권한 상승 전/후 따로 관리되는 공유 네트워크 드라이브 정보
13410정성태9/11/20235031닷넷: 2141. C# 12 - Interceptor (컴파일 시에 메서드 호출 재작성) [1]
13409정성태9/8/20233888닷넷: 2140. C# - Win32 API를 이용한 모니터 전원 끄기
13408정성태9/5/20233843Windows: 251. 임의로 만든 EXE 파일을 포함한 ZIP 파일의 압축을 해제할 때 Windows Defender에 의해 삭제되는 경우
13407정성태9/4/20233588닷넷: 2139. C# - ParallelEnumerable을 이용한 IEnumerable에 대한 병렬 처리
13406정성태9/4/20233557VS.NET IDE: 186. Visual Studio Community 버전의 라이선스
1  2  3  4  5  6  7  [8]  9  10  11  12  13  14  15  ...