Science Blog of Dr. Yuan分享 http://blog.sciencenet.cn/u/albumns This blog is mainly on Molecular molecular modelling and simulations

博文

compile Desmond from source code

已有 5368 次阅读 2012-4-15 22:02 |个人分类:科研笔记|系统分类:科研笔记| Compile, Desmond

As a highly optimized parallel MD tool, compiled Desmond is around 20-30% faster than the pre-compiled version which is distrubuted in Schrodinger software. here are some steps for how to compile Desmond from source code.

1. download source code from
http://www.deshawresearch.com/resources_desmond.html

2. install boost
although each Linux OS may already have boost, but Desmond required boost version> =4.15.0, it is better to compile it manually. The source code can be download from
http://sourceforge.net/projects/boost/files/boost/
 > tar xvf boost_1_45_0.tar.bz2
> ./bootstrap.sh
add the following line at the end of tools/build/v2/user-config.jam
using mpi;
> ./bjam install --prefix=/soft/boost1.45

3. install openmpi
it is highly recommend for openmpi1.4.3
> ./configure --prefix=/soft/openmpi
> make
> make install

4. configure installation file file for Desmond
>cp share/user-conf.sample.py user-conf.py
edit it as following:

--------user-conf.py--------
# Copyright D. E. Shaw Research, 2011.
'''
This configuration works in DESRES.  At a minimum, to get a single node version
of Desmond you will have to give the location of the Boost include and library
files.  To build a multi-node MPI version, you will have to give the same
path information for MPI.  Similarly for Python.

Build Desmond with scons --user-config=share/user-conf.sample.py

'''

import sys
import os

if EXTRA_C_FLAGS == None: EXTRA_C_FLAGS = ''
if EXTRA_CC_FLAGS == None: EXTRA_CC_FLAGS = ''
if EXTRA_LINK_FLAGS == None: EXTRA_LINK_FLAGS = ''
if EXTRA_LIBS == None: EXTRA_LIBS = ''
if EXTRA_INCLUDE_PATH == None: EXTRA_INCLUDE_PATH = ''
if EXTRA_LIBRARY_PATH == None: EXTRA_LIBRARY_PATH = ''
USE_BFD=False

if sys.platform == 'win32' :
    THREADS = 'BOOST'

    # When building for Windows, you will need to set the
    # DESRES_TARGET_ARCH variable as one of 'x86_64' or 'x86'.
    if os.getenv('DESRES_TARGET_ARCH') == 'x86_64' :
        larch = 'x64'
    elif os.getenv('DESRES_TARGET_ARCH') == 'x86' :
        larch = 'x86'
    else:
        print >>sys.stderr, "DESRES_TARGET_ARCH fail"
        sys.exit(1)

    # Boost
    EXTRA_INCLUDE_PATH = "C:/local/rendlemc/Libs/boost/boost_1_46_1"
    EXTRA_LIBRARY_PATH = "C:/local/rendlemc/Libs/boost/boost_1_46_1/lib/%s" % larch

    # Python
    # Python is not supported under Windows

else:
    THREADS = 'POSIX'
    if USE_BFD:
        EXTRA_INCLUDE_PATH += ' /usr/include'
        EXTRA_LIBRARY_PATH += ' /usr/lib64'

        EXTRA_LINK_FLAGS += ' -L/usr/lib64'
        EXTRA_LINK_FLAGS += ' -Wl,-rpath=/usr/lib64'

    # Boost;
    boost_prefix =  '/usr/local/include/boost'
    EXTRA_INCLUDE_PATH += ' %s/include' % boost_prefix
    EXTRA_LIBRARY_PATH += ' %s/lib' % boost_prefix
    EXTRA_LINK_FLAGS += ' -Wl,-rpath,%s/lib' % boost_prefix

    # MPI
    WITH_MPI = 1
    mpi_prefix = '/soft/openmpi1.4.3'
    MPI_CPPFLAGS = "-I%s/include -pthread -DOMPI_SKIP_MPICXX" % mpi_prefix
    MPI_LDFLAGS = "-L%s/lib -Wl,-rpath,%s/lib" % (mpi_prefix,mpi_prefix)

    # Python
    # DESRES installs Python and numpy in separate path locations; your installation
    # will likely install numpy somewhere in the Python path hierarchy
    python_prefix = '/usr/lib64/python2.7'
    numpy_prefix = "/usr/lib64/python2.7/site-packages"

    EXTRA_INCLUDE_PATH += ' %s/include/python2.7' % python_prefix
    EXTRA_LIBRARY_PATH += ' %s/lib' % python_prefix
    EXTRA_LINK_FLAGS   += ' -Wl,-rpath,%s/lib' % python_prefix

    EXTRA_INCLUDE_PATH += ' %s/numpy/core/include' % numpy_prefix
    EXTRA_LIBRARY_PATH += ' %s/numpy/core' % numpy_prefix
    EXTRA_LINK_FLAGS   += ' -Wl,-rpath,%s/numpy/core' % numpy_prefix
    EXTRA_LIBS += ' -lboost_python -lpython2.7'
-----------------------end-------------------------------------------------------


finally it can be compiled and installed with command:

>scons --user-conf=user-conf.py install PREFIX=/soft/desmond3.03

test for short MD:
>cd /soft/desmond3.0.3
>./bin/desmond  --include ./share/samples/dhfr.cfg                      
 --cfg boot.file=./share/samples/dhfr.dms            
--cfg mdsim.plugin.eneseq.name=dhfr.eneseq

test for restore checkpoint
./bin/desmond --restore checkpt

test for parallel
> orterun -np 2
> /soft/desmond3.03/bin/desmond
> --include ./share/samples/dhfr.cfg
> --cfg boot.file=./share/samples/dhfr.dms
> cfg mdsim.plugin.eneseq.name=dhfr.eneseq
> --destrier mpi

if everything goes well, you should see the following when the test finished at each step
(normal terminate)



https://blog.sciencenet.cn/blog-355217-559655.html

上一篇:20 years of SUSE Linux
下一篇:compile gromacs GPU version from source code
收藏 IP: 31.178.125.*| 热度|

1 黄富强

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

全部作者的精选博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-3 11:38

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部