1# GRIDXC helper mk
2#
3# In order to hide the structure of this hierarchy, this file
4# will export the needed symbols for a client.
5#
6# All you need is to define GRIDXC_ROOT in your makefile
7# to point to your installation of the gridxc library.
8#
9# This version is intended for installation trees with possibly
10# 'serial' and 'mpi' subtrees, as generated by using the
11# 'build.sh' script in the libGridXC distribution.
12# The actual library used is controlled by the setting of
13# the variable WITH_MPI in client makefiles which 'include'
14# this file.
15#
16#----------------------------------------------------------
17#
18GRIDXC_USES_LIBXC=0
19GRIDXC_USES_MPI=0
20#
21ifeq ($(GRIDXC_USES_MPI),1)
22  $(info GRIDXC includes MPI support)
23  GRIDXC_MPI_INCFLAGS= -I $(GRIDXC_ROOT)/mpi/include $(LIBXC_INCFLAGS)
24  GRIDXC_MPI_LIBS=$(GRIDXC_ROOT)/mpi/lib/libGridXC.a $(LIBXC_LIBS)
25endif
26#
27ifeq ($(GRIDXC_USES_LIBXC),1)
28 $(info GRIDXC was compiled with libxc support)
29 #
30 ifndef LIBXC_ROOT
31   $(error you need to define LIBXC_ROOT in your arch.make)
32 endif
33 #
34 include $(GRIDXC_ROOT)/libxc.mk
35 #
36else
37 #
38 LIBXC_INCFLAGS=
39 LIBXC_LIBS=
40endif
41#
42GRIDXC_SERIAL_INCFLAGS= -I $(GRIDXC_ROOT)/serial/include $(LIBXC_INCFLAGS)
43GRIDXC_SERIAL_LIBS=$(GRIDXC_ROOT)/serial/lib/libGridXC.a $(LIBXC_LIBS)
44#
45ifdef WITH_MPI
46 ifneq ($(GRIDXC_USES_MPI),1)
47   $(error GRIDXC was not compiled with MPI support)
48 endif
49 GRIDXC_LIBS = $(GRIDXC_MPI_LIBS)
50 GRIDXC_INCFLAGS = $(GRIDXC_MPI_INCFLAGS)
51else
52 GRIDXC_LIBS = $(GRIDXC_SERIAL_LIBS)
53 GRIDXC_INCFLAGS = $(GRIDXC_SERIAL_INCFLAGS)
54endif
55