Installation and compilation of ohmms

1. General questions
1.1. What is the minimum requirement for autoconf/automake?
1.2. What is the configuration file included by -DHAVE_CONFIG_H?
1.3. What is src/OhmmsApp/AppConfig.h for?
1.4. Why can't I just do configure like many other packages? Why do I need to specify c++compiler?
1.5. I'd like to use intel c and fortran compilers but it looks like gcc and g77 are selected.
2. Configuration options
2.1. The code does not seem to run fast enough withgcc. What can be done, if any?
2.2. How can I turn on MPI capability?
2.3. How can I turn on OpenMP capability?
2.4. How to use sprng random-number generator?
2.5. How to use HDF5 library?
2.6. I followed the instruction for sprng and HDF5 but I'm getting compiler errors with "missing library". How to fix it?
3. OS-specific questions on configuration
3.1. configure --with-cxx=gcc on Mac OS X (darwin) dies with an error message
3.2. How to use module/softenv at NSF and DOE HPC centers?

1. General questions

1.1. What is the minimum requirement for autoconf/automake?
1.2. What is the configuration file included by -DHAVE_CONFIG_H?
1.3. What is src/OhmmsApp/AppConfig.h for?
1.4. Why can't I just do configure like many other packages? Why do I need to specify c++compiler?
1.5. I'd like to use intel c and fortran compilers but it looks like gcc and g77 are selected.
1.1.

What is the minimum requirement for autoconf/automake?

Autoconf macros for MPI, blas and lapack require autoconf 2.50 or higher. Unfortunately, portable tools are not 100% portable. On cygwin, if you have both stable and develop versions of autoconf, the configuration will fail. An easy way to fix the problem (not the best probably) is to uninstall autoconf-stable (2.13.x). Check out cygwin site.

1.2.

What is the configuration file included by -DHAVE_CONFIG_H?

When configuration is successful,, a file src/ohmms-config.h is created in the build directory.

1.3.

What is src/OhmmsApp/AppConfig.h for?

Many features of ohmms applications are not available by default. On the other hand, you may not like to use the default features. This configuration file is created to enable/disable the application-level features that are compiled for an executable. If you want to build your executable only with EAM potential, disable everything else. The default features are determined by the developers, because they have to or like to use them. Note that the content of Makefile depends on the configuration option and src/OhmmsApp/AppConfig.h

1.4.

Why can't I just do configure like many other packages? Why do I need to specify c++compiler?

It is mostly to tune compiler flags and to allow users to choose different compilers for different applications. Although gcc will work on any unix platform, the developers find that vendor-provided compilers tend to perform better,especially when the performance of the applications is limited by the implementations of blas/lapack and the optimization capabilities of c/f77 compilers. For instance on typical linux machines, compiling with gcc is recommended for classical simulations (pure c++ codes), while compiling with intel compilers is recommended for quantum simulations.

1.5.

I'd like to use intel c and fortran compilers but it looks like gcc and g77 are selected.

configure script tries to guess a proper set of compilers based on CXX given by option --with-cxx=CXX However, it is a good idea to set the compiler flags for c CC=c-compiler and f77 F77=f77-compiler to make sure that the intended compilers are used. Mixing compilers on linux, g++ and intel c/f77 compilers,can improve the performance but may require changing Makefile that is generated automatically.

2. Configuration options

2.1. The code does not seem to run fast enough withgcc. What can be done, if any?
2.2. How can I turn on MPI capability?
2.3. How can I turn on OpenMP capability?
2.4. How to use sprng random-number generator?
2.5. How to use HDF5 library?
2.6. I followed the instruction for sprng and HDF5 but I'm getting compiler errors with "missing library". How to fix it?
2.1.

The code does not seem to run fast enough withgcc. What can be done, if any?

First step is to add--enable-optimize or change CXXFLAGS="flags". Especially with gcc 3.2 and higher, the performance will be greatly improved. Indeed, for the production runs, always use --enable-optimize[=yes]. Occasionally, the compiler flags JK uses can add too much stress to the compilers (have seen compilation taking a very long time on linux). You can always go into src/Makefile and tone down the options a bit.

2.2.

How can I turn on MPI capability?

