Differences between revisions 6 and 7
Revision 6 as of 2007-02-13 16:38:23
Size: 1344
Editor: gtang
Comment:
Revision 7 as of 2007-02-13 16:41:23
Size: 1533
Editor: gtang
Comment:
Deletions are marked like this. Additions are marked like this.
Line 27: Line 27:

{{{
1. ./configure --prefix=/home/gtang/library/gsl-1.6 --enable-shared=no
        --enable-static=yes
  2. make CFLAGS="-O3 -fPIC"
  3. make check > log 2>&1
  4. make install }}}

The idea to semi-static build EMAN is to link EMAN’s dependency libraries statically into EMAN’s shared libraries: libEM.so, libpyEM.so, libqEM.so, libqsci.so. By this way, the compiled EMAN can be run on another system even though it does not have those dependent libraries. You can specify each dependent library in ccmake to link to static library, for example libgsl.a instead of libgsl.so. And make sure there is no shared library in the same directory, otherwise, linker will prefer the shared library.

For 64 bit linux system, those static depency libraries must be compiled with a -fPIC flag.

For example, this is what I did to get static library compiled with '-fPIC' flag:

1. qt-3.3.6 static library for x86_64

1. ./configure -prefix /home/gtang/library/qt-x11-free-3.3.6
        -qt-gif -thread -qt-imgfmt-jpeg -platform linux-g++-64 -static
2. go to src subdirectory, edit Makefile add -fPIC into CFLAGS, and
CXXFLAGS
3. make
4. make install

2. fftw-2.1.5 static library for x86_64

1. ./configure --prefix /home/gtang/library/fftw-2.1.5 --enable-static
        --enable-shared=no --enable-float --enable-type-prefix
2. make CFLAGS='-O3 -fomit-frame-pointer -fno-schedule-insns
        -fschedule-insns2 -fstrict-aliasing -fPIC'

3. make install

3. GSL 1.6 static library for x86_64

1. ./configure --prefix=/home/gtang/library/gsl-1.6 --enable-shared=no
        --enable-static=yes
  2. make CFLAGS="-O3 -fPIC"
  3. make check > log 2>&1
  4. make install 

EMAN_COMPILE_STATIC (last edited 2008-11-26 04:42:28 by localhost)