'우분투'에 해당되는 글 7건

  1. 2010.08.16 다운 받은 소스 어떻게 열 수 있을까?
  2. 2010.07.02 우분투에서 피카사 쓰기..(picasa)
  3. 2010.06.28 안드로이드 소스 빌드...(ver 0.1)
  4. 2010.06.28 리눅스에서 originPro 와 같은 그래프 그려주는 프로그램...
  5. 2010.06.28 리눅스에서 매트랩을 이용하기...(gnuOctave...)
  6. 2010.06.25 gsl 의 사용 (우분투)
  7. 2009.09.25 우분투와 함께 시작 #1

다운 받은 소스 어떻게 열 수 있을까?

이클립스 상에서 만들어진 안드로이드 프로젝트는 윈도우와 달리 따로 prj 파일 등이 없다.

그렇다면 어떻게 프로젝트를 열 수 있을까?

File -> Import -> General -> Existing Projects into Workspace

를 선택하고 Next 단추를 누르면

Select root directory 를 선택할 수 있다.

이 때에 Browse 를 눌러 소스를 다운 받은 디렉토리를 지정해준다.

우분투에서 피카사 쓰기..(picasa)

먼저 apt-get 을 이용해서 패키지를 설치하고 싶은 경우..

http://www.google.com/linuxrepositories/ubuntu704.html

를 따라한다.

설치하고 난 후에 다음과 같은 에러가 뜰 수 있다.

터미널에서 실행을 하려고 하면,

/ usr / bin / picasa: line 139: 4213 Segmentation fault "$ PIC_BINDIR" / wrapper check_dir.exe.so
/ usr / bin / picasa: line 175: 4316 Segmentation fault "$ PIC_BINDIR / wrapper" regedit / E $ registry_export HKEY_USERS \ S-1-5-4 \ \ Software \ \ Google \ \ Picasa \ \ Picasa2 \ \ Preferences \ \

같은 메세지가 나온다
이  때엔 다음과 같이 해준다. (띄어 쓰기에 유의하라)

rm-rf ~ /. picasa /
sudo sysctl -w vm.mmap_min_addr=0
 
실행이 되는데, 한글이 깨지는 문제가 발생한다면

프로그램->기타->피카사 폰트 세팅

에서 한글 폰트를 추가해준다.


안드로이드 소스 빌드...(ver 0.1)

http://android.git.kernel.org/

참조..

우분투 상에선 다음을 참조하자.

Ubuntu Linux (32-bit x86)

To set up your Linux development environment, make sure you have the following:
  • Required Packages:
    • Git 1.5.4 or newer and the GNU Privacy Guard.
    • JDK 5.0, update 12 or higher.Java 6 is not supported, because of incompatibilities with @Override.
    • flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev (optional), build-essential, zip, curl.
$ sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev 
  • You might also want Valgrind, a tool that will help you find memory leaks, stack corruption, array bounds overflows, etc.
$ sudo apt-get install valgrind 
  • Intrepid ( 8.10) users may need a newer version of libreadline:
$ sudo apt-get install lib32readline5-dev           -->>> 이건 없는 파일인듯. 생략하자.

이걸 다 깔아도 가끔식 안될 때가 있는데 git 코어가 안 깔려있을 경우이다.
다음과 같은 에러 메시지가 나온다.

apt-get install git-core

를 해준다.

Installing Repo 

Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo, see Using Repo and Git .

To install, initialize, and configure Repo, follow these steps:

  1. Make sure you have a~/bindirectory in your home directory, and check to be sure that this bin directory is in your path: 
    $ cd ~
    $ mkdir bin 
    $ echo $PATH 
  2. Download thereposcript and make sure it is executable: 
    $ curl http://android.git.kernel.org/repo >~/bin/repo
    $ chmod a+x ~/bin/repo


Initializing a Repo client 

  1. Create an empty directory to hold your working files: 
    $ mkdir mydroid 
    $ cd mydroid 
  2. Run "repo init" to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest: 
    $ repo init -u git://android.git.kernel.org/platform/manifest.git
    • If you would like to check out a branch other than "master", specify it with -b, like: 
      $ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake 
  3. When prompted, configure Repo with your real name and email address. If you plan to submit code, use an email address that is associated with a Google account . 
A successful initialization will end with a message such as 
repo initialized in /mydroid
 


를 참조한다.

그런데 간단하게는 2,3번 절차에서

mkdir mydroid
cd mydroid
repo init -u git://android.git.kernel.org/platform/manifest.git
repo sync

