Coder Social home page Coder Social logo

yesint / pteros Goto Github PK

View Code? Open in Web Editor NEW
35.0 4.0 8.0 18.52 MB

Modern and fast molecular analysis and modeling library for C++ and Python

Home Page: https://yesint.github.io/pteros/

License: Other

CMake 7.66% C++ 88.28% C 0.11% Shell 0.01% Batchfile 0.62% Makefile 0.63% Python 2.12% Tcl 0.56%
molecular-modeling molecular-analysis md-data-analysis

pteros's Introduction

Pteros

Modern and fast molecular analysis and modeling library for C++ and Python

What is Pteros?

Pteros is a C++ library for molecular modeling. It is designed to simplify the development of custom programs and scripts for molecular modeling, analysis of molecular dynamics trajectories and implementing new simulation and analysis algorithms. Pteros provides facilities, which are routinely used in all molecular analysis programs, namely input/output of popular file formats, powerful and flexible atom selections, geometry transformations, RMSD fitting and alignment, etc. Pteros also contains powerful facilities for parsing command-line arguments in custom programs and for running several analysis tasks in parallel, utilizing the power of modern multi-core processors. Pteros supports writing analysis programs in either C++ or Python programming languages.

How to cite Pteros?

Any work, which uses Pteros, should cite the following papers:

  • Semen O. Yesylevskyy, "Pteros 2.0: Evolution of the fast parallel molecular analysis library for C++ and python", Journal of Computational Chemistry, 2015, 36(19), 1480–1488, doi: 10.1002/jcc.23943. (link)
  • Semen O. Yesylevskyy, "Pteros: Fast and easy to use open-source C++ library for molecular analysis", Journal of Computational Chemistry, 2012, 33(19), 1632–1636. doi: 10.1002/jcc.22989. (link)

Is Pteros for you?

Pteros library is for you if:

  • You want to implement custom non-standard algorithms of molecular analysis.
  • Your task is computationally expensive and potentially reusable.
  • You want to run several "heavy" analysis tasks in parallel.
  • You are not satisfied by the speed and memory consumption of the scripting languages embedded into popular molecular analysis programs, such as PyMol or VMD.
  • You know C++ or don't mind learning this rather hard, but very powerful language.
  • You know Python or want to learn it. Python scripts in Pteros are good for "throw-away" one-time scripts and serious reusable programs alike.

Pteros is not for you if:

  • Your task requires extensive usage of molecular visualizer. Pteros doesn't have one currently.
  • You have no programming skills at all, or you don't want to learn C++ or Python.

Features

  • Reading/writing popular molecular structure and trajectory formats (PDB, GRO, MOL2, XTC, TRR, TPR, DCD, TNG).
  • Very simple and expressive syntax for selecting groups of atoms similar to one used in VMD, but more powerfull.
  • Selections can be manipulated in many different ways from simple translation to orientation by principal axes.
  • Various properties of selections could be queried ranging from center of masses to radius of gyration.
  • RMSD fitting and alignment.
  • Full support for arbitrary periodic boxes - periodic selections and distances, wrapping/unwrapping, removing jumps over boundaries, computing closest images and shortest vectors, etc.
  • Computing non-bonded interactions with any force field available in Gromacs format (GROMOS, CHARMM, AMBER, OPLS and more).
  • Ability to work with very large trajectories, which does not fit into the memory.
  • Asynchronous processing made easy. Many different analysis tasks could be run in parallel and simulataneously with trajectory reading.
  • Very powerful and flexible syntax of the command-line options for custom analysis programs and scripts.
  • Easy to use. API is very simple and intuitive.
  • Easy to extend. Pteros is writen in high-level C++.
  • Oriented to human beings (reserachers and students), not to programming gurus. The code is very well structured and documented.
  • Bindings for the Python language.
  • Plugin architecture, which makes writing C++ or Python code for asynchronous trajectory analysis trivial. You concentrate on the analysis algorithm itself, not on the technical details of managing files and trajectories.

pteros's People

Contributors

