2016-10-19 03:05:30 +08:00
|
|
|
The Makefile.lammps file in this directory is used when building
|
|
|
|
LAMMPS with packages that make use of the NetCDF library or its
|
2017-05-05 01:22:20 +08:00
|
|
|
parallel version. For example, the USER-NETCDF package which adds
|
|
|
|
dump netcdf and dump netcdf/mpiio commands.
|
|
|
|
|
|
|
|
The file has several settings needed to compile
|
2016-10-19 03:05:30 +08:00
|
|
|
and link LAMMPS with the NetCDF and parallel NetCDF support.
|
|
|
|
For any regular NetCDF installation, all required flags should be
|
|
|
|
autodetected. Please note that parallel NetCDF support is
|
|
|
|
beneficial only when you run on a machine with very many processors
|
|
|
|
like an IBM BlueGene or Cray. For most people regular NetCDF
|
|
|
|
support should be sufficient and not cause any performance
|
|
|
|
penalties.
|
|
|
|
|
|
|
|
If you have problems compiling or linking, you may have to set
|
|
|
|
the flags manually. There are three makefile variables
|
|
|
|
|
|
|
|
1) netcdf_SYSINC
|
|
|
|
This is for setting preprocessor options and include file paths.
|
|
|
|
Set -DLMP_HAS_NETCDF, if you have NetCDF installed.
|
|
|
|
Set -DLMP_HAS_PNETCDF, if you have parallel NetCDF installed.
|
|
|
|
You can have either or both defines set. If none of these are
|
|
|
|
set, LAMMPS will compile, but the NetCDF enabled functionality
|
|
|
|
will not be available.
|
|
|
|
In addition you may have to point to the folder with the include
|
|
|
|
with -I/path/to/netcdf/include
|
|
|
|
|
|
|
|
Example for a Fedora 24 machine with serial NetCDF installed as
|
|
|
|
netcdf-devel-4.4.0-3.fc24.x86_64 RPM package:
|
|
|
|
|
|
|
|
netcdf_SYSINC = -DLMP_HAS_NETCDF -I/usr/include -I/usr/include/hdf
|
|
|
|
|
|
|
|
2) netcdf_SYSLIB
|
|
|
|
This is the setting for all required libraries that need to be linked to.
|
|
|
|
|
|
|
|
Example for a Fedora 24 machine with serial NetCDF installed as
|
|
|
|
netcdf-devel-4.4.0-3.fc24.x86_64 RPM package:
|
|
|
|
|
|
|
|
netcdf_SYSLIB = -lnetcdf
|
|
|
|
|
|
|
|
3) netcdf_SYSPATH
|
|
|
|
This is the setting for the path of directories with the NetCDF libraries.
|
|
|
|
Typically, this will be of the form -L/path/to/netcdf/lib
|
|
|
|
|
|
|
|
In the example from above, it can be left empty, because the Linux
|
|
|
|
distribution provided libraries are installed in a system library location.
|