tppmktop单机版编译
从李继存和sob老师的博客得知,TPPMKTOP
是构建小分子OPLS-AA
力场文件的一款不错的工具,但是其在线服务器并不太好用。同时在bitbucket上也有此工具的源码,于是便下载并在本地安装,现将编译过程遇到的问题记录如下:
1. 编译需要提前安装libmysql++-dev
和
boost, libboost-dev
2.
需要提前安装openbabel
,最好安装在系统默认的文件夹,否则会遭遇pkg-config
问题(若安装在自定义的路径,或许需要指定PKG_CONFIG_PATH
环境变量,指定到~/APP/openbabel-2.4.1/lib/pkgconfig
(或许不需要,没有测试)) 3.
make
的时候报错,提示和libmysql
相关的问题,但是能够在安装文件夹的src/programs/
路径发现,tpprenum
已经编译好了,但是tppmktop
无法通过编译。
解决方案:
将下列g++
参数中,-lmysqlpp
选项挪到最后即可通过编译。这样就能得到能够运行的
tpprenum
和tppmktop
1
g++ -std=c++11 -g -O2 -lmysqlpp -o programs/tppmktop programs/tppmktop.o global.o db_scanner.o dbinfo.o smartfit.o db_bonds.o topio.o strutil.o tppnames.o -lopenbabel -lboost_program_options
-l
flags and mysql_config
commands to the end of the command line. POSIX linkers look at the
command line right-to-left: the rightmost object should
depend on nothing else, the next to rightmost should depend on either
nothing, or only on what is in the rightmost object, etc. The leftmost
objects should be those that depend on everything to the right. Since
there's nothing to the right of your program modules, the linker doesn't
see anything it can link AWIWorldServer to. (Except for default
libraries like libc, that is, which is always to the right of everything
else.) Your library order is otherwise correct: least generic on the
left, most generic on the right.