1Quad-Double computation package 2Copyright (C) 2003-2018 3================================================ 4 5Revised 30 Oct 2018 6 7To build this library, follow the steps below. 8Some system specific notes are at the end of this file. 9 10Build Instructions 11================== 12 13 1. Run the configure script by typing 14 15 ./configure 16 17 The script will attempt to automatically detect various system-dependent 18 variables used during compilation (such as the C++/fortran compiler, 19 compiler flags, and linker flags). 20 21 If you want to specify a particular C++ / F90 compiler and their flags, 22 you can set them as environmental variables. For example: 23 24 FC=ifc FCFLAGS="-O2 -FR" ./configure 25 26 Important variables are 27 28 CXX C++ compiler to use 29 CXXFLAGS C++ compiler flags to use 30 CC C compiler to use (for C demo program) 31 CFLAGS C compiler flags to use (for C demo program) 32 FC Fortran 90 compiler 33 FCFLAGS Fortran 90 compiler flags to use 34 FCLIBS Fortran 90 libraries needed to to link with C++ code. 35 36 See ./configure --help to see other options. 37 38 3. The configure script should also have created the files 'config.h' and 39 'include/qd/qd_config.h', which will contain the compile time 40 defines. Examine these and edit them if necessary. In most cases 41 no edits are necessary, since the options are detected when configure 42 was run. 43 44 4. Type "make". This will build the library, and necessary Fortran 45 wrappers. 46 47 5. Optionally, one can build and run some simple test programs. 48 To do this, type "make check". Some programs run during this 49 phase is a good demonstration of how to use the qd library in C++. 50 51 6. You can now install the QD library by issuing "make install". 52 53 7. If you want to build some sample programs written in C++ 54 you can type "make cpp-demo". 55 56 8. If you want to build some sample programs written in Fortran 90, 57 you can type "make fortran-demo". 58 59 9. If you want to compile the Experimental Mathematician's Toolkit, 60 type "make toolkit". This will compile the Fortran-90 codes in 61 the toolkit cirectory, including the "mathinit" and "mathtool" 62 Read the "README" file in the toolkit directory for additional details. 63 64 65System-Specific Notes 66===================== 67 68Linux with Intel processors 69------------------- 70You can use g++ to compile the C++ code, which is a part of all 71Linux or other Unix distributions. The Fortran 90 codes 72can be compiled using the gfortran compiler available at 73 74 https://gcc.gnu.org/wiki/GFortranBinaries 75 76Alternatively, one can use the Intel compilers, available at: 77 78 http://www.intel.com/software/products/compilers/clin/ 79 http://www.intel.com/software/products/compilers/flin/ 80 81One can specify specific compilers for the configure script, as in: 82 83 ./configure CXX=g++ FC=gfortran 84 85 86Apple (OS X) 87------------ 88 89For Apple OS X Intel-based systems, it is recommended that you use 90the g++ compiler and related command-line tools, available via this URL: 91 92 https://developer.apple.com/downloads/index.action 93 94See "Command-line tools" for your version of OS X. The above URL requires 95a registered Apple ID. It may be necessary to install Apple's Xcode 96package first. 97 98The gfortran compiler for Mac OS X can be downloaded from: 99 https://gcc.gnu.org/wiki/GFortranBinaries 100 101After installing these compilers, in the main qd directory type 102 103 ./configure CXX=g++ FC=gfortran FCFLAGS=-m64 104 105then type "make" to construct the library. See the "README" file on 106how to construct a compile-link script for your own codes. 107 108IBM (Power) 109----------- 110 111With IBM's xlC/xlf90 compilers, you may want to experiment with 112--enable-fma option which uses a faster code but relies on the 113compiler to generate a fused multiply-accumulate instruction. 114WARNING: since the compiler is not required to produce such 115instructions, this is not guaranteed to work. Please test before 116using. 117 118