Size: 3580
Comment:
|
Size: 6287
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
= Installation = | |
Line 6: | Line 5: |
= Installation = | |
Line 8: | Line 8: |
Line 14: | Line 15: |
Line 19: | Line 19: |
If you use bash shell, you can set fortran and c compiler: | . If you use bash shell, you can set fortran and c compiler: |
Line 26: | Line 27: |
Tips: If you ignored this step, the configure script will pick up the gfortran and gcc compiler as default. | . Tips: If you ignored this step, the configure script will pick up the gfortran and gcc compiler as default. |
Line 28: | Line 29: |
2. Set blas and lapack library. | 2. Set blas and lapack library. The external Blas and Lapack library is needed for compling BDF. In addition, C language Blas and Lapack are required. It is easer to use Intel MKL. You only need set "MATHLIB" and "MATHINCLUDE" as |
Line 30: | Line 31: |
For flaxibality reason, we ask users to set blas and lapack libraries. | |
Line 32: | Line 32: |
$export MATHLIB="-LMathLibDir -llapackname -lblasname" | $export MATHLIB="-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread" $export MATHINCLUDE="-I/opt/intel/mkl/include" |
Line 34: | Line 35: |
However, you may choose to use Blas and Lapack from netlib. You may download lapack library from http://www.netlib.org/lapack/lapack-3.6.0.tgz. Do not forget also compile "lapacke" and "cblas", which is a C interface for lapack and blas library. | |
Line 35: | Line 37: |
3. Configure BDF package. |
Then, you need set "MATHLIB" and "MATHINCLUDE" {{{ $export MATHLIB="-L/Users/aaa/mathlib/lapack -llapack64 -lblas64" $export MATHINCLUDE="-I/Users/aaa/lapack-3.6.0/lapacke/include -I/Users/aaa/lapack-3.6.0/cblas/include" }}} And, due to netlib only offer 32-bit cblas and lapacke officially, you need either modify codes from netlib, or specific FORTINT=int: {{{ $export MATHINCLUDE="-I/Users/aaa/lapack-3.6.0/lapacke/include -I/Users/aaa/lapack-3.6.0/cblas/include -DFORTINT='int'" }}} the later option can make the package compile, but may meet unexpected error when the job involves cblas and lapacke. 3.(optional)Set processor specific compiling flag. If you need to speed up the program, you can turn on specific compiling flag in config/simd.mh for example, you can turn on core-avx2 with intel compiler on intel CPU with Haswell microarchitecture or later on. {{{ SIMDFLAGS := -march=core-avx2 CFLAGS :=$(SIMDFLAGS) $(CFLAGS) CXXFLAGS :=$(SIMDFLAGS) $(CXXFLAGS) F77FLAGS :=$(SIMDFLAGS) $(F77FLAGS) F90FLAGS :=$(SIMDFLAGS) $(F90FLAGS) }}} 4. Configure BDF package. |
Line 38: | Line 61: |
{{{ | {{{ |
Line 41: | Line 65: |
Configure support several parameters. | |
Line 42: | Line 67: |
Configure support several parameters. | |
Line 50: | Line 73: |
--enable-mkl=yes[no] Compiler BDF withIntel MKL support. | |
Line 51: | Line 75: |
5. Compile BDF package. | |
Line 52: | Line 77: |
4. Compile BDF package. | |
Line 54: | Line 78: |
$make | $make |
Line 56: | Line 80: |
Line 61: | Line 84: |
{{{ | {{{ |
Line 64: | Line 88: |
2. Only MPI. | |
Line 65: | Line 90: |
2. Only MPI. {{{ |
{{{ |
Line 69: | Line 93: |
3. Only OpenMP. | |
Line 70: | Line 95: |
3. Only OpenMP. {{{ |
{{{ |
Line 74: | Line 98: |
== Examples of some typical installations == 1. A 64bit machine with intel compiler and MKL library. |
|
Line 75: | Line 101: |
{{{ export FC=ifort export CC=gcc export CXX=g++ export MATHLIB="-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread" export MATHINLCUDE="-I/opt/intel/mkl/include" ./configure --enable-i8=yes --enable-openmp=yes --enable-mkl=yes make }}} 2. A Mac laptop with gfortran, gcc and user compiled lapack and blas library |
|
Line 76: | Line 112: |
== Examples of some typical installations == 1. A 64bit machine with intel compiler and MKL library. |
|
Line 80: | Line 113: |
$export FC=ifort | $export FC=gfortran |
Line 83: | Line 116: |
$export MATHLIB="-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread" $./configure --enabale-i8=yes --enable-openmp=yes |
$export MATHILIB="-L/Users/mike/mathlib -lblas -llapack" $export MATHINCLUDE="-I/Users/mike/lapack-3.6.0/lapacke/include -I/Users/mike/lapack-3.6.0/cblas/include" $./configure --enable-i8=yes --enable-openmp=yes |
Line 87: | Line 121: |
3. A Linux cluster with fort, icc, openmpi and intel MKL library. | |
Line 88: | Line 123: |
2. A Mac laptop with gfortran, gcc and user compiled lapack and blas library | . Check MPI flags by using command |
Line 90: | Line 126: |
$export FC=gfortran $export CC=gcc $export CXX=g++ $export MATHILIB="-L/Users/mike/mathlib -lblas -llapack" $./configure --enabale-i8=yes --enable-openmp=yes $make |
$mpif90 --shownme |
Line 97: | Line 128: |
. You may get such output. | |
Line 98: | Line 130: |
3. A Linux cluster with fort, icc, openmpi and intel MKL library. Check MPI flags by using command {{{ $mpif90 --shownme }}} You may get such output. {{{ |
{{{ |
Line 109: | Line 133: |
. You can compile bdf package as | |
Line 110: | Line 135: |
You can compile bdf package as | |
Line 116: | Line 140: |
$export MATHINCLUDE="I/opt/intel/mkl/include" | |
Line 117: | Line 142: |
$./configure --enabale-i8=yes --enable-parallel=yes | $./configure --enable-i8=yes --enable-parallel=yes --enable-mkl=yes |
Line 120: | Line 145: |
. If you only want to evoke MPI, just use | |
Line 121: | Line 147: |
If you only want to evoke MPI, just use | |
Line 123: | Line 148: |
$./configure --enabale-i8=yes --enable-mpi=yes | $./configure --enable-i8=yes --enable-mpi=yes --enable-mkl=yes |
Line 125: | Line 150: |
== Set system variables of BDF package == = Using dynamic library = For reducing program size and easy developing, dynamic library can be used. |
|
Line 126: | Line 154: |
== Set system variables of BDF package == | == Branch == Just clone/pull/checkout the branch dynamic-dev. The installation is just as static library version. == List of dynamic libraries == The extra libraries libcint,libgen1int,libxcfun are dynamic. The list of other dynamic libraries can be finded in variable "DYNUTL" in database/xianest.mh == Modifying libraries == If the modified code is code of static library, please rebuild the library and the programs use this library. Just type {{{ make }}} If the modified code is code of program, just rebuild the program. Just type {{{ make }}} After modifying dynamic libraries, just rebuild the library. You need to type {{{ make ISLIB=dynamic }}} If function calls are changed in both dynamic library and program, please rebuild the library first, then program. |
Contents
Installation
System requirements
In principle, BDF supports all Unix-like platforms. However, we strongly propose you to use BDF at Linux platform together Intel Fortran and C compiler because BDF package is developed and thoroughly tested on such platforms. System requirements of BDF is summarized as following lines:
OS: Linux, Mac, FreeBSD, Unix Compiler: Fortran 90 compiler such as Intel, gfortran, g95 Support softwares: Python, make Parallel environments: MPI
Configure and compile BDF package
Several steps are needed to install BDF package.
1. Set fortran and C compiler.
- If you use bash shell, you can set fortran and c compiler:
$export FC=ifort $export CC=gcc $export CXX=g++
- Tips: If you ignored this step, the configure script will pick up the gfortran and gcc compiler as default.
2. Set blas and lapack library. The external Blas and Lapack library is needed for compling BDF. In addition, C language Blas and Lapack are required. It is easer to use Intel MKL. You only need set "MATHLIB" and "MATHINCLUDE" as
$export MATHLIB="-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread" $export MATHINCLUDE="-I/opt/intel/mkl/include"
However, you may choose to use Blas and Lapack from netlib. You may download lapack library from http://www.netlib.org/lapack/lapack-3.6.0.tgz. Do not forget also compile "lapacke" and "cblas", which is a C interface for lapack and blas library.
Then, you need set "MATHLIB" and "MATHINCLUDE"
$export MATHLIB="-L/Users/aaa/mathlib/lapack -llapack64 -lblas64" $export MATHINCLUDE="-I/Users/aaa/lapack-3.6.0/lapacke/include -I/Users/aaa/lapack-3.6.0/cblas/include"
And, due to netlib only offer 32-bit cblas and lapacke officially, you need either modify codes from netlib, or specific FORTINT=int:
$export MATHINCLUDE="-I/Users/aaa/lapack-3.6.0/lapacke/include -I/Users/aaa/lapack-3.6.0/cblas/include -DFORTINT='int'"
the later option can make the package compile, but may meet unexpected error when the job involves cblas and lapacke. 3.(optional)Set processor specific compiling flag. If you need to speed up the program, you can turn on specific compiling flag in config/simd.mh for example, you can turn on core-avx2 with intel compiler on intel CPU with Haswell microarchitecture or later on.
SIMDFLAGS := -march=core-avx2 CFLAGS :=$(SIMDFLAGS) $(CFLAGS) CXXFLAGS :=$(SIMDFLAGS) $(CXXFLAGS) F77FLAGS :=$(SIMDFLAGS) $(F77FLAGS) F90FLAGS :=$(SIMDFLAGS) $(F90FLAGS)
4. Configure BDF package.
After setting compiler and mathematic library. You can configure BDF by command configure in BDF root directory.
$./configure
Configure support several parameters.
--enable-debug=yes[no] Compile BDF in debug mode. --enable-i8=yes[no] Compile BDF with 64 bit integrals. --enable-openmp=yes[no] Compile BDF with OpenMP supporting. --enable-mpi=yes[no] Compile BDF with MPI supporting. --enable-parallel=yes[no] Compiler BDF with MPI and OpenMP support. --enable-mkl=yes[no] Compiler BDF withIntel MKL support.
5. Compile BDF package.
$make
Compile parallel bdf
Some of BDF modules support parallel calculation. You can compiler BDF as parallel mode. At present, we support MPI and OpenMP.
1. MPI and OpenMP hybrid.
$./configure --enable-parallel=yes
2. Only MPI.
$./configure --enable-mpi=yes
3. Only OpenMP.
$./configure --enable-openmp=yes
Examples of some typical installations
1. A 64bit machine with intel compiler and MKL library.
export FC=ifort export CC=gcc export CXX=g++ export MATHLIB="-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread" export MATHINLCUDE="-I/opt/intel/mkl/include" ./configure --enable-i8=yes --enable-openmp=yes --enable-mkl=yes make
2. A Mac laptop with gfortran, gcc and user compiled lapack and blas library
$export FC=gfortran $export CC=gcc $export CXX=g++ $export MATHILIB="-L/Users/mike/mathlib -lblas -llapack" $export MATHINCLUDE="-I/Users/mike/lapack-3.6.0/lapacke/include -I/Users/mike/lapack-3.6.0/cblas/include" $./configure --enable-i8=yes --enable-openmp=yes $make
3. A Linux cluster with fort, icc, openmpi and intel MKL library.
- Check MPI flags by using command
$mpif90 --shownme
- You may get such output.
ifort -I/opt/openmpi/include -I/opt/openmpi/lib -L/opt/openmpi/lib -lmpi_f90 -lmpi_f77 -lmpi -ldl -lm -Wl,--export-dynamic -lrt -lnsl -lutil
- You can compile bdf package as
$export FC=ifort $export CC=icc $export CXX=icpc $export MATHLIB="-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread" $export MATHINCLUDE="I/opt/intel/mkl/include" $export MPILIB="-I/opt/openmpi/include -I/opt/openmpi/lib -L/opt/openmpi/lib -lmpi_f90 -lmpi_f77 -lmpi -ldl -lm -Wl,--export-dynamic -lrt -lnsl -lutil" $./configure --enable-i8=yes --enable-parallel=yes --enable-mkl=yes $make
- If you only want to evoke MPI, just use
$./configure --enable-i8=yes --enable-mpi=yes --enable-mkl=yes
Set system variables of BDF package
Using dynamic library
For reducing program size and easy developing, dynamic library can be used.
Branch
Just clone/pull/checkout the branch dynamic-dev. The installation is just as static library version.
List of dynamic libraries
The extra libraries libcint,libgen1int,libxcfun are dynamic. The list of other dynamic libraries can be finded in variable "DYNUTL" in database/xianest.mh
Modifying libraries
If the modified code is code of static library, please rebuild the library and the programs use this library. Just type
make
If the modified code is code of program, just rebuild the program. Just type
make
After modifying dynamic libraries, just rebuild the library. You need to type
make ISLIB=dynamic
If function calls are changed in both dynamic library and program, please rebuild the library first, then program.