source: trunk/omh/install/unix.omh @ 3550

Last change on this file since 3550 was 3550, checked in by bradbell, 5 years ago
  1. Add get_*.sh as a index for each of the corresponding sections.
  2. Fix (and make consistent) some external web links.

version.sh: remove CMakeLists.txt.old when done with it.
cppad_colpack.cpp: add option as to type of colorring.

  • Property svn:keywords set to Id
File size: 17.3 KB
Line 
1$Id: unix.omh 3550 2015-01-01 17:57:43Z bradbell $
2/* --------------------------------------------------------------------------
3CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-14 Bradley M. Bell
4
5CppAD is distributed under multiple licenses. This distribution is under
6the terms of the
7                    Eclipse Public License Version 1.0.
8
9A copy of this license is included in the COPYING file of this distribution.
10Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
11-------------------------------------------------------------------------- */
12
13$begin InstallUnix$$
14$escape $$
15$dollar ^$$
16$spell
17        ctor
18        testvector
19        Eigen
20        colpack
21        num
22        cxx
23        boostvector
24        inv
25        fopenmp
26        openmp
27        cout
28        Addr
29        sizeof
30        op_arg
31        err_retu
32        const
33        printf
34        avector.h
35        Ipopt
36        Ip
37        gzip
38        Linux
39        fi
40        exp_apx
41        tgz
42        gpl
43        Dev
44        sed
45        cppad
46        gprof
47        config
48        stdvector
49        std
50        ublas
51        hpp
52        adouble
53        badiff
54        usr
55        cygdrive
56        htm
57        xml
58        Dir
59        xvzf
60        gz
61        workspace
62        Makefile
63        exe
64        Cygwin
65        Microsoft
66        dsw
67        CppAD
68        Adolc
69        Fadbad
70        Sacado
71        ls
72        aclocal
73        yum
74        devel
75$$
76
77$index CppAD, unix install$$
78$index unix, CppAD install$$
79$index free, unix install$$
80$index install, unix CppAD$$
81
82$section Deprecated Unix Test and Installation$$
83
84$head Deprecated$$
85These install instructions have been deprecated and no improvements
86have been added since 2012.
87For example, this install procedure will not detect any of the
88$code c++11$$ extensions.
89You should use the $cref cmake$$ instructions to install CppAD.
90
91$head Distribution Directory$$
92You must first obtain a copy of the CppAD distribution directory
93using the $cref download$$ instructions.
94The install instructions below correspond to the
95$cref/current version/download/Compressed Archives/Current Version/$$
96which has distribution directory $code cppad-20121230$$.
97
98$head Work Directory$$
99Create the directory $code cppad-20121230/build$$,
100which will be referred to as the build directory below.
101
102$head Configure$$
103Execute the following command in the build directory:
104$index configure$$
105$codei%
106./configure                                  \
107        --prefix=%prefix_dir%                     \
108        --with-Documentation                    \
109        --with-%test%vector                       \ 
110        --with-sparse_%option%                    \
111        --with-implicit_ctor                    \
112        MAX_NUM_THREADS=%max_num_threads%         \
113        CXX_FLAGS=%cxx_flags%                     \
114        OPENMP_FLAGS=%openmp_flags%               \
115        POSTFIX_DIR=%postfix_dir%                 \
116        ADOLC_DIR=%adolc_dir%                     \
117        BOOST_DIR=%boost_dir%                     \
118        EIGEN_DIR=%eigen_dir%                     \
119        FADBAD_DIR=%fadbad_dir%                   \
120        SADADO_DIR=%sacado_dir%                   \
121        IPOPT_DIR=%ipopt_dir%                     \
122        TAPE_ADDR_TYPE=%tape_addr_type%           \
123        TAPE_ID_TYPE=%tape_id_type%
124%$$
125where only the $code configure$$ line need appear; i.e.,
126the entries in all of the other lines are optional.
127The text in italic is replaced values that you choose;
128see discussion below.
129
130$head make$$
131CppAD has some object libraries that are used for its correctness tests.
132(Currently, none of these libraries get installed.)
133You can build these libraries by executing the command
134$codei%
135        make
136%$$
137in the build directory.
138
139$subhead Examples and Tests$$
140Once you have executed the $code make$$ command,
141you can run the correctness and speed tests.
142$pre
143
144$$
145The following command will build all the correctness and speed tests.
146In addition, it will run all the correctness tests:
147$codep
148        make test
149$$
150$pre
151
152$$
153The following links describe how to build and run subsets of these tests:
154$table
155$cref/get_started/get_started.cpp/Running/$$ 
156        $cnext $title get_started.cpp$$
157$rnext
158$cref/exp_apx_main/exp_apx_main.cpp/Running Tests/$$ 
159        $cnext $title exp_apx_main.cpp$$
160$rnext
161$cref/example/example.cpp/Running Tests/$$ 
162        $cnext $title example.cpp$$
163$rnext
164$cref/print_for_cout/print_for_cout.cpp/Running/$$ 
165        $cnext $title print_for_cout.cpp$$
166$rnext
167$cref/speed_example/speed_example.cpp/Running Tests/$$ 
168        $cnext $title speed_example.cpp$$
169$rnext
170$cref/speed_double/speed_double/Running Tests/$$ 
171        $cnext $title speed_double$$
172$rnext
173$cref/speed_adolc/speed_adolc/Running Tests/$$ 
174        $cnext $title speed_adolc$$
175$rnext
176$cref/speed_cppad/speed_cppad/Running Tests/$$ 
177        $cnext $title speed_cppad$$
178$rnext
179$cref/speed_fadbad/speed_fadbad/Running Tests/$$ 
180        $cnext $title speed_fadbad$$
181$rnext
182$cref/speed_sacado/speed_sacado/Running Tests/$$ 
183        $cnext $title speed_sacado$$
184$tend
185In addition,
186you can run a large subset of correctness tests
187(that are not intended to be examples)
188by executing the following commands starting in the build directory:
189$codei%
190        cd test_more
191        make test
192%$$
193
194$head Profiling CppAD$$
195$index speed, profile cppad$$
196$index profile, cppad speed$$
197$index cppad, profile speed$$
198The CppAD derivative speed tests mentioned above can be profiled.
199You can test that the results computed during this profiling are correct
200by executing the following commands starting in the build directory:
201$codei%
202        cd speed/profile
203        make test
204%$$
205After executing $code make test$$, you can run a profile speed test
206by executing the command $code ./profile$$;
207see $cref speed_main$$ for the meaning of the command line
208options to this program.
209$pre
210
211$$
212After you have run a profiling speed test,
213you can then obtain the profiling results with
214$codei%
215        gprof -b profile
216%$$
217If you are using a windows operating system with Cygwin or MinGW,
218you may have to replace $code profile$$ by $code profile.exe$$
219in the $code gprof$$ command above; i.e.,
220$codep
221        gprof -b profile.exe
222$$
223In C++, template parameters and argument types become part of a
224routines's name.
225This can make the $code gprof$$ output hard to read
226(the routine names can be very long).
227You can remove the template parameters and argument types from the
228routine names by executing the following command
229$codep
230        gprof -b profile | sed -f gprof.sed
231$$
232If you are using a windows operating system with Cygwin or MinGW,
233you would need to use
234$codep
235        gprof -b profile.exe | sed -f gprof.sed
236$$
237
238$head prefix_dir$$
239$index configure, prefix directory$$
240$index prefix, configure directory$$
241$index directory, configure prefix$$
242The default value for prefix directory is $code ^HOME$$
243i.e., by default the CppAD include files
244will $cref/install/InstallUnix/make install/$$ below $code ^HOME$$.
245If you want to install elsewhere, you will have to use this option.
246As an example of using the $codei%--prefix=%prefix_dir%$$ option,
247if you specify
248$codep
249        ./configure --prefix=/usr/local
250$$
251the CppAD include files will be installed in the directory
252$codei%
253        /usr/local/include/cppad
254%$$
255If $cref/--with-Documentation/InstallUnix/--with-Documentation/$$
256is specified, the CppAD documentation files will be installed in the directory
257$codei%
258        /usr/local/share/doc/cppad-20121230
259%$$
260
261$head --with-Documentation$$
262$index documentation, install$$
263$index install, documentation$$
264If the command line argument $code --with-Documentation$$ is specified,
265the CppAD documentation HTML and XML files are copied to the directory
266$codei%
267        %prefix_dir%/share/doc/%postfix_dir%/cppad-20121230
268%$$
269(see $cref/postfix_dir/InstallUnix/postfix_dir/$$).
270The top of the CppAD HTML documentation tree
271(with mathematics displayed as LaTex command) will be located at
272$codei%
273        %prefix_dir%/share/doc/%postfix_dir%/cppad-20121230/cppad.htm
274%$$
275and the top of the XML documentation tree
276(with mathematics displayed as MathML) will be located at
277$codei%
278        %prefix_dir%/share/doc/%postfix_dir%/cppad-20121230/cppad.xml
279%$$
280
281$head --with-testvector$$
282$index std, test vector$$
283$index boost, test vector$$
284$index eigen, test vector$$
285$index test, vector$$
286$index vector, test$$
287The $cref/CPPAD_TESTVECTOR/testvector/$$
288template class is used for many of the CppAD examples and tests.
289The default for this template class is $codei%CppAD::vector<%Scalar%>%$$.
290If one, and only one, of the following command line arguments is specified:
291$codep
292        --with-stdvector
293        --with-boostvector
294        --with-eigenvector
295$$
296the corresponding of the following template classes is used
297$codei%
298        std::vector<%Scalar%>
299        boost::numeric::ublas::vector<%Scalar%>
300        Eigen::matrix<%Scalar%, Eigen::Dynamic, 1>
301%$$
302See also,
303$cref/boost_dir/InstallUnix/boost_dir/$$
304and
305$cref/eigen_dir/InstallUnix/eigen_dir/$$.
306
307
308$head --with-sparse_option$$
309$index sparse, internal vector sets$$
310$index internal, sparse vector sets$$
311$index sets, internal sparse vector$$
312There are two options for the preprocessor symbol
313$code CPPAD_INTERNAL_SPARSE_SET$$.
314If $code --with-sparse_set$$
315($code --with-sparse_list$$) is specified,
316this symbol is $code sparse_set$$ ($code sparse_list$$).
317This should affect the speed and memory required by the
318$cref sparse_jacobian$$, $cref sparse_hessian$$, and the
319$cref/sparse drivers/sparse/$$.
320
321$head --with-implicit_ctor$$
322$index ctor, implicit or explicit$$
323$index implicit, ctor$$
324$index explicit, ctor$$
325If this configure argument is present, there is a
326$cref/deprecated/ad_ctor/x/deprecated/$$
327implicit type constructor (type conversion)
328from any type to $codei%AD<%Base%>%$$.
329Otherwise this constructor is
330$cref/explicit/ad_ctor/x/explicit/$$.
331
332
333$head max_num_threads$$
334this specifies the value for the default value for the preprocessor symbol
335$cref/CPPAD_MAX_NUM_THREADS/multi_thread/CPPAD_MAX_NUM_THREADS/$$.
336It must be greater than or equal to four; i.e.,
337$icode%max_num_threads% >= 4%$$.
338
339$head cxx_flags$$
340$index compile, unix flags$$
341$index flags, unix compile$$
342If the command line argument $icode CompilerFlags$$ is present,
343it specifies compiler flags.
344For example,
345$codei%
346        CXX_FLAGS="-Wall -ansi"
347%$$
348would specify that warning flags $code -Wall$$
349and $code -ansi$$ should be included
350in all the C++ compile commands.
351The error and warning flags chosen must be valid options
352for the C++ compiler.
353The default value for $icode CompilerFlags$$ is the
354empty string.
355
356$head openmp_flags$$
357$index OpenMP, compile flags$$
358$index compile, OpenMP flags$$
359$index flags, OpenMP compile$$
360If the command line argument $icode OpenmpFlags$$ is present,
361it specifies the necessary flags so that the compiler will
362properly interpret OpenMP directives.
363For example, when using the GNU $code g++$$ compiler,
364the following setting includes the OpenMP tests:
365$codei%
366        OPENMP_FLAGS=-fopenmp
367%$$
368If you specify configure command,
369the CppAD OpenMP correctness and speed tests will be built; see
370$cref/threading/thread_test.cpp/Running Tests/threading/$$
371multi-threading tests.
372
373$head postfix_dir$$
374$index configure, postfix directory$$
375$index postfix, configure directory$$
376$index directory, configure postfix$$
377By default, the postfix directory is empty; i.e., there
378is no postfix directory.
379As an example of using the $codei%POSTFIX_DIR=%postfix_dir%$$ option,
380if you specify
381$codep
382        ./configure --prefix=/usr/local POSTFIX_DIR=coin
383$$
384the CppAD include files will be
385$cref/installed/InstallUnix/make install/$$ in the directory
386$codei%
387        /usr/local/include/coin/cppad
388%$$
389If $cref/--with-Documentation/InstallUnix/--with-Documentation/$$
390is specified, the CppAD documentation files will be installed in the directory
391$codei%
392        /usr/local/share/doc/coin/cppad-20121230
393%$$
394
395$head adolc_dir$$
396$index Adolc, unix$$
397If you have
398$href%https://projects.coin-or.org/ADOL-C%ADOL-C%$$
399installed on your system, you can
400specify a value for $icode adolc_dir$$ in the
401$cref/configure/InstallUnix/Configure/$$ command line.
402The value of $icode adolc_dir$$ must be such that
403$codei%
404        %adolc_dir%/include/adolc/adouble.h
405%$$
406is a valid way to reference $code adouble.h$$.
407In this case, you can run the Adolc speed correctness tests
408by executing the following commands starting in the build directory:
409$codei%
410        cd speed/adolc
411        make test
412%$$
413After executing $code make test$$, you can run an Adolc speed tests
414by executing the command $code ./adolc$$;
415see $cref speed_main$$ for the meaning of the command line
416options to this program.
417Note that these speed tests assume Adolc has been configure with
418its sparse matrix computations enabled using
419$codei%
420        --with-colpack=%colpack_dir%
421%$$
422
423$subhead Linux$$
424If you are using Linux,
425you will have to add $icode%adolc_dir%/lib%$$ to $code LD_LIBRARY_PATH$$.
426For example, if you use the $code bash$$ shell to run your programs,
427you could include
428$codei%
429        LD_LIBRARY_PATH=%adolc_dir%/lib:^{LD_LIBRARY_PATH}
430        export LD_LIBRARY_PATH
431%$$
432in your $code ^HOME/.bash_profile$$ file.
433
434$subhead Cygwin$$
435If you are using Cygwin,
436you will have to add to following lines to the file
437$code .bash_profile$$ in your home directory:
438$codei%
439        PATH=%adolc_dir%/bin:^{PATH}
440        export PATH
441%$$
442in order for Adolc to run properly.
443If $icode adolc_dir$$ begins with a disk specification,
444you must use the Cygwin format for the disk specification.
445For example,
446if $code d:/adolc_base$$ is the proper directory,
447$code /cygdrive/d/adolc_base$$ should be used for $icode adolc_dir$$.
448
449$head boost_dir$$
450$index boost, unix$$
451If the command line argument
452$codei%
453        BOOST_DIR=%boost_dir%
454%$$
455is present, it must be such that files
456$codei%
457        %boost_dir%/include/boost/numeric/ublas/vector.hpp
458        %boost_dir%/include/boost/thread.hpp
459%$$
460are present.
461In this case, these files will be used by CppAD.
462See also, $cref/--with-boostvector/InstallUnix/--with-testvector/$$
463
464$head eigen_dir$$
465$index Eigen, unix$$
466If you have
467$href%http://eigen.tuxfamily.org%Eigen%$$
468installed on your system, you can
469specify a value for $icode eigen_dir$$.
470It must be such that
471$codei%
472        %eigen_dir%/include/Eigen/Core
473%$$
474is a valid include file.
475In this case CppAD will compile and test the Eigen examples; e.g.,
476$cref eigen_array.cpp$$.
477See also, $cref/--with-eigenvector/InstallUnix/--with-testvector/$$
478
479$head fadbad_dir$$
480$index Fadbad, unix$$
481If you have
482$href%
483        http://www.fadbad.com/%
484        Fadbad 2.1
485%$$
486installed on your system, you can
487specify a value for $icode fadbad_dir$$.
488It must be such that
489$codei%
490        %fadbad_dir%/include/FADBAD++/badiff.h
491%$$
492is a valid reference to $code badiff.h$$.
493In this case, you can run the Fadbad speed correctness tests
494by executing the following commands starting in the build directory:
495$codei%
496        cd speed/fadbad
497        make test
498%$$
499After executing $code make test$$, you can run a Fadbad speed tests
500by executing the command $code ./fadbad$$;
501see $cref speed_main$$ for the meaning of the command line
502options to this program.
503
504$head ipopt_dir$$
505$index Ipopt, unix$$
506If you have
507$href%
508        http://www.coin-or.org/projects/Ipopt.xml%
509        Ipopt
510%$$
511installed on your system, you can
512specify a value for $icode ipopt_dir$$.
513It must be such that
514$codei%
515        %ipopt_dir%/include/coin/IpIpoptApplication.hpp
516%$$
517is a valid reference to $code IpIpoptApplication.hpp$$.
518In this case, the CppAD interface to Ipopt
519$cref/examples/cppad_ipopt_nlp/Example/$$ can be built and tested
520by executing the following commands starting in the build directory:
521$codei%
522        make
523        #
524        cd cppad_ipopt/example
525        make test
526        #
527        cd ../test
528        make test
529        #
530        cd ../speed
531        make test
532%$$
533Once this has been done, you can execute the program
534$code ./speed$$ in the $code build/cppad_ipopt/speed$$ directory;
535see $cref ipopt_ode_speed.cpp$$.
536
537$head sacado_dir$$
538$index Sacado, unix$$
539If you have
540$href%
541        http://trilinos.sandia.gov/packages/sacado/%
542        Sacado
543%$$
544installed on your system, you can
545specify a value for $icode sacado_dir$$.
546It must be such that
547$codei%
548        %sacado_dir%/include/Sacado.hpp
549%$$
550is a valid reference to $code Sacado.hpp$$.
551In this case, you can run the Sacado speed correctness tests
552by executing the following commands starting in the build directory:
553$codei%
554        cd speed/sacado
555        make test
556%$$
557After executing $code make test$$, you can run a Sacado speed tests
558by executing the command $code ./sacado$$;
559see $cref speed_main$$ for the meaning of the command line
560options to this program.
561
562
563$head tape_addr_type$$
564$index memory, usage$$
565$index memory, tape$$
566$index tape, memory$$
567If the command line argument $icode tape_addr_type$$ is present,
568it specifies the type used for address in the AD recordings (tapes).
569The valid values for this argument are
570$code unsigned short int$$,
571$code unsigned int$$,
572$code size_t$$.
573The smaller the value of $icode%sizeof(%tape_addr_type%)%$$,
574the less memory is used.
575On the other hand, the value
576$codei%
577        std::numeric_limits<%tape_addr_type%>::max()
578%$$
579must be larger than any of the following:
580$cref/size_op/seq_property/size_op/$$,
581$cref/size_op_arg/seq_property/size_op_arg/$$,
582$cref/size_par/seq_property/size_text/$$,
583$cref/size_par/seq_property/size_par/$$,
584$cref/size_par/seq_property/size_VecAD/$$.
585
586
587$head tape_id_type$$
588$index memory, usage$$
589$index memory, tape$$
590$index tape, memory$$
591If the command line argument $icode tape_id_type$$ is present,
592it specifies the type used for identifying tapes.
593The valid values for this argument are
594$code unsigned short int$$,
595$code unsigned int$$,
596$code size_t$$.
597The smaller the value of $icode%sizeof(%tape_id_type%)%$$,
598the less memory is used.
599On the other hand, the value
600$codei%
601        std::numeric_limits<%tape_id_type%>::max()
602%$$
603must be larger than the maximum number of tapes per thread
604times $cref/max_num_threads/InstallUnix/max_num_threads/$$.
605
606$head make install$$
607Once you are satisfied that the tests are giving correct results,
608you can install CppAD into easy to use directories by executing the command
609$codep
610        make install
611$$
612This will install CppAD in the location specified by
613$cref/prefix_dir/InstallUnix/prefix_dir/$$.
614You must have permission to write in the $icode prefix_dir$$
615directory to execute this command.
616You may optionally specify a destination directory for the install; i.e.,
617$codei%
618        make install DESTDIR=%DestinationDirectory%
619%$$
620
621$end
Note: See TracBrowser for help on using the repository browser.