Adding the wrapper compiler files to L8. Yet to comment it in a style
fit to be a man-page. I decided to commit them so that it gets into CVS. I will format the comments shortly. This commit was SVN r294.
Этот коммит содержится в:
родитель
307c0ea0e2
Коммит
23f1c30963
75
src/tools/wrappers/lamwrap.h
Обычный файл
75
src/tools/wrappers/lamwrap.h
Обычный файл
@ -0,0 +1,75 @@
|
||||
//
|
||||
// $HEADER$
|
||||
//
|
||||
/** @file **/
|
||||
#ifndef LAM_WRAP_H
|
||||
#define LAM_WRAP_H 1
|
||||
|
||||
#include "lam_config.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
//
|
||||
// Commonly used type
|
||||
//
|
||||
|
||||
typedef std::vector<std::string> lam_sv_t;
|
||||
|
||||
|
||||
//
|
||||
// Global variables
|
||||
//
|
||||
|
||||
extern bool fl_libs;
|
||||
extern bool fl_building;
|
||||
extern bool fl_profile;
|
||||
extern bool fl_cpp;
|
||||
|
||||
extern bool showme_cmd;
|
||||
extern bool showme_compile;
|
||||
extern bool showme_link;
|
||||
|
||||
|
||||
//
|
||||
// Functions in the helper LAM wrapper compiler library
|
||||
//
|
||||
|
||||
// This is the granddaddy that will invoke the rest
|
||||
|
||||
int
|
||||
lam_wrap_engine(int argc, char* argv[],
|
||||
const lam_sv_t& env_vars, const std::string& default_compiler,
|
||||
bool want_cxx_libs, bool want_f77_includes,
|
||||
const std::string& extra_args);
|
||||
|
||||
// Parse the command line and get some environment information
|
||||
|
||||
void lam_wrap_parse_args(int argc, char* argv[], bool& want_flags);
|
||||
|
||||
// Build up various argument lists
|
||||
|
||||
void lam_wrap_get_compiler(const lam_sv_t& env_list,
|
||||
const std::string& default_comp, lam_sv_t& out);
|
||||
void lam_wrap_build_user_args(int argc, char* argv[], lam_sv_t& user_args);
|
||||
void lam_wrap_build_cflags(bool want_f77_includes, lam_sv_t& cflags);
|
||||
void lam_wrap_build_ldflags(lam_sv_t& ldflags);
|
||||
void lam_wrap_build_libs(bool want_cxx_libs, lam_sv_t& libs);
|
||||
void lam_wrap_build_extra_flags(const std::string& extra_string,
|
||||
lam_sv_t& extra_flags);
|
||||
|
||||
// Print or execute the file list of arguments
|
||||
|
||||
void lam_wrap_print_sv(const lam_sv_t& sv);
|
||||
int lam_wrap_exec_sv(const lam_sv_t& sv);
|
||||
|
||||
// Various helper functions
|
||||
|
||||
void lam_wrap_strip_white(std::string & str);
|
||||
bool lam_wrap_split(const std::string& str, char c,
|
||||
lam_sv_t& out);
|
||||
void lam_wrap_split_append_sv(const std::string& str, lam_sv_t& out);
|
||||
void lam_wrap_append_sv(const lam_sv_t& in, lam_sv_t& out);
|
||||
bool lam_wrap_check_file(const std::string& dir, const std::string& file);
|
||||
|
||||
#endif // LAM_WRAP_H
|
28
src/tools/wrappers/mpicc.cc
Обычный файл
28
src/tools/wrappers/mpicc.cc
Обычный файл
@ -0,0 +1,28 @@
|
||||
//
|
||||
// $HEADER$
|
||||
// Function: - wrapper for C program compilation
|
||||
//
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "tools/wrappers/lamwrap.h"
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
// The four wrapper compilers are extremely similar. So similar,
|
||||
// in fact, that they can be parameterized on what is different.
|
||||
// Hence, we call the "wrapper compiler engine" to do all the work,
|
||||
// and pass in just a few arguments to customize for the language of
|
||||
// this wrapper compiler.
|
||||
|
||||
lam_sv_t str_vec;
|
||||
|
||||
str_vec.clear();
|
||||
str_vec.push_back("LAMMPICC");
|
||||
str_vec.push_back("LAMCC");
|
||||
|
||||
return lam_wrap_engine(argc, argv,
|
||||
str_vec, LAM_CC, false, false,
|
||||
WRAPPER_EXTRA_CFLAGS);
|
||||
}
|
28
src/tools/wrappers/mpicxx.cc
Обычный файл
28
src/tools/wrappers/mpicxx.cc
Обычный файл
@ -0,0 +1,28 @@
|
||||
//
|
||||
// $HEADER$
|
||||
// Function: - wrapper for C++ program compilation
|
||||
//
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "tools/wrappers/lamwrap.h"
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
// The four wrapper compilers are extremely similar. So similar,
|
||||
// in fact, that they can be parameterized on what is different.
|
||||
// Hence, we call the "wrapper compiler engine" to do all the work,
|
||||
// and pass in just a few arguments to customize for the language of
|
||||
// this wrapper compiler.
|
||||
|
||||
lam_sv_t str_vec;
|
||||
|
||||
str_vec.clear();
|
||||
str_vec.push_back("LAMMPICXX");
|
||||
str_vec.push_back("LAMCXX");
|
||||
|
||||
return lam_wrap_engine(argc, argv,
|
||||
str_vec, LAM_CXX,true, false,
|
||||
WRAPPER_EXTRA_CXXFLAGS);
|
||||
}
|
36
src/tools/wrappers/mpif77.cc
Обычный файл
36
src/tools/wrappers/mpif77.cc
Обычный файл
@ -0,0 +1,36 @@
|
||||
//
|
||||
// $HEADER$
|
||||
// Function: - wrapper for fortran program compilation
|
||||
//
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "tools/wrappers/lamwrap.h"
|
||||
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
// The four wrapper compilers are extremely similar. So similar,
|
||||
// in fact, that they can be parameterized on what is different.
|
||||
// Hence, we call the "wrapper compiler engine" to do all the work,
|
||||
// and pass in just a few arguments to customize for the language of
|
||||
// this wrapper compiler.
|
||||
|
||||
#if !LAM_ENABLE_MPI_F77
|
||||
#if 0
|
||||
show_help("hf77", "no-fortran-support", NULL);
|
||||
#endif
|
||||
return 1;
|
||||
#else
|
||||
lam_sv_t str_vec;
|
||||
|
||||
str_vec.clear();
|
||||
str_vec.push_back("LAMMPIF77");
|
||||
str_vec.push_back("LAMF77");
|
||||
|
||||
return lam_wrap_engine(argc, argv,
|
||||
str_vec, LAM_F77, false, true,
|
||||
WRAPPER_EXTRA_FFLAGS);
|
||||
#endif
|
||||
}
|
36
src/tools/wrappers/mpif90.cc
Обычный файл
36
src/tools/wrappers/mpif90.cc
Обычный файл
@ -0,0 +1,36 @@
|
||||
//
|
||||
// $HEADER$
|
||||
// Function: - wrapper for fortran program compilation
|
||||
//
|
||||
|
||||
#include "lam_config.h"
|
||||
#include "tools/wrappers/lamwrap.h"
|
||||
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
// The four wrapper compilers are extremely similar. So similar,
|
||||
// in fact, that they can be parameterized on what is different.
|
||||
// Hence, we call the "wrapper compiler engine" to do all the work,
|
||||
// and pass in just a few arguments to customize for the language of
|
||||
// this wrapper compiler.
|
||||
|
||||
#if !LAM_ENABLE_MPI_F90
|
||||
#if 0
|
||||
show_help("hf90", "no-fortran-support", NULL);
|
||||
#endif
|
||||
return 1;
|
||||
#else
|
||||
lam_sv_t str_vec;
|
||||
|
||||
str_vec.clear();
|
||||
str_vec.push_back("LAMMPIF90");
|
||||
str_vec.push_back("LAMF90");
|
||||
|
||||
return lam_wrap_engine(argc, argv,
|
||||
str_vec, LAM_F90, false, false,
|
||||
WRAPPER_EXTRA_FFLAGS);
|
||||
#endif
|
||||
}
|
Загрузка…
Ссылка в новой задаче
Block a user