manywaypark's Blog
개발, 검색, 함수

예전에 원작자인 ttyerl에게 패치를 보낸적이 있는데 적용되지 않았다. 그래서 그냥 포크했다.
또한 새로운 버그도 발견!!
davisp이 ttyerl의 원본을 좀 매끄럽게 돌게 고쳤는데 버그는 그대로였다.
그래서 davisp의 fork를 내가 fork해서 수정했다.

버그들:
  1. table_info 버그
  2. query timeout 버그

작업 내역:
  1. 상기 버그 퇴치
  2. eunit test case 추가


URL: http://github.com/mwpark/sqlite-erlang/tree/master

happy hackin'
GUI 버전을 많이 써서 그런지 매번 까먹는다. 잊지말자!!

M-` or F10


happy hackin'

erlyweb 빌드 하기

함수형 언어/Erlang 2009. 6. 1. 18:43 by manywaypark
erlyweb의 빌드 스크립트(make.sh)는 기본적으로 erlang의 lib 폴더(보통 /usr/local/lib/erlang/lib, code:lib_dir()로 찍어보면 나온다)에 yaws가 깔린 것으로 가정하고 만들어져있다.
즉, 다음과 같다.
#!/bin/bash

ERLIB=$(erl -noshell -eval 'io:format(code:lib_dir()).' -s erlang halt)
YAWS=$(ls $ERLIB | grep yaws)

cat >Emakefile <<EOF
{"src/erlyweb/*", [debug_info, {outdir, "ebin"},
{i,"$ERLIB/$YAWS/include"}]}.
{"src/erlydb/*", [debug_info, {outdir, "ebin"}]}.
{"src/erlsql/*", [debug_info, {outdir, "ebin"}]}.
{"src/erltl/*", [debug_info, {outdir, "ebin"}]}.
{"src/smerl/*", [debug_info, {outdir, "ebin"}]}.
{"src/erlang-mysql-driver/*", [debug_info, {outdir, "ebin"}]}.
{"src/erlang-psql-driver/*", [debug_info, strict_record_tests, {outdir,
"ebin"}]}.
EOF

ebin_dir="./ebin"
# bash check if directory exists
if [ ! -d $ebin_dir ]; then
    mkdir $ebin_dir
fi

erl -noshell -eval 'make:all(), filelib:fold_files("src/", ".+\.et$", true, fun(F, _Acc) -> erltl:compile(F, [{outdir, "ebin"}, debug_info, show_errors, show_warnings]) end, []).' -pa ebin -s erlang halt
일견 복잡해보이지만, 실제로 하는 일은 erlang의 기본 lib 폴더에서 yaws 폴더를 찾은 후에 Emakefile을 만들고 erlang 방식의 make를 돌리는 것이다.
문제는 나는 yaws를 직접 빌드해서 설치해서 다른 디렉토리(/usr/local/lib)에 있다는 것이다.
그냥 간단하게 make.sh를 다음과 같이 고쳐서 make 하면 잘된다. 나는 yaws의 기본 설정(즉, prefix 따위 설정 안한)으로 빌드했다. prefix 설정으로 설치 경로 바꾼 경우는 적절히 바꾸면 될 것이다.^^
#!/bin/bash

#ERLIB=$(erl -noshell -eval 'io:format(code:lib_dir()).' -s erlang halt)
#YAWS=$(ls $ERLIB | grep yaws)

cat >Emakefile <<EOF
{"src/erlyweb/*", [debug_info, {outdir, "ebin"},
{i,"/usr/local/lib/yaws/include"}]}.
{"src/erlydb/*", [debug_info, {outdir, "ebin"}]}.
{"src/erlsql/*", [debug_info, {outdir, "ebin"}]}.
{"src/erltl/*", [debug_info, {outdir, "ebin"}]}.
{"src/smerl/*", [debug_info, {outdir, "ebin"}]}.
{"src/erlang-mysql-driver/*", [debug_info, {outdir, "ebin"}]}.
{"src/erlang-psql-driver/*", [debug_info, strict_record_tests, {outdir,
"ebin"}]}.
EOF

ebin_dir="./ebin"
# bash check if directory exists
if [ ! -d $ebin_dir ]; then
    mkdir $ebin_dir
fi

erl -noshell -eval 'make:all(), filelib:fold_files("src/", ".+\.et$", true, fun(F, _Acc) -> erltl:compile(F, [{outdir, "ebin"}, debug_info, show_errors, show_warnings]) end, []).' -pa ebin -s erlang halt

happy hackin'
문제:
lyx에서 문서를 랜더링할때 다음과 같은 에러를 내면서 안되는 경우가 있다.
Warning: Document class not available
----------------------------------------
The layout file requested by this document,
IEEEtran.layout,
is not usable. This is probably because a LaTeX
class or style file required by it is not
available. See the Customization documentation
for more information.
LyX will not be able to produce output.
Error: Couldn't export file
----------------------------------------

해결: package 하나만 설치하면 된다.
sudo apt-get install texlive-publishers
lyx에서 tools > reconfigure 하는 것도 잊지 말자.
예전에 한번 문제가 되어서 해결했던 것인데, 다시 다른 박스의 ubuntu에서 예전에 작성했던 문서 소스를 rendering하려니 make 에러가 났다. 1시간 가량 삽질. Orz

happy hackin'
고양이가 쥐를 잡는 것을 본 적이 있는가?
여느 맹수처럼 한번에 죽이지 않는다.

지쳐 기진맥진할 때까지 가지고 놀다가 죽인 후 칭찬해달라는 듯 주인앞에다 물어다 놓는다.

고양이와 고양이 주인은 애도하지 마라.
왜? 더 못가지고 놀아서 안타까운가?

화가 치민다. 울화가 치민다.
djbdns를 설치하려했는데, 의존성이 걸린 daemontools-run이 제대로 설치 되지 않는 문제가 발생했다.
환경: ubuntu intrepid

에러 메시지:

[...]
Adding SV inittab entry...
cp: cannot stat `/etc/inittab': No such file or directory

