diff --git a/Dockerfile.dev b/Dockerfile.dev index f3b9f567e..d76d68d86 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -70,15 +70,15 @@ RUN pip install \ # Build & Install libxil COPY thirdparty/libxil /tmp/libxil -RUN mkdir -p /tmp/libxil/build && cd /tmp/libxil/build && cmake .. && make install +RUN mkdir -p /tmp/libxil/build && cd /tmp/libxil/build && cmake -DLIB_SUFFIX=64 .. && make install # Build & Install Criterion COPY thirdparty/criterion /tmp/criterion -RUN mkdir -p /tmp/criterion/build && cd /tmp/criterion/build && cmake .. && make install +RUN mkdir -p /tmp/criterion/build && cd /tmp/criterion/build && cmake -DCMAKE_INSTALL_LIBDIR=/usr/local/lib64 .. && make install # Build & Install libwebsockets COPY thirdparty/libwebsockets /tmp/libwebsockets -RUN mkdir -p /tmp/libwebsockets/build && cd /tmp/libwebsockets/build && cmake -DLWS_IPV6=1 -DLWS_WITH_STATIC=0 -DLWS_WITHOUT_TESTAPPS=1 -DLWS_WITH_HTTP2=1 .. && make install +RUN mkdir -p /tmp/libwebsockets/build && cd /tmp/libwebsockets/build && cmake -DLWS_IPV6=1 -DLWS_WITH_STATIC=0 -DLWS_WITHOUT_TESTAPPS=1 -DLWS_WITH_HTTP2=1 -DLIB_SUFFIX=64 .. && make install # Cleanup intermediate files from builds RUN rm -rf /tmp/* @@ -87,6 +87,9 @@ RUN rm -rf /tmp/* EXPOSE 80 EXPOSE 443 +ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig +ENV LD_LIBRARY_PATH /usr/local/lib:/usr/local/lib64 + #ADD https://villas.fein-aachen.org/packages/villas.repo /etc/yum.repos.d/ ENTRYPOINT villas diff --git a/Makefile b/Makefile index 03c7d75c8..65b6a1db3 100644 --- a/Makefile +++ b/Makefile @@ -50,12 +50,8 @@ CFLAGS += -std=c11 -MMD -mcx16 CFLAGS += -Wall -Werror -fdiagnostics-color=auto LDFLAGS += -L$(BUILDDIR) -# Some environment variables to increase compatability with Fedora and other distros -export PKG_CONFIG_PATH := /usr/local/lib/pkgconfig:/usr/lib/pkgconfig:$(PKG_CONFIG_PATH) -export LD_LIBRARY_PATH := /usr/local/lib:/usr/lib:$(LD_LIBRARY_PATH) - # Some tools -PKGCONFIG := PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config +PKGCONFIG := PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:$(PKG_CONFIG_PATH) pkg-config # We must compile without optimizations for gcov! ifdef DEBUG @@ -111,8 +107,8 @@ PKGS = libconfig ######## Targets ######## # Add flags by pkg-config -CFLAGS += $(shell pkg-config --cflags ${PKGS}) -LDLIBS += $(shell pkg-config --libs ${PKGS}) +CFLAGS += $(shell $(PKGCONFIG) --cflags ${PKGS}) +LDLIBS += $(shell $(PKGCONFIG) --libs ${PKGS}) all: src plugins tools src plugins tools tests: lib diff --git a/lib/Makefile.inc b/lib/Makefile.inc index 1c4543aee..8287b49ac 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -32,9 +32,6 @@ LIB_CFLAGS = $(CFLAGS) -fPIC -include $(patsubst %, lib/Makefile.%.inc, $(SONAMES)) -# Add flags by pkg-config -LIB_CFLAGS += $(shell pkg-config --cflags ${LIB_PKGS}) - # Compile $(BUILDDIR)/lib/%.o: lib/%.c $(BUILDDIR)/defines | $$(dir $$@) $(CC) $(LIB_CFLAGS) -c $< -o $@ diff --git a/lib/Makefile.villas.inc b/lib/Makefile.villas.inc index aef409a0a..ab5aeabeb 100644 --- a/lib/Makefile.villas.inc +++ b/lib/Makefile.villas.inc @@ -39,11 +39,6 @@ LIB_LDLIBS = $(LDLIBS) -ldl -lrt -Wl,-soname,$(LIB_NAME).so.$(LIB_ABI_VERSION) LIB_PKGS += libwebsockets openssl -ifneq ($(shell $(PKGCONFIG) --print-errors $(LIB_PKGS); echo $$?),0) -$(error Please install missing dependencies: make install-thirdparty) -endif - - ######## Node types ######## # Enable Socket node type when libnl3 is available @@ -59,11 +54,12 @@ endif # Enable VILLASfpga support when libxil is available ifndef WITHOUT_FPGA ifeq ($(shell $(PKGCONFIG) libxil; echo $$?),0) - LIB_SRCS += $(addprefix lib/nodes/, fpga.c) - LIB_SRCS += $(addprefix lib/kernel/, pci.c vfio.c) - PKGS += libxil + LIB_SRCS += $(addprefix lib/nodes/, fpga.c) \ + $(addprefix lib/kernel/, pci.c vfio.c) \ + $(wildcard lib/fpga/*.c) \ + $(wildcard lib/fpga/ips/*.c) - -include lib/fpga/Makefile.inc + LIB_PKGS += libxil endif endif diff --git a/lib/fpga/Makefile.inc b/lib/fpga/Makefile.inc deleted file mode 100644 index e3e774c25..000000000 --- a/lib/fpga/Makefile.inc +++ /dev/null @@ -1,30 +0,0 @@ -# Makefile. -# -# @author Steffen Vogel -# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC -# @license GNU General Public License (version 3) -# -# VILLASnode -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -################################################################################### - -# Enable VILLASfpga support when libxil is available -ifndef WITHOUT_FPGA -ifeq ($(shell pkg-config libxil; echo $$?),0) - LIB_SRCS += $(wildcard lib/fpga/*.c) -endif -endif - --include lib/fpga/ips/Makefile.inc \ No newline at end of file diff --git a/lib/fpga/ips/Makefile.inc b/lib/fpga/ips/Makefile.inc deleted file mode 100644 index fcc5e7824..000000000 --- a/lib/fpga/ips/Makefile.inc +++ /dev/null @@ -1,28 +0,0 @@ -# Makefile. -# -# @author Steffen Vogel -# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC -# @license GNU General Public License (version 3) -# -# VILLASnode -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -################################################################################### - -# Enable VILLASfpga support when libxil is available -ifndef WITHOUT_FPGA -ifeq ($(shell pkg-config libxil; echo $$?),0) - LIB_SRCS += $(wildcard lib/fpga/ips/*.c) -endif -endif \ No newline at end of file diff --git a/src/Makefile.inc b/src/Makefile.inc index 6153715fd..c88b73c5c 100644 --- a/src/Makefile.inc +++ b/src/Makefile.inc @@ -34,7 +34,7 @@ SRC_CFLAGS = $(CFLAGS) SRC_LDFLAGS = $(LDFLAGS) -Wl,-rpath,'$$ORIGIN' # Enable VILLASfpga support when libxil is available -ifeq ($(shell pkg-config libxil; echo $$?),0) +ifeq ($(shell $(PKGCONFIG) libxil; echo $$?),0) LIB_SRCS += $(addprefix lib/nodes/, fpga.c) LIB_SRCS += $(addprefix lib/kernel/, pci.c vfio.c) LIB_SRCS += $(wildcard lib/fpga/*.c) @@ -42,7 +42,7 @@ ifeq ($(shell pkg-config libxil; echo $$?),0) PKGS += libxil # Add support for LAPACK / BLAS benchmarks / solvers - ifeq ($(shell pkg-config blas lapack; echo $$?),0) + ifeq ($(shell $(PKGCONFIG) blas lapack; echo $$?),0) PKGS += blas lapack BENCH_OBJS += fpga-bench-overruns.o endif diff --git a/thirdparty/Makefile.inc b/thirdparty/Makefile.inc index bed6b87e3..cd4b0ed43 100644 --- a/thirdparty/Makefile.inc +++ b/thirdparty/Makefile.inc @@ -44,6 +44,7 @@ $(DEPS_AUTOCONF): | $(BUILDDIR)/thirdparty/$$@/ # Install & compile CMake based projects $(DEPS_CMAKE): | $(BUILDDIR)/thirdparty/$$@/ cmake -DCMAKE_INSTALL_PREFIX:PATH=$(PREFIX) \ + -DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib64 -DLIB_SUFFIX=64 \ -H$(SRCDIR)/thirdparty/$@ \ -B$(BUILDDIR)/thirdparty/$@ $(CMAKE_OPTS) make -C$(BUILDDIR)/thirdparty/$@