Y.B.'s profilewavewaving's 爬痕PhotosBlogLists Tools Help

Blog


    9/5/2009

    Tips for CAMFR installation with Python2.6

    to 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
     
    $ grep 'model name' /proc/cpuinfo
    model name : Intel(R) Core(TM)2 Quad CPU    Q9400  @ 2.66GHz
    $ 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".

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://wavewaving.spaces.live.com/blog/cns!DF35415F8ED2448D!944.trak
    Weblogs that reference this entry
    • None