Differences between revisions 3 and 4
Revision 3 as of 2007-02-13 16:33:17
Size: 983
Editor: gtang
Comment:
Revision 4 as of 2007-02-13 16:36:42
Size: 1304
Editor: gtang
Comment:
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
./configure -prefix /home/gtang/library/qt-x11-free-3.3.6 1. ./configure -prefix /home/gtang/library/qt-x11-free-3.3.6
Line 15: Line 15:
4. make install}}}
2. fftw-2.1.5 static library for x86_64
Line 16: Line 18:
4. make install}}} {{{
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}}}

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

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