Subversion Repositories slepc-dev

Rev

Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 dsic.upv.es!jroman 1
#
2
# This is the makefile for installing SLEPc. See the Users Manual
3
# for directions on installing SLEPc.
4
#
5
ALL: all
6
LOCDIR = .
7
DIRS   = src include docs
8
 
9
include ${SLEPC_DIR}/bmake/slepc_common
10
 
11
#
12
# Basic targets to build SLEPc libraries.
13
# all: builds the C/C++ and Fortran libraries
14
all:
785 dsic.upv.es!antodo 15
	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} chkpetsc_dir
16
	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} chkslepc_dir
1003 slepc 17
	-@${OMAKE} all_build 2>&1 | tee make_log_${PETSC_ARCH}
785 dsic.upv.es!antodo 18
	-@egrep -i "( error | error:)" make_log_${PETSC_ARCH} > /dev/null; if [ "$$?" = "0" ]; then \
19
           echo "********************************************************************"; \
20
           echo "  Error during compile, check make_log_${PETSC_ARCH}"; \
21
           echo "  Send it and configure.log to slepc-maint@grycap.upv.es";\
22
           echo "********************************************************************"; \
23
           exit 1; fi
24
 
25
all_build: chk_petsc_dir chk_slepc_dir chklib_dir info deletelibs build shared
6 dsic.upv.es!jroman 26
#
27
# Prints information about the system and version of SLEPc being compiled
28
#
29
info:
30
	-@echo "=========================================="
31
	-@echo On `date` on `hostname`
32
	-@echo Machine characteristics: `uname -a`
33
	-@echo "-----------------------------------------"
785 dsic.upv.es!antodo 34
	-@echo "Using SLEPc directory: ${SLEPC_DIR}"
35
	-@echo "Using PETSc directory: ${PETSC_DIR}"
36
	-@echo "Using PETSc arch: ${PETSC_ARCH}"
6 dsic.upv.es!jroman 37
	-@echo "-----------------------------------------"
785 dsic.upv.es!antodo 38
	-@grep "define SLEPC_VERSION" ${SLEPC_DIR}/include/slepcversion.h | ${SED} "s/........//"
6 dsic.upv.es!jroman 39
	-@echo "-----------------------------------------"
785 dsic.upv.es!antodo 40
	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
41
	-@echo "-----------------------------------------"
1078 slepc 42
	-@echo "Using PETSc configure options " ${CONFIGURE_OPTIONS}
43
	-@echo "Using SLEPc configuration flags:"
44
	-@cat ${SLEPC_DIR}/bmake/${PETSC_ARCH}/slepcconf
45
	-@echo "Using PETSc configuration flags:"
785 dsic.upv.es!antodo 46
	-@grep "\#define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h
47
	-@echo "-----------------------------------------"
48
	-@echo "Using include paths: ${SLEPC_INCLUDE} ${PETSC_INCLUDE}"
49
	-@echo "------------------------------------------"
1042 slepc 50
	-@echo "Using C/C++ compiler: ${PCC} ${PCC_FLAGS} ${COPTFLAGS} ${CFLAGS}"
785 dsic.upv.es!antodo 51
	-@echo "C/C++ Compiler version: " `${CCV}`
52
	-@if [ "${FC}" != "" ]; then \
1042 slepc 53
	   echo "Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}";\
785 dsic.upv.es!antodo 54
	   echo "Fortran Compiler version: " `${FCV}`;\
55
         fi
6 dsic.upv.es!jroman 56
	-@echo "-----------------------------------------"
1042 slepc 57
	-@echo "Using C/C++ linker: ${PCC_LINKER}"
785 dsic.upv.es!antodo 58
	-@if [ "${FC}" != "" ]; then \
59
	   echo "Using Fortran linker: ${FC_LINKER}";\
60
         fi
6 dsic.upv.es!jroman 61
	-@echo "-----------------------------------------"
785 dsic.upv.es!antodo 62
	-@echo "Using libraries: ${SLEPC_LIB}"
6 dsic.upv.es!jroman 63
	-@echo "------------------------------------------"
785 dsic.upv.es!antodo 64
	-@echo "Using mpirun: ${MPIRUN}"
6 dsic.upv.es!jroman 65
	-@echo "=========================================="
66
 
67
#
68
# Builds the SLEPc libraries
69
#
785 dsic.upv.es!antodo 70
build:
6 dsic.upv.es!jroman 71
	-@echo "BEGINNING TO COMPILE SLEPc LIBRARIES IN ALL DIRECTORIES"
72
	-@echo "========================================="
73
	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=libfast  tree
