Skip to content

Commit 90c0e78

Browse files
committed
Fixing make.inc to give original user-friendly error message on first try.
1 parent cd2e9c3 commit 90c0e78

1 file changed

Lines changed: 5 additions & 356 deletions

File tree

make.inc

Lines changed: 5 additions & 356 deletions
Original file line numberDiff line numberDiff line change
@@ -1,357 +1,6 @@
1-
#
2-
# This file is part of INDDGO.
3-
# Copyright (C) 2012, Oak Ridge National Laboratory
4-
#
5-
6-
#----------------------------------------------------------------
7-
# REQUIRED USER-SUPPLIED VARIABLE
8-
# This should be a full path to the root directory for INDDGO.
9-
# (i.e. the parent of lib_graphd, libtree_d, madness, wis, etc.)
10-
#
11-
SRC_DIR =
12-
13-
#----------------------------------------------------------------
14-
# REQUIRED USER-SUPPLIED OPTIONS
15-
# Determine which third-party software is used in the compilation.
16-
# For any enabled packages, directories need to be set in next section.
17-
# With default settings, necessary dirs are marked with #FILL IN
18-
19-
#WARNING: If HAS_PARMETIS=1, you must also set HAS_METIS=1 (metis is
20-
#included in the parmetis install).
21-
22-
# Set to 1 if building on CYGWIN
23-
# This then defines the variable _GK_ERROR_C_ which
24-
# cures a compile error when building with gcc and g++
25-
# under cygwin
26-
CYGWIN = 0
27-
28-
HAS_ARPACK = 0
29-
HAS_SUITESPARSE = 0
30-
HAS_PARMETIS = 0
31-
HAS_METIS = 0
32-
HAS_IGRAPH = 0
33-
HAS_GMP = 0
34-
HAS_GTEST = 0
35-
# Set whether serial or parallel version is desired for WIS.
36-
IS_PARALLEL = 0
37-
HAS_MADNESS = 0
38-
# madness is included in the INDDGO distribution, but can be set to 0 for serial compilation.
39-
40-
#use this to turn logging on/off
41-
LOG_ENABLED = 0
42-
43-
#----------------------------------------------------------------
44-
# OPTIONAL USER-SUPPLIED DIRECTORY VARIABLES
45-
# These are the directories to find optional third-party software.
46-
#
47-
48-
ARPACK =
49-
50-
# Directory containing SuiteSparse source code - not the directory where it
51-
# is installed
52-
SUITESPARSE = #FILL IN
53-
54-
#NOTE: the build directory is usually platform dependent.
55-
PARMETIS_SRC_DIR =
56-
PARMETIS_LIB_DIR =
57-
#NOTE: the METIS_SRC_DIR should be the directory containing programs/ and GKLib/ dirs
58-
#NOTE: when building Metis, we have seen cases where setting IDXTYPEWIDTH=64 in
59-
#metis.h on a 64-bit system fails, so we recommend leaving IDXTYPEWIDTH=32
60-
METIS_SRC_DIR = #FILL IN
61-
METIS_LIB_DIR = #FILL IN
62-
63-
64-
IGRAPH =
65-
IGRAPH_INSTALL_DIR = $(IGRAPH)/deploy
66-
67-
GMP =
68-
69-
GTEST_DIR=
70-
71-
72-
#----------------------------------------------------------------
73-
#
74-
# Compilers, Flags and System Tools
75-
#
76-
77-
CC = gcc
78-
CXX = g++
79-
# Set the following flag to 1 if you are compiling with a gcc version < 4.4
80-
OLDGCC = 0
81-
82-
CFLAGS = -O3
83-
CPPFLAGS =
84-
LDFLAGS =
85-
86-
ifeq ($(CYGWIN), 1)
87-
CFLAGS:= $(CFLAGS) -D_GK_ERROR_C_
88-
CPPFLAGS:= $(CPPFLAGS) -D_GK_ERROR_C_
89-
endif
90-
91-
ifeq ($(LOG_ENABLED), 1)
92-
CFLAGS := $(CFLAGS) -D__LOG_ENABLE__
93-
endif
94-
95-
ifeq ($(HAS_MADNESS),1)
96-
CXX = mpicxx
97-
ifeq ($(OLDGCC), 1)
98-
CFLAGS := $(CFLAGS) -D__MADNESS__ -D_OLDGCC -Wno-strict-aliasing -Wno-deprecated -ffast-math
99-
endif
100-
ifeq ($(OLDGCC), 0)
101-
CPPFLAGS := $(CPPFLAGS) -std=c++0x
102-
CFLAGS := $(CFLAGS) -D__MADNESS__ -std=c++0x -Wno-strict-aliasing -Wno-deprecated -ffast-math -march=native
103-
endif
104-
endif
105-
106-
ifeq ($(IS_PARALLEL),1)
107-
CXX = mpicxx
108-
CFLAGS := $(CFLAGS) -D__PARALLEL__ -D__OPENMP__ -fopenmp
109-
endif
110-
111-
ifeq ($(HAS_PARMETIS),1)
112-
CXX = mpicxx
113-
endif
114-
115-
#FC = gfortran
116-
#FFLAGS = -O3 -m64
117-
118-
CD = cd
119-
ECHO = echo
120-
LN = ln
121-
LNFLAGS = -s
122-
EXPORT = export
123-
CONFIGURE = ./configure
124-
MAKE = /usr/bin/make
125-
AUTOGEN = ./autogen.sh
126-
VALGRIND_COMMAND = valgrind --leak-check=yes --show-reachable=yes -v
127-
VALGRIND_FLAGS= -g -O0
128-
RM = rm
129-
RMFLAGS = -f
130-
SHELL = /bin/sh
131-
AR = ar
132-
ARFLAGS = rv
133-
RANLIB = ranlib
134-
135-
#--------------------------------------------------------
136-
# STOP: Most users should not need to edit below this
137-
#--------------------------------------------------------
138-
139-
#-------------------------------------
140-
# INDDGO internal directories
141-
#
142-
ifeq ($(SRC_DIR),)
143-
$(error User must set SRC_DIR in make.inc)
144-
endif
145-
GRAPH = $(SRC_DIR)/lib_graphd
146-
TREE = $(SRC_DIR)/lib_treed
147-
PTREE = $(SRC_DIR)/lib_ptreed
148-
WIS = $(SRC_DIR)/max_wis
149-
VIZ = $(SRC_DIR)/viz
150-
UTIL = $(SRC_DIR)/util
151-
INDDGO_LIB_DIR = $(SRC_DIR)/lib
152-
INDDGO_LIB = -L$(INDDGO_LIB_DIR)
153-
INDDGO_BIN = $(SRC_DIR)/bin
154-
SUBDIRS = $(GRAPH) $(TREE) $(PTREE) $(VIZ) $(WIS) $(UTIL)
155-
MADNESS = $(SRC_DIR)/madness
156-
MADNESS_INSTALL_DIR = $(MADNESS)/deploy
157-
UTHASH_INCDIR = -I$(SRC_DIR)/uthash-1.9.3/src
158-
159-
RUN_TEST=./run_test.sh
160-
161-
#-------------------------------------
162-
#
163-
# Sanity checking for required third-party directories using HAS_XXX flags.
164-
#
165-
ifeq ($(HAS_ARPACK),1)
166-
ifeq ($(ARPACK), )
167-
$(error When HAS_ARPACK = 1, you must define the ARPACK directory variable)
168-
endif
169-
endif
170-
171-
172-
ifeq ($(HAS_SUITESPARSE),1)
173-
ifeq ($(SUITESPARSE), )
174-
$(error When HAS_SUITESPARSE = 1, you must define the SUITESPARSE directory variable)
175-
endif
176-
endif
177-
178-
179-
ifeq ($(HAS_PARMETIS),1)
180-
ifeq ($(HAS_METIS),0)
181-
$(error When HAS_PARMETIS = 1, HAS_METIS must also be 1)
182-
endif
183-
ifeq ($(PARMETIS_LIB_DIR), )
184-
$(error When HAS_PARMETIS = 1, you must define the PARMETIS_LIB_DIR directory variable)
185-
endif
186-
ifeq ($(PARMETIS_SRC_DIR), )
187-
$(error When HAS_PARMETIS = 1, you must define the PARMETIS_SRC_DIR directory variable)
188-
endif
189-
endif
190-
191-
ifeq ($(HAS_METIS),1)
192-
ifeq ($(METIS_LIB_DIR), )
193-
$(error When HAS_METIS = 1, you must define the METIS_LIB_DIR directory variable)
194-
endif
195-
ifeq ($(METIS_SRC_DIR), )
196-
$(error When HAS_METIS = 1, you must define the METIS_SRC_DIR directory variable)
197-
endif
198-
endif
199-
200-
ifeq ($(HAS_IGRAPH),1)
201-
ifeq ($(IGRAPH), )
202-
$(error When HAS_IGRAPH = 1, you must define the IGRAPH directory variable)
203-
endif
204-
endif
205-
206-
ifeq ($(HAS_GMP),1)
207-
ifeq ($(GMP), )
208-
$(error When HAS_GMP = 1, you must define the GMP directory variable)
209-
endif
210-
endif
211-
212-
ifeq ($(HAS_GTEST),1)
213-
ifeq ($(GTEST_DIR), )
214-
$(error When HAS_GTEST = 1, you must define the GTEST_DIR directory variable)
215-
endif
216-
endif
217-
218-
#------------------------------------------------------------------
219-
#
220-
# Setting auxiliary library variables.
221-
# If you have non-default third party builds, you may need to edit this.
222-
#
223-
224-
MPILIBS =
225-
MADLIBS = -lMADworld
226-
227-
ifeq ($(HAS_GTEST),1)
228-
LIBGTEST=libgtest.a
229-
endif
230-
231-
METIS_INCLUDES=
232-
ifeq ($(HAS_METIS),1)
233-
METIS_INCLUDES = -I$(METIS_SRC_DIR)/include -I$(METIS_SRC_DIR)/libmetis -I$(METIS_SRC_DIR)/GKlib -I$(METIS_SRC_DIR)/programs
234-
endif
235-
236-
PARMETIS_INCDIR=
237-
238-
ifeq ($(HAS_PARMETIS),1)
239-
PARMETIS_INCDIR= -I$(PARMETIS_SRC_DIR)/include
240-
endif
241-
242-
ARPACK_LIB=
243-
ifeq ($(HAS_ARPACK),1)
244-
ARPACK_LIB= -larpack_x86_64 -lgfortran
245-
endif
246-
247-
248-
#-----------------------------------------------------------------
249-
#
250-
# Start:
251-
# ARPACK Specific options.
252-
#
253-
254-
PLAT = x86_64
255-
256-
BLASdir = $(ARPACK)/BLAS
257-
LAPACKdir = $(ARPACK)/LAPACK
258-
UTILdir = $(ARPACK)/UTIL
259-
SRCdir = $(ARPACK)/SRC
260-
#
261-
DIRS = $(BLASdir) $(LAPACKdir) $(UTILdir) $(SRCdir)
262-
263-
#
264-
# %-------------------------------------------------------------------%
265-
# | Comment out the previous line and uncomment the following |
266-
# | if you already have the BLAS and LAPACK installed on your system. |
267-
# | NOTE: ARPACK assumes the use of LAPACK version 2 codes. |
268-
# %-------------------------------------------------------------------%
269-
#
270-
#DIRS = $(UTILdir) $(SRCdir)
271-
#
272-
# %---------------------------------------------------%
273-
# | The name of the libraries to be created/linked to |
274-
# %---------------------------------------------------%
275-
#
276-
ARPACKLIB = $(ARPACK)/libarpack_$(PLAT).a
277-
LAPACKLIB =
278-
BLASLIB =
279-
#
280-
ALIBS = $(ARPACKLIB) $(LAPACKLIB) $(BLASLIB)
281-
282-
#
283-
# END:
284-
# ARPACK specific options.
285-
#------------------------------------------------------------------
286-
287-
288-
#----------------------------------------------------------------
289-
#
290-
# Third party dependent flags and library settings.
291-
# You should not need to edit these in almost all cases.
292-
#
293-
294-
ifeq ($(HAS_ARPACK),1)
295-
CFLAGS := $(CFLAGS) -DHAS_ARPACK
296-
VALGRIND_FLAGS := $(VALGRINDFLAGS) -DHAS_ARPACK
297-
ARPACK_LIB := -L $(ARPACK) $(ARPACK_LIB)
298-
endif
299-
300-
METIS_LIB =
301-
VALGRIND_FLAGS=
302-
ifeq ($(HAS_METIS),1)
303-
CFLAGS := $(CFLAGS) -DHAS_METIS -D_FILE_OFFSET_BITS=64
304-
VALGRIND_FLAGS := $(VALGRINDFLAGS) -DHAS_METIS
305-
METIS_LIB := -L$(METIS_LIB_DIR) -lmetis
306-
endif
307-
308-
PARMETIS_LIB=
309-
PARMETISOBJ=
310-
ifeq ($(HAS_PARMETIS),1)
311-
CFLAGS := $(CFLAGS) -DHAS_PARMETIS
312-
PARMETISOBJ = $(METIS_LIB_DIR)/libmetis.a $(PARMETIS_LIB_DIR)/libparmetis.a
313-
PARMETIS_LIB := -L$(PARMETIS_LIB_DIR) -lparmetis
314-
endif
315-
316-
317-
GMP_INCDIR=
318-
GMP_LIB=
319-
ifeq ($(HAS_GMP),1)
320-
CFLAGS := $(CFLAGS) -DHAS_GMP
321-
VALGRIND_FLAGS := $(VALGRINDFLAGS) -DHAS_GMP
322-
GMP_INCDIR=-I$(GMP)/include
323-
GMP_LIB= -L$(GMP)/lib -lgmp
324-
325-
endif
326-
327-
328-
SSPARSE_INCDIR=
329-
SSPARSE_LIB=
330-
ifeq ($(HAS_SUITESPARSE),1)
331-
AMD = $(SUITESPARSE)/AMD
332-
UFCONFIG = $(SUITESPARSE)/SuiteSparse_config
333-
CFLAGS := $(CFLAGS) -DHAS_SUITESPARSE
334-
VALGRIND_FLAGS := $(VALGRINDFLAGS) -DHAS_SUITESPARSE
335-
AMD_INCDIR= -I$(AMD)/Include -I$(UFCONFIG)
336-
AMD_LIB= -L$(AMD)/Lib -lamd
337-
SSPARSE_INCDIR= -I$(SUITESPARSE)/CHOLMOD/Include -I$(SUITESPARSE)/COLAMD/Include $(AMD_INCDIR)
338-
SSPARSE_LIB= -L$(SUITESPARSE)/CHOLMOD/Lib -lcholmod -L$(SUITESPARSE)/COLAMD/Lib -lcolamd $(AMD_LIB)
339-
endif
340-
341-
342-
MADNESS_INCDIR=
343-
MADNESS_LIB=
344-
ifeq ($(HAS_MADNESS),1)
345-
MADNESS_INCDIR= -I$(MADNESS_INSTALL_DIR)/include
346-
MADNESS_LIB= -L$(MADNESS_INSTALL_DIR)/lib $(MADLIBS) -lpthread
347-
SUBDIRS := $(SUBDIRS) $(MADNESS)
348-
endif
349-
350-
IGRAPH_LIB=
351-
IGRAPH_INCDIR=
352-
ifeq ($(HAS_IGRAPH),1)
353-
CFLAGS := $(CFLAGS) -DHAS_IGRAPH
354-
IGRAPH_LIB= -L $(IGRAPH_INSTALL_DIR)/lib -ligraph
355-
IGRAPH_INCDIR = -I $(IGRAPH_INSTALL_DIR)/include/igraph
356-
endif
1+
#-----------------------------------------
2+
# This is a placeholder. Users will need to copy one of
3+
# make.inc.serial, make.inc.parallel to make.inc and set
4+
# required variables (including SRC_DIR) to compile INDDGO.
3575

6+
$(error Default make.inc. Please copy one of make.inc.serial, make.inc.parallel over this file and set necessary environment variables)

0 commit comments

Comments
 (0)