You have to have --enable-mpi . In addition, you need to set few options or environment variables. If your system supports mpi compilers, which are typically shell scripts, e.g., mpiCC for mpich and mpCC for AIX, set MPICXX=mpiCC|mpCC to the compiler. E.g.,configure --with-cxx=icc --enable-mpi MPICXX=mpiCC MPICC=mpicc will try to configure with intel compilers and default MPICH library. If your system has mpi header files and libraries in the standard places, probably you do not need to do anything. However, if the files cannot be found in your paths, you need to provide the paths explicitly. Note that enabling MPI does not mean you are using data-distributed mpi unless your scripts have specific instructions.

[Warning] Warning

Since autoconf uses c compiler to check mpi libraries, both MPICC and MPICXX have to be set either as environment variables or as options for the configure.

2.3.

How can I turn on OpenMP capability?

In order to enable OpenMP, add--enable-openmp. After checking the compilers and their options, the script will decide if the OpenMP parallelization can be enabled. Currently, the authors have tested OpenMP on SGI Origin,IA64 running linux with intel compilers, IBM P4 with AIX compilers, DEC Cluster with DEC compilers. No platform- or compiler-dependent flags need to be provided for the systems mentioned above during configuration. However, you may need to use thread-safe c++ compiler, such as CXX=xlC_r. Consult HPC sites for further information.

[Warning] Warning

Not many compilers support OpenMP constructs for C++codes. ohmms does not just use loop parallelizations with openmp pragma. The implementation is more like mpi using OpenMP constructs. By taking advantage of strict scope resolutions of C++,one can eliminate private(variables) entirely and do many things clean and efficiently.

2.4.

How to use sprng random-number generator?

Use --with-sprng=DIR. The script assumes that DIR/include/sprng.h and DIR/lib/libsprng.a are available, instead of using AC_CHECK_LIB or AC_CHECK_HEADER. The option is required in order to set HAVE_LIBSPRNG macro in src/ohmms-config.h correctly.

2.5.

How to use HDF5 library?

Use --with-hdf5=DIR. The script assumes that DIR/include/hdf5.h and DIR/lib/libhdf5.a are available, instead of using AC_CHECK_LIB or AC_CHECK_HEADER. The option is required in order to set HAVE_LIBHDF5 macro in src/ohmms-config.h correctly.

2.6.

I followed the instruction for sprng and HDF5 but I'm getting compiler errors with "missing library". How to fix it?

For --with-pkg=DIR, choose DIR so that DIR/include is added to CPPFLAGS, CXXFLAGS and CFLAGS. Then, use LIBS to link all the libraries you need to use. For instance, one can pass LIBS="-L/usr/local/hdf5-1.4.2p1/lib -lhdf5 -lpthread -lssl -lcrypto -lz" to configure to link HDF5 library at OSC IA64 cluster. Alternatively, --with-pkg-libs="-L/usr/local/hdf5-1.4.2p1/lib -lhdf5 -lpthread -lssl -lcrypto -lz" will work. Check out the environment variables set by module and softenv on HPC platforms to link correct libraries.

3. OS-specific questions on configuration

3.1. configure --with-cxx=gcc on Mac OS X (darwin) dies with an error message
3.2. How to use module/softenv at NSF and DOE HPC centers?
3.1.

configure --with-cxx=gcc on Mac OS X (darwin) dies with an error message

unknown configure: error: linking to Fortran libraries from C fails

Overwrite FLIBS and LDFLAGS with configure. For instance,add to the configuration options,--enable-shared --enable-dl --disable-static FLIBS=-lg2c LDFLAGS=-L/sw/lib. This assumes that the base libraries are installed by fink.

3.2.

How to use module/softenv at NSF and DOE HPC centers?

First, check out the exellent documentations provided by the centers. Everything is clearly explained. Typically, after loading a module, e.g., module load hdf5 on OSC IA64 cluster, typing env | grep -i hdf5 will list the relevant environment variables as

HDF5_LIBS="-L/usr/local/hdf5-1.4.2p1/lib -lhdf5 -lpthread -lssl -lcrypto -lz -lm"
HDF5_INCLUDE=-I/usr/local/hdf5-1.4.2p1/include
HDF5_HOME=/usr/local/hdf5-1.4.2p1

Since -lpthread or -lm is normally added by C compiler checks, using --with-hdf5=/usr/local/hdf5-1.4.2p1 LIBS="-lssl -lcrypto -lz" will work correctly. Important: in order to use the package compiled with mpi (OpenMP), your application has to be configured with mpi-capable (OpenMP) compilers and options. Check if the compiler mode is 32 or 64.


   
Site search Web search