785 dsic.upv.es!antodo 74
	${RANLIB} ${SLEPC_LIB_DIR}/*.${AR_LIB_SUFFIX}
6 dsic.upv.es!jroman 75
	-@echo "Completed building SLEPc libraries"
76
	-@echo "========================================="
77
 
804 dsic.upv.es!antodo 78
# Builds SLEPc test examples for a given architecture
1098 slepc 79
test:
80
	-@echo "Running test examples to verify correct installation"
81
	@cd src/examples; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} SLEPC_DIR=${SLEPC_DIR} ex1.PETSc runex1_1
82
	@if [ "${FC}" != "" ]; then cd src/examples; ${OMAKE} PETSC_ARCH=${PETSC_ARCH} SLEPC_DIR=${SLEPC_DIR} PETSC_DIR=${PETSC_DIR} ex1f.PETSc runex1f_1; fi;
83
	-@echo "Completed test examples"
84
 
801 dsic.upv.es!antodo 85
testexamples: info
6 dsic.upv.es!jroman 86
	-@echo "BEGINNING TO COMPILE AND RUN SLEPc TEST EXAMPLES"
87
	-@echo "Due to different numerical round-off on certain"
88
	-@echo "machines some of the numbers may not match exactly."
89
	-@echo "========================================="
801 dsic.upv.es!antodo 90
	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} \
932 dsic.upv.es!antodo 91
	   ACTION=testexamples_C  tree
6 dsic.upv.es!jroman 92
	-@echo "Completed compiling and running test examples"
93
	-@echo "========================================="
94
 
804 dsic.upv.es!antodo 95
# Builds SLEPc test examples for a given architecture
801 dsic.upv.es!antodo 96
testfortran: info
6 dsic.upv.es!jroman 97
	-@echo "BEGINNING TO COMPILE AND RUN SLEPc FORTRAN TEST EXAMPLES"
98
	-@echo "========================================="
99
	-@echo "Due to different numerical round-off on certain"
100
	-@echo "machines or the way Fortran formats numbers"
101
	-@echo "some of the results may not match exactly."
102
	-@echo "========================================="
801 dsic.upv.es!antodo 103
	-@if [ "${FC}" != "" ]; then \
932 dsic.upv.es!antodo 104
	    ${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=testexamples_Fortran  tree ; \
604 dsic.upv.es!antodo 105
            echo "Completed compiling and running Fortran test examples"; \
106
          else \
107
            echo "Error: No FORTRAN compiler available"; \
108
          fi
109
	-@
6 dsic.upv.es!jroman 110
	-@echo "========================================="
111
 
804 dsic.upv.es!antodo 112
# Builds SLEPc test examples for a given architecture
801 dsic.upv.es!antodo 113
testexamples_uni: info
6 dsic.upv.es!jroman 114
	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
115
	-@echo "Due to different numerical round-off on certain"
116
	-@echo "machines some of the numbers may not match exactly."
117
	-@echo "========================================="
801 dsic.upv.es!antodo 118
	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} \
932 dsic.upv.es!antodo 119
	   ACTION=testexamples_C_X11_MPIUni  tree
6 dsic.upv.es!jroman 120
	-@echo "Completed compiling and running uniprocessor test examples"
121
	-@echo "========================================="
804 dsic.upv.es!antodo 122
 
123
# Builds SLEPc test examples for a given architecture
801 dsic.upv.es!antodo 124
testfortran_uni: info
6 dsic.upv.es!jroman 125
	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
126
	-@echo "Due to different numerical round-off on certain"
127
	-@echo "machines some of the numbers may not match exactly."
128
	-@echo "========================================="
801 dsic.upv.es!antodo 129
	-@if [ "${FC}" != "" ]; then \
932 dsic.upv.es!antodo 130
            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran_MPIUni  tree; \
604 dsic.upv.es!antodo 131
            echo "Completed compiling and running uniprocessor fortran test examples"; \
132
          else \
133
            echo "Error: No FORTRAN compiler available"; \
134
          fi
135
	-@
6 dsic.upv.es!jroman 136
	-@echo "========================================="
137
 
138
# Ranlib on the libraries
785 dsic.upv.es!antodo 139
ranlib:
6 dsic.upv.es!jroman 140
	${RANLIB} ${SLEPC_LIB_DIR}/*.${LIB_SUFFIX}
141
 
142
# Deletes SLEPc libraries
785 dsic.upv.es!antodo 143
deletelibs:
6 dsic.upv.es!jroman 144
	-${RM} -f ${SLEPC_LIB_DIR}/*
145
 
785 dsic.upv.es!antodo 146
# Cleans up build
147
allclean: deletelibs
148
	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree
6 dsic.upv.es!jroman 149
 
150
#
785 dsic.upv.es!antodo 151
# Check if PETSC_DIR variable specified is valid
152
#
153
chk_petsc_dir:
154
	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
155
	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
156
	  echo "You need to use / to separate directories, not \\!"; \
157
	  echo "Aborting build"; \
158
	  false; fi
159
#
6 dsic.upv.es!jroman 160
# Check if SLEPC_DIR variable specified is valid
161
#
162
chk_slepc_dir:
163
	@if [ ! -f ${SLEPC_DIR}/include/slepcversion.h ]; then \
164
	  echo "Incorrect SLEPC_DIR specified: ${SLEPC_DIR}!"; \
165
	  echo "You need to use / to separate directories, not \\!"; \
166
	  echo "Aborting build"; \
167
	  false; fi
168
 
1366 slepc 169
install:
170
	-@if [ "${SLEPC_INSTALL_DIR}" = "${SLEPC_DIR}" ]; then \
171
	  echo "Install directory is current directory; nothing needs to be done";\
172
        else \
173
	  echo Installing SLEPc at ${SLEPC_INSTALL_DIR};\
174
          if [ ! -d `dirname ${SLEPC_INSTALL_DIR}` ]; then \
175
	    ${MKDIR} `dirname ${SLEPC_INSTALL_DIR}` ; \
176
          fi;\
177
          if [ ! -d ${SLEPC_INSTALL_DIR} ]; then \
178
	    ${MKDIR} ${SLEPC_INSTALL_DIR} ; \
179
          fi;\
180
          cp -fr include ${SLEPC_INSTALL_DIR};\
181
          if [ ! -d ${SLEPC_INSTALL_DIR}/bmake ]; then \
182
	    ${MKDIR} ${SLEPC_INSTALL_DIR}/bmake ; \
183
          fi;\
184
          if [ ! -d ${SLEPC_INSTALL_DIR}/bmake/${PETSC_ARCH} ]; then \
185
	    ${MKDIR} ${SLEPC_INSTALL_DIR}/bmake/${PETSC_ARCH} ; \
186
          fi;\
187
          cp -fr bmake/slepc_common* ${SLEPC_INSTALL_DIR}/bmake;\
188
          cp -fr bmake/${PETSC_ARCH}/slepcconf ${SLEPC_INSTALL_DIR}/bmake/${PETSC_ARCH};\
189
          if [ ! -d ${SLEPC_INSTALL_DIR}/lib ]; then \
190
	    ${MKDIR} ${SLEPC_INSTALL_DIR}/lib ; \
191
          fi;\
192
          if [ ! -d ${SLEPC_INSTALL_DIR}/lib/${PETSC_ARCH} ]; then \
193
	    ${MKDIR} ${SLEPC_INSTALL_DIR}/lib/${PETSC_ARCH} ; \
194
          fi;\
195
          if [ -d lib/${PETSC_ARCH} ]; then \
196
            cp -fr lib/${PETSC_ARCH}/* ${SLEPC_INSTALL_DIR}/lib/${PETSC_ARCH};\
197
            ${RANLIB} ${SLEPC_INSTALL_DIR}/lib/${PETSC_ARCH}/*.a ;\
198
            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} SLEPC_DIR=${SLEPC_INSTALL_DIR} shared; \
199
          fi;\
200
          echo "sh/bash: SLEPC_DIR="${SLEPC_INSTALL_DIR}"; export SLEPC_DIR";\
201
          echo "csh/tcsh: setenv SLEPC_DIR "${SLEPC_INSTALL_DIR} ;\
202
          echo "Then do make test to verify correct install";\
203
        fi;
42 dsic.upv.es!antodo 204
 
6 dsic.upv.es!jroman 205
# ------------------------------------------------------------------
206
#
207
# All remaining actions are intended for SLEPc developers only.
208
# SLEPc users should not generally need to use these commands.
209
#
210
 
211
# Builds all the documentation
804 dsic.upv.es!antodo 212
alldoc: alldoc1 alldoc2
6 dsic.upv.es!jroman 213
 
804 dsic.upv.es!antodo 214
# Build everything that goes into 'doc' dir except html sources
1161 slepc 215
alldoc1: chk_loc deletemanualpages
42 dsic.upv.es!antodo 216
	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
804 dsic.upv.es!antodo 217
	-@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap
218
	-@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap
1161 slepc 219
	-${OMAKE} ACTION=slepc_manualpages tree_basic LOC=${LOC}
42 dsic.upv.es!antodo 220
	-${PETSC_DIR}/maint/wwwindex.py ${SLEPC_DIR} ${LOC}
804 dsic.upv.es!antodo 221
	-${OMAKE} ACTION=manexamples tree_basic LOC=${LOC}
222
 
223
# Builds .html versions of the source
224
# html overwrites some stuff created by update-docs - hence this is done later.
225
alldoc2: chk_loc
226
	-${OMAKE} ACTION=slepc_html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC}
47 dsic.upv.es!antodo 227
	cp ${LOC}/docs/manual.htm ${LOC}/docs/index.html
6 dsic.upv.es!jroman 228
 
804 dsic.upv.es!antodo 229
# Deletes man pages (HTML version)
230
deletemanualpages: chk_loc
231
	-@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \
232
          find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\
233
          ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\
234
        fi
235
 
6 dsic.upv.es!jroman 236
# Builds Fortran stub files
794 dsic.upv.es!antodo 237
allfortranstubs:
986 slepc 238
	-@${SLEPC_DIR}/config/generatefortranstubs.py ${BFORT}
6 dsic.upv.es!jroman 239
 
240
# -------------------------------------------------------------------------------
241
#
242
# Some macros to check if the fortran interface is up-to-date.
243
#
794 dsic.upv.es!antodo 244
countfortranfunctions:
1022 slepc 245
	-@for D in `find ${SLEPC_DIR}/src -name ftn-auto` \
246
	`find ${SLEPC_DIR}/src -name ftn-custom`; do cd $$D; \
247
	egrep '^void' *.c | \
248
	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f3 | uniq | egrep -v "(^$$|Petsc)" | \
1025 slepc 249
	sed "s/_$$//"; done | sort > /tmp/countfortranfunctions
6 dsic.upv.es!jroman 250
 
794 dsic.upv.es!antodo 251
countcfunctions:
1022 slepc 252
	-@ grep "EXTERN " ${SLEPC_DIR}/include/*.h | grep "(" | tr -s ' ' | \
6 dsic.upv.es!jroman 253
	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
254
	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
255
 
794 dsic.upv.es!antodo 256
difffortranfunctions: countfortranfunctions countcfunctions
257
	-@echo -------------- Functions missing in the fortran interface ---------------------
258
	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
6 dsic.upv.es!jroman 259
	-@echo ----------------- Functions missing in the C interface ------------------------
794 dsic.upv.es!antodo 260
	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
6 dsic.upv.es!jroman 261
	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
262
 
794 dsic.upv.es!antodo 263
checkbadfortranstubs:
6 dsic.upv.es!jroman 264
	-@echo "========================================="
265
	-@echo "Functions with MPI_Comm as an Argument"
266
	-@echo "========================================="
1022 slepc 267
	-@for D in `find ${SLEPC_DIR}/src -name ftn-auto`; do cd $$D; \
268
	grep '^void' *.c | grep 'MPI_Comm' | \
1025 slepc 269
	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3; done
6 dsic.upv.es!jroman 270
	-@echo "========================================="
271
	-@echo "Functions with a String as an Argument"
272
	-@echo "========================================="
1022 slepc 273
	-@for D in `find ${SLEPC_DIR}/src -name ftn-auto`; do cd $$D; \
274
	grep '^void' *.c | grep 'char \*' | \
1025 slepc 275
	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3; done
6 dsic.upv.es!jroman 276
	-@echo "========================================="
794 dsic.upv.es!antodo 277
	-@echo "Functions with Pointers to PETSc Objects as Argument"
6 dsic.upv.es!jroman 278
	-@echo "========================================="
1022 slepc 279
	-@_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
6 dsic.upv.es!jroman 280
	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
281
	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
1022 slepc 282
	_p_OBJS=`grep _p_ ${SLEPC_DIR}/include/*.h | tr -s ' ' | \
283
	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
284
	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
285
	for D in `find ${SLEPC_DIR}/src -name ftn-auto`; do cd $$D; \
286
	for OBJ in $$_p_OBJ $$_p_OBJS; do \
6 dsic.upv.es!jroman 287
	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
1022 slepc 288
	cut -d'(' -f1 | cut -d' ' -f1,4; \
1025 slepc 289
	done; done
6 dsic.upv.es!jroman 290
 
1130 slepc 291
# Generate tags with Exuberant Ctags 5.5.4
292
ctags:
293
	-@ctags -R --exclude="examples" --languages=-HTML,Make --fortran-kinds=-l include src
294
	-@egrep -v __FUNCT__\|PetscToPointer\|PetscFromPointer\|PetscRmPointer tags > tags-tmp
295
	-@mv tags-tmp tags
296