Linux2010. 3. 2. 18:29
alias make='make -j'
를 해놨는데

gmake는 symbolic link로 make로 되어있다.

하지만 alias 특성상, 명령줄 치환을 하기 때문에
입력 당시 gmake가 비록 링크 추적으로 인해서 make가 실행되겠지만,
그렇다고 해서 make가 make -j로 치환되지는 않는다.

2010/03/02 - [프로그램 사용/gcc] - make, gmake
2010/02/26 - [Linux] - make를 더욱 빠르게 하기!


Posted by 구차니
make와 gmake는 유사하나
Fedora Core 6 에서는 실질적으로 symbolic link로 연결이 되어있다.

# ll /usr/bin/*make
lrwxrwxrwx 1 root root      4 Feb 16 13:23 /usr/bin/gmake -> make
-rwxr-xr-x 1 root root 162204 Jul 13  2006 /usr/bin/make

[링크 : http://linux.die.net/man/1/gmake]
[링크 : http://linux.die.net/man/1/make]

shenzhen{bzhu}$ gmake -version
GNU Make version 3.71, by Richard Stallman and Roland McGrath.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

shenzhen{bzhu}$ make -version
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

[링크 : http://www.unix.com/high-level-programming/29191-what-distinguish-between-gmake-make.html]

아무튼, 다르지만 실질적으로 같은 녀석이다.
Posted by 구차니
프로그램 사용/gcc2010. 3. 2. 17:34
gcc 옵션중에 헷갈리는게 있다.
-L과 -l이 그녀석인데, 비슷비슷해서 조금 헷갈린다.

아무튼 -L은 디렉토리(경로)를
-l은 특정 라이브러리 파일을 설정하는데 사용된다.

       -l library
           Search the library named library when linking.  (The second alternative with the library as a separate argu-
           ment is only for POSIX compliance and is not recommended.)

           It makes a difference where in the command you write this option; the linker searches and processes libraries
           and object files in the order they are specified.  Thus, foo.o -lz bar.o searches library z after file foo.o
           but before bar.o.  If bar.o refers to functions in z, those functions may not be loaded.

           The linker searches a standard list of directories for the library, which is actually a file named libli-
           brary.a.  The linker then uses this file as if it had been specified precisely by name.

           The directories searched include several standard system directories plus any that you specify with -L.

           Normally the files found this way are library files---archive files whose members are object files.  The
           linker handles an archive file by scanning through it for members which define symbols that have so far been
           referenced but not defined.  But if the file that is found is an ordinary object file, it is linked in the
           usual fashion.  The only difference between using an -l option and specifying a file name is that -l sur-
           rounds library with lib and .a and searches several directories.

       -Ldir
           Add directory dir to the list of directories to be searched for -l.

       LIBRARY_PATH
           The value of LIBRARY_PATH is a colon-separated list of directories, much like PATH.  When configured as a
           native compiler, GCC tries the directories thus specified when searching for special linker files, if it
           can’t find them using GCC_EXEC_PREFIX.  Linking using GCC also uses these directories when searching for
           ordinary libraries for the -l option (but directories specified with -L come first).

[링크 : http://linux.die.net/man/1/gcc]
Posted by 구차니
C 에서 python을 불러서 사용하는 방법인데, 아직 복잡한 예제는 발견하지 못했다.

테스트한 플랫폼은
Fedora Core 6
Python 2.4.3 이다.

# cat py.c
#include <Python.h>

int main()
{
        Py_Initialize();
        PyRun_SimpleString("print 'Hello Python C/API'");
        Py_Finalize();
        return 0;
}

[링크 : http://koichitamura.blogspot.com/2008/06/this-is-small-python-capi-tutorial.html]

# gcc py.c -I/usr/include/python2.4 -lpython2.4
# a.out
Hello Python C/API


이렇게 메시지가 출력된다.

아마 2.4와 2.6이 혼합되어 설치되어있고, 2.6이 정상설치가 되지 않은듯 싶다.
옵션에 따라서 이러한 오류가 발생했다.


웃긴건, 헤더는 2.6으로 링킹은 2.4로 해도 이상이 없다는 점이다.
(뭥미?)
Posted by 구차니
컴파일 환경 자동화툴인
autoconf, automake, libtool을 설명한다.

컴파일시 각종 헤더들의 위치, 라이브러리들의위치
그리고 설치할 위치들을 설정하고,
컴파일할 프로그램의 세부 패키지를 설정한다.

아래는 ffmpeg의 configure --help 내용중 일부이다.
Standard options:
  --prefix=PREFIX         install in PREFIX          []

  --bindir=DIR            install binaries in DIR    [PREFIX/bin]
  --datadir=DIR           install data files in DIR  [PREFIX/share/ffmpeg]
  --libdir=DIR            install libs in DIR        [PREFIX/lib]
  --shlibdir=DIR          install shared libs in DIR [PREFIX/lib]
  --incdir=DIR            install includes in DIR    [PREFIX/include]
  --mandir=DIR            install man page in DIR    [PREFIX/share/man]

Advanced options (experts only):
  --enable-cross-compile   assume a cross-compiler is used
  --arch=ARCH              select architecture []
  --target-os=OS           compiler targets OS []
  --cross-prefix=PREFIX    use PREFIX for compilation tools []
  --source-path=PATH       path to source code [/home/morpheuz/st7109/target_ori/root/ffmpeg]
  --sysroot=PATH           root of cross-build tree
  --sysinclude=PATH        location of cross-build system headers
  --target-exec=CMD        command to run executables on target
  --target-path=DIR        path to view of build directory on target
  --nm=NM                  use nm tool
  --as=AS                  use assembler AS []
  --cc=CC                  use C compiler CC [gcc]
  --ld=LD                  use linker LD
  --host-cc=HOSTCC         use host C compiler HOSTCC
  --host-cflags=HCFLAGS    use HCFLAGS when compiling for host
  --host-ldflags=HLDFLAGS  use HLDFLAGS when linking for host
  --host-libs=HLIBS        use libs HLIBS when linking for host
  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS []
  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS []
  --extra-libs=ELIBS       add ELIBS []
  --extra-version=STRING   version string suffix []
  --build-suffix=SUFFIX    library name suffix []
  --cpu=CPU                select the minimum required CPU (affects
                           instruction selection, may crash on older CPUs)
  --disable-yasm           disable use of yasm assembler
  --enable-pic             build position-independent code

이녀석의 경우 arch 와 target-os를 조합해서 cross compiler prefix를 만들어 낸다.
예를들어 sh4-linux의 경우
--enable-cross-compile --arch=sh4 --target-os=linux 라고 하면
자동으로 sh4-linux- 접두를 붙이게 된다.

하지만, target 에만 존재하는 library를 끌어 오려면 어떤 옵션을 써야 하나.. 후우..

[링크 : http://wariua.springnote.com/pages/1041972] << 한글 번역
[링크 : http://sources.redhat.com/autobook/]
Posted by 구차니
원래 목적은, 임의의 인터럽트를 소프트웨어적으로 발생시키는 건데
딱히 그에 맞는 문서를 발견하지 못했다.

그와 유사한 것은
외부 인터럽트의 경우 입력으로 설정되어 있더라도, 핀값을 설정해서 임의로 인터럽트를 발동시킬수 있다고 한다.

[링크 : http://gnc.chungbuk.ac.kr/?module=file&act=procFileDownload&file_srl=38154&sid=bdc58bb2e09e0bbfb91e3d176e68a1cf]
Posted by 구차니
x86 계열에서 메모리 팍팍 쓰면서 속도를 향상시켜준다는,
마법의(!?) JIT(Just In Time) compiler 이다.
결론은.. x86이 아니면 안되는군 ㅠ.ㅠ

 What you can do with it
     

In short: run your existing Python software much faster, with no change in your source.

Think of Psyco as a kind of just-in-time (JIT) compiler, a little bit like what exists for other languages, that emit machine code on the fly instead of interpreting your Python program step by step. The difference with the traditional approach to JIT compilers is that Psyco writes several version of the same blocks (a block is a bit of a function), which are optimized by being specialized to some kinds of variables (a "kind" can mean a type, but it is more general). The result is that your unmodified Python programs run faster.

Benefits

    2x to 100x speed-ups, typically 4x, with an unmodified Python interpreter and unmodified source code, just a dynamically loadable C extension module.

Drawbacks

    Psyco currently uses a lot of memory. It only runs on Intel 386-compatible processors (under any OS) right now. There are some subtle semantic differences (i.e. bugs) with the way Python works; they should not be apparent in most programs.

[링크 : http://psyco.sourceforge.net/]

[링크 : http://www.ibm.com/developerworks/kr/library/l-psyco.html]
Posted by 구차니
파이어폭스에서 URL에 한글이 들어간걸 복사하면은
%22 이런식으로 이상한(!) 문자가 복사된다.

이런 표기를
URL encoding + UTF-8 이라고 하는거 같은데
아무튼, 유튜브에서 내부적으로 인코딩된 녀석을 풀어주기에는
적절한 서비스인것으로 보인다.


[링크 : http://mimul.com/pebble/default/2009/08/21/1250862600000.html]
[링크 : http://www.mimul.com/examples/dencoder/] << 웹에서 인코딩/디코딩


[링크 : http://bdyne.net/?document_srl=11733] << 동시에 여러가지 보여줌

[링크 : http://kldp.org/node/76274]
Posted by 구차니
3월 1일은 독립만세를 부르짖던 삼일절인데
비가와서 국기게양도 못했다.
혹시.. 정부에서 국기게양 못하도록 기우제 지낸건 아니겠지?


아무튼 비가온 덕분에 맑은 공기와 적절한 구름이 끼어주었다.


고개를 반시계 방향으로 돌리고 보면, 아시아, 아프리카 대륙으로 보이는거 같기도 하고..


적절한 구름따윈 원형 달 무지개로 커버!


흔들려서 나올만한 궤적이 아닌디.. 도대체 어떻게 나온겨 ㄱ-

'개소리 왈왈 > 사진과 수다' 카테고리의 다른 글

단풍이다!  (2) 2010.05.01
달댕이  (2) 2010.04.30
붉은달  (4) 2010.01.31
개기일식! -> 부분일식  (4) 2010.01.15
길고양이 두마리  (4) 2010.01.03
Posted by 구차니


막판이라 신나서 하늘뚫고 날아가는
우리의 보스 아저씨

'게임 > 마비노기 영웅전' 카테고리의 다른 글

마비노기 에서 때려죽이고 싶은 NPC!  (6) 2010.03.07
미안해! 이비  (2) 2010.03.07
치프틴 빡시다 ㅠ.ㅠ  (8) 2010.02.13
마영전 리시타 기술 + 이름  (0) 2010.02.08
착한 마비노기 영웅전!  (0) 2010.02.04
Posted by 구차니