dpkg: error processing daemontools-run (--install):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 daemontools-run

해결:

다음을 /etc/apt/sources.list에 추가해서 patch된 버전을 인스톨(apt-get update후 apt-get install)한다.
deb http://ppa.launchpad.net/amoog/amoog-devel/ubuntu jaunty main
deb-src http://ppa.launchpad.net/amoog/amoog-devel/ubuntu jaunty main

인증 관련해서 apt-get update가 실패하면
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com E6090F843576F6EDB9FB63DE24BDD6095AFE82CE

참고:

happy hackin'

[TIP] Java on Mac OS X 그리고 Maven

java 2009. 4. 30. 00:43 by manywaypark
hudson을 build하다가 생긴 문제의 해결방법이다(좀 특이하다는 말). 이전 포스트와도 좀 연관이 있다.
내 경우(유니바디 알미늄 맥북, java가 깔려서 출고된다)에는 터미널에서 java -version을 하면 1.5대의 버전이 찍혔다. 기본 설정인 듯했다.
결론부터 말하자면 Mac OS X에서는 "Applications/Utilities/Java/Java Preferences"에서 java 환경을 설정할 수 있다.
1.6(메뉴상에는 Java SE 6으로 표시된다)으로 설정하고 명령행에서 확인하면 다음과같이 나온다.
$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)

그럼에도 불구하고, hudson을 build하기위해 터미널에서 mvn install을 실행하면 이전 포스트의 에러가 반복되었다.
Detected JDK Version: 1.5.0-16 is not in the allowed range [1.6.0,].
해결책은 JAVA_HOME을 설정하면 된다.
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
아득한 기억을 더듬어보면, windows와 linux에서는 JAVA_HOME이 설정 안되어있으면 에러가 나면서 build 자체를 시도하지도 않았던거같은데...  맥에서는 왜 이런거지? Orz.

참고:

happy hackin'
eclipse의 maven plugin인 m2eclipse를 이용해서 빌드를 할때 다음과 같은 메시지가 나오면서 빌드가 멈출 때가 있다.
Detected JDK Version: 1.5.0-16 is not in the allowed range [1.6.0,].
기본적으로 컴파일에 필요한 자바 버전이 안맞아서 나오는 메시지인데, 실제로 명령행에서 빌드할 때는 JAVA_HOME이 정확한 버전(이 경우 1.6이상 버전의 JDK)을 가리키고 있다면 mvn으로 잘 빌드되는 환경에서도 eclipse 내에서 m2eclipse를 사용하면 이 에러가 나는 좀 복잡한 상황이다.
일단 pom.xml에서 오른쪽 클릭으로 문맥 메뉴 선택후 "Run As > Maven Build..."를 해서 빌드를 하면 된다는 workaround는 찾았는데 조금 찜찜하다.

참고:

참고2:
eclipse는 JAVA_HOME 환경변수와는 무관하게 독자노선(?)을 걷는다. eclipse.ini에서 설정가능하다. README 참조.
또한 eclipse를 실행시키는 java(eclipse.ini에서 설정)와 eclipse가 build에 쓰는 java(Preferences에서 설정)는 다를 수 있다.

happy hackin'

Project Properties -> Project Facets panel에서 설정


happy hackin'
증상:
mvn install 등의 명령으로 좀 큰 프로젝트(예를 들자면 hudson 등)를 빌드하다 보면, 다음과 같은 에러 메시지와 함께 빌드가 되지 않는 경우가 있다.
The system is out of resources. Consult the following stack trace for details. java.lang.OutOfMemoryError: Java heap space
해결책:
MAVEN_OPTS 환경 변수를 "-Xmx1024m" 정도로 설정한다.
export MAVEN_OPTS=-Xmx1024m

happy hackin'
1 ··· 19 20 21 22 23 24 25 ··· 31 
분류 전체보기 (306)
잡담 (20)
함수형 언어 (65)
emacs (16)
java (18)
tips & tricks (154)
사랑 (1)
가사 (0)
독서 (4)
mobile (6)
비함수형 언어 (2)

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

04-29 07:42