Skip to content

Commit

Permalink
[alpaka] Autogenerate plugins.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed May 1, 2022
1 parent 50570e8 commit f56ac8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 56 deletions.
7 changes: 5 additions & 2 deletions src/alpaka/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ EXE_DEP := $(EXE_OBJ:$.o=$.d)

LIBNAMES := $(filter-out plugin-% bin test Makefile% plugins.txt%,$(wildcard *))
PLUGINNAMES := $(patsubst plugin-%,%,$(filter plugin-%,$(wildcard *)))
MY_CXXFLAGS := -I$(TARGET_DIR) -DSRC_DIR=$(TARGET_DIR) -DLIB_DIR=$(LIB_DIR)/$(TARGET_NAME) -DALPAKA_HOST_ONLY -DALPAKA_ACC_CPU_B_SEQ_T_SEQ_PRESENT -DALPAKA_ACC_CPU_B_TBB_T_SEQ_PRESENT
MY_CXXFLAGS := -I$(TARGET_DIR) -DLIB_DIR=$(LIB_DIR)/$(TARGET_NAME) -DALPAKA_HOST_ONLY -DALPAKA_ACC_CPU_B_SEQ_T_SEQ_PRESENT -DALPAKA_ACC_CPU_B_TBB_T_SEQ_PRESENT
ifdef CUDA_BASE
MY_CXXFLAGS += -DALPAKA_ACC_GPU_CUDA_PRESENT -DALPAKA_ACC_GPU_CUDA_ONLY_MODE
endif
Expand Down Expand Up @@ -182,7 +182,10 @@ $(foreach test,$(TESTS_ROCM_EXE),$(eval $(call RUNTEST_template,$(test),amdgpu))
-include $(ALL_DEPENDS)

# Build targets
$(TARGET): $(EXE_OBJ) $(LIBS) $(PLUGINS) | $(TESTS_EXE)
$(LIB_DIR)/$(TARGET_NAME)/plugins.txt: $(PLUGINS)
nm -A -C -D -P --defined-only $(PLUGINS) | sed -n -e"s#$(LIB_DIR)/$(TARGET_NAME)/\(plugin\w\+\.so\): typeinfo for edm::\(PluginFactory\|ESPluginFactory\)::impl::Maker<\([A-Za-z0-9_:]\+\)> V .* .*#\3 \1#p" | sort > $@

$(TARGET): $(EXE_OBJ) $(LIBS) $(PLUGINS) $(LIB_DIR)/$(TARGET_NAME)/plugins.txt | $(TESTS_EXE)
# Link all libraries, also the "portable" ones
$(CXX) $(EXE_OBJ) $(LDFLAGS) $(MY_LDFLAGS) -o $@ -L$(LIB_DIR)/$(TARGET_NAME) $(foreach lib,$(LIBNAMES),$($(lib)_LDFLAGS) $($(lib)_SERIAL_LDFLAGS) $($(lib)_TBB_LDFLAGS) $($(lib)_CUDA_LDFLAGS) $($(lib)_ROCM_LDFLAGS)) $(foreach dep,$(EXTERNAL_DEPENDS),$($(dep)_LDFLAGS))

Expand Down
5 changes: 1 addition & 4 deletions src/alpaka/bin/PluginManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

#include "PluginManager.h"

#ifndef SRC_DIR
#error "SRC_DIR undefined"
#endif
#ifndef LIB_DIR
#error "LIB_DIR undefined"
#endif
Expand All @@ -18,7 +15,7 @@

namespace edmplugin {
PluginManager::PluginManager() {
std::ifstream pluginMap(STR(SRC_DIR) "/plugins.txt");
std::ifstream pluginMap(STR(LIB_DIR) "/plugins.txt");
std::string plugin, library;
while (pluginMap >> plugin >> library) {
//std::cout << "plugin " << plugin << " in " << library << std::endl;
Expand Down
50 changes: 0 additions & 50 deletions src/alpaka/plugins.txt

This file was deleted.

0 comments on commit f56ac8b

Please sign in to comment.