Commit 9f108ac5 authored by Sergey Litvinov's avatar Sergey Litvinov
Browse files

use $(shell ...)

parent 689895fa
include ../../../conf.mk
LD = $(NCC)
UDX_CXXFLAGS = `u.pkg-config udx_cuda --cflags` \
--compiler-options '`u.pkg-config udx_cpu --cflags`' \
--compiler-options '$(CXXFLAGS)'
UDX_LDFLAGS = `u.pkg-config udx_cuda --libs` --compiler-options '`u.pkg-config udx_cpu --libs`'
LD = $(CXX)
UDX_CXXFLAGS = $(shell u.pkg-config udx_cuda --cflags)
UDX_LDFLAGS = $(shell u.pkg-config udx_cpu --libs) $(shell u.pkg-config udx_cuda --libs)
main: main.o; $(LD) $^ $(UDX_LDFLAGS) -o $@
main.o: main.cu; $(NCC) $(CXXFLAGS) $(UDX_CXXFLAGS) $< -c -o $@
main.o: main.cu; $(NCC) $(UDX_CXXFLAGS) $< -c -o $@
install: main; u.install main $(BIN)
main.o: dev.h
......
include ../../conf.mk
LD = $(NCC)
UDX_CXXFLAGS = `u.pkg-config udx_cpu --cflags`
UDX_LDFLAGS = --compiler-options `u.pkg-config udx_cuda --libs` --compiler-options `u.pkg-config udx_cpu --libs`
LD = $(CXX)
UDX_CXXFLAGS = $(shell u.pkg-config udx_cpu --cflags)
UDX_LDFLAGS = $(shell u.pkg-config udx_cpu --libs) $(shell u.pkg-config udx_cuda --libs)
main: main.o; $(LD) $< $(UDX_LDFLAGS) -o $@
main.o: main.cpp; $(CXX) $(CXXFLAGS) $(UDX_CXXFLAGS) $< -c -o $@
......
......@@ -18,7 +18,7 @@ udx_cpu.pc: udx_cpu.pc.in
sed "s|@PREFIX@|$(PREFIX)|g" $< > $@
udx_cuda.pc: udx_cuda.pc.in
CFLAGS="$(ARCH) $(NVCCFLAGS)" LIBS="$(ARCH) `./coma $(NVCCLIBS)`"; \
CFLAGS="$(ARCH) --compiler-options $(shell ./coma $(CXXFLAGS))" ; LIBS="$(NVCCLIBS)" ; \
sed -e "s|@PREFIX@|$(PREFIX)|g" \
-e "s|@CFLAGS@|$$CFLAGS|g" \
-e "s|@LIBS@|$$LIBS|g" $< > $@
......
......@@ -8,14 +8,14 @@ MPI_LIBS = -L/usr/lib64/mpich/lib -Wl,-rpath,/usr/lib64/mpich/lib -lmpichcxx -l
HDF5_LIBS = -lhdf5
NVCC_LIBS = -L${NVCC_DIR}/lib64 -Wl,-rpath,${NVCC_DIR}/lib64
libconfigL = `pkg-config --libs-only-l libconfig`
libconfigID = `pkg-config --variable=includedir libconfig`
libconfigLD = `pkg-config --variable=libdir libconfig`
libconfigL = $(shell pkg-config --libs-only-l libconfig)
libconfigID = $(shell pkg-config --variable=includedir libconfig)
libconfigLD = $(shell pkg-config --variable=libdir libconfig)
LIBCONFIG_CXXFLAGS = -I${libconfigID}
LIBCONFIG_LIBS = -L${libconfigLD} -Wl,-rpath,${libconfigLD} ${libconfigL}
BOP_CXXFLAGS = `bop-config --cflags`
BOP_LIBS = `bop-config --libs-mpi`
BOP_CXXFLAGS = $(shell bop-config --cflags)
BOP_LIBS = $(shell bop-config --libs-mpi)
CXXFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-unused-function
MPI_VARIANT = mpich
MPI_CXXFLAGS = `pkg-config --cflags ${MPI_VARIANT}`
MPI_LIBS = `pkg-config --libs ${MPI_VARIANT}`
MPI_CXXFLAGS = $(shell pkg-config --cflags ${MPI_VARIANT})
MPI_LIBS = $(shell pkg-config --libs ${MPI_VARIANT})
HDF5_VARIANT = hdf5-mpich
HDF5_CXXFLAGS = `pkg-config --cflags ${HDF5_VARIANT}`
HDF5_LIBS = `pkg-config --libs ${HDF5_VARIANT}`
HDF5_CXXFLAGS = $(shell pkg-config --cflags ${HDF5_VARIANT})
HDF5_LIBS = $(shell pkg-config --libs ${HDF5_VARIANT})
libconfigL = `pkg-config --libs-only-l libconfig`
libconfigID = `pkg-config --variable=includedir libconfig`
libconfigLD = `pkg-config --variable=libdir libconfig`
libconfigL = $(shell pkg-config --libs-only-l libconfig)
libconfigID = $(shell pkg-config --variable=includedir libconfig)
libconfigLD = $(shell pkg-config --variable=libdir libconfig)
LIBCONFIG_CXXFLAGS = -I${libconfigID}
LIBCONFIG_LIBS = -L${libconfigLD} -Wl,-rpath -Wl,${libconfigLD} ${libconfigL}
BOP_CXXFLAGS = `bop-config --cflags`
BOP_LIBS = `bop-config --libs-mpi`
BOP_CXXFLAGS = $(shell bop-config --cflags)
BOP_LIBS = $(shell bop-config --libs-mpi)
# Ubuntu 16.04: https://github.com/BVLC/caffe/issues/4046
NVCCFLAGS += -D_FORCE_INLINES
......
......@@ -6,5 +6,5 @@ includedir=${prefix}/include
Name: udx_cuda
Version: 0.1
Description: udx cuda flags
Libs: -L${libdir} -ludx_cpu @LIBS@
Libs: -L${libdir} -ludx_cuda @LIBS@
Cflags: -I${includedir}/udx @CFLAGS@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment