Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 388. Windows 환경에서 Octave 패키지 설치하는 방법 [링크 복사], [링크+제목 복사]
조회: 13736
글쓴 사람
정성태 (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

비밀번호

댓글 작성자
 




... [31]  32  33  34  35  36  37  38  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
12846정성태10/7/20218261스크립트: 30. 파이썬 __debug__ 플래그 변수에 따른 코드 실행 제어
12845정성태10/6/20218102.NET Framework: 1120. C# - BufferBlock<T> 사용 예제 [5]파일 다운로드1
12844정성태10/3/20216133오류 유형: 764. MSI 설치 시 "... is accessible and not read-only." 오류 메시지
12843정성태10/3/20216594스크립트: 29. 파이썬 - fork 시 기존 클라이언트 소켓 및 스레드의 동작파일 다운로드1
12842정성태10/1/202124814오류 유형: 763. 파이썬 오류 - AttributeError: type object '...' has no attribute '...'
12841정성태10/1/20218379스크립트: 28. 모든 파이썬 프로세스에 올라오는 특별한 파일 - sitecustomize.py
12840정성태9/30/20218434.NET Framework: 1119. Entity Framework의 Join 사용 시 다중 칼럼에 대한 OR 조건 쿼리파일 다운로드1
12839정성태9/15/20219496.NET Framework: 1118. C# 11 - 제네릭 타입의 특성 적용파일 다운로드1
12838정성태9/13/20219148.NET Framework: 1117. C# - Task에 전달한 Action, Func 유형에 따라 달라지는 async/await 비동기 처리 [2]파일 다운로드1
12837정성태9/11/20218089VC++: 151. Golang - fmt.Errorf, errors.Is, errors.As 설명
12836정성태9/10/20217683Linux: 45. 리눅스 - 실행 중인 다른 프로그램의 출력을 확인하는 방법
12835정성태9/7/20218949.NET Framework: 1116. C# 10 - (15) CallerArgumentExpression 특성 추가 [2]파일 다운로드1
12834정성태9/7/20217323오류 유형: 762. Visual Studio 2019 Build Tools - 'C:\Program' is not recognized as an internal or external command, operable program or batch file.
12833정성태9/6/20216774VC++: 150. Golang - TCP client/server echo 예제 코드파일 다운로드1
12832정성태9/6/20217610VC++: 149. Golang - 인터페이스 포인터가 의미 있을까요?
12831정성태9/6/20216153VC++: 148. Golang - 채널에 따른 다중 작업 처리파일 다운로드1
12830정성태9/6/20218374오류 유형: 761. Internet Explorer에서 파일 다운로드 시 "Your current security settings do not allow this file to be downloaded." 오류
12829정성태9/5/202110028.NET Framework: 1115. C# 10 - (14) 구조체 타입에 기본 생성자 정의 가능파일 다운로드1
12828정성태9/4/20218149.NET Framework: 1114. C# 10 - (13) 단일 파일 내에 적용되는 namespace 선언파일 다운로드1
12827정성태9/4/20218130스크립트: 27. 파이썬 - 웹 페이지 데이터 수집을 위한 scrapy Crawler 사용법 요약
12826정성태9/3/202110372.NET Framework: 1113. C# 10 - (12) 문자열 보간 성능 개선 [1]파일 다운로드1
12825정성태9/3/20217933개발 환경 구성: 603. GoLand - WSL 환경과 연동
12824정성태9/2/202117009오류 유형: 760. 파이썬 tensorflow - Dst tensor is not initialized. 오류 메시지
12823정성태9/2/20216741스크립트: 26. 파이썬 - PyCharm을 이용한 fork 디버그 방법
12822정성태9/1/202111948오류 유형: 759. 파이썬 tensorflow - ValueError: Shapes (...) and (...) are incompatible [2]
12821정성태9/1/20217506.NET Framework: 1112. C# - .NET 6부터 공개된 ISpanFormattable 사용법
... [31]  32  33  34  35  36  37  38  39  40  41  42  43  44  45  ...