티스토리 뷰

OS/Tinker Board

Tinker Board : Lazarus 설치

파란크리스마스 2018. 9. 16. 12:26
728x90

출처

OS 업그레이드

$ sudo apt-get update
$ sudo apt-get upgrade

기존 전치된 lazarus 삭제

$ sudo apt-get remove lazarus
$ sudo apt-get remove fpc
$ sudo apt-get autoremove
$ sudo shutdown -r now

Swap 파일 크기 늘리기

여유 공간 확인

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  8.3G  5.5G  61% /
devtmpfs        943M     0  943M   0% /dev
tmpfs          1007M     0 1007M   0% /dev/shm
tmpfs          1007M  8.9M  998M   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs          1007M     0 1007M   0% /sys/fs/cgroup
/dev/mmcblk1p1   63M  7.5M   56M  12% /boot
tmpfs           202M  8.0K  202M   1% /run/user/1000

Swap 설정 파일 수정

$ sudo vi /etc/dphys-swapfile

Swap 사이즈 설정

CONF_SWAPSIZE=1000

Swap 설정 파일을 저장하고 스와핑을 다시 시작

$ sudo /etc/init.d/dphys-swapfile stop
Stopping dphys-swapfile (via systemctl): dphys-swapfile.service.
$ sudo /etc/init.d/dphys-swapfile start
Starting dphys-swapfile (via systemctl): dphys-swapfile.service.
$ ls -lh /var
total 1001M
drwxr-xr-x  2 root root   4.0K Sep 16 01:22 backups
drwxr-xr-x 11 root root   4.0K Jul 21 10:44 cache
drwxr-xr-x 49 root root   4.0K Jul 21 20:09 lib
drwxrwsr-x  2 root staff  4.0K Nov 19  2017 local
lrwxrwxrwx  1 root root      9 Jan 10  2018 lock -> /run/lock
drwxr-xr-x  7 root root   4.0K Sep 16 03:29 log
drwxrwsr-x  2 root mail   4.0K Jan 10  2018 mail
drwxr-xr-x  2 root root   4.0K Jan 10  2018 opt
lrwxrwxrwx  1 root root      4 Jan 10  2018 run -> /run
drwxr-xr-x  7 root root   4.0K Jul 21 10:43 spool
-rw-------  1 root root  1000M Sep 16 03:43 swap
drwxrwxrwt  6 root root   4.0K Sep 16 03:30 tmp

Seed/Bootstrap Pascal Compiler 설치

$ mkdir /usr/local/fpc
$ wget ftp://ftp.hu.freepascal.org/pub/fpc/dist/3.0.4/arm-linux/fpc-3.0.4.arm-linux-eabihf-raspberry.tar
$ tar xvf fpc-3.0.4.arm-linux-eabihf-raspberry.tar 
fpc-3.0.4.arm-linux/
fpc-3.0.4.arm-linux/doc-pdf.tar.gz
fpc-3.0.4.arm-linux/binary.arm-linux.tar
fpc-3.0.4.arm-linux/install.sh
fpc-3.0.4.arm-linux/demo.tar.gz
$ mv fpc-3.0.4.arm-linux /usr/local/fpc/
$ cd /usr/local/fpc/fpc-3.0.4.arm-linux/
$ sudo ./install.sh

설치과정

linaro@tinkerboard:/usr/local/fpc/fpc-3.0.4.arm-linux$ sudo ./install.sh 
This shell script will attempt to install the Free Pascal Compiler
version 3.0.4 with the items you select

Install prefix (/usr or /usr/local)  [/usr] : 
Installing compiler and RTL for arm-linux...

Install Textmode IDE (Y/n) ? 
Done.

Install documentation (Y/n) ? 
Installing documentation in /usr/share/doc/fpc-3.0.4 ...
Done.

Install demos (Y/n) ? 
Install demos in [/usr/share/doc/fpc-3.0.4/examples] : 
Installing demos in /usr/share/doc/fpc-3.0.4/examples ...
Done.

Running on linux
Write permission in /etc.
Writing sample configuration file to /etc/fpc.cfg
Writing sample configuration file to /usr/lib/fpc/3.0.4/ide/text/fp.cfg
Writing sample configuration file to /usr/lib/fpc/3.0.4/ide/text/fp.ini
Writing sample configuration file to /etc/fppkg.cfg
Writing sample configuration file to /etc/fppkg/default

End of installation.

Refer to the documentation for more information.

svn 클라이언트 설치

$ sudo apt-get install subversion

관련 라이브러리 설치

$ sudo apt-get install libgtk2.0-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libatk1.0-dev libghc-x11-dev libx11-dev

Free Pascal 설치

$ cd /usr/local/fpc
$ svn co http://svn.freepascal.org/svn/fpc/trunk source 
$ cd source
$ sudo make all OPT="-dFPC_ARMHF -CpARMV7A -OpARMV7A"
$ sudo make install OPT="-dFPC_ARMHF -CpARMV7A -OpARMV7A" PREFIX=/usr/local
$ sudo make install sourceinstall OPT="-dFPC_ARMHF -CpARMV7A -OpARMV7A" PREFIX=/usr/local

설치된 pascal 버전 확인

$ ls /usr/lib/fpc
3.0.4  lexyacc

fpc 최신 버전으로 심볼릭 링크 걸기

$ ls -al /usr/bin/ppcarm
lrwxrwxrwx 1 root root 25 Sep 16 11:23 /usr/bin/ppcarm -> /usr/lib/fpc/3.0.4/ppcarm

fpc 컴파일러 버전 확인

$ fpc -iW
3.0.4

Lazarus 설치

관련 라이브러리 설치

$ sudo apt-get install libx11-dev libgdk-pixbuf2.0-dev libcairo2-dev gir1.2-coglpango-1.0 libpangox-1.0-dev xorg-dev libgtk2.0-dev libpango1.0-dev

Lazarus 다운로드 및 컴파일

$ mkdir /usr/local/lazarus
$ cd /usr/local/lazarus
$ sudo wget https://jaist.dl.sourceforge.net/project/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%201.8.4/lazarus-1.8.4.tar.gz
$ sudo tar -xvf lazarus-1.8.4.tar.gz 
$ cd lazarus/
$ sudo make all OPT="-dFPC_ARMHF -CpARMV7A -OpARMV7A"
$ sudo make install OPT="-dFPC_ARMHF -CpARMV7A -OpARMV7A" PREFIX=/usr/local

gcc 라이브러리 경로 설정

컴파일하면 crtbegin.o 및 crtend.o를 찾을 수 없다는 경고가 출력됩니다. 경고가 표지 되지 않도록 설정

crtbegin.o 찾기

$ sudo find / -name crtbegin.o
/usr/lib/gcc/arm-linux-gnueabihf/6/crtbegin.o

fpc 환경 파일 (fpc.cfg) 수정

$ sudo vi /etc/fpc.cfg

내용 추가

# path to the gcclib
-Fl/usr/lib/gcc/arm-linux-gnueabihf/6

gdb 설치

$ sudo apt-get install gdb-multiarch

Lazarus 실행

fpc 경로 오류

fpc 경로 찾기

fpc 경로 설정

Lazarus 실행화면

댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함