CompPhysVienna / n2p2

n2p2 - A Neural Network Potential Package
https://compphysvienna.github.io/n2p2/
GNU General Public License v3.0
217 stars 82 forks source link

Installing dependencies for making nnp-norm #133

Open fireballpoint1 opened 2 years ago

fireballpoint1 commented 2 years ago

Is your feature request related to a problem? Please describe. The existing documentation feels insufficient because certain dependencies are required to be installed and it's hard to figure out how to install them

Describe the solution you'd like I was able to solve my dependency issues by doing the following installations:

apt install libopenmpi-dev
apt install libeigen3-dev
apt install libgsl-dev
apt install libblas-dev

I was wondering if it can be mentioned somewhere in the documentation for the aid of other users

philippmisof commented 2 years ago

I've added the dependencies to the documentation on the branch I'm currently working on: b0ce41e669e54286590eb852fb575c33b2bf9014. But I don't have the permissions to push it to the master branch, so maybe @singraber can do this.

fireballpoint1 commented 2 years ago

@philippmisof in your documentation you mention that we might need to create a symlink for eigen if it is not found even after being installed. I have been trying that, however it seems to be looking for eigen in /usr/include on moc instead of /usr/local/include`. Hwere should the appropriate symlink be created ?

philippmisof commented 2 years ago

Since this problem is not specific to n2p2 I didn't go into details about that. Basically you have two options to make the compiler find the Eigen directory:

  1. Symlink the Eigen directory to a directory where your compiler looks for include files by default. This is system and compiler dependent. I'm using the GNU compiler on Arch linux which means it also checks in the /usr/local/include directory as mentioned in the Eigen documentation. If your compiler doesn't check in this path choose another one which is checked by default.

  2. Another option is to edit the src/makefile.* (for * choose gnu, intel or llvm depending on your compiler). Look for PROJECT_EIGEN and change it to the path of the directory containing your Eigen folder. By default it is set to PROJECT_EIGEN=/usr/local/include/eigen3 which is why you will see g++ ... -I/usr/include/eigen3/ ... on the output when building n2p2.

Personally I prefer option 1 because then the compiler will also find Eigen when compiling other projects. If you feel uneasy about symlinking inside the /usr directory, choose option 2.