Skip to content

Commit

Permalink
Add C wrapper in cali-manager.h (LLNL#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme authored May 1, 2020
1 parent 9ac3b6e commit 8602d2e
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
18 changes: 7 additions & 11 deletions examples/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
project(caliper-examples)

if (${CMAKE_CXX_COMPILER_ID} MATCHES Intel)
# CMake does not have proper compiler feature support for Intel compilers :-/
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
else()
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 99)
endif()
include_directories("../../src/interface/c_fortran")

set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 99)

set(CALIPER_CXX_EXAMPLE_APPS
cxx-example
Expand Down
6 changes: 4 additions & 2 deletions include/caliper/cali-manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

#pragma once

#include "wrapConfigManager.h"

#ifdef __cplusplus
#include "caliper/ConfigManager.h"
#include "caliper/ChannelController.h"
#include "ConfigManager.h"
#include "ChannelController.h"

extern "C" {
#endif
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(CMAKE_C_STANDARD 99)

include_directories(${PROJECT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interface/c_fortran)

add_subdirectory(common)
add_subdirectory(interface/c_fortran)
Expand Down
1 change: 1 addition & 0 deletions src/caliper/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,7 @@ std::vector<std::string>
ConfigManager::get_config_docstrings()
{
ConfigManagerImpl mgr;
mgr.import_builtin_config_specs();
return mgr.get_docstrings();
}

Expand Down
2 changes: 1 addition & 1 deletion src/interface/c_fortran/wrapCaliper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "typesCaliper.h"

#include "BufferedRegionProfile.h"
#include "caliper/cali-manager.h"
#include "caliper/ConfigManager.h"

// splicer begin CXX_definitions
// splicer end CXX_definitions
Expand Down
2 changes: 1 addition & 1 deletion src/interface/c_fortran/wrapConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <cstddef>
#include <cstring>
#include <string>
#include "caliper/cali-manager.h"
#include "caliper/ConfigManager.h"

// splicer begin class.ConfigManager.CXX_definitions
// splicer end class.ConfigManager.CXX_definitions
Expand Down
2 changes: 1 addition & 1 deletion src/interface/caliper_shroud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ declarations:
- decl: void end()

- decl: class ConfigManager
cxx_header: caliper/cali-manager.h
cxx_header: caliper/ConfigManager.h
declarations:
- decl: ConfigManager() +name(new)
- decl: ~ConfigManager() +name(delete)
Expand Down
1 change: 1 addition & 0 deletions test/ci_app_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include_directories("../../src/caliper")
include_directories("../../src/interface/c_fortran")

# build the C/C++ CI test apps

Expand Down

0 comments on commit 8602d2e

Please sign in to comment.