xref: /petsc/makefile (revision ac3484823236698d48492dd53574a1e0f08c9b07)
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_SUBMINOR" ${TAO_DIR}/include/tao_version.h | grep -v "&&" | sed "s/........//"
42	-@grep -e "TAO_VERSION_PATCH" ${TAO_DIR}/include/tao_version.h | grep -v "&&" | sed "s/........//"
43	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
44	-@echo "-----------------------------------------"
45	-@echo "Using PETSc configure Options: ${CONFIGURE_OPTIONS}"
46	-@echo "------------------------------------------"
47	-@echo "Using C/C++ include paths: ${TAO_INCLUDE}"
48	-@echo "Using C/C++ compiler: ${PCC} ${PCC_FLAGS} ${COPTFLAGS} ${CFLAGS}"
49	-@if [ "${FC}" != "" ]; then \
50	   echo "Using Fortran include/module paths: ${PETSC_FC_INCLUDES}";\
51	   echo "Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}";\
52         fi
53	-@echo "-----------------------------------------"
54	-@echo "Using C/C++ linker: ${PCC_LINKER}"
55	-@echo "Using C/C++ flags: ${PCC_LINKER_FLAGS}"
56	-@if [ "${FC}" != "" ]; then \
57	   echo "Using Fortran linker: ${FC_LINKER}";\
58	   echo "Using Fortran flags: ${FC_LINKER_FLAGS}";\
59         fi
60	-@echo "-----------------------------------------"
61	-@echo "Using PETSc libraries: ${PETSC_LIB}"
62	-@echo "Using TAO libraries: ${TAO_LIB}"
63	-@echo "------------------------------------------"
64	-@echo "Using mpiexec: ${MPIEXEC}"
65	-@echo "=========================================="
66
67
68
69#
70# Builds the TAO libraries
71# This target also builds fortran77 and f90 interface
72# files and compiles .F files
73#
74tao_build:
75	@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
76	@echo "========================================="
77	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} TAO_DIR=${TAO_DIR} ACTION=libfast tree
78	@${RANLIB} ${TAO_LIB_DIR}/*.${AR_LIB_SUFFIX}
79	@echo "Completed building libraries"
80	@echo "========================================="
81
82#
83
84# Deletes TAO libraries
85tao_deletelibs:
86	-${RM} -f ${TAO_LIB_DIR}/libtao*.*
87
88
89tao_shared: shared
90
91install: tao_chk_petsc_install
92	@${PYTHON} ./conf/install.py -destDir=${DESTDIR}
93
94tao_alletags:
95	-@maint/generateetags.py
96
97
98tao_testexamples:
99	-@PYTHONPATH=${TAO_DIR}/maint ./maint/runTests.py -d -e c
100
101tao_testexamples_uni:
102	-@PYTHONPATH=${TAO_DIR}/maint ./maint/runTests.py -d -e c single
103
104tao_testfortran:
105	-@PYTHONPATH=${TAO_DIR}/maint ./maint/runTests.py -d -e fortran
106
107tao_testfortran_uni:
108	-@PYTHONPATH=${TAO_DIR}/maint ./maint/runTests.py -d -e fortran single
109
110
111tao_allfortranstubs:
112	-@maint/generatefortranstubs.py ${BFORT}
113
114tao_manual:
115	cd docs/tex/manual; ${OMAKE} manual.pdf
116
117tao_deletemanpages:
118	${RM} -f ${TAO_DIR}/docs/manpages/*/*.html \
119                 ${TAO_DIR}/docs/manpages/manpages.cit
120
121tao_allmanpages: tao_htmlpages tao_deletemanpages tao_pages tao_docsetdate
122
123tao_pages:
124	@mkdir -p ${TAO_DIR}/docs/manpages/taosolver
125	@mkdir -p ${TAO_DIR}/docs/manpages/taolinesearch
126
127	-${OMAKE} ACTION=tao_manpages_buildcite tree
128	-${OMAKE} ACTION=tao_manpages tree
129	-${OMAKE} ACTION=tao_manexamples tree LOC=${TAO_DIR}
130	-maint/wwwindex.py ${TAO_DIR}
131
132
133tao_htmlpages:
134	-${OMAKE} ACTION=tao_html TAO_DIR=${TAO_DIR} PETSC_DIR=${PETSC_DIR} alltree LOC=${TAO_DIR}
135
136
137tao_docsetdate:
138	@echo "Updating generated html files with TAO version, date info";\
139        version_release=`grep '^#define TAO_VERSION_RELEASE ' include/tao_version.h |tr -s ' ' | cut -d ' ' -f 3`; \
140        version_major=`grep '^#define TAO_VERSION_MAJOR ' include/tao_version.h |tr -s ' ' | cut -d ' ' -f 3`; \
141        version_minor=`grep '^#define TAO_VERSION_MINOR ' include/tao_version.h |tr -s ' ' | cut -d ' ' -f 3`; \
142        version_subminor=`grep '^#define TAO_VERSION_SUBMINOR ' include/tao_version.h |tr -s ' ' | cut -d ' ' -f 3`; \
143        if  [ $${version_release} = 0 ]; then \
144          taoversion=tao-devel; \
145          export taoversion; \
146        elif [ $${version_release} = 1 ]; then \
147          taoversion=tao-$${version_major}.$${version_minor}.$${version_subminor}; \
148          export taoversion; \
149        else \
150          echo "Unknown TAO_VERSION_RELEASE: $${version_release}"; \
151          exit; \
152        fi; \
153	datestr=`hg tip --template "{date|shortdate}"`; \
154	export datestr; \
155	find * -type d -wholename src/docs/website -prune -o \
156	  -type f -name \*.html \
157	  -exec perl -pi -e 's^(<body.*>)^$$1\n <div id=\"version\" align=right><b>$$ENV{taoversion} $$ENV{datestr}</b></div>^i' {} \; \
158	  -exec perl -pi -e 's^(<head>)^$$1 <link rel="canonical" href="http://www.mcs.anl.gov/tao/www/{}" />^i' {} \; ; \
159	echo "Done fixing version number, date, canonical URL info"
160
161tao_chk_lib_dir: chklib_dir
162