xref: /petsc/makefile (revision db420c8c83c2229585576be8e0331b4bf553988e)
1
2#
3# This is the makefile for installing TAO. See the file
4# docs/installation.html for directions on installing TAO.
5# See also bmake/common for additional commands.
6#
7ALL: all
8
9# Call make recursively in these directory
10DIRS = src include docs tests
11
12include ${PETSC_DIR}/${PETSC_ARCH}/conf/petscvariables
13include ${TAO_DIR}/conf/tao_base
14
15#
16# Basic targets to build TAO libraries.
17# all     : builds the C/C++ and Fortran libraries
18all       : tao_info tao_chk_tao_dir tao_chk_lib_dir tao_deletelibs tao_build tao_shared
19#
20# Prints information about the system and version of TAO being compiled
21#
22tao_info:
23	-@echo "=========================================="
24	-@echo " "
25	-@echo "Please send EVERYTHING printed out below when"
26	-@echo "reporting problems to tao-comments@mcs.anl.gov"
27	-@echo " "
28	-@echo "To subscribe to the TAO users mailing list, please "
29	-@echo "visit https://lists.mcs.anl.gov/mailman/listinfo/tao-news"
30	-@echo " "
31	-@echo "=========================================="
32	-@echo On `date` on `hostname`
33	-@echo Machine characteristics: `uname -a`
34	-@echo "-----------------------------------------"
35	-@echo "Using PETSc directory: ${PETSC_DIR}"
36	-@echo "Using PETSc arch: ${PETSC_ARCH}"
37	-@echo "Using TAO directory: ${TAO_DIR}"
38	-@echo "-----------------------------------------"
39	-@grep -e "TAO_VERSION_MAJOR" ${TAO_DIR}/include/tao_version.h | grep -v "&&" | sed "s/........//"
40	-@grep -e "TAO_VERSION_MINOR" ${TAO_DIR}/include/tao_version.h | grep -v "&&" | sed "s/........//"
41	-@grep -e "TAO_VERSION_PATCH" ${TAO_DIR}/include/tao_version.h | grep -v "&&" | sed "s/........//"
42	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
43	-@echo "-----------------------------------------"
44	-@echo "Using PETSc configure Options: ${CONFIGURE_OPTIONS}"
45	-@echo "------------------------------------------"
46	-@echo "Using C/C++ include paths: ${TAO_INCLUDE}"
47	-@echo "Using C/C++ compiler: ${PCC} ${PCC_FLAGS} ${COPTFLAGS} ${CFLAGS}"
48	-@if [ "${FC}" != "" ]; then \
49	   echo "Using Fortran include/module paths: ${PETSC_FC_INCLUDES}";\
50	   echo "Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}";\
51         fi
52	-@echo "-----------------------------------------"
53	-@echo "Using C/C++ linker: ${PCC_LINKER}"
54	-@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}"
55	-@if [ "${FC}" != "" ]; then \
56	   echo "Using Fortran linker: ${FC_LINKER}";\
57	   echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\
58         fi
59	-@echo "-----------------------------------------"
60	-@echo "Using PETSc libraries: ${PETSC_LIB}"
61	-@echo "Using TAO libraries: ${TAO_LIB}"
62	-@echo "------------------------------------------"
63	-@echo "Using mpiexec: ${MPIEXEC}"
64	-@echo "=========================================="
65
66
67
68#
69# Builds the TAO libraries
70# This target also builds fortran77 and f90 interface
71# files and compiles .F files
72#
73tao_build:
74	@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
75	@echo "========================================="
76	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} TAO_DIR=${TAO_DIR} ACTION=libfast tree
77	@${RANLIB} ${TAO_LIB_DIR}/*.${AR_LIB_SUFFIX}
78	@echo "Completed building libraries"
79	@echo "========================================="
80
81#
82
83# Deletes TAO libraries
84tao_deletelibs:
85	-${RM} -f ${TAO_LIB_DIR}/libtao*.*
86
87
88tao_shared: shared
89
90install: tao_chk_petsc_install
91	@${PYTHON} ./conf/install.py -destDir=${DESTDIR}
92
93tao_alletags:
94	-@maint/generateetags.py
95
96
97tao_testexamples:
98	-@PYTHONPATH=${TAO_DIR}/maint ./maint/runTests.py -d -e c
99
100tao_testexamples_uni:
101	-@PYTHONPATH=${TAO_DIR}/maint ./maint/runTests.py -d -e c single
102
103tao_testfortran:
104	-@PYTHONPATH=${TAO_DIR}/maint ./maint/runTests.py -d -e fortran
105
106tao_testfortran_uni:
107	-@PYTHONPATH=${TAO_DIR}/maint ./maint/runTests.py -d -e fortran single
108
109
110tao_allfortranstubs:
111	-@maint/generatefortranstubs.py ${BFORT}
112
113tao_manual:
114	cd docs/tex/manual; ${OMAKE} manual.pdf
115
116tao_deletemanpages:
117	${RM} -f ${TAO_DIR}/docs/manpages/*/*.html \
118                 ${TAO_DIR}/docs/manpages/manpages.cit
119
120tao_allmanpages: tao_htmlpages tao_deletemanpages tao_pages tao_docsetdate
121
122tao_pages:
123	@mkdir -p ${TAO_DIR}/docs/manpages/taosolver
124	@mkdir -p ${TAO_DIR}/docs/manpages/taolinesearch
125
126	-${OMAKE} ACTION=tao_manpages_buildcite tree
127	-${OMAKE} ACTION=tao_manpages tree
128	-${OMAKE} ACTION=tao_manexamples tree LOC=${TAO_DIR}
129	-maint/wwwindex.py ${TAO_DIR}
130
131
132tao_htmlpages:
133	-${OMAKE} ACTION=tao_html TAO_DIR=${TAO_DIR} PETSC_DIR=${PETSC_DIR} alltree LOC=${TAO_DIR}
134
135
136tao_docsetdate:
137	@echo "Updating generated html files with TAO version, date info";\
138        version_release=`grep '^#define TAO_VERSION_RELEASE ' include/tao_version.h |tr -s ' ' | cut -d ' ' -f 3`; \
139        version_major=`grep '^#define TAO_VERSION_MAJOR ' include/tao_version.h |tr -s ' ' | cut -d ' ' -f 3`; \
140        version_minor=`grep '^#define TAO_VERSION_MINOR ' include/tao_version.h |tr -s ' ' | cut -d ' ' -f 3`; \
141        version_patch=`grep '^#define TAO_VERSION_PATCH ' include/tao_version.h |tr -s ' ' | cut -d ' ' -f 3`; \
142        if  [ $${version_release} = 0 ]; then \
143          taoversion=tao-devel; \
144          export taoversion; \
145        elif [ $${version_release} = 1 ]; then \
146          taoversion=tao-$${version_major}.$${version_minor}-p$${version_patch}; \
147          export taoversion; \
148        else \
149          echo "Unknown TAO_VERSION_RELEASE: $${version_release}"; \
150          exit; \
151        fi; \
152	datestr=`hg tip --template "{date|shortdate}"`; \
153	export datestr; \
154	find * -type d -wholename src/docs/website -prune -o \
155	  -type f -name \*.html \
156	  -exec perl -pi -e 's^(<body.*>)^$$1\n <div id=\"version\" align=right><b>$$ENV{taoversion} $$ENV{datestr}</b></div>^i' {} \; \
157	  -exec perl -pi -e 's^(<head>)^$$1 <link rel="canonical" href="http://www.mcs.anl.gov/tao/docs/{}" />^i' {} \; ; \
158	echo "Done fixing version number, date, canonical URL info"
159
160tao_chk_lib_dir: chklib_dir
161