로 끝낼 수도 있다.

다만 소스 크기가 매우 크므로 시간이 오래 걸린다.

도중에 멈춘 경우엔 다시
repo sync
를 입력하여 소스를 다운 받자.


Android Build System

안드로이드는 GNU 의 최신 버전의 make 를 사용한다.

# make -v 

버전이 3.80 보다 작으면 업그레이드 해야한다.

Understanding the makefile

Makefile 엔 다음과 같은 정보를 담아야 한다.

Name: Give your build a name (LOCAL_MODULE := <build_name>).
Local Variables: Clear local variables with CLEAR_VARS (include (CLEARVARS)).
Files: Determine which files your application depends upon (LOCAL_SRC_FILES := main.c).
Tags: Define tags, as necessary (LOCAL_MODULE_TAGS := eng development).
Libraries: Define whether your application links with other libraries (LOCAL_SHARED_LIBRARIES := cutils).
Template file: Include a template file to define underlining make tools for a particular target (include (BUILDEXECUTABLE)).

정형적인 메이크 파일은 다음과 같다.
LOCAL_PATH := (my-dir)
include (CLEARVARS)
LOCAL_MODULE := <buil_name>
LOCAL_SRC_FILES := main.c
LOCAL_MODULE_TAGS := eng development
LOCAL_SHARED_LIBRARIES := cutils
include (BUILDEXECUTABLE)
(HOST_)EXECUTABLE, (HOST_)JAVA_LIBRARY, (HOST_)PREBUILT, (HOST_)SHARED_LIBRARY,
  (HOST_)STATIC_LIBRARY, PACKAGE, JAVADOC, RAW_EXECUTABLE, RAW_STATIC_LIBRARY,
  COPY_HEADERS, KEY_CHAR_MAP

Layers

빌드는 아래 테이블에 기술된 추상화된 계층을 포함하는 구조로 이루어진다.

@@Layer (Example) ------- Description

@@Product (myProduct, myProduct_eu, myProduct_eu_fr, j2, sdk )
-------- The product layer defines a complete specification of a shipping product, defining which modules to build and how to configure them. You might offer a device in several different versions based on locale, for example, or on features such as a camera.

@@Device (myDevice, myDevice_eu, myDevice_eu_lite) --------- The device layer represents the physical layer of plastic on the device. For example, North American devices probably include QWERTY keyboards whereas devices sold in France probably include AZERTY keyboards. Peripherals typically connect to the device layer.

@@Board (sardine, trout, goldfish)
----------- The board layer represents the bare schematics of a product. You may still connect peripherals to the board layer.

@@Arch (arm (arm5te) (arm6), x86, 68k ) ----------The arch layer describes the processor running on your board.

Building the Android Platform

이번 섹션은 안드로이드의 기본 빌드 방법에 대해 기술한다. 한번 이러한 빌드를 익힌 후면, 타겟 디바이스로의 수정도 가능하게 될거다.

Device Code

일반적인 빌드를 하기 위해서  build/envsetup.sh 의 소스엔 필요한 변수들을 담고 있다.

% cd TOP

% . build/envsetup.sh

# pick a configuration using choosecombo
% choosecombo

% make -j4 PRODUCT-generic-user

eng 로 바꿔 쓸 수도 있다.

% make -j4 PRODUCT-generic-eng

이렇게 빌드 변수를 바꿔가면서 여러가지 디버깅 옵션을 줄 수 있다.

Cleaning Up

Execute % m clean to clean up the binaries you just created. You can also execute % m clobber to get rid of the binaries of all combos. % m clobber is equivalent to removing the //out/ directory where all generated files are stored.

Speeding Up Rebuilds

각각의 combo 바이너리들은 분리된 sub-directories of //out/ 에 저장되어 있다.  이 바이너리들은 재 컴파일시에 빌드 타임을 단축시켜준다.

그러나, 환경 변수 등을 수정한 경우에는 완전 재빌드가 필요하다. 이러한 경우 USE-CCACHE 환경 변수를 다음과 같이 설정한다

% export USE_CCACHE=1

CCASH 는 //prebuilt/. 에 설치되어 있으므로 따로 설치할 필요가 없다. 

Troubleshooting

The following error is likely caused by running an outdated version of Java.

