| United States-English |
|
|
|
![]() |
HP-MPI User's Guide > Chapter 3 Understanding
HP-MPICompilation wrapper script utilities |
|
HP-MPI provides compilation utilities for the languages shown in Table 3-1 “Compiler selection”. In general, if a particular compiler is desired, it is best to set the appropriate environment variable such as MPI_CC. Without such a setting, the utility script will search the PATH and a few default locations for a variety of possible compilers. Although in many environments this search produces the desired results, explicitly setting the environment variable is safer. Command line options take precedence over environment variables. Table 3-1 Compiler selection
The compiler you use to build HP-MPI applications depends upon which programming language you use. The HP-MPI compiler utilities are shell scripts that invoke the appropriate native compiler. You can pass the pathname of the MPI header files using the -I option and link an MPI library (for example, the diagnostic or thread-compliant library) using the -Wl, -L or -l option. By default, HP-MPI compiler utilities include a small amount of debug information in order to allow the TotalView debugger to function. However, certain compiler options are incompatible with this debug information. Use the -notv option to exclude debug information. The -notv option will also disable TotalView usage on the resulting executable. The -notv option applies to archive libraries only. HP-MPI offers a -show option to compiler wrappers. When compiling by hand, run as mpicc -show and a line will print displaying exactly what the job was going to do (and skips the actual build). In order to use the 'mpi' Fortran 90 module, the user must create the module file by compiling the module.F file in /opt/hpmpi/include/64/module.F for 64-bit compilers. For 32-bit compilers, compile the module.F file in /opt/hpmpi/include/32/module.F.
In each case, you will need to build (just once) the module that corresponds to 'mpi' with the compiler you intend to use. For example, with hpmpi/bin and pgi/bin in path:
The utility "%MPI_ROOT%\bin\mpicc" is included to aid in command line compilation. To compile with this utility, set MPI_CC to the path of the command line compiler you want to use. Specify -mpi32 or -mpi64 to indicate if you are compiling a 32- or 64-bit application. Specify the command line options that you would normally pass to the compiler on the mpicc command line. The mpicc utility will add additional command line options for HP-MPI include directories and libraries. The -show option can be specified to indicate that mpicc should display the command generated without actually executing the compilation command. See the mpicc man page for more information. To compile C code and link against HP-MPI without utilizing the mpicc tool, start a command prompt that has the appropriate environment settings loaded for your compiler, and use it with the compiler option: /I"%MPI_ROOT%\include\[32|64]" and the linker options: /libpath:"%MPI_ROOT%\lib" /subsystem:console ^ [libhpmpi64.lib|libhpmpi32.lib] The above assumes the environment variable MPI_ROOT is set. For example, to compile hello_world.c from the Help directory using Visual Studio (from a Visual Studio 2005 command prompt window): cl hello_world.c /I"%MPI_ROOT%\include\64" The PGI compiler uses a more UNIX-like syntax. From a PGI command prompt: pgcc hello_world.c -I"%MPI_ROOT%\include\64" The utility "%MPI_ROOT%\bin\mpif90" is included to aid in command line compilation. To compile with this utility, set MPI_F90 to the path of the command line compiler you want to use. Specify -mpi32 or -mpi64 to indicate if you are compiling a 32- or 64-bit application. Specify the command line options that you would normally pass to the compiler on the mpif90 command line. The mpif90 utility will add additional command line options for HP-MPI include directories and libraries. The -show option can be specified to indicate that mpif90 should display the command generated without actually executing the compilation command. See the mpif90 man page for more information. To compile compute_pi.f using Intel Fortran without utilizing the mpif90 tool (from a command prompt that has the appropriate environment settings loaded for your Fortran compiler): ifort compute_pi.f /I"%MPI_ROOT%\include\64" |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||