Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libmuscle/cpp/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ distclean:
# Find dependencies or set up build

dep_name := msgpack
dep_version_constraint := >= 3.2.0
dep_version := 3.2.0
dep_pkgconfig_name := msgpack
dep_version_constraint := >= 4.0.0
dep_version := 7.0.0
dep_pkgconfig_name := msgpack-cxx
dep_install := 1
include $(TOOLDIR)/make_available.make

Expand All @@ -46,7 +46,7 @@ include $(TOOLDIR)/make_available.make
DEP_DIRS += $(CURDIR)/msgpack/msgpack
export DEP_DIRS

PKG_CONFIG_EXTRA_DIRS := $(PKG_CONFIG_EXTRA_DIRS):$(CURDIR)/msgpack/msgpack/lib/pkgconfig
PKG_CONFIG_EXTRA_DIRS := $(PKG_CONFIG_EXTRA_DIRS):$(CURDIR)/msgpack/lib/pkgconfig
export PKG_CONFIG_EXTRA_DIRS


Expand Down
19 changes: 12 additions & 7 deletions libmuscle/cpp/build/libmuscle/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ endif

installed_pkg_config_files := $(pkg_config_files:%=$(PREFIX)/lib/pkgconfig/%)

CXXFLAGS += -Wall -pedantic -std=c++14 -pthread -O3
CXXFLAGS += -Wall -pedantic -std=c++14 -pthread -O3 -DMSGPACK_NO_BOOST
export CXXFLAGS

MPIFLAGS := -DMUSCLE_ENABLE_MPI
Expand Down Expand Up @@ -136,10 +136,12 @@ install: all $(installed_headers) $(installed_pkg_config_files)
-install_name_tool -change libymmsl.dylib @loader_path/libymmsl.dylib $(PREFIX)/lib/libmuscle_d.dylib
-install_name_tool -change libymmsl.dylib @loader_path/libymmsl.dylib $(PREFIX)/lib/libmuscle_mpi.dylib
-install_name_tool -change libymmsl.dylib @loader_path/libymmsl.dylib $(PREFIX)/lib/libmuscle_mpi_d.dylib
install_name_tool -change @rpath/libmsgpackc.2.dylib @loader_path/libmsgpackc.2.dylib $(PREFIX)/lib/libmuscle.dylib
-install_name_tool -change @rpath/libmsgpackc.2.dylib @loader_path/libmsgpackc.2.dylib $(PREFIX)/lib/libmuscle_d.dylib
-install_name_tool -change @rpath/libmsgpackc.2.dylib @loader_path/libmsgpackc.2.dylib $(PREFIX)/lib/libmuscle_mpi.dylib
-install_name_tool -change @rpath/libmsgpackc.2.dylib @loader_path/libmsgpackc.2.dylib $(PREFIX)/lib/libmuscle_mpi_d.dylib

