Skip to content

Cross initialization error from pair_aniso.cpp when compiling with cmake and Invalid atom_style error when trying to fix this #14

@mce13

Description

@mce13

Hi there,

thanks a lot for the lovely package, which I'm trying to install/get to work on our HPC.

Following your installation guide make DNA_mpi gave me

g++: error: unrecognized command-line option '-restrict'; did you mean '-Wrestrict'?

Changing '-restrict' to '-Wrestrict' did not help but resulted in a different error

g++: error: language host not recognized,

which I could not really make sense of.

Therefore, I decided to compile using cmake as described here, which gave me

/usr/users/mengeho/lammps/src/pair_aniso.cpp:204:14: error: jump to case label [-fpermissive]
         case SPHERE_ELLIPSE:
              ^~~~~~~~~~~~~~
/usr/users/mengeho/lammps/src/pair_aniso.cpp:190:18: note:   crosses initialization of ‘double r’
           double r = sqrt(rsq);

So, there seems to be a problem with the switch statement beginning line 179 in pair_aniso.cpp. I tried to fix this in two different ways:

  1. I put the contents of each case in brackets to limit the scope of the variable.

  2. I declared variable r before the switch statement.

With either approach compliation worked fine and an executable lmp was buildt. However, when I used this either on the demo file in.run or on the chemically_specific_12N_165NRL_HREMD/in.hremd_breathing I got

ERROR: Invalid atom_style command (src/atom_vec.cpp:75)
Last command: atom_style   hybrid ellipsoid angle charge

I suppose this could be related to the changes I made to pair_aniso.cpp, although I'm not sure about this.

Do you have any suggestion how I could get my installation to work (with or without cmake) or how I could fix the Invalid atom_style error?

Your help would be much appreciated,

Cheers,

Maik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions