Ticket #11321: lcalc-1.23.p8-p9.diff
File lcalc-1.23.p8-p9.diff, 27.6 KB (added by , 11 years ago) |
---|
-
spkg-install
diff -Naur lcalc-1.23.p8/spkg-install lcalc-1.23.p9/spkg-install
old new 1 1 #!/usr/bin/env bash 2 2 3 if [ -z "$SAGE_LOCAL" ] 4 echo >&2 "SAGE_LOCAL undefined ... exiting";5 echo >&2 "Maybe run 'sage -sh'?"6 exit 13 if [ -z "$SAGE_LOCAL" ]; then 4 echo >&2 "Error: SAGE_LOCAL undefined ... exiting" 5 echo >&2 "Maybe run 'sage -sh'?" 6 exit 1 7 7 fi 8 8 9 9 # Add a sensible default optimisation flag. Change if necessary. 10 10 OPTIMIZATION_FLAGS="-O3" 11 11 12 # Most packages do not need all these set 13 # But it is better to do them all each time, rather than ommit 14 # a flag by mistake. 15 16 CFLAGS="$CFLAGS $OPTIMIZATION_FLAGS " 17 CXXFLAGS="$CXXFLAGS $OPTIMIZATION_FLAGS " 18 FCFLAGS="$FCFLAGS $OPTIMIZATION_FLAGS " 19 F77FLAGS="$F77FLAGS $OPTIMIZATION_FLAGS " 20 CPPFLAGS="$CPPFLAGS -I$SAGE_LOCAL/include" 21 LDFLAGS="$LDFLAGS -L$SAGE_LOCAL/lib" 22 23 24 # Compile for 64-bit if SAGE64 is set to 'yes' 25 if [ "x$SAGE64" = xyes ] ; then 26 echo >&2 "Building a 64-bit version of lcalc" 27 28 # Both Sun and GNU compilers use -m64 to build 64-bit code, 29 # but compilers from IBM (on AIX), and HP (on HP-UX) 30 # do not. So allow the environment 31 # variables CFLAG64 and CXXFLAG64 to set the flag to whatever 32 # option the C and C++ compilers want for 64-bit code. If not default to -m64. 33 34 if [ -z "$CFLAG64" ] ; then 35 CFLAG64=-m64 36 fi 37 38 if [ -z "$CXXFLAG64" ] ; then 39 CXXFLAG64=-m64 40 fi 41 export CFLAG64 42 export CXXFLAG64 43 44 CFLAGS="$CFLAGS $CFLAG64 " 45 CXXFLAGS="$CXXFLAGS $CXXFLAG64 " 46 FCFLAGS="$FCFLAGS $CXXFLAG64 " 47 F77FLAGS="$F77FLAGS $CXXFLAG64 " 48 # Some packages may need LDFLAGS and/or ABI set here. 49 # LDFLAGS="$LDFLAGS -m64 " 50 # ABI=64 51 # Normally one would just add this to CXXFLAGS, but since the Makefile 52 # does not import CXXFLAGS properly, and it would take a major change to 53 # sort out the Makefile properly, the variable can just be added here, 54 # and ${CXXFLAG64} added at the right point in the Makefile for 64-bit builds. 12 # Most packages do not need all these set, but it is better to do them all 13 # each time, rather than omit a flag by mistake: 14 15 CFLAGS="$OPTIMIZATION_FLAGS $CFLAGS" 16 CXXFLAGS="$OPTIMIZATION_FLAGS $CXXFLAGS" 17 FCFLAGS="$OPTIMIZATION_FLAGS $FCFLAGS" 18 F77FLAGS="$OPTIMIZATION_FLAGS $F77FLAGS" 19 CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS" 20 LDFLAGS="-L$SAGE_LOCAL/lib $LDFLAGS" 21 22 23 # Compile for 64-bit if SAGE64 is set to 'yes': 24 if [ "x$SAGE64" = xyes ]; then 25 echo >&2 "Building a 64-bit version of lcalc" 26 27 # Both Sun and GNU compilers use -m64 to build 64-bit code, but compilers 28 # from IBM (on AIX), and HP (on HP-UX) do not. So allow the environment 29 # variables CFLAG64 and CXXFLAG64 to set the flag to whatever option the 30 # C and C++ compilers want for 64-bit code. If not set, default to -m64. 31 32 if [ -z "$CFLAG64" ]; then 33 CFLAG64=-m64 34 fi 35 if [ -z "$CXXFLAG64" ]; then 36 CXXFLAG64="$CFLAG64" # default to that of the C compiler 37 fi 38 export CFLAG64 39 export CXXFLAG64 40 41 CFLAGS="$CFLAGS $CFLAG64" 42 CXXFLAGS="$CXXFLAGS $CXXFLAG64" 43 FCFLAGS="$FCFLAGS $CXXFLAG64" # XXX Does this make sense? 44 F77FLAGS="$F77FLAGS $CXXFLAG64" 45 # Some packages may need LDFLAGS and/or ABI set here. 46 # LDFLAGS="$LDFLAGS $CFLAG64" # XXX Perhaps should use some LDFLAG64. 47 # ABI=64 48 # Normally one would just add this to CXXFLAGS, but since the Makefile 49 # does not import CXXFLAGS properly, and it would take a major change to 50 # sort out the Makefile properly, the variable can just be added here, 51 # and ${CXXFLAG64} added at the right point in the Makefile for 64-bit 52 # builds. 53 # (The last sentence apparently refers to CXXFLAG64 only. -leif) 55 54 fi 56 55 57 56 # If SAGE_DEBUG is set to 'yes', add debugging information. Since both 58 57 # the Sun and GNU compilers accept -g to give debugging information, 59 58 # there is no need to do anything specific to one compiler or the other. 60 59 61 if [ "x$SAGE_DEBUG" = xyes ] 60 if [ "x$SAGE_DEBUG" = xyes ]; then 62 61 echo >&2 "Code will be built with debugging information present. Unset 'SAGE_DEBUG'" 63 62 echo >&2 "or set it to 'no' if you don't want that." 64 63 65 CFLAGS="$CFLAGS -g 66 CXXFLAGS="$CXXFLAGS -g 67 FCFLAGS="$FCFLAGS -g 68 F77FLAGS="$F77FLAGS -g 64 CFLAGS="$CFLAGS -g" 65 CXXFLAGS="$CXXFLAGS -g" 66 FCFLAGS="$FCFLAGS -g" 67 F77FLAGS="$F77FLAGS -g" 69 68 else 70 69 echo >&2 "No debugging information will be used during the build of this package." 71 70 echo >&2 "Set 'SAGE_DEBUG' to 'yes' if you want debugging information present (-g added)." 72 71 fi 73 72 74 73 # Add appropriate flag(s) to show all warnings. 75 # This test of a compiler is not perfect by any means, but 76 # is better than nothing.74 # This test of a compiler is not perfect by any means, but is better than 75 # nothing: 77 76 78 if $CC -flags > /dev/null 2>&1; then79 SUN_COMPILER=180 # The Sun compilers are fussy, and adding extra81 # warnings will just show too many.77 if $CC -flags >/dev/null 2>&1; then 78 SUN_COMPILER=1 79 # The Sun compilers are fussy, and adding extra 80 # warnings will just show too many. 82 81 else 83 # Assume gcc if not the Sun C compiler.84 # Add -Wall to show all warnings.85 CFLAGS="$CFLAGS -Wall "86 CXXFLAGS="$CXXFLAGS -Wall"87 FCFLAGS="$FCFLAGS -Wall"88 F77FLAGS="$F77FLAGS -Wall"89 GNU_COMPILER=182 # Assume gcc if not the Sun C compiler. 83 GNU_COMPILER=1 84 # Add -Wall to show all warnings. 85 CFLAGS="-Wall $CFLAGS" 86 CXXFLAGS="-Wall $CXXFLAGS" 87 FCFLAGS="-Wall $FCFLAGS" 88 F77FLAGS="-Wall $F77FLAGS" 90 89 fi 91 90 92 # Determine if the C++ compiler is the Sun or GNU compiler 93 # Just to check we are not mising GNU and non-GNU.94 if $CXX -flags > /dev/null 2>&1; then95 SUN_COMPILER=191 # Determine if the C++ compiler is the Sun or GNU compiler, 92 # just to check we are not mixing GNU and non-GNU: 93 if $CXX -flags >/dev/null 2>&1; then 94 SUN_COMPILER=1 96 95 else 97 GNU_COMPILER=1 96 # Assume gcc/g++ if not the Sun C++ compiler. 97 GNU_COMPILER=1 98 98 fi 99 99 100 # Determine if the Fortran compiler is the Sun or GNU compiler 101 if [ -z "$SAGE_FORTRAN" ] 102 echo >&2 "No Fortran compiler has been defined. This is not normally a problem."100 # Determine if the Fortran compiler is the Sun or GNU compiler: 101 if [ -z "$SAGE_FORTRAN" ]; then 102 echo >&2 "No Fortran compiler has been defined. This is not normally a problem." 103 103 else 104 if $SAGE_FORTRAN -flags > /dev/null 2>&1 ;then105 SUN_COMPILER=1106 else107 GNU_COMPILER=1108 fi104 if $SAGE_FORTRAN -flags >/dev/null 2>&1; then 105 SUN_COMPILER=1 106 else 107 GNU_COMPILER=1 108 fi 109 109 fi 110 110 111 112 # Check if SAGE_FORTRAN_LIB is defined, that the file actually exists. 113 # SAGE_FORTRAN_LIB does not always need to be defined, but if it is defined, then 114 # the file should exist. 115 if [ -n "$SAGE_FORTRAN_LIB" ] && [ ! -r "$SAGE_FORTRAN_LIB" ]; then 116 echo >&2 "SAGE_FORTRAN_LIB is defined as $SAGE_FORTRAN_LIB," 117 echo >&2 "but that file does not exist." 111 # Check if SAGE_FORTRAN_LIB is defined, that the file actually exists. 112 # SAGE_FORTRAN_LIB does not always need to be defined, but if it is defined, 113 # then the file should exist. 114 if [ -n "$SAGE_FORTRAN_LIB" ] && [ ! -r "$SAGE_FORTRAN_LIB" ]; then 115 echo >&2 "Error: SAGE_FORTRAN_LIB is defined as '$SAGE_FORTRAN_LIB'," 116 echo >&2 "but that file does not exist (or isn't readable)." 118 117 exit 1 119 118 fi 120 119 121 120 # Checks that the user is not mixing the Sun and GNU compilers. This problem 122 121 # has been seen on code built with the aid of SCons, but in general could 123 122 # happen with any code if the user has specified a C compiler but not a C++ one. 124 # This problem is even more likely to occur with the Fortran compiler - I've done 125 # it myself when building Sage! 126 127 if [ "x$SUN_COMPILER" = "x1" ] && [ "x$GNU_COMPILER" = "x1" ] ; then 128 echo >&2 "You are mixing the Sun and GNU C/C++/Fortran compilers" 123 # This problem is even more likely to occur with the Fortran compiler - I've 124 # done it myself when building Sage! 125 if [ "x$SUN_COMPILER" = "x1" ] && [ "x$GNU_COMPILER" = "x1" ]; then 126 echo >&2 "Error: You are mixing the Sun and GNU C/C++/Fortran compilers." 129 127 echo >&2 "Such a combination will lead to problems." 130 echo >&2 "Check CC, CXX & SAGE_FORTRAN carefully."128 echo >&2 "Check the environment variables CC, CXX & SAGE_FORTRAN carefully." 131 129 echo >&2 "Exiting ..." 132 130 exit 1 133 131 fi 134 132 135 # These are all used by GNU to specify compilers. 133 echo "The following environment variables will be exported:" 134 135 # These are all used by GNU to specify compilers: 136 136 echo "Using CC=$CC" 137 137 echo "Using CXX=$CXX" 138 138 echo "Using FC=$FC" 139 139 echo "Using F77=$F77" 140 140 141 # Used by Sage in connection with Fortran 141 # Usually, one would add LD here, too. 142 echo "Using MAKE=$MAKE" 143 144 # Used by Sage in connection with Fortran: 142 145 echo "Using SAGE_FORTRAN=$SAGE_FORTRAN" 143 146 echo "Using SAGE_FORTRAN_LIB=$SAGE_FORTRAN_LIB" 144 147 145 # Flags which may be set. 146 echo "The following environment variables will be exported" 148 # Flags which may be set: 147 149 echo "Using CFLAG64=$CFLAG64" 148 150 echo "Using CXXFLAG64=$CXXFLAG64" 149 151 echo "Using CFLAGS=$CFLAGS" … … 153 155 echo "Using CPPFLAGS=$CPPFLAGS" 154 156 echo "Using LDFLAGS=$LDFLAGS" 155 157 echo "Using ABI=$ABI" 156 echo " configure scripts and/or makefiles might override these later"158 echo "'configure' scripts and/or makefiles might override these later." 157 159 echo " " 158 160 159 # export everything. Probably not necessary in most cases.161 # Export everything. Probably not necessary in most cases. 160 162 export CFLAGS 161 163 export CXXFLAGS 162 164 export FCFLAGS … … 164 166 export CPPFLAGS 165 167 export LDFLAGS 166 168 export ABI 169 # (Variables like CC, CXX etc. have already been exported by 'sage-env'.) 167 170 168 # End of pretty general spkg-install file. 169 # Now do the specific things needed for this package (lcalc) 171 # End of pretty general spkg-install file. 172 # Now do the specific things needed for this package (lcalc). 170 173 171 174 success() { 172 175 if [ $? -ne 0 ]; then 173 echo >&2 "Error building lcalc'$1'"176 echo >&2 "Error building the Lcalc package: '$1'" 174 177 exit 1 175 178 fi 176 179 } … … 179 182 180 183 cd src 181 184 182 # Apply Sage specific patches 185 # Apply Sage-specific patches: (See SPKG.txt for details on the patches.) 186 echo >&2 "Patching the upstream source code for Sage..." 183 187 for patch in ../patches/*.patch; do 184 188 patch -p1 <"$patch" 185 success "patch $patch failed "189 success "patch $patch failed to apply" 186 190 done 187 191 192 # There's currently no 'configure' script for Lcalc; we (also) configure 193 # it by patching the Makefile. This may change in a later release of Lcalc. 188 194 189 cd src # Now we are in src/src 195 cd src # Now we are in src/src. 190 196 191 # Build everything 197 # Build everything: 198 echo >&2 "Now building lcalc, example programs and the shared library..." 192 199 $MAKE 193 200 success 'make' 194 201 195 echo >&2 "Now copying over lcalc binary "202 echo >&2 "Now copying over lcalc binary..." 196 203 cp lcalc "$SAGE_LOCAL"/bin 197 204 success 'copying binary' 198 205 199 echo >&2 "Now copying over lcalc library "206 echo >&2 "Now copying over lcalc library..." 200 207 201 # Remove next few lines when OSX 10.4 is no longer supported202 # 10.4 does not seem to compile with .so extension in the library files208 # Remove next few lines when MacOS X 10.4 (Darwin 8) is no longer supported. 209 # 10.4 does not seem to compile with .so extension in the library files. 203 210 if [ "$UNAME" = "Darwin" ]; then 204 211 if [ `sysctl -n kern.osrelease | cut -d . -f 1` -lt 9 ]; then 205 212 cp libLfunction.so "$SAGE_LOCAL"/lib/libLfunction.dylib 206 213 success "copying libLfunction.dylib" 207 214 fi 208 fi # End of MacOS X 10.4 specific instructions215 fi # End of MacOS X 10.4 specific instructions 209 216 210 217 211 218 if [ "$UNAME" = "CYGWIN" ]; then … … 215 222 fi 216 223 success "copying libLfunction.so" 217 224 218 echo >&2 "Now copying over lcalc library header files "225 echo >&2 "Now copying over lcalc library header files..." 219 226 rm -fr "$SAGE_LOCAL"/include/lcalc 220 227 mkdir -p "$SAGE_LOCAL"/include/lcalc 221 228 cp ../include/* "$SAGE_LOCAL"/include/lcalc 222 success ' install'229 success 'copying header files' -
lcalc-1.23.
diff -Naur lcalc-1.23.p8/SPKG.txt lcalc-1.23.p9/SPKG.txt
old new 23 23 24 24 == Dependencies == 25 25 26 * MPIR26 * GMP/MPIR 27 27 * MPFR 28 28 * PARI 29 * GNU patch 29 30 30 31 == Special Update/Build Instructions == 31 32 32 There is some garbage in the upstream sources: 33 src/include/.Lexplicit_formula.h.swp 34 src/include/.Lvalue.h.swp 35 src/include/._.DS_Store 36 src/include/.DS_Store 37 src/include/Lexplicit_formula.h.swap.crap 38 src/include/Lvalue.h.bak 39 src/src/.Makefile.old.swp 40 src/src/._.DS_Store 41 src/src/.DS_Store 42 src/src/.Lcommandline.ggo.swp 43 src/src/libLfunction.a 33 * There is some garbage in the upstream sources which should be removed: 34 src/include/.Lexplicit_formula.h.swp 35 src/include/.Lvalue.h.swp 36 src/include/._.DS_Store 37 src/include/.DS_Store 38 src/include/Lexplicit_formula.h.swap.crap 39 src/include/Lvalue.h.bak 40 src/src/Makefile.old 41 src/src/.Makefile.old.swp 42 src/src/._.DS_Store 43 src/src/.DS_Store 44 src/src/.Lcommandline.ggo.swp 45 src/src/libLfunction.a 46 * We (and apparently also upstream) currently don't build Lcalc's tests 47 (see Makefile), hence there's no spkg-check. 48 This might change in newer upstream versions. 49 * TODO / FIXME: 50 The (upstream) Makefile uses $(CC) to compile C++ (also using $(CCFLAGS)), 51 which it defines to 'g++', and hardcodes 'g++' when linking the shared 52 library. (It should use $(CXX) instead, which might *default* to 'g++'.) 53 54 === Patches === 55 56 * Makefile.patch: 57 We change a lot there, since Lcalc doesn't have a 'configure' script, 58 and hence the Makefile is supposed to be edited to customize Lcalc (build 59 options, locations of headers and libraries etc.). 60 Besides that, we 61 - put CXXFLAGS into Lcalc's "CCFLAGS" used for compiling C++, 62 - remove some stuff involving LDFLAGS1 and LDFLAGS2, setting just LDFLAGS, 63 - use $(MAKE) instead of 'make' in the crude build receipts, 64 - use CXXFLAG64 when linking the shared library. 65 * Lcommon.h.patch: 66 Uncomment the definition of lcalc_to_double(const long double& x). 67 (Necessary for GCC >= 4.6.0, cf. #10892.) 68 Comment from there: 69 The reason is the following code horror from src/src/include/Lcommon.h: 70 [...] 71 But somebody who is familiar with the codebase should really rewrite lcalc 72 to not redefine the double() cast, thats just fragile and will sooner or 73 later again fail inside some system headers. 74 * pari-2.4.4.patch: 75 (Patches src/src/Lcommandline.cc and src/src/Lcommandline_elliptic.cc) 76 Use allocatemem() instead of allocatemoremem() which the new PARI no 77 longer supports. Also replace lgeti() by (long)cgeti(). 78 * time.h.patch: 79 (Patches src/include/Lcommandline_numbertheory.h) 80 Include also <time.h> in Lcommandline_numbertheory.h (at least required 81 on Cygwin, cf. #9845). 82 This should get reported upstream. 44 83 45 84 == Changelog == 46 85 47 === lcalc-1.23.p 8 (Jeroen Demeyer, 26 July2011) ===86 === lcalc-1.23.p9 (Jeroen Demeyer, Leif Leonhardy, 6 October 2011) === 48 87 * Trac #11321: Add a patch for PARI-2.4.4 (use allocatemem() instead of 49 88 allocatemoremem()) 50 89 * Remove unused patch Lcommandline_elliptic.cc.cygwin.diff 51 90 * Use `patch` for patching instead of `cp`. 52 * Restore upstream sources (src/src/Makefile was edited) 91 * Restore upstream sources (src/src/Makefile was edited) but remove 92 garbage files mentioned above. 53 93 * Remove date from spkg version string 54 94 * Various clean-up in spkg-install 55 95 -
src/src/Makefile.old
diff -Naur lcalc-1.23.p8/src/src/Makefile.old lcalc-1.23.p9/src/src/Makefile.old
old new 1 #2 # Makefile for the L-function calculator version 0.23 #4 5 #todo: set up a configuration file that will detect6 #the operating system, whether gmp, or pari are installed and7 #the location of all the relevant files,8 #the c compiler, that will generate options which are specific to the9 #compilers, optimization options depending on the chip, etc10 11 12 # Comment out the following line to remove the use of pari's13 # elliptic curve routines. Doing so disables the -e option.14 # g++ with -DINCLUDE_PARI sends a #define INCLUDE_PARI to the preprocessor.15 16 #PARI_DEFINE = -DINCLUDE_PARI17 #PREPROCESSOR_DEFINE = -DUSE_LONG_DOUBLE18 19 #OPENMP_FLAG = -fopenmp20 21 #PREPROCESSOR_DEFINE = -DUSE_MPFR22 ifeq ($(PREPROCESSOR_DEFINE),-DUSE_MPFR)23 #GMP_FLAGS= -L/usr/local/lib -lmpfrcpp -lgmp -lmpfr24 GMP_FLAGS= gmpfrxx.o mpfr_mul_d.o -lmpfr -lgmp -lgmpxx -lm25 else26 GMP_FLAGS=27 endif28 29 30 OS_NAME := $(shell uname)31 32 CC = g++33 #cc = /home/mrubinst/local/bin/gcc34 #CC = /home/mrubinst/local/bin/g++35 #LD = /home/mrubinst/local/bin/g++36 37 #CC = /Users/michaelrubinstein/math/L/packages/gcc4.3/usr/local/bin/g++38 #EXTRA= -pg39 #EXTRA = -ftree-vectorize -ftree-vectorizer-verbose=5 -funroll-loops40 41 42 43 #MACHINE_SPECIFIC_FLAGS = -Wno-long-double44 MACHINE_SPECIFIC_FLAGS = -ffast-math45 46 #G4 = FALSE47 #ifeq ($(G4),TRUE)48 #MACHINE_SPECIFIC_FLAGS = -fast -mcpu=G4 -mtune=G449 #endif50 51 #G5 = TRUE52 ifeq ($(G5),TRUE)53 #MACHINE_SPECIFIC_FLAGS = -fast -mcpu=G5 -mtune=G554 #MACHINE_SPECIFIC_FLAGS = -ffast-math -maltivec -mpowerpc -mpowerpc64 -ftree-vectorize -ftree-vectorizer-verbose=5 -funroll-loops55 56 #MACHINE_SPECIFIC_FLAGS = -ffast-math -mpowerpc -mpowerpc64 -ftree-vectorize -ftree-vectorizer-verbose=5 -funroll-loops57 MACHINE_SPECIFIC_FLAGS = -ffast-math -mpowerpc -mpowerpc64 -m6458 #MACHINE_SPECIFIC_FLAGS = -mpowerpc -mpowerpc64 -m6459 endif60 61 CCFLAGS = -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)62 #CCFLAGS = -Wa,-W -O3 $(OPENMP_FLAG) $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)63 #CCFLAGS = -Wa,-W -O2 -fno-exceptions -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)64 65 #warning- O2 doesn't help with -DUSE_LONG_DOUBLE on mac, and actually seems to hurt, making runtime longer66 #by a factor of 1.567 68 69 ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)70 #location of pari.h.71 LOCATION_PARI_H = /usr/local/include/pari #usual location72 73 #location of libpari.a or of libpari.so74 #depending on whether static or dynamic libraries are being used.75 #On mac os x it's the former, on linux I think usually the latter.76 LOCATION_PARI_LIBRARY = /usr/local/lib #usual location77 else78 #supplied as a dummy so as to avoid more ifeq's below79 LOCATION_PARI_H = .80 LOCATION_PARI_LIBRARY = .81 endif82 83 84 85 #INCLUDEFILES= -I../include -I../../packages/gcc4.3/usr/local/include86 INCLUDEFILES= -I../include87 88 #For Mac os x we omit shared library options89 90 ifeq ($(OS_NAME),Darwin)91 LDFLAGS2 =92 else93 LDFLAGS1 = -Xlinker -export-dynamic #not sure why pari calls these when linking but on the web I found94 #'Libtool provides the `-export-dynamic' link flag (see section Link mode), which does this declaration.95 #You need to use this flag if you are linking a shared library that will be dlopened'96 #see notes below97 #ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)98 LDFLAGS2 = $(LDFLAGS1) -Xlinker -rpath -Xlinker $(LOCATION_PARI_LIBRARY)99 #else100 # LDFLAGS2 = $(LDFLAGS1)101 #endif102 endif103 104 ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)105 LDFLAGS = $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari106 else107 LDFLAGS = $(LDFLAGS2)108 endif109 110 111 112 #NOTES:113 #for caedmon: the shared pari library is in a funny location: /usr/local/pari/pari-2.1.5/lib114 #At compile time we need to specify that location with:115 # -L/usr/local/pari/pari-2.1.5/lib -lpari116 #At runtime, the computer attempts to load the pari shared library, and if it isn't in a standard117 #location, we can do two things.118 #1) One page suggested:119 # -Xlinker -rpath -Xlinker /usr/local/pari/pari-2.1.5/lib120 #2) The other option, not recommended, is to type at the unix prompt:121 # LD_LIBRARY_PATH=/usr/local/pari/pari-2.1.5/lib:$LD_LIBRARY_PATH122 # export LD_LIBRARY_PATH123 #If this is not done correctly, at runntime one gets the error124 # ./lcalc: error while loading shared libraries: libpari.so.1: cannot open shared125 # object file: No such file or directory126 #One can list, after compiling, dynamic dependencies with the command: ldd lcalc and it will127 #become clear which libraries the computer can find.128 129 130 INSTALL_DIR= /usr/local131 132 #object files for the libLfunction library133 OBJ_L = Lglobals.o Lgamma.o Lriemannsiegel.o Lriemannsiegel_blfi.o Ldokchitser.o134 135 #object files for the command line program136 OBJ2=$(OBJ_L) Lcommandline_globals.o Lcommandline_misc.o Lcommandline_numbertheory.o Lcommandline_values_zeros.o137 OBJ3=$(OBJ2) Lcommandline_elliptic.o Lcommandline_twist.o Lcommandline.o cmdline.o138 OBJECTS = $(OBJ3)139 140 all:141 # make print_vars142 make libLfunction.a143 make lcalc144 make examples145 # make find_L146 # make test147 148 print_vars:149 @echo OS_NAME = $(OS_NAME)150 151 lcalc: $(OBJECTS)152 $(CC) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(LDFLAGS) -o lcalc $(GMP_FLAGS)153 154 examples:155 $(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/example.cc libLfunction.a -o example_programs/example $(GMP_FLAGS)156 157 158 proc:159 $(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/proc.cc libLfunction.a -o example_programs/proc $(GMP_FLAGS)160 161 test:162 $(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/test.cc libLfunction.a -o example_programs/test $(GMP_FLAGS)163 164 find_L:165 $(CC) $(CCFLAGS) $(INCLUDEFILES) find_L_functions/find_L_functions.cc libLfunction.a -o find_L_functions/find_L $(GMP_FLAGS)166 167 .cc.o:168 $(CC) $(CCFLAGS) $(INCLUDEFILES) -c $<169 .c.o:170 $(CC) $(CCFLAGS) $(INCLUDEFILES) -c $<171 172 173 Lglobals.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h174 175 #Lmisc.o: ../include/Lmisc.h ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h176 177 Lgamma.o: ../include/Lgamma.h ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h178 179 Lriemannsiegel.o: ../include/Lriemannsiegel.h ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h180 Lriemannsiegel.o: ../include/Lint_complex.h ../include/Lgamma.h181 Lriemannsiegel.o: ../include/Lmisc.h182 183 Ldokchitser.o: ../include/Ldokchitser.h ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h184 185 #all I need here is dependence on the definition of the L-function class186 #and the Complex typedef187 Lcommandline_globals.o: ../include/Lcommandline_globals.h ../include/L.h188 Lcommandline_globals.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h189 #Lcommandline_globals.o: ../include/Lmisc.h ../include/Lgamma.h190 #Lcommandline_globals.o: ../include/Lriemannsiegel.h191 #Lcommandline_globals.o: ../include/Ldirichlet_series.h ../include/Lprint.h192 #Lcommandline_globals.o: ../include/Lnumberzeros.h ../include/Lgram.h193 #Lcommandline_globals.o: ../include/Lvalue.h ../include/Lfind_zeros.h194 195 Lcommandline_misc.o: ../include/Lcommandline_misc.h ../include/L.h196 Lcommandline_misc.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h197 Lcommandline_misc.o: ../include/Lmisc.h ../include/Lgamma.h198 Lcommandline_misc.o: ../include/Lriemannsiegel.h199 Lcommandline_misc.o: ../include/Ldirichlet_series.h ../include/Lprint.h200 Lcommandline_misc.o: ../include/Lnumberzeros.h ../include/Lgram.h201 Lcommandline_misc.o: ../include/Lvalue.h ../include/Lfind_zeros.h202 Lcommandline_misc.o: ../include/Lcommandline_numbertheory.h203 Lcommandline_misc.o: ../include/Lcommandline_globals.h204 205 Lcommandline_numbertheory.o: ../include/Lcommandline_numbertheory.h206 Lcommandline_numbertheory.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h207 208 Lcommandline_values_zeros.o: ../include/Lcommandline_values_zeros.h209 Lcommandline_values_zeros.o: ../include/L.h ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h210 Lcommandline_values_zeros.o: ../include/Lint_complex.h ../include/Lmisc.h211 Lcommandline_values_zeros.o: ../include/Lgamma.h ../include/Lriemannsiegel.h212 Lcommandline_values_zeros.o: ../include/Ldirichlet_series.h213 Lcommandline_values_zeros.o: ../include/Lprint.h ../include/Lnumberzeros.h214 Lcommandline_values_zeros.o: ../include/Lgram.h ../include/Lvalue.h215 Lcommandline_values_zeros.o: ../include/Lfind_zeros.h216 Lcommandline_values_zeros.o: ../include/Lcommandline_numbertheory.h217 Lcommandline_values_zeros.o: ../include/Lcommandline_globals.h218 219 Lcommandline_elliptic.o: ../include/Lcommandline_elliptic.h ../include/L.h220 Lcommandline_elliptic.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h221 #Lcommandline_elliptic.o: ../include/Lmisc.h ../include/Lgamma.h222 Lcommandline_elliptic.o: ../include/Lriemannsiegel.h223 Lcommandline_elliptic.o: ../include/Ldirichlet_series.h ../include/Lprint.h224 Lcommandline_elliptic.o: ../include/Lnumberzeros.h ../include/Lgram.h225 Lcommandline_elliptic.o: ../include/Lvalue.h ../include/Lfind_zeros.h226 Lcommandline_elliptic.o: ../include/Lcommandline_numbertheory.h227 Lcommandline_elliptic.o: ../include/Lcommandline_globals.h228 $(CC) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_elliptic.cc229 230 Lcommandline_twist.o: ../include/Lcommandline_twist.h ../include/L.h231 Lcommandline_twist.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h232 #Lcommandline_twist.o: ../include/Lmisc.h ../include/Lgamma.h233 Lcommandline_twist.o: ../include/Lriemannsiegel.h234 Lcommandline_twist.o: ../include/Ldirichlet_series.h ../include/Lprint.h235 Lcommandline_twist.o: ../include/Lnumberzeros.h ../include/Lgram.h236 Lcommandline_twist.o: ../include/Lvalue.h ../include/Lfind_zeros.h237 Lcommandline_twist.o: ../include/Lcommandline_numbertheory.h238 Lcommandline_twist.o: ../include/Lcommandline_globals.h239 Lcommandline_twist.o: ../include/Lcommandline_elliptic.h240 $(CC) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_twist.cc241 242 cmdline.o: ../include/cmdline.h ../include/getopt.h243 #$(CC) $(CCFLAGS) $(INCLUDEFILES) -DHAVE_LONG_LONG -c cmdline.c244 245 246 Lcommandline.o: ../include/Lcommandline.h ../include/L.h247 Lcommandline.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h248 Lcommandline.o: ../include/Lmisc.h ../include/Lgamma.h249 Lcommandline.o: ../include/Lriemannsiegel.h ../include/Ldirichlet_series.h250 Lcommandline.o: ../include/Lprint.h ../include/Lnumberzeros.h251 Lcommandline.o: ../include/Lgram.h ../include/Lvalue.h252 Lcommandline.o: ../include/Lfind_zeros.h253 Lcommandline.o: ../include/Lcommandline_numbertheory.h254 Lcommandline.o: ../include/Lcommandline_globals.h255 Lcommandline.o: ../include/Lcommandline_misc.h256 Lcommandline.o: ../include/Lcommandline_elliptic.h257 Lcommandline.o: ../include/Lcommandline_twist.h258 Lcommandline.o: ../include/Lcommandline_values_zeros.h259 $(CC) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline.cc260 261 262 libLfunction.a: $(OBJ_L)263 ar ruv libLfunction.a $(OBJ_L)264 ranlib libLfunction.a265 266 clean:267 rm -f *.o lcalc libLfunction.a example_programs/example268 269 install:270 cp -f lcalc $(INSTALL_DIR)/bin/.271 cp -f libLfunction.a $(INSTALL_DIR)/lib/.272 ranlib $(INSTALL_DIR)/lib/libLfunction.a273 cp -rf ../include $(INSTALL_DIR)/include/Lfunction274 275 276 SRCS = Lcommandline.cc Lcommandline_elliptic.cc Lcommandline_globals.cc Lcommandline_misc.cc Lcommandline_numbertheory.cc Lcommandline_twist.cc Lcommandline_values_zeros.cc Lgamma.cc Lglobals.cc Lmisc.cc Lriemannsiegel.cc Lriemannsiegel_blfi.cc cmdline.c277 depend:278 makedepend -f depends -- $(CCFLAGS) -Y../include -- $(SRCS)