diff --git a/doc/Section_start.html b/doc/Section_start.html index 8042c40909..7b960e8995 100644 --- a/doc/Section_start.html +++ b/doc/Section_start.html @@ -72,26 +72,28 @@ as described in the next section.

This section has the following sub-sections:


Read this first: -

Building LAMMPS can be non-trivial. You will likely need to edit a -makefile, there are compiler options, additional libraries can be used -(MPI, FFT, JPEG), etc. Please read this section carefully. If you -are not comfortable with makefiles, or building codes on a Unix -platform, or running an MPI job on your machine, please find a local -expert to help you. Many compiling, linking, and run problems that -users are not really LAMMPS issues - they are peculiar to the user's -system, compilers, libraries, etc. Such questions are better answered -by a local expert. +

Building LAMMPS can be non-trivial. You may need to edit a makefile, +there are compiler options to consider, additional libraries can be +used (MPI, FFT, JPEG), LAMMPS packages may be included or excluded, +some of these packages use auxiliary libraries which need to be +pre-built, etc. +

+

Please read this section carefully. If you are not comfortable with +makefiles, or building codes on a Unix platform, or running an MPI job +on your machine, please find a local expert to help you. Many +compiling, linking, and run problems that users have are not really +LAMMPS issues - they are peculiar to the user's system, compilers, +libraries, etc. Such questions are better answered by a local expert.

If you have a build problem that you are convinced is a LAMMPS issue (e.g. the compiler complains about a line of LAMMPS source code), then @@ -104,16 +106,19 @@ to the developers and we'll include it in future LAMMPS releases.


-Building a LAMMPS executable: +Steps to build a LAMMPS executable: +

Step 0 +

The src directory contains the C++ source and header files for LAMMPS. It also contains a top-level Makefile and a MAKE sub-directory with -low-level Makefile.* files for several machines. From within the src +low-level Makefile.* files for many machines. From within the src directory, type "make" or "gmake". You should see a list of available choices. If one of those is the machine and options you want, you can type a command like:

make linux
+or
 gmake mac 
 

Note that on a multi-processor or multi-core platform you can launch a @@ -123,62 +128,27 @@ will build LAMMPS more quickly.

If you get no errors and an executable like lmp_linux or lmp_mac is produced, you're done; it's your lucky day.

-
- -Common errors that can occur when making LAMMPS: - -

(1) If the make command breaks immediately with errors that indicate -it can't find files with a "*" in their names, this can be because -your machine's make doesn't support wildcard expansion in a makefile. -Try gmake instead of make. If that doesn't work, try using a -f -switch with your make command to use Makefile.list which explicitly -lists all the needed files, e.g. +

Note that by default only a few of LAMMPS optional pacakges are +installed. To build LAMMPS with optional packages, see this +section below.

-
make makelist
-make -f Makefile.list linux
-gmake -f Makefile.list mac 
-
-

The first "make" command will create a current Makefile.list with all -the file names in your src dir. The 2nd "make" command (make or -gmake) will use it to build LAMMPS. +

Step 1

-

(2) If you get an error that says something like 'identifier "atoll" -is undefined', then your machine does not support "long long" -integers, and you need to edit the src/lmptype.h file. There is a -comment in the file about what to do. Basically you replace -MPI_LONG_LONG with MPI_LONG and atoll with atol. +

If Step 0 did not work, you will need to create a low-level Makefile +for your machine, like Makefile.foo. You should make a copy of an +existing src/MAKE/Makefile.* as a starting point. The only portions +of the file you need to edit are the first line, the "compiler/linker +settings" section, and the "LAMMPS-specific settings" section.

-

(3) Other errors typically occur because the low-level Makefile isn't -setup correctly for your machine. If your platform is named "foo", -you will need to create a Makefile.foo in the MAKE sub-directory. Use -whatever existing file is closest to your platform as a starting -point. See the next section for more instructions. +

Step 2

-

(4) If you get a link-time error about missing libraries or missing -dependencies, then it can be because: +

Change the first line of src/MAKE/Makefile.foo to list the word "foo" +after the "#", and whatever other options it will set. This is the +line you will see if you just type "make".

- -

The first issue is discussed below. The other two issue mean you need -to edit your low-level Makefile.foo, as discussed in the next -sub-section. +

Step 3

-
- -Editing a new low-level Makefile.foo: - -

These are the issues you need to address when editing a low-level -Makefile for your machine. The portions of the file you typically -need to edit are the first line, the "compiler/linker settings" -section, and the "system-specific settings" section. -

-

(1) Change the first line of Makefile.foo to list the word "foo" after -the "#", and whatever other options you set. This is the line you -will see if you just type "make". -

-

(2) The "compiler/linker settings" section lists compiler and linker +

The "compiler/linker settings" section lists compiler and linker settings for your C++ compiler, including optimization flags. You can use g++, the open-source GNU compiler, which is available on all Unix systems. You can also use mpicc which will typically be available if @@ -204,11 +174,15 @@ on a new platform, a long list of *.d files will be printed out rapidly. This is not an error; it is the Makefile doing its normal creation of dependencies.

-

(3) The "system-specific settings" section has 6 parts. +

Step 4

-

(3.a) The LMP_INC variable is used to include options that turn on -system-dependent ifdefs within the LAMMPS code. The settings -that are currently recogized are: +

The "system-specific settings" section has several parts. Note that +if you change any -D setting in this section, you should do a full +re-compile, after typing "make clean" (which will describe different +clean options). +

+

The LMP_INC variable is used to include options that turn on ifdefs +within the LAMMPS code. The options that are currently recogized are: