Skip to content

[BUG] Cannot get LAMMPS to compile with pair_bornsolv potential #1

Description

@kevinshen56714

Summary

Compilation error occurred when building LAMMPS with pair_bornsolv.cpp/.h. Thanks to Alexandros Tsamopoulos from Caltech for reporting this bug.

k$ make serial
make[1]: Entering directory '/home/tsamo/Downloads/lammps/lammps_bornsolv-master/src/STUBS'
make[1]: 'libmpi_stubs.a' is up to date.
make[1]: Leaving directory '/home/tsamo/Downloads/lammps/lammps_bornsolv-master/src/STUBS'
Gathering installed package information (may take a little while)
make[1]: Entering directory '/home/tsamo/Downloads/lammps/lammps_bornsolv-master/src'
Gathering git version information
make[1]: Leaving directory '/home/tsamo/Downloads/lammps/lammps_bornsolv-master/src'
Compiling LAMMPS for machine serial
make[1]: Entering directory '/home/tsamo/Downloads/lammps/lammps_bornsolv-master/src/Obj_serial'
make[1]: Leaving directory '/home/tsamo/Downloads/lammps/lammps_bornsolv-master/src/Obj_serial'
make[1]: Entering directory '/home/tsamo/Downloads/lammps/lammps_bornsolv-master/src/Obj_serial'
g++ -g -O3  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64    -I../STUBS     -c ../pair_bornsolv.cpp
../pair_bornsolv.cpp: In member function ‘virtual void LAMMPS_NS::PairBornsolv::compute_inner()’:
../pair_bornsolv.cpp:159:10: error: ‘listinner’ was not declared in this scope
  159 |   inum = listinner->inum;
      |          ^~~~~~~~~
../pair_bornsolv.cpp: In member function ‘virtual void LAMMPS_NS::PairBornsolv::compute_middle()’:
../pair_bornsolv.cpp:232:10: error: ‘listmiddle’ was not declared in this scope
  232 |   inum = listmiddle->inum;
      |          ^~~~~~~~~~
../pair_bornsolv.cpp: In member function ‘virtual void LAMMPS_NS::PairBornsolv::compute_outer(int, int)’:
../pair_bornsolv.cpp:318:10: error: ‘listouter’ was not declared in this scope
  318 |   inum = listouter->inum;
      |          ^~~~~~~~~
../pair_bornsolv.cpp: In member function ‘virtual void LAMMPS_NS::PairBornsolv::init_list(int, LAMMPS_NS::NeighList*)’:
../pair_bornsolv.cpp:536:21: error: ‘listinner’ was not declared in this scope
  536 |   else if (id == 1) listinner = ptr;
      |                     ^~~~~~~~~
../pair_bornsolv.cpp:537:21: error: ‘listmiddle’ was not declared in this scope
  537 |   else if (id == 2) listmiddle = ptr;
      |                     ^~~~~~~~~~
../pair_bornsolv.cpp:538:21: error: ‘listouter’ was not declared in this scope
  538 |   else if (id == 3) listouter = ptr;
      |                     ^~~~~~~~~
../pair_bornsolv.cpp: In member function ‘virtual void LAMMPS_NS::PairBornsolv::read_restart(FILE*)’:
../pair_bornsolv.cpp:637:25: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  637 |       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
      |                    ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../pair_bornsolv.cpp:641:16: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  641 |           fread(&epsilon[i][j],sizeof(double),1,fp);
      |           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../pair_bornsolv.cpp:642:16: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  642 |           fread(&sigma[i][j],sizeof(double),1,fp);
      |           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../pair_bornsolv.cpp:643:16: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  643 |           fread(&cut[i][j],sizeof(double),1,fp);
      |           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../pair_bornsolv.cpp: In member function ‘virtual void LAMMPS_NS::PairBornsolv::read_restart_settings(FILE*)’:
../pair_bornsolv.cpp:672:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  672 |     fread(&cut_global,sizeof(double),1,fp);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../pair_bornsolv.cpp:673:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  673 |     fread(&offset_flag,sizeof(int),1,fp);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../pair_bornsolv.cpp:674:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  674 |     fread(&mix_flag,sizeof(int),1,fp);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../pair_bornsolv.cpp:675:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
  675 |     fread(&tail_flag,sizeof(int),1,fp);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:109: pair_bornsolv.o] Error 1
make[1]: Leaving directory '/home/tsamo/Downloads/lammps/lammps_bornsolv-master/src/Obj_serial'
make: *** [Makefile:212: serial] Error 2

LAMMPS Version and Platform

Reproduced with both patch_21Jul2020 tag (which this repo was forked from) and stable_29Oct2020 tag (LAMMPS (29 Oct 2020)).
MacOS

Expected Behavior

Normal compilation result with pair_style bornsolv potential successfully built.

Actual Behavior

Errors with unknown parameters (shown above).

Steps to Reproduce

cd src; make serial or cd src; make mpi

Further Information, Files, and Links

This didn't happen with the 11Aug17 LAMMPS version. Might have something to do with the change of LAMMPS infrastructure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions