Subversion Repositories slepc-dev

Rev

Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2495 jroman 1
#
2
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3
#  SLEPc - Scalable Library for Eigenvalue Problem Computations
2575 eromero 4
#  Copyright (c) 2002-2011, Universitat Politecnica de Valencia, Spain
2495 jroman 5
#
6
#  This file is part of SLEPc.
7
#
8
#  SLEPc is free software: you can redistribute it and/or modify it under  the
9
#  terms of version 3 of the GNU Lesser General Public License as published by
10
#  the Free Software Foundation.
11
#
12
#  SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
13
#  WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
14
#  FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
15
#  more details.
16
#
17
#  You  should have received a copy of the GNU Lesser General  Public  License
18
#  along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
19
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20
#
1522 slepc 21
 
22
chkslepc_dir:
2249 jroman 23
	@mypwd=`pwd`; cd ${SLEPC_DIR} 2>&1 > /dev/null; true_SLEPC_DIR=`pwd`; cd $${mypwd} 2>&1 >/dev/null; \
1522 slepc 24
        newpwd=`echo $${mypwd} | sed "s+$${true_SLEPC_DIR}+DUMMY+g"`;\
25
        hasslepc=`echo $${mypwd} | sed "s+slepc-+DUMMY+g"`;\
26
        if [ $${mypwd} = $${newpwd} -a $${hasslepc} != $${mypwd} ]; then \
27
          echo "*********************Warning*************************" ; \
2249 jroman 28
          echo "Your SLEPC_DIR may not match the directory you are in";\
29
          echo "SLEPC_DIR " $${true_SLEPC_DIR} "Current directory" $${mypwd};\
1522 slepc 30
          echo "******************************************************" ; \
31
        fi
32
 
33
slepc_manualpages:
34
	-@if [ "${MANSEC}" != "" ] ; then \
35
	  DOCTEXT_PATH=${PETSC_DIR}/src/docs/tex/doctext; export DOCTEXT_PATH; \
36
	  ${DOCTEXT} -html \
37
		-mpath ${LOC}/docs/manualpages/${MANSEC} -heading SLEPc \
38
		-defn ${SLEPC_DIR}/src/docs/tex/doctext/html.def \
39
		-locdir ${LOCDIR} -mapref ${LOC}/docs/manualpages/manualpages.cit \
40
		${SOURCEC} ${SOURCEH}; \
41
		chmod -f g+w ${LOC}/docs/manualpages/${MANSEC}/* ; fi
42
 
2654 jroman 43
slepc_manexamples:
44
	-@base=`basename ${LOCDIR}`; \
45
        if [ "$${base}" = "tutorials" ] ; then \
46
          echo "Generating manual example links" ; \
47
          for i in ${EXAMPLESC} ${EXAMPLESF} foo ; do \
48
            if [ "$$i" != "foo" ] ; then \
49
              a=`cat $$i | ${MAPNAMES} -map ${LOC}/docs/manualpages/manualpages.cit \
50
                   -printmatch -o /dev/null | sort | uniq` ;  \
51
              for j in $$a ; do \
52
                b=`ls ${LOC}/docs/manualpages/*/$${j}.html | cut -f9` ; \
53
                l=`grep tutorials $${b} | wc -l`; \
54
                if [ $$l -le 10 ] ; then \
55
                  if [ $$l -eq 0 ] ; then \
56
                    echo "<P><H3><FONT COLOR=\"#883300\">Examples</FONT></H3>" >> $$b; \
57
                  fi; \
58
                  echo  "<A HREF=\"../../../BB\">BB</A><BR>" | sed s?BB?${LOCDIR}$$i.html?g >> $$b; \
59
                  grep -v /BODY $$b > ltmp; \
60
                  echo "</BODY></HTML>" >> ltmp; \
61
                  mv -f ltmp $$b; \
62
                fi; \
63
              done; \
64
            fi; \
65
	  done; \
66
        fi
67
 
1522 slepc 68
slepc_html:
69
	-@sed -e s?man+../?man+ROOT/docs/manualpages/? ${LOC}/docs/manualpages/manualpages.cit > /tmp/$$USER.htmlmap
70
	-@cat ${PETSC_DIR}/src/docs/mpi.www.index >> /tmp/$$USER.htmlmap
71
	-@ROOT=`echo ${LOCDIR} | sed -e s?/[a-z]*?/..?g -e s?src/??g -e s?include/??g` ;\
72
          loc=`pwd | sed -e s?\$${PETSC_DIR}?$${LOC}/?g -e s?/disks??g`;  \
73
          ${MKDIR} -p $${loc} ;\
74
          for i in ${SOURCEC} ${SOURCEF} ${SOURCEH} ${EXAMPLESC} ${EXAMPLESF} ${EXAMPLESCH} ${EXAMPLESFH} ${EXAMPLESMATLAB} foo ; do\
75
	    if [ -f $$i ]; then \
76
              iroot=`echo $$i | sed -e "s?[a-z.]*/??g"`;\
77
              IROOT=`echo $${i} | sed -e s?[.][.]??g` ;\
78
              if [ "$${IROOT}" != "$${i}" ] ; then \
79
                IROOT=".."; \
80
              else \
81
                IROOT=$${ROOT};\
82
              fi;\
83
              ${RM} $${loc}/$$i.html; \
84
              echo "<center><a href=\"$${iroot}\">Actual source code: $${iroot}</a></center><br>" > $${loc}/$$i.html; \
85
              sed -e "s/CHKERRQ(ierr);//g" -e "s/PetscFunctionReturn(0)/return(0)/g"  \
86
              -e "s/ierr [ ]*= //g"  $$i | ${C2HTML} -n  | ${PETSC_DIR}/bin/maint/fixinclude $$i $${ROOT} | \
2682 jroman 87
              egrep -v '(PetscValid|PetscFunctionBegin|PetscCheck|PetscErrorCode ierr;|#if !defined\(__|#define __|#undef __|EXTERN_C )' | \
1522 slepc 88
              ${MAPNAMES} -map /tmp/$$USER.htmlmap -inhtml | sed -e s?ROOT?$${IROOT}?g >> $${loc}/$$i.html ; \
89
	    fi; \
90
         done
91
	-@ROOT=`echo ${LOCDIR} | sed -e s?/[a-z]*?/..?g -e s?src/??g -e s?include/??g` ;\
92
          loc=`pwd | sed -e s?\$${PETSC_DIR}?$${LOC}/?g -e s?/disks??g`; ${RM} $${loc}/index.html; \
93
          cat ${SLEPC_DIR}/src/docs/manualpages-sec/header_${MANSEC} | sed -e "s?<A HREF=\"PETSC_DIR[a-z/]*\">Examples</A>?<A HREF=\"$${ROOT}/docs/manualpages/${MANSEC}\">Manual pages</A>?g" -e "s?PETSC_DIR?$${ROOT}/?g"> $${loc}/index.html; \
94
          echo "<p>" >> $${loc}/index.html
95
	-@loc=`pwd | sed -e s?\$${PETSC_DIR}?$${LOC}/?g -e s?/disks??g`;\
96
            if [ "${EXAMPLESC}" != "" ] ; then \
97
               for file in ${EXAMPLESC} foo ; do \
98
		if [ -f $$file ]; then \
99
                   cmess=`grep "static char help" $${file} | cut -d\" -f2 | cut -d\. -f1`; \
100
                   echo "<a href=\"$${file}.html\">$${file}: $${cmess}</a><br>" >> $${loc}/index.html;\
101
		fi; \
102
               done ;\
103
            else \
104
               for file in ${DIRS} foo; do \
105
		 if [ -d $$file ]; then \
106
                   echo "<a href=\"$${file}/\">$${file}/</a><br>" >> $${loc}/index.html; \
107
		 fi; \
108
               done; \
109
               echo " " >> $${loc}/index.html; \
110
               for file in ${SOURCEH} ${SOURCEC} ${SOURCEF} foo ; do \
111
		 if [ -f $$file ]; then \
112
                   echo "<a href=\"$${file}.html\">$${file}</a><br>" >> $${loc}/index.html; \
113
		 fi; \
114
               done; \
115
            fi ;\
116
            echo " " >> $${loc}/index.html; \
117
            echo "<a href=\"makefile.html\">makefile</a><br>" >> $${loc}/index.html
118
	-@loc=`pwd | sed -e s?\$${PETSC_DIR}?$${LOC}/?g -e s?/disks??g`;  \
119
	   cat makefile | ${C2HTML}  | ${MAPNAMES} -map /tmp/$$USER.htmlmap -inhtml > $${loc}/makefile.html
120
	-@${RM} /tmp/$$USER.htmlmap tmp
1714 jroman 121
 
2495 jroman 122
slepc_tree: ${ACTION}
2266 jroman 123
	-@for dir in ${DIRS} ftn-auto ftn-custom f90-custom; do \
