Ticket #7650: makefile

File makefile, 2.6 KB (added by Mitesh Patel, 13 years ago)

Updated SAGE_ROOT/makefile.

Line 
1# NUM_THREADS is the number of threads to use for parallel testing (and
2# sometime in the future, parallel building).  If this is 0, then it
3# will be set to the number of processors, with a default maximum of 8
4# -- see sage-ptest.
5#
6# The detection of number of processors might not be reliable on some
7# platforms. On a Sun SPARC T5240 (t2.math), the number of processors
8# reported by multiprocessing.cpu_count() might not correspond to the
9# actual number of processors. See ticket #6283.
10#
11# WARNING: if your machine has <= 8 cpus (according to cpu_count() and
12# you *don't* want to use that many threads for parallel doctesting,
13# change the value of NUM_THREADS to a (sensible) positive integer. If
14# cpu_count() reports > 8, then if NUM_THREADS is 0, only 8 threads will
15# be used. The default value is zero.
16NUM_THREADS=0  # 0 interpreted as min(8, multiprocessing.cpu_count())
17
18all:
19        cd spkg && ./install all 2>&1 | tee -a ../install.log
20
21clean:
22        echo "Deleted spkg/build"
23        rm -rf spkg/build
24        mkdir -p spkg/build
25        echo "Deleted spkg/archive"
26        rm -rf spkg/archive
27        mkdir -p spkg/archive
28
29distclean:
30        make clean
31        rm -rf local
32        rm -rf spkg/installed/*
33        rm -f install.log
34        rm -f test.log
35        rm -rf data
36        rm -rf dist
37        rm -rf devel
38        rm -rf doc
39        rm -rf examples
40        rm -rf sage-python
41        rm -rf spkg/build
42        rm -rf spkg/archive
43        rm -rf ipython
44        rm -rf matplotlibrc
45        rm -rf tmp
46
47TESTPRELIMS=. local/bin/sage-env && sage-starts &&
48TESTDIRS=devel/sage/doc/common devel/sage/doc/en devel/sage/doc/fr devel/sage/sage
49
50test: all
51        $(TESTPRELIMS) sage-maketest
52
53check: test
54
55testoptional: all
56        ./sage -b
57        $(TESTPRELIMS) ./sage -t -sagenb -optional $(TESTDIRS) 2>&1 | tee -a testall.log
58
59testlong: all
60        ./sage -b
61        $(TESTPRELIMS) ./sage -t -sagenb -long $(TESTDIRS) 2>&1 | tee -a testlong.log
62
63ptest: all
64        $(TESTPRELIMS) ./sage -tp $(NUM_THREADS) -sagenb $(TESTDIRS) 2>&1 | tee -a ptest.log
65
66ptestall: all
67        $(TESTPRELIMS) ./sage -tp $(NUM_THREADS) -sagenb -optional $(TESTDIRS) 2>&1 | tee -a ptest.log
68
69ptestlong: all
70        $(TESTPRELIMS) ./sage -tp $(NUM_THREADS) -sagenb -long $(TESTDIRS) 2>&1 | tee -a ptestlong.log
71
72install:
73        echo "Experimental use only!"
74        if [ "$(DESTDIR)" = "" ]; then \
75                echo "Set DESTDIR"; \
76                exit 1; \
77        fi
78        mkdir -p $(DESTDIR)
79        mkdir -p $(DESTDIR)/sage
80        mkdir -p $(DESTDIR)/bin/
81        cp -rpv * $(DESTDIR)/sage/
82        python local/bin/sage-hardcode_sage_root $(DESTDIR)/sage/sage "$(DESTDIR)"/sage
83        cp $(DESTDIR)/sage/sage $(DESTDIR)/bin/
84        cd $(DESTDIR)/bin/; ./sage -c
85
86#base:
87#       cd spkg && ./install base 2>&1 | tee -a ../install.log
88
89####################
90# useful shortcuts #
91####################
92
93gmp:
94        ./sage -i gmp