device Dex: core  UNEXPECTED TOP-LEVEL ERROR:
java.lang.NoSuchMethodError: method java.util.Arrays.hashCode with
signature ([Ljava.lang.Object;)I was not found.
  at com.google.util.FixedSizeList.hashCode(FixedSizeList.java:66)
  at com.google.rop.code.Rop.hashCode(Rop.java:245)
  at java.util.HashMap.hash(libgcj.so.7)
[...]

dx is a Java program that uses facilities first made available in Java version 1.5. Check your version of Java by executing % java -version in the shell you use to build. You should see something like:

java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-164)
Java HotSpot(TM) Client VM (build 1.5.0_07-87, mixed mode, sharing)

Java 1.5 이상 버전에서는  이러한 error가 발생한다. 이 때에는 환경 변수에 PATH가 제대로 등록되어있는지 확인한다.

Building the Android Kernel

이번 섹션은 안드로이드의 기본 커널이 어떻게 빌드되는지 기술한다. 한번 이러한 빌드에 익숙해지면, 타겟 디바이스로의 수정도 가능하게 될것이다.

커널 베이스를 빌드하기 위해서 디바이스 디렉토리(/home/joe/android/device)를 바꿔준다.

% . build/envsetup.sh
% partner_setup generic

이 떄, 커널 디렉토리를 /home/joe/android/kernel 로 바꿔준다

Checking Out a Branch

기본 브랜치는 항상 안드로이드가 된다. 다른 브랜치를 체크하고 싶으면, 다음과 같이 실행하라.

% git checkout --track -b android-mydevice origin/android-mydevice
  //Branch android-mydevice set up to track remote branch
% refs/remotes/origin/android-mydevice.
  //Switched to a new branch "android-mydevice"
To simplify code management, give your local branch the same name as the remote branch it is tracking (as illustrated in the snippet above). Switch between branches by executing % git checkout <branchname>.

Verifying Location

Find out which branches exist (both locally and remotely) and which one is active (marked with an asterisk) by executing the following:

% git branch -a
  android
* android-mydevice
  origin/HEAD
  origin/android
  origin/android-mydevice
  origin/android-mychipset
To only see local branches, omit the -a flag.

Building the Kernel

커널을 빌드하고 싶으면 다음과 같이 실행한다.

% make -j4

Build Variants

When building for a particular product, it's often useful to have minor variations on what is ultimately the final release build. These are the currently-defined build variants:

eng This is the default flavor. A plain make is the same as make eng.
Installs modules tagged with: eng, debug, user, and/or development.
Installs non-APK modules that have no tags specified.
Installs APKs according to the product definition files, in addition to tagged APKs.
ro.secure=0
ro.debuggable=1
ro.kernel.android.checkjni=1
adb is enabled by default.
user make user
This is the flavor intended to be the final release bits.

Installs modules tagged with user.
Installs non-APK modules that have no tags specified.
Installs APKs according to the product definition files; tags are ignored for APK modules.
ro.secure=1
ro.debuggable=0
adb is disabled by default.
userdebug make userdebug
The same as user, except:

Also installs modules tagged with debug.
ro.debuggable=1
adb is enabled by default.
If you build one flavor and then want to build another, you should run make installclean between the two makes to guarantee that you don't pick up files installed by the previous flavor. make clean will also suffice, but it takes a lot longer.

리눅스에서 originPro 와 같은 그래프 그려주는 프로그램...

qtiPlot 이란 프로그램이 있다.

오리진프로와 거의 유사한 환경으로 플롯을 그릴 수 있다.

강추....

마찬가지로 "프로그램->우분투 소프트웨어 센터" 

에서 qtiPlot 을 검색 후 설치.


리눅스에서 매트랩을 이용하기...(gnuOctave...)

뭐 진짜 매트랩은 비싸서 못쓸 것이고,

리눅스 상에선 gnuOctave 란 프로그램이 있는데

매트랩 보다야 못하겠지만 매트랩과 거의 유사한 수준으로 호환된다.

m 파일을 지원한다고 하면 말 다했지..

콘솔 기반의 프로그램을 qt를 이용하여 GUI 를 구현한

QtOctave 를 깔아서 사용한다면 매트랩과 유사한 환경에서 실행해볼 수 있다.

우분투에서

"프로그램 -> 우분투 소프트웨어 센터"

qtoctave 검색

설치.

하면 된다..

gsl 의 사용 (우분투)

먼저, 우분투 소프트웨어 센터에서
gsl binary package,
gsl development package,
gsl library package 
를 선택해서 깐다

(필요 없는 것도 있을 것이나 일단 3개를 선택해서 깔아봤다)

여기 까지 깔면 컴파일해서 inclue 문제는 해결된다.

