Makerules 1.59 KB
Newer Older
1
2
3
4
5
6
7
8
CC       = gcc
MPICC    = gcc #mpicc
RM_F_V   = rm -f -v
PWD      = $(shell pwd)
export CC
export MPICC
export RM_F_V
export PWD
9
10
11

OBJS_DIR := $(PWD)/objs

12
13
SVN_REV := $(shell svnversion -n .)
DATE_REV := $(shell date '+%F %T')
14

thomasl's avatar
thomasl committed
15
NUM_CORES:=$(shell cat /proc/cpuinfo | grep processor | wc -l)
16

17
# Check for libraries and export cflags/linker variables
18
NETTLE_FOUND    = $(shell if pkg-config --exists nettle; then echo "1" ; else echo "0"; fi)
19
20
21
22
ifeq ($(NETTLE_FOUND), 1)
NETTLE_LIBS     = `pkg-config --libs nettle`
endif

23
OPENSSL_FOUND   = $(shell if pkg-config --exists openssl; then echo "1" ; else echo "0"; fi)
24
25
26
27
ifeq ($(OPENSSL_FOUND), 1)
OPENSSL_LIBS     = `pkg-config --libs openssl`
endif

28
PGM_FOUND       = $(shell if pkg-config --exists openpgm-5.1; then echo "1" ; else echo "0"; fi)
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
ifeq ($(PGM_FOUND), 1)
PGM_CFLAGS  = `pkg-config --cflags openpgm-5.1`
PGM_LIBS    = `pkg-config --libs openpgm-5.1`
endif

LIBXML2_FOUND   = $(shell if pkg-config --exists libxml-2.0; then echo "1" ; else echo "0"; fi)
ifeq ($(LIBXML2_FOUND), 1)
LIBXML2_CFLAGS  = `pkg-config --cflags libxml-2.0`
LIBXML2_LIBS    = `pkg-config --libs libxml-2.0`
endif

XPM_FOUND       = $(shell if pkg-config --exists xpm; then echo "1" ; else echo "0"; fi)
ifeq ($(XPM_FOUND), 1)
XPM_LIBS        = `pkg-config --libs xpm`
endif

LIBBLAS_FOUND   = $(shell if [ -f /usr/include/cblas.h ]; then echo "1"; else echo "0"; fi)
ifeq ($(LIBBLAS_FOUND), 1)
LIBBLAS_LIBS    = -lblas
else
echo "libblas not found, please install it"
endif

#Export common libs
LIBS =  \
    -lm                 \
    $(LIBBLAS_LIBS)     \
    $(LIBXML2_LIBS)     \
    $(XPM_LIBS)