Building liggghts 2.3.8 with visual studio

Submitted by apeskhov on Thu, 10/24/2013 - 15:30

Hi,

I have problem to build the latest version of liggghts(2.3.8) with visual studio. I obtain the following errors:

Error 1 error LNK2001: unresolved external symbol ""public: int __thiscall LAMMPS_NS::AtomVecSphere::pack_border_vel_wedge(int,int *,double *,int,int *)" (?pack_border_vel_wedge@AtomVecSphere@LAMMPS_NS@@QAEHHPAHPANH0@Z)" C:\Users\Anton\Downloads\liggghts\LIGGGHTS-PUBLIC\src\WINDOWS\atom_vec_sphere.obj LIGGGHTS-PUBLIC

Error 2 error LNK2001: unresolved external symbol ""public: int __thiscall LAMMPS_NS::AtomVecSphere::pack_comm_vel_wedge(int,int *,double *,int,int *)" (?pack_comm_vel_wedge@AtomVecSphere@LAMMPS_NS@@QAEHHPAHPANH0@Z)" C:\Users\Anton\Downloads\liggghts\LIGGGHTS-PUBLIC\src\WINDOWS\atom_vec_sphere.obj LIGGGHTS-PUBLIC

I tried to build both in VS2010 and VS2013, the same error appear in each cases.
If I comment out the lines 242-243 and 618-619 in 'atom_vec_sphere.cpp' everything builds fine (hoping that I will not need the wedge stuff). As I absolutely do not know C++ I can hardly help you to resolve this problem.

Also VS2013 now have built in support for erf and erfc. So the erf.h should include a check for VS2013 like this:


# ifndef ERF_H
# define ERF_H

# if(_WIN32 && _MSC_VER <= 1700) //1800=Visual Studio 2013 has already erf and erfc

# ifdef __cplusplus
extern "C" {
# endif

double erf(double x);
double erfc(double x);

# ifdef __cplusplus
}
# endif

# endif

# endif

apeskhov | Thu, 10/24/2013 - 18:05

I have found out the problem. The 2.3.8 new files 'atom_vec_sphere_w.cpp', 'comm_I.h' and 'domain_I.h' where not included in the VS project.

Where can I submit the corrected 'erf.h' and vs project files?

ckloss's picture

ckloss | Wed, 10/30/2013 - 10:21

Hi apeskhov,

we'll try to auto-generate correct VS files, starting one of the next releases

Cheers
Christoph