Microsoft MVP성태의 닷넷 이야기
개발 환경 구성: 674. WSL 2 환경에서 GNU Octave 설치 [링크 복사], [링크+제목 복사],
조회: 4615
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

(시리즈 글이 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




WSL 2 + Ubuntu 환경에서 GNU Octave 설치

예전에 Windows에서 Octave를 설치했었는데요, 근래에 나온 8.1.0 버전의 경우 윈도우에서는 JRE 문제도 없어졌습니다.

이번에는, 재미 삼아 WSL 2 환경의 Ubutn 20.04 또는 18.04에서 Octave를 다음의 명령어로 설치해 보겠습니다.

$ sudo apt update && sudo apt upgrade -y

$ sudo apt install octave         // 필수
$ sudo apt install liboctave-dev  // 선택

// 제거

$ sudo apt remove octave
$ sudo apt remove liboctave-dev

음... 버전이 좀 아쉽군요. ^^

$ octave --version
GNU Octave, version 5.2.0
Copyright (C) 2020 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.

20.04의 경우 5.2.0 버전이 설치되고, 18.04의 경우에는 4.2.2 버전이 설치됩니다. 문서에 보면 별도의 ppa repo를 추가하면 된다고 하는데요, 그런데 실제로 해보면,

$ sudo add-apt-repository ppa:octave/stable
 The latest version of GNU Octave built for all supported Ubuntu releases. GNU Octave is normally distributed with Ubuntu, this PPA is for you if you have a need to use a newer version of Octave than what you can already get from your installed version of Ubuntu.

Simply follow the instructions below to add this PPA to your system and install the octave package. If it's not that easy or you encounter any errors, contact the team and let us know.

Much credit goes to the Debian Octave Group who maintain the official Debian packages that this work is derived from. Without their efforts to bring Octave packaging to such a high level of quality in Debian and Debian derivatives, this PPA would not be here.
 More info: https://launchpad.net/~octave/+archive/ubuntu/stable
Press [ENTER] to continue or Ctrl-c to cancel adding it.

0% [Connecting to archive.ubuntu.com (185.125.190.39)] [Waiting for headers] [Connecting to ppa.launchpad.net (2620:2d:sHit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:2 http://ppa.launchpad.net/octave/stable/ubuntu bionic InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                                      d
Hit:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Err:6 http://ppa.launchpad.net/octave/stable/ubuntu bionic Release
  404  Not Found [IP: 185.125.190.52 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/octave/stable/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

// 제거 방법
$ sudo add-apt-repository ppa:octave/stable --remove

이렇게 오류가 발생합니다. 오류가 발생한 "http://ppa.launchpad.net/octave/stable/ubuntu" 링크를 가보면, ./dists 하위에 있는 각각의 폴더명에 대해 대응하는 코드명은 이렇게 됩니다.

devel
lucid (10.04)
natty (11.04)
oneiric (11.10)
precise (12.04)
quantal (12.10)
saucy (13.10)
trusty (14.04)
vivid (15.04)
xenial (16.04)

18.04의 경우 bionic이고 20.04의 경우 focal이기 때문에 결국 18.04 이후로는 "ppa:octave/stable" repo에서 더 이상 업데이트가 안 된 것입니다. (문서에 2018년까지 유지됐다고 합니다.) 게다가 WSL은 Ubuntu 16.04 버전은 배포를 하지 않기 때문에,

C:\temp> wsl -l -o
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.

NAME                                   FRIENDLY NAME
Ubuntu                                 Ubuntu
Debian                                 Debian GNU/Linux
kali-linux                             Kali Linux Rolling
Ubuntu-18.04                           Ubuntu 18.04 LTS
Ubuntu-20.04                           Ubuntu 20.04 LTS
Ubuntu-22.04                           Ubuntu 22.04 LTS
OracleLinux_8_5                        Oracle Linux 8.5
OracleLinux_7_9                        Oracle Linux 7.9
SUSE-Linux-Enterprise-Server-15-SP4    SUSE Linux Enterprise Server 15 SP4
openSUSE-Leap-15.4                     openSUSE Leap 15.4
openSUSE-Tumbleweed                    openSUSE Tumbleweed

딱히 해볼 것이 없군요. ^^ (이때까지만 해도 있었는데.)




일단, apt 명령어는 그렇고 또 다른 패키지 관리자로 snap을 이용해 보겠습니다. ^^ 그 전에, 다음의 글에 따라 snap을 활성화시키고,

WSL 2 Ubuntu 20.04 - error: cannot communicate with server: Post http://localhost/v2/snaps/...
; https://www.sysnet.pe.kr/2/0/13317

설치하면,

$ sudo snap install octave
octave 7.1.0 from GNU Octave (octave-snap✓) installed

최신 버전(8.1.0)은 아니지만 7.1.0 버전이 설치됩니다. 뭐 그런대로, 소스코드로부터 빌드하는 것이 아닌 이상 이 정도면 만족해야겠습니다. ^^

마지막으로, WSL 2에서 다음과 같이 실행해 주면,

$ octave --force-gui

// 또는,

$ nohup octave --force-gui &

윈도우 환경과 연계해 이렇게 잘 실행됩니다.

wsl2_octave7_1.png




참고로, snap으로 설치한 octave는 이렇게 위치하고 있습니다.

$ ll /snap/octave
total 8
drwxr-xr-x  3 root root 4096 Apr 11 00:09 ./
drwxr-xr-x  9 root root 4096 Apr 11 00:09 ../
drwxr-xr-x 12 root root    0 Apr 21  2022 306/
lrwxrwxrwx  1 root root    3 Apr 11 00:09 current -> 306/

$ ll /snap/octave/306
total 0
drwxr-xr-x  2 root root 0 Apr 21  2022 bin/
drwxr-xr-x 19 root root 0 Apr 21  2022 etc/
drwxr-xr-x  3 root root 0 Apr 21  2022 include/
drwxr-xr-x  7 root root 0 Apr 21  2022 lib/
drwxr-xr-x  3 root root 0 Apr 21  2022 libexec/
drwxr-xr-x  3 root root 0 Apr 21  2022 meta/
drwxr-xr-x  7 root root 0 Apr 21  2022 share/
drwxr-xr-x  3 root root 0 Apr 21  2022 snap/
drwxr-xr-x  7 root root 0 Mar 15  2022 usr/
drwxr-xr-x  4 root root 0 Apr 21  2022 var/

또한, 기본적으로 python 3.6을 포함하고 있습니다.

$ ll /snap/octave/306/usr/bin/python3
lrwxrwxrwx 1 root root 9 Oct 25  2018 /snap/octave/306/usr/bin/python3 -> python3.6*

$ /snap/octave/306/usr/bin/python3.6
Python 3.6.9 (default, Mar 15 2022, 13:55:28)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

나중에 설명하겠지만, 아쉽게도 7.1.0 버전에서는 위의 python3.6이 Octave의 "python" 명령에 연결되지 않습니다.




snap으로 설치한 octave를 실행하면 초기에 이런 오류 메시지들이 나옵니다.

$ octave
QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/1000/snap.octave', please create it with 0700 permissions.
Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
...[생략]...
Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 6: invalid attribute 'version'
Fontconfig error: Cannot load config file from /etc/fonts/fonts.conf

처음의 XDG_RUNTIME_DIR 오류는 그 메시지에서 알려주는 대로 다음과 같은 처리를 하면 됩니다.

$ mkdir -p /run/user/1000/snap.octave
$ chmod 0700 /run/user/1000/snap.octave

그다음, fonts.conf에서 발생하는 오류를 검색해 보면, 2.12.x 버전의 config을 사용하는 프로그램이 2.13.x 버전으로 업그레이드된 시스템에서 발생하는 문제라고 합니다. 실제로 제 Ubuntu에는 2.13.1이었는데요,

$ sudo apt show fontconfig
Package: fontconfig
Version: 2.13.1-2ubuntu3
Priority: optional
Section: utils
...[생략]...

그렇다면 아마도 Octave 7.1.0 버전은 2.12.x를 대상으로 빌드된 듯합니다. 이에 대해 딱히 방법은 없는 것 같고, its 네임스페이스를 갖는 노드가 문제가 되는 것이므로 그것만 삭제해 해결했다는 글이 나옵니다. 일례로, 오류가 나는 파일들 중 하나를 보면,

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
    <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
        <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
    </its:rules>

    <description>Default configuration file</description>
    
    ...[생략]...
</fontconfig>

오류 메시지에서 지적하고 있는 내용이 저렇게 꼭 포함이 됩니다. 그래서 다음의 명령어로 해당 XML 노드를 삭제해 주면 됩니다.

// https://stackoverflow.com/questions/62348866/how-to-fix-fontconfig-warning-unknown-elements-error

$ sudo sed -i '/<description/d; /its\:/d' /etc/fonts/fonts.conf /etc/fonts/conf.d/*conf

그나저나, 혹시 8.1.0 버전을 소스코드 빌드 없이 repo에서 설치하는 방법은 없는 걸까요? ^^ 현재로서는 docker를 이용하는 것이 그나마 나은 듯합니다.

docker pull docker.io/gnuoctave/octave:8.1.0




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







[최초 등록일: ]
[최종 수정일: 4/12/2023]

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

비밀번호

댓글 작성자
 




... 46  47  48  49  50  51  52  [53]  54  55  56  57  58  59  60  ...
NoWriterDateCnt.TitleFile(s)
12322정성태9/11/202010930개발 환경 구성: 513. Azure VM의 RDP 접속 위치 제한 [1]
12321정성태9/11/20208993오류 유형: 648. netsh http add urlacl - Error: 183 Cannot create a file when that file already exists.
12320정성태9/11/202010153개발 환경 구성: 512. RDP(원격 데스크톱) 접속 시 비밀 번호를 한 번 더 입력해야 하는 경우
12319정성태9/10/20209943오류 유형: 647. smigdeploy.exe를 Windows Server 2016에서 실행할 때 .NET Framework 미설치 오류 발생
12318정성태9/9/20209363오류 유형: 646. OpenVPN - "TAP-Windows Adapter V9" 어댑터의 "Network cable unplugged" 현상
12317정성태9/9/202011724개발 환경 구성: 511. Beats용 Kibana 기본 대시 보드 구성 방법
12316정성태9/8/202010128디버깅 기술: 170. WinDbg Preview 버전부터 닷넷 코어 3.0 이후의 메모리 덤프에 대해 sos.dll 자동 로드
12315정성태9/7/202012448개발 환경 구성: 510. Logstash - FileBeat을 이용한 IIS 로그 처리 [2]
12314정성태9/7/202011083오류 유형: 645. IIS HTTPERR - Timer_MinBytesPerSecond, Timer_ConnectionIdle 로그
12313정성태9/6/202012173개발 환경 구성: 509. Logstash - 사용자 정의 grok 패턴 추가를 이용한 IIS 로그 처리
12312정성태9/5/202016046개발 환경 구성: 508. Logstash 기본 사용법 [2]
12311정성태9/4/202011302.NET Framework: 937. C# - 간단하게 만들어 보는 리눅스의 nc(netcat), json_pp 프로그램 [1]
12310정성태9/3/202010576오류 유형: 644. Windows could not start the Elasticsearch 7.9.0 (elasticsearch-service-x64) service on Local Computer.
12309정성태9/3/202010316개발 환경 구성: 507. Elasticsearch 6.6부터 기본 추가된 한글 형태소 분석기 노리(nori) 사용법
12308정성태9/2/202011593개발 환경 구성: 506. Windows - 단일 머신에서 단일 바이너리로 여러 개의 ElasticSearch 노드를 실행하는 방법
12307정성태9/2/202012332오류 유형: 643. curl - json_parse_exception / Invalid UTF-8 start byte
12306정성태9/1/202010474오류 유형: 642. SQL Server 시작 오류 - error code 10013
12305정성태9/1/202011396Windows: 172. "Administered port exclusions"이 아닌 포트 범위 항목을 삭제하는 방법
12304정성태8/31/202010334개발 환경 구성: 505. 윈도우 - (네트워크 어댑터의 우선순위로 인한) 열거되는 IP 주소 순서를 조정하는 방법
12303정성태8/30/202010534개발 환경 구성: 504. ETW - 닷넷 프레임워크 기반의 응용 프로그램을 위한 명령행 도구 etrace 소개
12302정성태8/30/202010402.NET Framework: 936. C# - ETW 관련 Win32 API 사용 예제 코드 (5) - Private Logger파일 다운로드1
12301정성태8/30/202010734오류 유형: 641. error MSB4044: The "Fody.WeavingTask" task was not given a value for the required parameter "IntermediateDir".
12300정성태8/29/202010104.NET Framework: 935. C# - ETW 관련 Win32 API 사용 예제 코드 (4) CLR ETW Consumer파일 다운로드1
12299정성태8/27/202011041.NET Framework: 934. C# - ETW 관련 Win32 API 사용 예제 코드 (3) ETW Consumer 구현파일 다운로드1
12298정성태8/27/202010755오류 유형: 640. livekd - Could not resolve symbols for ntoskrnl.exe: MmPfnDatabase
12297정성태8/25/202010022개발 환경 구성: 503. SHA256 테스트 인증서 생성 방법
... 46  47  48  49  50  51  52  [53]  54  55  56  57  58  59  60  ...