다만 링크 문제가 남는데

gcc example.c -lgsl -lgslcblas -lm

처럼 링크를 해주면 에러 없이 컴파일 된다.

다음은 예제이다.

http://www.gnu.org/software/gsl/manual/html_node/Eigenvalue-and-Eigenvector-Examples.html

#include <stdio.h>
     #include <gsl/gsl_math.h>
     #include <gsl/gsl_eigen.h>
     
     int
     main (void)
     {
       double data[] = { 1.0  , 1/2.0, 1/3.0, 1/4.0,
                         1/2.0, 1/3.0, 1/4.0, 1/5.0,
                         1/3.0, 1/4.0, 1/5.0, 1/6.0,
                         1/4.0, 1/5.0, 1/6.0, 1/7.0 };
     
       gsl_matrix_view m 
         = gsl_matrix_view_array (data, 4, 4);
     
       gsl_vector *eval = gsl_vector_alloc (4);
       gsl_matrix *evec = gsl_matrix_alloc (4, 4);
     
       gsl_eigen_symmv_workspace * w = 
         gsl_eigen_symmv_alloc (4);
       
       gsl_eigen_symmv (&m.matrix, eval, evec, w);
     
       gsl_eigen_symmv_free (w);
     
       gsl_eigen_symmv_sort (eval, evec, 
                             GSL_EIGEN_SORT_ABS_ASC);
       
       {
         int i;
     
         for (i = 0; i < 4; i++)
           {
             double eval_i 
                = gsl_vector_get (eval, i);
             gsl_vector_view evec_i 
                = gsl_matrix_column (evec, i);
     
             printf ("eigenvalue = %g\n", eval_i);
             printf ("eigenvector = \n");
             gsl_vector_fprintf (stdout, 
                                 &evec_i.vector, "%g");
           }
       }
     
       gsl_vector_free (eval);
       gsl_matrix_free (evec);
     
       return 0;
     }
Here is the beginning of the output from the program,
     $ ./a.out
     eigenvalue = 9.67023e-05
     eigenvector =
     -0.0291933
     0.328712
     -0.791411
     0.514553
     ...

우분투와 함께 시작 #1

1. 시디 놓고 윈도우 처럼 설치. - 성공
-- 우분투 9.4 64bit version - okay

2. 문제 발생 ! - 한영 변환이 안됨 - 해결
- 시스템 -> 관리 -> 업데이트 관리자 -> 업데이트 (자동으로 된다)

- 터미널에서 명령 :
  $ sudo apt-get install nabi
  $ sudo im-switch -c
- 명령후 입력 후 뜨는 창에서 nabi 에 해당하는 번호 선택(4번이었음)

3. OS 시스템 언어 한글화 설치 - 해결
시스템 -> 관리 -> language -> 한글 선택

4. pdf 에서 한글이 보이지 않는 문제 - 해결
  sudo apt-get install poppler-data

5. 네트워크에서 윈도우에 설치된 프린터 가져오기 - 성공
시스템-> 관리 -> 인쇄
server -> new -> printer
네트워크 프린터 -> windows printer via SAMBA -> 찾아보기 단추
해당 워크그룹 발견 -> 해당 프린터 깔린 윈도우 발견 -> 프린터 발견
추가 -> 프린터 벤더 선택 -> 프린터 선택 -> 테스트 페이지 인쇄

6. 동영상 플레이어 설치
 sudo apt-get install mplayer mplayer-skin-blue
  vi ~/.mplayer/config 에서, 자막을 위해 다음 라인 추가
subcp=cp949
font=/usr/share/fonts/truetype/unfonts/UnDotum.ttf
unicode=1
subont-text-scale=3

7. 삼바를 설치해서 파일 공유
삼바 관련 패키지 설치
apt-get install samba smbfs

윈도우에서 우분투 공유 폴더로 접근
삼바 사용자 추가
sudo smbpasswd -a username
username은 시스템 사용자 이름으로 해야한다 그렇지 않으면 다음과 같은 오류가 난다
Failed to modify password entry for user username
비밀번호는 시스템 사용자 비밀번호와 다르게 설정 가능하다
폴더 생성
폴더에 커서를 두고 오른쪽 마우스 클릭
sharing options을 클릭
share this folder 체크
guest access에 체크하면 위에 설정한 사용자와 비번 체크 안하고 공유 폴더에 접근이 가능하다

8. root 설정
우분투에선 root 계정은 있으나 암호가 입력되어 있지 않다.
$ sudo passwd root




prev 1 next