124
            if [ -d $$dir ]; then \
2278 eromero 125
              if [ "${PETSC_ARCH}" = "arch-installed-petsc" ]; then \
2277 jroman 126
                PETSCCONF="${PETSC_DIR}/include/petscconf.h" ; \
127
              else \
128
                PETSCCONF="${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h" ; \
129
              fi; \
2266 jroman 130
	      r=`grep -w requirespackage $$dir/makefile`; \
131
              if [ "$$?" = 0 ]; then \
132
		PKGFLG=`echo $$r | cut -d \' -f2`;\
2277 jroman 133
                grep -w "#define $${PKGFLG}" $${PETSCCONF} > /dev/null; \
2266 jroman 134
                if [ "$$?" = 1 ]; then \
2395 jroman 135
                  continue; \
2266 jroman 136
                fi; \
137
              fi; \
138
	      r=`grep -w requiresfunction $$dir/makefile`; \
139
              if [ "$$?" = 0 ]; then \
140
		PKGFLG=`echo $$r | cut -d \' -f2`;\
2277 jroman 141
                grep -w "#define $${PKGFLG}" $${PETSCCONF} > /dev/null; \
2266 jroman 142
                if [ "$$?" = 1 ]; then \
2395 jroman 143
                  continue; \
2266 jroman 144
                fi; \
145
              fi; \
146
	      r=`grep -w requiresdefine $$dir/makefile`; \
147
              if [ "$$?" = 0 ]; then \
148
		PKGFLG=`echo $$r | cut -d \' -f2`;\
149
                grep -w "#define $${PKGFLG}" ${SLEPC_DIR}/${PETSC_ARCH}/include/slepcconf.h > /dev/null; \
150
                if [ "$$?" = 1 ]; then \
2277 jroman 151
                  grep -w "#define $${PKGFLG}" $${PETSCCONF} > /dev/null; \
2267 jroman 152
                  if [ "$$?" = 1 ]; then \
2395 jroman 153
                    continue; \
2266 jroman 154
                  fi; \
155
                fi; \
156
              fi; \
157
              r=`grep -w requireslanguage $$dir/makefile`; \
158
              if [ "$$?" = 0 ]; then \
159
                echo $$r | grep -w ${PETSC_LANGUAGE} > /dev/null; \
160
                if [ "$$?" = 1 ]; then \
161
                  continue; \
162
                fi; \
163
              fi; \
164
              r=`grep -w requiresscalar $$dir/makefile`; \
165
              if [ "$$?" = 0 ]; then \
166
                echo $$r |  grep -w ${PETSC_SCALAR} > /dev/null; \
167
                if [ "$$?" = 1 ]; then \
168
                  continue; \
169
                fi; \
170
              fi; \
171
              r=`grep -w requiresprecision $$dir/makefile`; \
172
              if [ "$$?" = 0 ]; then \
173
                echo $$r |  grep -w ${PETSC_PRECISION} > /dev/null; \
174
                if [ "$$?" = 1 ]; then \
175
                  continue; \
176
                fi; \
177
              fi; \
178
            else \
179
              continue; \
180
            fi; \
181
            (cd $$dir ; \
182
            echo ${ACTION} in: `pwd`; \
2495 jroman 183
            ${OMAKE} slepc_tree ACTION=${ACTION}  PETSC_ARCH=${PETSC_ARCH} LOC=${LOC} DATAFILESPATH=${DATAFILESPATH} BASE_DIR=${BASE_DIR});\
2266 jroman 184
	  done
185
 
2734 jroman 186
# builds the SLEPc shared library
187
slepc_shared:
188
	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} SLEPC_DIR=${SLEPC_DIR} OTHERSHAREDLIBS="${PETSC_LIB}" shared_nomesg
189
 
2477 jroman 190
# uses the cmake infrastructure to build/rebuild the libraries
191
slepc_cmake:
2484 jroman 192
	@if [ "${SLEPC_BUILD_USING_CMAKE}" != "" ]; then \
193
	   ${OMAKE} -j ${MAKE_NP} -C ${SLEPC_DIR}/${PETSC_ARCH}; \
194
	 else \
195
           echo "CMake builds are disabled"; \
196
	 fi
2477 jroman 197
 
2495 jroman 198
include ${PETSC_DIR}/conf/rules
1714 jroman 199
include ${SLEPC_DIR}/${PETSC_ARCH}/conf/slepcrules