# Not needed for MessagePack 7.0.0
# install_name_tool -change @rpath/libmsgpackc.2.dylib @loader_path/libmsgpackc.2.dylib $(PREFIX)/lib/libmuscle.dylib
# -install_name_tool -change @rpath/libmsgpackc.2.dylib @loader_path/libmsgpackc.2.dylib $(PREFIX)/lib/libmuscle_d.dylib
# -install_name_tool -change @rpath/libmsgpackc.2.dylib @loader_path/libmsgpackc.2.dylib $(PREFIX)/lib/libmuscle_mpi.dylib
# -install_name_tool -change @rpath/libmsgpackc.2.dylib @loader_path/libmsgpackc.2.dylib $(PREFIX)/lib/libmuscle_mpi_d.dylib
@mkdir -p $(PREFIX)/bin
sed -e 's@%PREFIX%@$(PREFIX)@g' muscle3.env.in >$(PREFIX)/bin/muscle3.env
for pc in $(PREFIX)/lib/pkgconfig/* ; do sed -i -e 's@^prefix=.*$$@prefix=$(PREFIX)@' $$pc ; done
Expand All @@ -152,11 +154,14 @@ ifeq "$(filter $(MAKECMDGOALS),$(cleantargets))" ""

# Dependencies
$(info pcextra: $(PKG_CONFIG_EXTRA_DIRS))
CXXFLAGS += $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_EXTRA_DIRS):$(PKG_CONFIG_PATH) ; pkg-config --cflags msgpack)
# MSGPACK_FLAGS := $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_EXTRA_DIRS):$(PKG_CONFIG_PATH) ; pkg-config --cflags msgpack-cxx)
MSGPACK_INCLUDE_DIR = $(CURDIR)/../msgpack/msgpack/include
export MSGPACK_INCLUDE_DIR
CXXFLAGS += -I$(MSGPACK_INCLUDE_DIR)

LDFLAGS2 = $(LDFLAGS)
LDFLAGS2 += -pthread -L$(CURDIR)/../ymmsl -lymmsl
LDFLAGS2 += $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_EXTRA_DIRS):$(PKG_CONFIG_PATH) ; pkg-config --libs msgpack)
# LDFLAGS2 += $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_EXTRA_DIRS):$(PKG_CONFIG_PATH) ; pkg-config --libs msgpack-cxx)

# Automatic header dependencies
-include $(deps)
Expand Down
5 changes: 3 additions & 2 deletions libmuscle/cpp/build/libmuscle/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ ifeq "$(filter $(MAKECMDGOALS),$(cleantargets))" ""
EXTRA_LINK_DIRS := $(foreach DIR,$(DEP_DIRS),-Wl,-rpath,$(DIR)/lib)

CXXFLAGS += -I$(libmuscle_testdir) -isystem $(googletest_ROOT)/include -pthread
CXXFLAGS += $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(PKG_CONFIG_EXTRA_DIRS) ; pkg-config --cflags msgpack)
# CXXFLAGS += $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(PKG_CONFIG_EXTRA_DIRS) ; pkg-config --cflags msgpack) # Keep this line anyways, may need it
CXXFLAGS += -I$(MSGPACK_INCLUDE_DIR)
CXXFLAGS += -DTESTING $(DEBUGFLAGS)

LDFLAGS += $(CURDIR)/../libmuscle_d.a $(CURDIR)/../../ymmsl/libymmsl_d.a
LDFLAGS += $(googletest_LIB) -pthread

LDFLAGS2 := $(LDFLAGS)
LDFLAGS2 += $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(PKG_CONFIG_EXTRA_DIRS) ; pkg-config --libs msgpack)
# LDFLAGS2 += $(shell export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(PKG_CONFIG_EXTRA_DIRS) ; pkg-config --libs msgpack)
LDFLAGS2 += $(EXTRA_LINK_DIRS)

-include $(deps)
Expand Down
29 changes: 15 additions & 14 deletions libmuscle/cpp/build/msgpack/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ all: msgpack

.PHONY: install
install: msgpack
mkdir -p $(PREFIX)/lib
cp -a msgpack/lib/* $(PREFIX)/lib/
# mkdir -p $(PREFIX)/lib
# cp -a msgpack/lib/* $(PREFIX)/lib/ # Commented: MessagePack 7.0.0 is header-only
mkdir -p $(PREFIX)/include
cp -a msgpack/include/* $(PREFIX)/include/

Expand All @@ -17,28 +17,29 @@ distclean: clean
rm -rf $$(find . -type d -name 'msgpack-*')
rm -rf msgpack

MSGPACK_LIB=$(CURDIR)/msgpack/lib/libmsgpackc.a
MSGPACK_SRC=$(CURDIR)/msgpack-$(msgpack_VERSION)/ChangeLog
# MSGPACK_LIB=$(CURDIR)/msgpack/lib/libmsgpackc.a # Commented: MessagePack 7.0.0 is header-only
MSGPACK_INCLUDE_DIR=$(CURDIR)/msgpack/include
MSGPACK_SRC=$(CURDIR)/msgpack-cxx-$(msgpack_VERSION)/ChangeLog

msgpack-$(msgpack_VERSION).tar.gz:
$(DOWNLOAD) https://github.com/msgpack/msgpack-c/releases/download/cpp-$(msgpack_VERSION)/msgpack-$(msgpack_VERSION).tar.gz
msgpack-cxx-$(msgpack_VERSION).tar.gz:
$(DOWNLOAD) https://github.com/msgpack/msgpack-c/releases/download/cpp-$(msgpack_VERSION)/msgpack-cxx-$(msgpack_VERSION).tar.gz

$(MSGPACK_SRC): msgpack-$(msgpack_VERSION).tar.gz
$(TAR) xf msgpack-$(msgpack_VERSION).tar.gz -m
$(MSGPACK_SRC): msgpack-cxx-$(msgpack_VERSION).tar.gz
$(TAR) xf msgpack-cxx-$(msgpack_VERSION).tar.gz -m

$(MSGPACK_LIB): $(MSGPACK_SRC)
cd msgpack-$(msgpack_VERSION) && rm -rf build && mkdir -p build && cd build && \
$(MSGPACK_INCLUDE_DIR): $(MSGPACK_SRC)
cd msgpack-cxx-$(msgpack_VERSION) && rm -rf build && mkdir -p build && cd build && \
export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$(PKG_CONFIG_EXTRA_DIRS) && \
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=$(CURDIR)/msgpack -DMSGPACK_CXX11=ON -DMSGPACK_BUILD_EXAMPLES=OFF -DMSGPACK_BUILD_TESTS=OFF .. && \
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DMSGPACK_USE_BOOST=OFF -DCMAKE_INSTALL_PREFIX=$(CURDIR)/msgpack -DMSGPACK_CXX11=ON -DMSGPACK_BUILD_EXAMPLES=OFF -DMSGPACK_BUILD_TESTS=OFF .. && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the CMAKE_POLICY_VERSION_MINIMUM still needed when building 7.0.0.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake does NOT like when I do that, so my recommendation is to keep it for now.

$(MAKE) -j $(NCORES) && make install

ifdef MUSCLE_LINUX

msgpack: $(MSGPACK_LIB)
msgpack: $(MSGPACK_INCLUDE_DIR)

else ifdef MUSCLE_MACOS

msgpack: $(MSGPACK_LIB)
install_name_tool -id $(CURDIR)/msgpack/lib/libmsgpackc.dylib $(CURDIR)/msgpack/lib/libmsgpackc.dylib
msgpack: $(MSGPACK_INCLUDE_DIR)
# install_name_tool -id $(CURDIR)/msgpack/lib/libmsgpackc.dylib $(CURDIR)/msgpack/lib/libmsgpackc.dylib

endif
3 changes: 1 addition & 2 deletions libmuscle/cpp/src/libmuscle/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,5 +1097,4 @@ DataConstRef DataConstRef::grid_data_<bool>(
}
}

} } // namespace libmuscle::_MUSCLE_IMPL_NS

} } // namespace libmuscle::_MUSCLE_IMPL_NS
1 change: 0 additions & 1 deletion libmuscle/cpp/src/libmuscle/mpp_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@ DataConstRef MPPMessage::as_dict_() const {
}

} }

1 change: 0 additions & 1 deletion libmuscle/cpp/src/libmuscle/tests/test_communicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,3 @@ TEST_F(libmuscle_communicator2, test_shutdown) {

ASSERT_TRUE(expected_receivers.empty());
}

Loading