Differences between revisions 8 and 14 (spanning 6 versions)
Revision 8 as of 2007-02-13 16:41:40
Size: 1530
Editor: gtang
Comment:
Revision 14 as of 2007-02-13 16:57:07
Size: 3866
Editor: gtang
Comment:
Deletions are marked like this. Additions are marked like this.
Line 24: Line 24:
3. make install
}}}
3. make install}}}
Line 31: Line 30:
 2. make CFLAGS="-O3 -fPIC"
 3. make check > log 2>&1
 4. make install }}}
2. make CFLAGS="-O3 -fPIC"
3. make check > log 2>&1
4. make install }}}
4. hdf5-1.6.4 static library for x86_64

{{{
1. ./configure --prefix=/home/gtang/library/hdf5-1.6.3 --enable-shared=no
        --enable-static=yes
2. make CFLAGS='-fPIC'
3. make check
4. make install}}}
5. boost-1.33.1 static boost.python library for x86_64

{{{
I can not figure out a way to compile boost.python with
option '-fPIC', in Jamfile, so use CMake to create a Makefile.
write a CMakeLists.txt file in /libs/python/src/ as follow:

PROJECT(BOOSTPYTHON)

INCLUDE(${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)

FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(.)

SET (OPT_FLAGS "-march=k8 -O1 -fPIC")

SET(LIB_BOOSTPYTHON_SOURCE
        numeric.cpp
        list.cpp
        long.cpp
        dict.cpp
        tuple.cpp
        str.cpp
        slice.cpp
        aix_init_module.cpp
        converter/from_python.cpp
        converter/registry.cpp
        converter/type_id.cpp
        object/enum.cpp
        object/class.cpp
        object/function.cpp
        object/inheritance.cpp
        object/life_support.cpp
        object/pickle_support.cpp
        errors.cpp
        module.cpp
        converter/builtin_converters.cpp
        converter/arg_to_python_base.cpp
        object/iterator.cpp
        object_protocol.cpp
        object_operators.cpp
        wrapper.cpp )

ADD_LIBRARY(boost_python STATIC ${LIB_BOOSTPYTHON_SOURCE})

Note:
1. copy boost header directory "boost" into /libs/python/src directory.
2. on FC5 64 bit, above is enough to create 64 bit static boost library with
-fPIC enabled. But on 64 bit FC3, I have to modify
CMakeFiles/boost_python.dir/flags.make add "-fPIC" into CXX_FLAGS.}}}
6. tiff-3.7.2 static libtiff library for x86_64:

{{{
1. ./configure --prefix=/home/gtang/library/tiff-3.8.2
        --enable-shared=no --enable-static=yes
2. make CFLAGS = '-O2 -fPIC'
3. make install}}}
7. Python 2.4.3 static library for x86_64:

{{{
1. ./configure --prefix=/home/gtang/library/Python-2.4.3
change Makefile line:
OPT= -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
to line:
OPT= -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
2. make
3. make test
4. make install}}}
8.

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 

4. hdf5-1.6.4 static library for x86_64

1. ./configure --prefix=/home/gtang/library/hdf5-1.6.3 --enable-shared=no
        --enable-static=yes
2. make CFLAGS='-fPIC'
3. make check
4. make install

5. boost-1.33.1 static boost.python library for x86_64

I can not figure out a way to compile boost.python with
option '-fPIC', in Jamfile, so use CMake to create a Makefile.
write a CMakeLists.txt file in /libs/python/src/ as follow:

PROJECT(BOOSTPYTHON)

INCLUDE(${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)

FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(.)

SET (OPT_FLAGS "-march=k8 -O1 -fPIC")

SET(LIB_BOOSTPYTHON_SOURCE
        numeric.cpp
        list.cpp
        long.cpp
        dict.cpp
        tuple.cpp
        str.cpp
        slice.cpp
        aix_init_module.cpp
        converter/from_python.cpp
        converter/registry.cpp
        converter/type_id.cpp
        object/enum.cpp
        object/class.cpp
        object/function.cpp
        object/inheritance.cpp
        object/life_support.cpp
        object/pickle_support.cpp
        errors.cpp
        module.cpp
        converter/builtin_converters.cpp
        converter/arg_to_python_base.cpp
        object/iterator.cpp
        object_protocol.cpp
        object_operators.cpp
        wrapper.cpp       )

ADD_LIBRARY(boost_python STATIC ${LIB_BOOSTPYTHON_SOURCE})

Note:
1. copy boost header directory "boost" into /libs/python/src directory.
2. on FC5 64 bit, above is enough to create 64 bit static boost library with
-fPIC enabled. But on 64 bit FC3, I have to modify
CMakeFiles/boost_python.dir/flags.make add "-fPIC" into CXX_FLAGS.

6. tiff-3.7.2 static libtiff library for x86_64:

1. ./configure --prefix=/home/gtang/library/tiff-3.8.2
        --enable-shared=no --enable-static=yes
2. make CFLAGS = '-O2 -fPIC'
3. make install

7. Python 2.4.3 static library for x86_64:

1. ./configure --prefix=/home/gtang/library/Python-2.4.3
change Makefile line:
OPT= -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
to line:
OPT= -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
2. make
3. make test
4. make install

8.

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