Permalink
Browse files

Automatically generate a list of installed frameworks in project/incl…

…ude/project/frameworks.h
  • Loading branch information...
1 parent 4d6f3ee commit 8577ab48be59b418f482ffdc2a2ea719895d8ad6 @hjelmn committed Mar 6, 2013
View
@@ -362,6 +362,36 @@ sub mca_process_framework {
##############################################################################
+sub mca_generate_framework_header(\$\@) {
+ my ($project, @frameworks) = @_;
+ my $framework_array_output="";
+ my $framework_decl_output="";
+
+ foreach my $framework (@frameworks) {
+ # There is no common framework object
+ if ($framework ne "common") {
+ my $framework_name = "${project}_${framework}_base_framework";
+
+ $framework_array_output .= " &$framework_name,\n";
+ $framework_decl_output .= "extern mca_base_framework_t $framework_name;\n";
+ }
+ }
+
+ open(FRAMEWORKS_OUT, ">$project/include/$project/frameworks.h");
+ printf FRAMEWORKS_OUT "%s", "/*
+ * This file is autogenerated by autogen.pl. Do not edit this file by hand.
+ */
+#include <opal/mca/base/mca_base_framework.h>
+
+$framework_decl_output
+static mca_base_framework_t *${project}_frameworks[] = {
+$framework_array_output NULL
+};\n";
+ close(FRAMEWORKS_OUT);
+}
+
+##############################################################################
+
sub mca_process_project {
my ($topdir, $project) = @_;
@@ -472,6 +502,8 @@ sub mca_run_global {
}
$frameworks_comma =~ s/^, //;
+ &mca_generate_framework_header($pname, @mykeys);
+
$m4 .= "$dnl_line
dnl Frameworks in the $pname project and their corresponding directories
View
@@ -233,7 +233,7 @@ AC_DEFUN([OMPI_MCA],[
m4_undefine([mca_component_configure_active])
])
-
+
######################################################################
#
@@ -23,7 +23,8 @@ headers += \
ompi/constants.h \
ompi/types.h \
ompi/memchecker.h \
- ompi/totalview.h
+ ompi/totalview.h \
+ ompi/frameworks.h
nodist_headers += \
ompi/version.h
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
- * University Research and Technology
- * Corporation. All rights reserved.
- * Copyright (c) 2004-2005 The University of Tennessee and The University
- * of Tennessee Research Foundation. All rights
- * reserved.
- * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
- * University of Stuttgart. All rights reserved.
- * Copyright (c) 2004-2005 The Regents of the University of California.
- * All rights reserved.
- * $COPYRIGHT$
- *
- * Additional copyrights may follow
- *
- * $HEADER$
- */
-
-#include "ompi_config.h"
-
-#include <stdio.h>
-
-#include "ompi/constants.h"
-#include "opal/mca/mca.h"
-#include "opal/mca/base/base.h"
-#include "ompi/mca/allocator/allocator.h"
-#include "ompi/mca/allocator/base/base.h"
-
-/**
- * Closes all the remaining modules.
- *
- * @retval OMPI_SUCCESS
- */
-int mca_allocator_base_close(void)
-{
- /* Close all remaining available modules (may be one if this is a
- OMPI RTE program, or [possibly] multiple if this is ompi_info) */
-
- mca_base_components_close(0, &mca_allocator_base_components, NULL);
-
- /* All done */
- return OMPI_SUCCESS;
-}
-
@@ -25,7 +25,8 @@ headers += \
opal/opal_socket_errno.h \
opal/types.h \
opal/prefetch.h \
- opal/hash_string.h
+ opal/hash_string.h \
+ opal/frameworks.h
nodist_headers += \
opal/version.h
@@ -25,6 +25,10 @@
#include <string.h>
#include <ctype.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include "opal/class/opal_list.h"
#include "opal/class/opal_pointer_array.h"
@@ -36,6 +40,8 @@
#include "opal/runtime/opal.h"
#include "opal/dss/dss.h"
+#include "opal/include/opal/frameworks.h"
+
#include "opal/mca/installdirs/installdirs.h"
#include "opal/mca/event/base/base.h"
#include "opal/mca/base/base.h"
@@ -21,7 +21,8 @@
headers += \
orte/constants.h \
- orte/types.h
+ orte/types.h \
+ orte/frameworks.h
nodist_headers += \
orte/version.h

0 comments on commit 8577ab4

Please sign in to comment.