| Y.B.'s profilewavewaving's 爬痕PhotosBlogLists | Help |
|
9/5/2009 Tips for CAMFR installation with Python2.6to memorize the past day.
System info:
Ubuntu 9.10 alpha4
$ cat /proc/version
Linux version 2.6.31-5-generic (buildd@crested) (gcc version 4.4.1 (Ubuntu 4.4.1-1ubuntu1) ) #24-Ubuntu SMP Sat Aug 1 12:47:58 UTC 2009 $ python --version
Python 2.6.2+ CAMFR release version: camfr20070717
1, Insert one decaration line to CAMFR_20070717/camfr/defs.h due to some problem related to new GCC compiler.
#include <cstdlib>
or it will lead to some errors like:
...
camfr/primitives/section/../../util/vectorutil.h:66: error: call of overloaded abs(long int) is ambiguous
/usr/include/c++/4.4/cmath:102: note: candidates are: long double std::abs(long double) /usr/include/c++/4.4/cmath:98: note: float std::abs(float) ...
The declaration for std::abd(long int) is in 'cstdlib'
2, Using apt-get to install the softwares indicated in the guidance from INSTALL.
3, using the following file "machine_cfg.py" for setup. Chang it to fit your system.
#-----------------------------------------------
# This Python script contains all the machine dependent settings
# needed during the build process. # Compilers to be used.
cc = "gcc"
cxx = "g++" f77 = "gfortran -fPIC" # using gfortran compiler link = cxx
link_flags = "" # Compiler flags.
# # Note: for the Fortran name definition you can define one of the following # preprocessor macros: # # FORTRAN_SYMBOLS_WITHOUT_TRAILING_UNDERSCORES # FORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE # FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES # For 32bit cpu, may use FORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE
base_flags = "-DFORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES -DNDEBUG "
flags_noopt = base_flags
# -march=core2 is for current cpu, set others if different
flags = base_flags + "-O3 -march=core2 -g -funroll-loops "
fflags = flags + "-fPIC "
# Include directories. # special setting for python2.6
include_dirs = ["/usr/include/python2.6", "/usr/lib/python2.6/dist-packages"]
# Library directories. # I use intel mkl mathmatical library. Leave it blank if not.
library_dirs = ["/opt/intel/mkl/10.2.1.017/lib/em64t"]
# library_dirs = []
# Library names. # use the library related to your system
libs = ["boost_python-mt", "blitz", "mkl_lapack", "mkl_core", "gfortran"]
# Command to strip library of excess symbols:
dllsuffix = ".so"
strip_command = "strip --strip-unneeded camfr/_camfr" + dllsuffix strip_command = "" # Extra files to copy into installation directory.
extra_files = [("doc", ["docs/camfr.pdf"])]
#------------------------------------------
For python 2.6, it seems that "site-packages" is replaced by "dist-packages". TrackbacksThe trackback URL for this entry is: http://wavewaving.spaces.live.com/blog/cns!DF35415F8ED2448D!944.trak Weblogs that reference this entry
|
|
|