Prev Next Install

Installing f2cad

Subversion
If you have subversion , you can use the following command to get the specified release of
     svn checkout $f2cad_svn/releases/0.
yyyymmdd.r
where yyyy is the year, mm is the month, dd is the day, and r is the release number.

Tarballs

Download
You can download a tarball release of the form f2cAD-0.yyyymmdd.r ,

Extraction
Use the command
     tar -xvzf f2cAD-0.
yyyymmdd.r.tgz
to extract the download file into the distribution directory
     f2cAD-0.
yyyymmdd.r

User Documentation
The user documentation for releases is included in the doc sub-directory of the distribution directory. The file doc/doc.xml is the top of the documentation tree (note table at top listing the different versions of the documentation).

Built Sources
The next step is to use f2c to automatically build the C++ source code from the Fortran source code. In the distribution directory, execute the command:
 
	./build_sources.sh


Configure
Enter the directory created by the extraction and execute the command:
     ./configure \
          
[ prefix=prefix ] \
          F2C_DIR=
f2c_dir \
          
[ ADOLC_DIR=adolc_dir ] \
          
[ CPPAD_DIR=cppad_dir ] \
          
[ FADBAD_DIR=fadbad_dir ] \
          
[ CXX_FLAGS=cxx_flags ]
where values in italic are replaced values that you choose, and entries of the form [ ... ] are optional.

Prefix
The default value for prefix is $HOME; i.e., by default the f2cad include files will install in
     $HOME/include/f2cad
and the f2cad libraries are
     $HOME/lib/libf2c_adolc.a
     $HOME/lib/libf2c_cppad.a
     $HOME/lib/libf2c_fadbad.a
If you want to install elsewhere, you will have to use this option. For example, if you have permission to write into the directories /usr/local/include and /usr/local/lib,
 
	./configure --prefix=/usr/local
will set up for installing the f2cad include files in the directory
     /usr/local/include/f2cad
and the f2cad libraries will be
     /usr/local/lib/libf2c_adolc.a
     /usr/local/lib/libf2c_cppad.a
     /usr/local/lib/libf2c_fadbad.a
This is the standard location for such files on many systems. If prefix is not a standard location for your system, you will need the compiler switches
     -I 
prefix/include -L prefix/lib
on the command line when you compile and link your programs with the f2cad libraries.

F2C_DIR
The directory f2c_dir must be the location where f2c is installed. To be specific, the files
     
f2c_dir/include/f2c.h
     
f2c_dir/lib/libf2c.a
     
f2c_dir/bin/f2c
must be the include file, library file, and executable for f2c.

ADOLC_DIR
If you have adolc installed on your system, you can specify a value for adolc_dir in the configure command line. The value of adolc_dir must be such that
     
adolc_dir/include/adolc/adouble.h
is a valid way to reference the include file adouble.h. In this case, the lib/adolc/libf2c_adolc.a library and the corresponding example and test program example/adolc/run will be built.

CPPAD_DIR
If you have cppad installed on your system, you can specify a value for cppad_dir in the configure command line. The value of cppad_dir must be such that
     
cppad_dir/include/cppad/cppad.hpp
is a valid way to reference the include file cppad.hpp. In this case, the lib/cppad/libf2c_cppad.a library and the corresponding example and test program example/cppad/run will be built.

FADBAD_DIR
If you have fadbad installed on your system, you can specify a value for fadbad_dir . It must be such that
     
fadbad_dir/FADBAD++/fadiff.h
is a valid reference to fadiff.h. In this case, the lib/fadbad/libf2c_fadbad.a library and the corresponding example and test program example/fadbad/run will be built.

C++ Errors And Warnings
If the command line argument cxx_flags is present, it specifies compiler error and warning flags. For example,
     CXX_FLAGS="-Wall -ansi"
would specify that error and warning flags -Wall and -ansi should be included in all the C++ compile commands. The error and warning flags chosen must be valid options for the C++ compiler. The default value for cxx_flags is the empty string.

Building The Libraries
In the f2cad distribution directory, execute the command
 
	make
This will build the libraries lib/adolc/libf2c_adolc.a, lib/cppad/libf2c_cppad.a, and lib/fadbad/libf2c_fadbad.a.

Testing
In the f2cad distribution directory, execute the command
 
	make test
This will compile and run the tests. The results of the tests are stored in the file test.log.

Final Installation
Once you are satisfied that the tests are giving correct results, you can install the libraries and include files into easy to use directories by executing the command
 
	make install
This will install f2cad in the location specified by prefix .
Input File: omh/install.omh