mdimura avatar yesint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pteros's Issues

dssp shoudn't include spdlog's bundled fmt.

In dssp.cpp and structure.cpp, it should include fmt/printf.h instead. It create problems for packagers because spdlog is installed without a bundled fmt and it uses the system's fmt.

Windows: dcdplugin) read_dcdstep: error during read

Reading of .dcd files fails on windows, on Linux everything works fine. I used the pteros/template project to reproduce the error and added this:

System sys("3GUN_NMSim_cl-rep-001.pdb");
sys.load("3GUN_NMSim_cl-rep_894.dcd");

output:

[pteros]	(debug)	Reading trajectory '3GUN_NMSim_cl-rep-001.pdb'...

[pteros]	(info)	Accepted 1 frames. Now 1 frames in the System.
dcdplugin) detected standard 32-bit DCD file of native endianness
dcdplugin) CHARMM format DCD file (also NAMD 2.1 and later)
[pteros]	(debug)	Reading trajectory '3GUN_NMSim_cl-rep_894.dcd'...
dcdplugin) read_dcdstep: error during read
[pteros]	(info)	Accepted 0 frames. Now 1 frames in the System.
Number of atoms is 1293

Quick review

Hi

Just result of pretty short review:

  1. строки не надо инитить "". это ненужные выделения памяти. лучше пусть парсер понимает эмпти стринг. так же как и парсеру вроде не надо делать постоянно ресет в конструкторах - он же и так новый, не? в методах встречается посторная инициализвация полей возвращаемого нового селекшена хотя он только после конструктора
  2. зачем индексы и номера фрейма проверять на отрицательность если можно просто юзать беззнаковый size_t. вообще там местами вольный обмен между инт и сайз_т шо как бы не альо.
  3. во многих операциях с временными векторами не юзается мув семантика. зачем временный вектор копировать в _индекс если его можно мувнуть?
  4. селект(стринг) принимает строку не по ссылке. но это мелочи. в процессе экспанда макросов регеспы парсятся снова и снова. почему не сделать статик массив готовых распасенных? они ж потом константно юзаются
  5. в каком месте парсера модифицируется стартинг сабсет, шо его так уж надо передавать некостантным? тоже самое - зачем парсеру селекшена неконстантны систем?
  6. вообще много вольного обращения с конст кастом. делаем внутри неконстантный поинтер и потом в него постоянно кастим из конста. как по мне лучше сделать константный поинтер и кастить только там где это действительно нужно. заодно будет понятно где именно нужна неконстантность.
  7. возможно я бы так не мучал атом_хендлер, а сделал пару атом_хендлер и конст_атом_хендлер. и возвращал тот что нужно в зависимости от того константный индексатор или нет
  8. поскольку вектор индексов сортированный - иногда можно пользоваться вставкой через лоу_баунд чем пихать в конец и по большому кругу
  9. Selection Selection::select(int ind1, int ind2) const дублирует код - уже есть такой конструктор
  10. лютый копипаст кода проверок хотя можно просто сделать впомогательные верифи (инлайн?) методы. в теории, кстати, вместо налл поинтера на систем для пустого селекшена можно юзать статик экземпляр системы который будет считатся за "пустой"
  11. какой смысл делать Affine3f fit_transform(const Selection& sel1, const Selection& sel2, bool translate_to_zero) и внутри конст каст, если походу все равно никогда он не вызывается для константных селекшенов?

error: function ‘int tngplugin_init()’ definition is marked dllimport

When building with mingw get this error:

...
[ 30%] Building CXX object thirdparty/molfile_plugins/CMakeFiles/molfile_plugins.dir/tngplugin.cpp.obj
In file included from /io/pteros/thirdparty/molfile_plugins/molfile_plugin.h:26,
                 from /io/pteros/thirdparty/molfile_plugins/tngplugin.cpp:36:
<command-line>: error: function ‘int tngplugin_init()’ definition is marked dllimport
/io/pteros/thirdparty/molfile_plugins/vmdplugin.h:41:19: note: in definition of macro ‘cat’
   41 | #define cat(x, y) x ## y
      |                   ^
