• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

MakefileH A D31-Mar-20089 KiB190145

README.MSVCH A D31-Mar-20083.1 KiB6753

acro.cH A D31-Mar-2008404 1915

makegprcH A D31-Mar-2008476 2521

objsH A D31-Mar-2008405 4746

objsgpH A D31-Mar-200851 76

pari.nsiH A D31-Mar-20084.8 KiB153128

pariCE.cH A D31-Mar-20083.5 KiB152100

pariCE.hH A D31-Mar-2008331 1511

paricfg.hH A D03-Feb-20101.8 KiB7459

pariinl.hH A D31-Mar-2008295 146

README.MSVC

1Posted on pari-dev by Bill Daly : [edited to fit current filenames]
2=================================
3
4Here is a description of the steps necessary to compile PARI with the MSVC
5compiler under WIN32.
6
71. Unzip the archive, preserving folder names so that the directory
8structure is correct. I use WinZip to do this, and I put the files on my D:
9drive, so that the files for pari-2.1.0 for example will be stored under
10D:\pari-2.1.0. Note that the archive as downloaded, pari.tgz, is an archive
11of an archive. Winzip doesn't know how to unzip pari.tgz, so I use Aladdin
12Expander to do this, which will create for example the file pari-2.1.0.tar in
13the same directory as pari.tgz. Unfortunately, Aladdin Expander doesn't know
14how to unzip this file, so I use Winzip to do it. Isn't Windows wonderful?
15
162. MSVC doesn't like names of the form "pari-2.1.0", so rename the base
17directory to something like "pari210". Now the files are stored under
18D:\pari210.
19
203. Start MSVC (I use version 6, but earlier versions will probably work the
21same way).
22
234. Select "File\New..." and pick the "Project" tab to create a new project.
24Select "Win32 Console Application" as the project type, and specify the
25project name as "pari210". Make sure that the "Location" of the files is
26D:\pari210. Click "OK", then select "An empty project" (should be the
27default anyway) and click "Finish".
28
295. Select "Project\Add to project\Files..." to add files to the project.
30Select all the *.c and *.h files in src\basemath, src\headers,
31src\kernel\ix86, src\language, src\modules and Odos, EXCEPT pariCE.[ch];
32all of the files in src\gp except gp_rl.c; the files plotnull.c, plotport.c
33and rect.h in src\graph.c; and the file src\kernel\none\mp.c.
34
356. Select "Project\Settings" and pick the "C/C++" tab. Select
36"Preprocessor" from the "Category" menu, and enter
37"D:\pari210\src\headers,D:\pari210\Odos" into the "Additional include
38directories" box. (I also select the "Code Generation" category and change
39the "Struct member alignment" to "1 byte", but this may not be necessary.)
40It is usually convenient for debugging to select the "Debug" tab and
41specify a "Working directory", e.g. "D:\gp" if you have .gp files there
42that you can use for testing.
43
44You should now be able to build and test the program. When you want to
45build a release version, you will have to repeat step 6 above, since MSVC
46doesn't apply the project settings globally.
47
48A couple of points:
49-------------------
50You may get some inconsequential warning messages. You can suppress these
51by adding a line of the form:
52
53   #pragma warning(disable: ...)
54
55to paricfg.h, where ... is a space-delimited list of warning numbers, e.g.
56"4018 4244" corresponding to the warnings C4018 and C4244.
57
58When you compile a release version, global optimization is enabled by
59default. MSVC is fairly buggy with global optimization, so you may find
60that some modules won't compile with it, e.g. sumiter.c. You can either
61disable global optimization (in "Project\Settings" under the tab "C/C++" in
62the category "Optimization"), or you can surround the offending code with:
63
64   #pragma optimization("g", off)
65   ...
66   #pragma optimization("g", on)
67