#!/bin/csh if ($1 != "")goto $1 echo " " echo Hello! This is an automated script for installing Split on your echo system. There are a number of stages, some requiring action on your echo "part. Should the script be interrupted (and you wish to start it up" echo "again), you may restart it with 'INSTALL woof', where 'woof' is the" echo "name of the stage you wish to start at. You'll know where this is" echo "because I will periodically issue messages of the form 'stage = woof'." echo " " echo "I am hoping that this script is portable. If not (or there are any other" echo "problems), please let me know\!" echo " " ; echo "David Jaffe (e-mail: jaffe@cpthree.unl.edu)" echo " "; echo -n "Press return to proceed (or x, followed by return to exit)...."; set input = $<; if ($input == "x")exit; echo " "; acknowledge: ; echo stage = acknowledge; echo " " echo Software acknowledgments: Split makes use of the following free software echo which was not written by the author: echo "--- various GNU (Free Software Foundation) products, including g++ and" echo " libg++" echo "--- Brendan McKay's graph isomorphism package **nauty**" echo "--- Keith Briggs double-double precision floating point package " echo " **doubledouble**." echo "--- Victor Shoup's NTL - A Library for doing Number Theory" echo "--- T. Granlund's GMP - GNU Multiple Precision" echo " "; echo -n Press return to proceed....; set input = $<; if ($input == "x")exit; echo " "; hardware_check: ; echo stage = hardware_check; echo " " echo "This program should run on any reasonably modern Unix machine. " echo " " echo This program requires at least 64 megabytes of RAM to install and use. echo " "; echo -n Press return to proceed....; set input = $<; if ($input == "x")exit; echo " "; cplex_check: ; echo stage = cplex_check; echo " " echo Split functions best if the commercial linear programming solver CPLEX echo is installed. For academic users, a echo "'Linear Optimizer Single CPU License' costs about 500 dollars; you can " echo send e-mail to info@cplex.com if you want to get it. Otherwise, echo Split will work without CPLEX, but it will be slower. Split has been echo tested with versions 2.1 and 4.04 of CPLEX. Hopefully other versions echo will work as well. echo " "; echo -n Press return to proceed....; set input = $<; if ($input == "x")exit; echo " "; egcs_check: ; echo stage = egcs_check; echo " " echo "Now let's make sure that you have the right compiler. To compile" echo "Split, you need gcc 2.95 with libg++ preinstalled. It may be that a" echo "later version of gcc 2.95 will also work, but usually SOMETHING in" echo "Split breaks when the compiler is substantially upgraded. If so, let" echo "me know and I will make appropriate repairs. If you happen to have echo "an ev6-based computer (Alpha 21264), use egcs-1.1.2 instead;" echo "gcc 2.95 will give internal compiler errors." echo " " echo "To install gcc with libg++ preinstalled, get the source code for both" echo "from http://egcs.cygnus.com. Make yourself root, and:" echo "[1] Create a source directory (probably in /usr/local). I'll call this" echo " directory gcc, but you probably want to give it a longer name." echo " Move everything in the libg++ directory into gcc." echo "[2] Create an empty directory gcc-build, parallel to gcc. Change" echo " directory to it." echo "[3] ../gcc/configure" echo "[4] make" echo "[5] make install" echo " " echo "Let's make sure you really have the correct gcc and g++, and that" echo "your path is set to invoke them." echo "trying gcc --version:" gcc --version echo "trying g++ --version:" g++ --version echo "If gcc 2.95 is correctly installed, you should have seen" echo "gcc 2.95 (two times)." echo " "; echo -n Press return to proceed....; set input = $<; if ($input == "x")exit; echo " "; misc_check: ; echo stage = misc_check; echo " " echo "Now I am going to test for various miscellaneous software items," echo "or ask you questions about them." echo " " echo -n "testing for uname... " uname >& /dev/null if ($status != 0 ) then echo " " echo I did not find uname. This either means that it is not installed on echo your computer, or else PATH is not set correctly. If you are using echo NeXTStep, you may have to create a shell script "uname" which does echo nothing except print out "OPENSTEP". In any case, please fix the uname echo problem, and then continue with the installation. exit else echo OK echo -n "testing for gzip... " echo woof | gzip >& /dev/null if ($status != 0 ) then echo " " echo I did not find gzip. This either means that it is not installed on echo your computer, or else PATH is not set correctly. Please fix this, and echo then continue with the installation. exit else echo OK echo -n "testing for sort... " sort --version >& /dev/null if ($status != 0 ) then echo " " echo I found a version other than than the GNU version. This either means echo that the GNU version is not installed on your computer, or else PATH echo is not set correctly. Please fix this, and then continue with the echo installation. exit else echo OK echo -n "testing for fold... " echo woof | fold --spaces >& /dev/null if ($status != 0 ) then echo " " echo I found a version other than than the GNU version. This either means echo that the GNU version is not installed on your computer, or else PATH echo is not set correctly. Please fix this, and then continue with the echo installation. exit else echo OK echo -n "testing for m4... " if (`echo "xbc" | m4` != "xbc") then echo " " echo I found a version other than than the GNU version. This either means echo that the GNU version is not installed on your computer, or else PATH echo is not set correctly. Please fix this, and then continue with the echo installation. exit else echo OK echo -n "testing for c++filt... " c++filt --version >& /dev/null if ($status != 0 ) then echo " " echo I did not find c++filt. This either means that it is not installed on echo your computer, or else PATH is not set correctly. echo Please fix this, and then continue with the installation. exit else echo OK echo "" echo "xdvi (version 20 or later -- only used by 'help' command)" echo "gs (ghostscript) -- only used by 'help' command)" echo echo "If you don't have these, but want them, go install them, and come back" echo to continue with the installation. echo " "; echo -n Press return to proceed....; set input = $<; if ($input == "x")exit; echo " "; download: ; echo stage = download; echo " " echo You should now be in the directory where you want to install Split. echo This could be an empty directory or it could be a directory where you echo "previously installed Split. I won't delete anything, but I might" echo accidentally overwrite a file you care about. If your computer shares echo a file system with other computers, it may be advisable to put the echo directory in a place where it can be directly accessed from the executing echo computer, so as to avoid overburdening the network. On some machines echo this will be in /tmp, but of course there is some risk that such a echo directory will be destroyed. echo "" echo I will now download files into this directory by anonymous ftp. echo In total, about 1500 kilobytes will be transferred. echo " "; echo -n Press return to proceed....; set input = $<; if ($input == "x")exit; echo " "; echo user ftp `whoami`@`hostname` > ftp_in echo cd pub >> ftp_in echo cd coding >> ftp_in echo binary >> ftp_in foreach i (REF MACROS CODE DATA_F2_1 NOT_MINE LOG t.dvi NTL.tar GMP.tar) echo get $i.gz >> ftp_in end echo get disect.cc >> ftp_in echo get t.idxb >> ftp_in echo bye >> ftp_in cd src ftp -n -v cpthree.unl.edu < ftp_in rm ftp_in echo " "; unpack: ; echo stage = unpack; echo " " echo "File transfer complete. Now I'll make subdirectories, unzip some files," echo "and put some files in them. Please wait..." foreach i (cc doc functions functions/future inc obj tex calculations calculations/tmp hints webcodes log src) if(!(-d $i)) mkdir $i foreach i (CODE DATA_F2_1 REF MACROS NOT_MINE LOG t.dvi NTL.tar GMP.tar) gunzip -f $i.gz end cd .. cp src/REF tex mv src/t.dvi tex mv src/t.idxb tex cat src/NTL.tar | tar xf - echo " "; echo -n Done. Press return to proceed....; set input = $<; if ($input == "x")exit; echo " "; ntl: ; echo stage = ntl; echo " " echo "Now I will compile Victor Shoup's library for doing number theory." echo "You may need to adjust the makefile (in directory NTL). In particular," echo I added -mv8 to CFLAGS, which may not be appropriate for your hardware. echo Also, for NeXTStep, you need to go through and replace all the includes echo of malloc.h by includes of stdlib.h. modify: ; echo stage = modify; echo " " echo " "; echo -n Press return to proceed with compilation....; cd NTL make /bin/mv ntl.a ../obj make clean /bin/mv mach_desc.h ../inc /bin/rm Test XXX GetTime.c cd .. echo " "; echo -n Done. Press return to proceed....; gmp: ; echo stage = ntl; echo " " echo "Now I will compile the GNU multiple precision library (gmp)." echo "It is version 2.0.2 plus a patch to mpq add/sub, a patch to mpf...str," echo "a patch to mpf_set_q, and a patch to divrem.c." echo " "; echo -n Press return to proceed with compilation....; cp src/GMP.tar.gz . gunzip GMP.tar cat GMP.tar | tar xf - cd GMP cd gmp-2.0.2 ./configure make cp libgmp.a ../../obj/libgmp_local.a cp gmp.h ../../inc cd ../.. /bin/rm -rf GMP echo " "; echo -n Done. Press return to proceed....; echo Now you may need to modify CODE to suit your system, by editing the echo "#define lines, as indicated below. In the case where something should " echo "not be defined, put // in front of #define to comment out the line. In " echo the case where something should be defined, remove the // if present. echo " " echo --- CPLEX should be set to the name of your CPLEX executable file echo " (probably cplex or cplexmip)" echo --- CPLEX_VERSION should be set to the version number of your copy of CPLEX echo --- ABSOLUTE_PATH_FOR_CPLEX will need to be set if CPLEX refuses to echo " recognize relative file names" echo " " echo If you do not have CPLEX, there is no need to change any of these lines. echo " " echo -n Make any needed changes to CODE and then press return to proceed.... set input = $<; if ($input == "x")exit; echo " "; disect: ; echo stage = disect; echo " " echo Now I am ready to unpack the file CODE. First I will compile the program echo disect, and then execute it on CODE. This stage takes about 30 seconds on echo my machine, but disect is rather badly written, and could take forever if echo "files are being shuffled across a network. (I'll also unpack some other" echo "files.)" echo " "; echo -n Press return to proceed with the disection....; set input = $<; if ($input == "x")exit; echo " "; cp src/disect.cc . if ('Linux' == "OPENSTEP") then g++ disect.cc -w -lg++ -o disect -x else g++ disect.cc -lg++ -s -o disect endif foreach i (CODE DATA_F2_1 NOT_MINE SEVENS EIGHTS) disect src/$i end /bin/rm disect.cc disect src/LOG /bin/rm src/LOG chmod 555 log/* chmod 755 prep echo " "; echo -n Done. Press return to proceed....; set input = $<; if ($input == "x")exit; echo " "; compile: ; echo stage = compile echo "And now it's time to compile Split\! This takes 32 minutes on my machine." echo "If it is incredibly slow on your machine, try reading the file 'prep'" echo " "; echo -n Press return to proceed with the compilation....; set input = $<; if ($input == "x")exit; echo " "; prep all echo " " echo Assuming that no error messages appeared above, Split has now been echo "successfully installed\!" echo " " echo If you do not wish to modify and thence recompile the program, only echo the following files/directories are absolutely essential: echo Split, code.data, code.data1, calculations, tex, tex/t.dvi, tex/t.idxb, echo and hints. echo "You could (if you wished) copy these to another place on your computer" echo for someone else to use. echo " "; echo You may wish to look at the file doc/backward-compatibility, which echo contains a record of incompatibilities with earlier versions that have echo been introduced. echo " "; echo -n Press return to proceed....; set input = $<; if ($input == "x")exit; echo " "; echo "Now look at the section of the report (tex/t.dvi) entitled" echo "'Execution of the proofs in this report'", where you will find a echo battery of tests to carry out. echo " "; echo Have fun!