/io/pteros/thirdparty/molfile_plugins/vmdplugin.h:56:32: note: in expansion of macro ‘xcat’
   56 | #define VMDPLUGIN_init         xcat(VMDPLUGIN, _init)
      |                                ^~~~
/io/pteros/thirdparty/molfile_plugins/vmdplugin.h:56:37: note: in expansion of macro ‘VMDPLUGIN’
   56 | #define VMDPLUGIN_init         xcat(VMDPLUGIN, _init)
      |                                     ^~~~~~~~~
/io/pteros/thirdparty/molfile_plugins/tngplugin.cpp:597:19: note: in expansion of macro ‘VMDPLUGIN_init’
  597 | VMDPLUGIN_API int VMDPLUGIN_init() {
      |                   ^~~~~~~~~~~~~~
<command-line>: warning: ‘int tngplugin_init()’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
/io/pteros/thirdparty/molfile_plugins/vmdplugin.h:41:19: note: in definition of macro ‘cat’
...

to reproduce:

#!/bin/bash

BUILDDIR=`mktemp -d -t build-pteros-mingw-XXX`

cat <<EOF > ${BUILDDIR}/build_pteros_mingw.sh
#!/bin/bash
cd /io
git clone https://github.com/yesint/pteros.git
mkdir pteros/build && cd pteros/build
x86_64-w64-mingw32-cmake -DWITH_PYTHON=OFF -DWITH_OPENBABEL=OFF -DWITH_GROMACS=OFF ..
make
EOF
chmod +x ${BUILDDIR}/build_pteros_mingw.sh

sudo docker run --rm -v ${BUILDDIR}:/io:rw burningdaylight/docker-mingw-qt5 /io/build_pteros_mingw.sh

Build fails when -DWITH_OPENBABEL=OFF is specified

If cmake is configured like this:

x86_64-w64-mingw32-cmake -DWITH_PYTHON=OFF -DWITH_OPENBABEL=OFF ..

The make fails with:

In file included from /home/devel/pteros/src/core/io/pdbqt_file.h:30,
from /home/devel/pteros/src/core/io/mol_file.cpp:38:
/home/devel/pteros/src/core/io/babel_wrapper.h:35:10: fatal error: openbabel/obconversion.h: No such file or directory
#include <openbabel/obconversion.h>

Manually specifying topology?

I'm trying to use Pteros to take a raw amino-acid sequence and compute the free energy in the un-folded state.

To do this I am taking a list of PDB files for the basic amino-acids geometry and manually assembling them into a chain (creating the peptide bonds using known bond lengths and discarding two H, one O atom for each bond).

I can manually specify the atom coordinates correctly, however it seems that to evaluate the energy I need to load a topology file. Is there a way that I can manually specify the topology instead? Or perhaps there is an easier way to do this?

Gromacs API Update Causing Issues

Hello!

I am attempting to install Pteros and I have run into an issue that seems to stem from an update gromacs did to their API about a month ago. Below is the error from the terminal:

Consolidate compiler generated dependencies of target dssp
Consolidate compiler generated dependencies of target pteros_io
[ 43%] Built target dssp
[ 44%] Building CXX object src/core/io/CMakeFiles/pteros_io.dir/tpr_file.cpp.o
In file included from /home/user/Desktop/pteros-master/build/temp.linux-x86_64-3.9/_deps/gromacs_external_fetch-src/api/legacy/include/gromacs/fileio/tpxio.h:42,
                 from /home/user/Desktop/pteros-master/src/core/io/tpr_file.cpp:34:
/home/user/Desktop/pteros-master/build/temp.linux-x86_64-3.9/_deps/gromacs_external_fetch-src/api/legacy/include/gromacs/pbcutil/pbc.h:41:10: fatal error: gromacs/libgromacs_export.h: No such file or directory
 #include "gromacs/libgromacs_export.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/core/io/CMakeFiles/pteros_io.dir/build.make:258: src/core/io/CMakeFiles/pteros_io.dir/tpr_file.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1177: src/core/io/CMakeFiles/pteros_io.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
error: command '/home/user/anaconda3/bin/cmake' failed with exit code 2

This seems to be stemming from #include "gromacs/libgromacs_export.h", as it would seem this no longer exists with the new API version. This does not seem to be the only missing file unfortunately, as #include #include "gromacs/utility/alignedallocator.h" caused the same issue in pbcutil/pbc.h

Does there happen to be a way to instruct the installation process to use the older version of gromacs?

Reading topology information.

Thank you for your useful library. 👍 What is best way to read in topology information such that get_internal_bonds can be used? I've been reading in PDB and MOL2 files, both with bonding information. At the moment, I'm just interested in a single set of coordinates, i.e. single frame.

Whether this software can be compiled on Windows with Visual Studio 2019 and Intel C++ 19.1?

Thank you very much provide this tool!
I want to use pteros on Windows, so firstly I have compiled GROMACS2019.6 by VS2019 and Intel C++ 19.1 , also gmx can be used normally, and generated gromacs.lib library. Then I compile pteros by using Cmake tool, combined with VS2019 and Intel C++ 19.1. However some errors occured in the process of compile, I post these errors in the following:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "public: int __cdecl pteros::Selection::unwrap_bonds(float,class Eigen::Ref<class Eigen::Array<int,3,1,0,3,1> const ,0,class Eigen::InnerStride<1> > const &,int)" (?unwrap_bonds@Selection@pteros@@QEAAHMAEBV?$Ref@$$CBV?$Array@H$02$00$0A@$02$00@Eigen@@$0A@V?$InnerStride@$00@2@@Eigen@@H@Z) referenced in function "public: void __cdecl pteros::Jump_remover::remove_jumps(class pteros::System &)" (?remove_jumps@Jump_remover@pteros@@QEAAXAEAVSystem@2@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\jump_remover.obj :	1	
Error	LNK2019	unresolved external symbol "public: class Eigen::Matrix<float,3,1,0,3,1> __cdecl pteros::Periodic_box::closest_image(class Eigen::Ref<class Eigen::Matrix<float,3,1,0,3,1> const ,0,class Eigen::InnerStride<1> > const &,class Eigen::Ref<class Eigen::Matrix<float,3,1,0,3,1> const ,0,class Eigen::InnerStride<1> > const &,class Eigen::Ref<class Eigen::Array<int,3,1,0,3,1> const ,0,class Eigen::InnerStride<1> > const &)const " (?closest_image@Periodic_box@pteros@@QEBA?AV?$Matrix@M$02$00$0A@$02$00@Eigen@@AEBV?$Ref@$$CBV?$Matrix@M$02$00$0A@$02$00@Eigen@@$0A@V?$InnerStride@$00@2@@4@0AEBV?$Ref@$$CBV?$Array@H$02$00$0A@$02$00@Eigen@@$0A@V?$InnerStride@$00@2@@4@@Z) referenced in function "public: void __cdecl pteros::Jump_remover::remove_jumps(class pteros::System &)" (?remove_jumps@Jump_remover@pteros@@QEAAXAEAVSystem@2@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\jump_remover.obj :	1	
Error	LNK2019	unresolved external symbol "public: __cdecl pteros::Selection::Selection(class pteros::System const &,class std::vector<int,class std::allocator<int> > const &)" (??0Selection@pteros@@QEAA@AEBVSystem@1@AEBV?$vector@HV?$allocator@H@std@@@std@@@Z) referenced in function "public: void __cdecl pteros::Jump_remover::remove_jumps(class pteros::System &)" (?remove_jumps@Jump_remover@pteros@@QEAAXAEAVSystem@2@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\jump_remover.obj :	1	
Error	LNK2019	unresolved external symbol "public: virtual __cdecl pteros::Selection::~Selection(void)" (??1Selection@pteros@@UEAA@XZ) referenced in function "public: void __cdecl pteros::Jump_remover::remove_jumps(class pteros::System &)" (?remove_jumps@Jump_remover@pteros@@QEAAXAEAVSystem@2@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\jump_remover.obj :	1	
Error	LNK2019	unresolved external symbol "public: float __cdecl pteros::Periodic_box::extent(int)const " (?extent@Periodic_box@pteros@@QEBAMH@Z) referenced in function "public: void __cdecl pteros::Jump_remover::remove_jumps(class pteros::System &)" (?remove_jumps@Jump_remover@pteros@@QEAAXAEAVSystem@2@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\jump_remover.obj :	1	
Error	LNK2019	unresolved external symbol "class std::shared_ptr<class spdlog::logger> __cdecl pteros::create_logger(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?create_logger@pteros@@YA?AV?$shared_ptr@Vlogger@spdlog@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z) referenced in function "public: virtual void __cdecl pteros::Trajectory_reader::run(void)" (?run@Trajectory_reader@pteros@@UEAAXXZ)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\trajectory_reader.obj :	1	
Error	LNK2001	unresolved external symbol "class std::shared_ptr<class spdlog::logger> __cdecl pteros::create_logger(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?create_logger@pteros@@YA?AV?$shared_ptr@Vlogger@spdlog@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\traj_file_reader.obj :	1	
Error	LNK2019	unresolved external symbol "public: static class std::unique_ptr<class pteros::Mol_file,struct std::default_delete<class pteros::Mol_file> > __cdecl pteros::Mol_file::recognize(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?recognize@Mol_file@pteros@@SA?AV?$unique_ptr@VMol_file@pteros@@U?$default_delete@VMol_file@pteros@@@std@@@std@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z) referenced in function "public: virtual void __cdecl pteros::Trajectory_reader::run(void)" (?run@Trajectory_reader@pteros@@UEAAXXZ)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\trajectory_reader.obj :	1	
Error	LNK2019	unresolved external symbol "public: void __cdecl pteros::System::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,int,int,class std::function<bool __cdecl(class pteros::System *,int)>)" (?load@System@pteros@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HHHV?$function@$$A6A_NPEAVSystem@pteros@@H@Z@4@@Z) referenced in function "public: virtual void __cdecl pteros::Trajectory_reader::run(void)" (?run@Trajectory_reader@pteros@@UEAAXXZ)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\trajectory_reader.obj :	1	
Error	LNK2019	unresolved external symbol "public: __cdecl pteros::Periodic_box::Periodic_box(void)" (??0Periodic_box@pteros@@QEAA@XZ) referenced in function "public: virtual void __cdecl pteros::Trajectory_reader::run(void)" (?run@Trajectory_reader@pteros@@UEAAXXZ)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\trajectory_reader.obj :	1	
Error	LNK2001	unresolved external symbol "public: __cdecl pteros::Periodic_box::Periodic_box(void)" (??0Periodic_box@pteros@@QEAA@XZ)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\traj_file_reader.obj :	1	
Error	LNK2019	unresolved external symbol "public: bool __cdecl pteros::Mol_file::read(class pteros::System *,struct pteros::Frame *,class pteros::Mol_file_content const &)" (?read@Mol_file@pteros@@QEAA_NPEAVSystem@2@PEAUFrame@2@AEBVMol_file_content@2@@Z) referenced in function "public: virtual void __cdecl pteros::Trajectory_reader::run(void)" (?run@Trajectory_reader@pteros@@UEAAXXZ)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\trajectory_reader.obj :	1	
Error	LNK2001	unresolved external symbol "public: bool __cdecl pteros::Mol_file::read(class pteros::System *,struct pteros::Frame *,class pteros::Mol_file_content const &)" (?read@Mol_file@pteros@@QEAA_NPEAVSystem@2@PEAUFrame@2@AEBVMol_file_content@2@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\traj_file_reader.obj :	1	
Error	LNK2019	unresolved external symbol "public: void __cdecl pteros::System::frame_append(struct pteros::Frame const &)" (?frame_append@System@pteros@@QEAAXAEBUFrame@2@@Z) referenced in function "public: virtual void __cdecl pteros::Trajectory_reader::run(void)" (?run@Trajectory_reader@pteros@@UEAAXXZ)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\trajectory_reader.obj :	1	
Error	LNK2019	unresolved external symbol "public: static class std::unique_ptr<class pteros::Mol_file,struct std::default_delete<class pteros::Mol_file> > __cdecl pteros::Mol_file::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char)" (?open@Mol_file@pteros@@SA?AV?$unique_ptr@VMol_file@pteros@@U?$default_delete@VMol_file@pteros@@@std@@@std@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@D@Z) referenced in function "public: void __cdecl pteros::Traj_file_reader::reader_thread_body(class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &,class std::shared_ptr<class Message_channel<class std::shared_ptr<struct pteros::Data_container> > > const &)" (?reader_thread_body@Traj_file_reader@pteros@@QEAAXAEBV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@AEBV?$shared_ptr@V?$Message_channel@V?$shared_ptr@UData_container@pteros@@@std@@@@@4@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\traj_file_reader.obj :	1	
Error	LNK2019	unresolved external symbol "public: virtual __cdecl pteros::System::~System(void)" (??1System@pteros@@UEAA@XZ) referenced in function "public: virtual void * __cdecl pteros::Task_base::`scalar deleting destructor'(unsigned int)" (??_GTask_base@pteros@@UEAAPEAXI@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\task_base.obj :	1	
Error	LNK2001	unresolved external symbol "public: virtual __cdecl pteros::System::~System(void)" (??1System@pteros@@UEAA@XZ)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\task_plugin.obj :	1	
Error	LNK2019	unresolved external symbol "public: __cdecl pteros::System::System(void)" (??0System@pteros@@QEAA@XZ) referenced in function "public: __cdecl pteros::Task_base::Task_base(void)" (??0Task_base@pteros@@QEAA@XZ)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\task_base.obj :	1	
Error	LNK2019	unresolved external symbol "public: class pteros::System & __cdecl pteros::System::operator=(class pteros::System const &)" (??4System@pteros@@QEAAAEAV01@AEBV01@@Z) referenced in function "public: __cdecl pteros::Task_base::Task_base(class pteros::Task_base const &)" (??0Task_base@pteros@@QEAA@AEBV01@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\task_base.obj :	1	
Error	LNK2019	unresolved external symbol "public: class pteros::Periodic_box & __cdecl pteros::Periodic_box::operator=(class pteros::Periodic_box const &)" (??4Periodic_box@pteros@@QEAAAEAV01@AEBV01@@Z) referenced in function "private: void __cdecl pteros::Task_base::put_frame(struct pteros::Frame const &)" (?put_frame@Task_base@pteros@@AEAAXAEBUFrame@2@@Z)	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\task_base.obj :	1	
Error	LNK1120	16 unresolved externals	pteros_analysis	E:\code-test\pteros-master\build\src\analysis\Release\pteros_analysis.dll :	1	

Can you give me some advices?

Thank you wary much!
Yujie Liu

mingw-w64 build fails

Here is the cmake output:

Looking for OpenMP...
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE   
Looking for Boost...
-- Boost version: 1.66.0
-- Found the following Boost libraries:
--   system
--   date_time
-- Boost version: 1.66.0
-- Found the following Boost libraries:
--   filesystem
--   system
Looking for Eigen...
Looking for Gromacs...
   Trying /usr/local...
-- Gromacs not found! Gromacs-related features are disabled!
Looking for spdlog...
-- spdlog not found! Using internal one.
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
------------------------------
IMPORTANT!
In order to be able to link with Pteros and to use Pteros Python modules
you have to add the following directories to your PATH:
/usr/i686-w64-mingw32/lib
/usr/i686-w64-mingw32/bin
/usr/i686-w64-mingw32/python
------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/build-i686-w64-mingw32
[ 18%] Built target tng_io
[ 20%] Built target tng_testing
[ 22%] Built target md_openmp
[ 23%] Built target md_openmp_util
[ 24%] Built target tng_parallel_read
[ 26%] Built target tng_io_read_pos
[ 28%] Built target tng_io_read_pos_util
Scanning dependencies of target dssp
[ 28%] Building CXX object thirdparty/dssp/CMakeFiles/dssp.dir/dssp.cpp.obj
In file included from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/include/pteros/core/system.h:37:0,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/include/pteros/core/selection.h:39,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/dssp/structure.h:11,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/dssp/dssp.cpp:23:
/workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/include/pteros/core/atom.h: In constructor 'pteros::Atom::Atom()':
/workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/include/pteros/core/atom.h:76:17: warning: 'pteros::Atom::type_name' will be initialized after [-Wreorder]
     std::string type_name;
                 ^~~~~~~~~
/workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/include/pteros/core/atom.h:63:9: warning:   'int pteros::Atom::element_number' [-Wreorder]
     int element_number;
         ^~~~~~~~~~~~~~
/workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/include/pteros/core/atom.h:79:5: warning:   when initialized here [-Wreorder]
     Atom():
     ^~~~
In file included from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/spdlog/details/os.h:14:0,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/spdlog/details/log_msg.h:9,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/spdlog/sinks/sink.h:9,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/spdlog/sinks/base_sink.h:13,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/spdlog/logger.h:15,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/spdlog/spdlog.h:14,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/include/pteros/core/system.h:41,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/include/pteros/core/selection.h:39,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/dssp/structure.h:11,
                 from /workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/dssp/dssp.cpp:23:
/usr/i686-w64-mingw32/include/c++/7.2.1/thread: In instantiation of 'std::thread::thread(_Callable&&, Args&& ...) [with Callable = void (spdlog::details::async_log_helper::*)(); _Args = {spdlog::details::async_log_helper*}]':
/workspace/mingw-w64-pteros-git/src/mingw-w64-pteros/thirdparty/spdlog/details/async_log_helper.h:220:56:   required from here
/usr/i686-w64-mingw32/include/c++/7.2.1/thread:126:9: error: invalid conversion from 'int' to 'void (*)()' [-fpermissive]
         _M_start_thread(_S_make_state(
         ^~~~~~~~~~~~~~~
/usr/i686-w64-mingw32/include/c++/7.2.1/thread:190:5: note:   initializing argument 2 of 'void std::thread::_M_start_thread(std::thread::_State_ptr, void (*)())'
     _M_start_thread(_State_ptr, void (*)());
     ^~~~~~~~~~~~~~~
make[2]: * [thirdparty/dssp/CMakeFiles/dssp.dir/build.make:64: thirdparty/dssp/CMakeFiles/dssp.dir/dssp.cpp.obj] Error 1
make[1]: * [CMakeFiles/Makefile2:411: thirdparty/dssp/CMakeFiles/dssp.dir/all] Error 2
make: * [Makefile:130: all] Error 2

memory leak in System::select()

This program leaks RAM proportionally to N (~20MB/1000 iterations):

#include "pteros/pteros.h"
#include "pteros/core/pteros_error.h"
#include <iostream>

using namespace pteros;

int main(int argc, char** argv){
    set_log_level("err");
    int N;
    std::cin>>N;
    System sys("small.gro");
    int seleSize=-1;
    for(int i=0; i<N; ++i) {
        auto sele = sys.select("chain A and resid 123 and not name CA CB C N O and chain B");
        seleSize = sele.size();
    }
    std::cout<<seleSize<<std::endl;
    return 0;
}

With more complex selection expressions it leaks more. This also seems to happen with valid selections.

$ /usr/bin/time -v ./pteros_test_dcd <<< 2000 2>&1 | grep Maximum
Maximum resident set size (kbytes): 65324

noself keyword is ignored in selection expressions

this selection string:

(within 0.300000 noself of (resid 151 and name CB )) or (resid 151 and not name CA CB C N O)

selects these atoms:

151@N, 151@H, 151@CA, 151@HA, 151@CB, 151@HB1, 151@HB2, 151@HB3, 151@C,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.