forked from STEllAR-GROUP/hpx
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix STEllAR-GROUP#3124: Build hello world client through make tests.u…
…nit.build
- Loading branch information
Showing
9 changed files
with
51 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,38 @@ | ||
# Copyright (c) 2012 Steven R. Brandt | ||
# Copyright (c) 2014 Thomas Heller | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
# Linux Bash Script for running hello world | ||
|
||
PKG_CONFIG_PATH = $(HPX_LOCATION)/lib/pkgconfig | ||
export PKG_CONFIG_PATH | ||
|
||
MY_HPX_LIBS = $(HOME)/my_hpx_libs | ||
|
||
# Prepare the environment so that we can run the command | ||
LD_LIBRARY_PATH = $(MY_HPX_LIBS) | ||
export LD_LIBRARY_PATH | ||
|
||
all : run | ||
|
||
# Compile the library | ||
libhello_world.so : hello_world_component.cpp | ||
c++ -o libhello_world.so hello_world_component.cpp `pkg-config --cflags --libs hpx_component` -DHPX_COMPONENT_NAME=hello_world | ||
|
||
# Move the library to the library directory | ||
$(MY_HPX_LIBS)/libhello_world.so: libhello_world.so | ||
mkdir -p $(MY_HPX_LIBS) | ||
cp libhello_world.so $(MY_HPX_LIBS) | ||
|
||
# Create the hpx.ini file | ||
$(HOME)/.hpx.ini: | ||
echo "[hpx]" > $(HOME)/.hpx.ini | ||
echo "ini_path = \$$[hpx.ini_default_path]:$(MY_HPX_LIBS)" >> $(HOME)/.hpx.ini | ||
|
||
# Create the ini file | ||
$(MY_HPX_LIBS)/hello_world.ini: | ||
echo "$(MY_HPX_LIBS)/hello_world.ini" > $(MY_HPX_LIBS)/hello_world.ini | ||
echo "[hpx.components.hello_world]" >> $(MY_HPX_LIBS)/hello_world.ini | ||
echo "name = hello_world" >> $(MY_HPX_LIBS)/hello_world.ini | ||
echo "path = $(MY_HPX_LIBS)" >> $(MY_HPX_LIBS)/hello_world.ini | ||
|
||
# Compile the client | ||
hello_world_client: hello_world_client.cpp $(MY_HPX_LIBS)/libhello_world.so | ||
c++ -o hello_world_client hello_world_client.cpp `pkg-config --cflags --libs hpx_application` -lhpx_iostreams -lhello_world -L $(MY_HPX_LIBS) | ||
|
||
# Run the client, first add our directory to the LD_LIBRARY_PATH | ||
run: hello_world_client $(HOME)/.hpx.ini $(MY_HPX_LIBS)/hello_world.ini | ||
./hello_world_client | ||
|
||
clean: | ||
rm -f hello_world_client libhello_world.so | ||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt | ||
|
||
.PHONY: all | ||
|
||
ifeq ($(BUILD_TYPE),Debug) | ||
hpx_application = hpx_application_debug | ||
hpx_component = hpx_component_debug | ||
debug_suffix = d | ||
else | ||
hpx_application = hpx_application | ||
hpx_component = hpx_component | ||
debug_suffix = | ||
endif | ||
|
||
APP_CFLAGS = $(CXX_FLAGS) | ||
APP_CFLAGS += $(shell PKG_CONFIG_PATH=$(HPX_DIR) $(PKG_CONFIG) --cflags --libs $(hpx_application)) | ||
APP_CFLAGS += -lhpx_iostreams$(debug_suffix) | ||
APP_CFLAGS += -DHPX_APPLICATION_NAME=test | ||
|
||
COMP_CFLAGS = $(CXX_FLAGS) | ||
COMP_CFLAGS += $(shell PKG_CONFIG_PATH=$(HPX_DIR) $(PKG_CONFIG) --cflags --libs $(hpx_component)) | ||
COMP_CFLAGS += -DHPX_COMPONENT_NAME=test_component | ||
|
||
ifneq ($(wildcard $(HPX_DIR)/*),) | ||
all: hello_world_client | ||
else | ||
all: | ||
@echo "HPX_DIR=$(HPX_DIR) does not exist. Did you forget to run the install rule?" | ||
endif | ||
|
||
hello_world_client: $(SRC_DIR)/hello_world_client.cpp libhello_world_component.so | ||
$(CXX) -o hello_world_client -I$(SRC_DIR)/ $(SRC_DIR)/hello_world_client.cpp $(APP_CFLAGS) libhello_world_component.so | ||
|
||
libhello_world_component.so: $(SRC_DIR)/hello_world_component.cpp | ||
$(CXX) -o libhello_world_component.so -fPIC -I$(SRC_DIR)/ $(SRC_DIR)/hello_world_component.cpp $(COMP_CFLAGS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.