You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDPA for Python (`sdpa-python`) is a wrapper on top of the SDPA package. We will go over building SDPA first, followed by SDPA for Python.
13
13
14
-
## Obtaining and building SDPA
14
+
## Obtaining and building the backend
15
15
16
-
The primary software package containing SDPA is named simply `sdpa` and the source can be obtained from the [official website](http://sdpa.sourceforge.net/download.html). Currently, the latest version is {{page.sdpa_latest_version}}.
16
+
As a backend, we can use either the regular SDPA package, or the SDPA Multiprecision variant. SDPA Multiprecision is a fork of SDPA-GMP.
17
17
18
-
Sourceforge does not allow a direct download link, however, the specific file required is [sdpa_{{page.sdpa_latest_version}}.tar.gz](https://downloads.sourceforge.net/project/sdpa/sdpa/sdpa_{{page.sdpa_latest_version}}.tar.gz).
18
+
If you choose to use **SDPA Multiprecision**, please follow the instructions in the README of its [GitHub repository](https://github.com/sdpa-python/sdpa-multiprecision), and then skip directly to the [next section](#obtaining-and-installing-sdpa-python-wrapper) on building the Python wrapper.
19
+
20
+
If you choose to use the **regular SDPA package**, please download it from the [official website](http://sdpa.sourceforge.net/download.html). Currently, the latest version is {{page.sdpa_latest_version}}. Sourceforge does not allow a direct download link, however, the specific file required is [sdpa_{{page.sdpa_latest_version}}.tar.gz](https://downloads.sourceforge.net/project/sdpa/sdpa/sdpa_{{page.sdpa_latest_version}}.tar.gz).
19
21
20
22
Once downloaded, unzip it using:
21
23
@@ -88,22 +90,42 @@ This should complete a test run the `sdpa` binary using one of the provided exam
88
90
89
91
## Obtaining and installing SDPA Python wrapper
90
92
91
-
Once you have built and done a test run on `sdpa`, you have a working SDPA binary, it's finally time to build and install `sdpa-python`.
93
+
Once you have built and done a test run on `sdpa` (or `sdpa_gmp` if using the Multiprecision backend), you have a working SDPA binary, it's finally time to build and install `sdpa-python`.
92
94
93
95
We need SPOOLES for building `sdpa-python`.
94
96
95
-
### Obtaining SPOOLES headers
97
+
### Obtaining and building the SPOOLES library and headers
98
+
99
+
If you are using the **SDPA Multiprecision** backend, it contains SPOOLES and will build it as part of the buildsystem. In that case, you can skip directly to the next subsection.
96
100
97
-
On Linux, `libspooles` is provided by your distribution (as `libspooles` or `libspooles-dev`) and installed system wide (so you need not provide the library path for it in `setupcfg.py`). The best way to check if you have it is to compile a very basic Hello World program with `g++ hello.c -lspooles`. If it throws an error, you can refer to instructions for installing them for your distribution.
101
+
If you are using the regular SDPA backend, you will have to download as well as build the SPOOLES library.
98
102
99
-
You will however, still need to download it because SPOOLES headers are imported by `sdpa-python` (and you will need to provide the include path for it in `setupcfg.py`). It can be obtained from the official [SPOOLES webpage](http://www.netlib.org/linalg/spooles/spooles.2.2.html) or the [Debian package sources](http://ftp.de.debian.org/debian/pool/main/s/spooles/spooles_2.2.orig.tar.gz).
103
+
SPOOLES can be obtained from the official [SPOOLES webpage](http://www.netlib.org/linalg/spooles/spooles.2.2.html) or the [Debian package sources](http://ftp.de.debian.org/debian/pool/main/s/spooles/spooles_2.2.orig.tar.gz).
tar -zxf spooles.2.2.tgz -C spooles # (OR spooles_2.2.orig.tar.gz if from Debian Sources)
108
+
tar -zxf spooles_2.2.orig.tar.gz -C spooles
105
109
```
106
110
111
+
Open `Make.inc` (located in the root of the extracted `spooles` folder) in a text editor and remove the line `CC = /usr/lang-4.0/bin/cc`. This will let it use the default compiler on your system (otherwise it will throw an error).
112
+
113
+
To build it, cd to the directory where you extracted SPOOLES and do `make lib`.
114
+
115
+
```bash
116
+
cd spooles
117
+
make lib
118
+
```
119
+
120
+
By default, the `Makefile` will load the code into `spooles.a` and this may cause the library to be not locatable (despite providing the search path in `setupcfg.py`). To avoid this issue, please rename this file to `libspooles.a`.
121
+
122
+
```bash
123
+
mv spooles.a libspooles.a
124
+
```
125
+
126
+
{: .warning }
127
+
SPOOLES may clash with GLIBC on some distributions. If that happens when you run `python setup.py install` later, you will need to rebuild SPOOLES with the `-fPIC` flag. This flag can be added to `CFLAGS` in the same `Make.inc` file.
128
+
107
129
### Obtain and prepare `sdpa-python` for build
108
130
109
131
You can obtain it by
@@ -120,25 +142,33 @@ cd sdpa-python
120
142
121
143
There is a file `setupcfg.py` in the root of `sdpa-python`. We need to edit it and provide
122
144
123
-
1. The link to the `make.inc` in the `sdpa` folder (so it can find `libsdpa.a`). Assuming you extracted it in your home folder:
145
+
1. The location of SDPA headers and static library (i.e. `libsdpa.a` or `libsdpa_gmp.a`):
146
+
147
+
```python
148
+
SDPA_DIR='/path/to/sdpa_package_name'
149
+
```
150
+
151
+
2. Only if using the **regular SDPA** backend, the location of SPOOLES library and headers (for Multiprecision backend these variables need not be changed):
2. The location of SPOOLES library and headers. Assuming you extracted it in your home folder:
158
+
3. Only if using the **regular SDPA** backend, the names of the BLAS/LAPACK implementation(s) that you intend to use. Please use the same one asyou did while building the SDPA (backend) package. Assuming you used OpenBLAS:
130
159
131
160
```python
132
-
SPOOLES_INCLUDE='/home/yourusername/spooles/'
161
+
BLAS_LAPACK_LIBS=['openblas']
133
162
```
134
163
135
-
3. Names of BLAS/LAPACKifyou did not use the reference BLAS. Please use the same BLAS/LAPACK that you used while building `sdpa`. Assuming you used OpenBLAS:
164
+
4. Only ifusing the **SDPA Multiprecision** backend, the location of GMP library and headers:
136
165
137
166
```python
138
-
LAPACK_NAME='openblas'
139
-
BLAS_NAME='openblas'
167
+
GMP_DIR='/path/to/gmp-version'
140
168
```
141
169
170
+
5. Lastly, if you are using the **SDPA Multiprecision** backend, please set`USEGMP = True`in this file.
171
+
142
172
### Install `sdpa-python` Package
143
173
144
174
Finally, build and install `sdpa-python` package. While still in the `sdpa-python` directory, do:
SDPA for Python (`sdpa-python`) is a wrapper on top of the SDPA package. We will go over building SDPA first, followed by SDPA for Python.
13
13
14
-
## Obtaining and building SDPA
14
+
## Obtaining and building the backend
15
15
16
-
The primary software package containing SDPA is named simply `sdpa` and the source can be obtained from the [official website](http://sdpa.sourceforge.net/download.html). Currently, the latest version is {{page.sdpa_latest_version}}.
16
+
As a backend, we can use either the regular SDPA package, or the SDPA Multiprecision variant. SDPA Multiprecision is a fork of SDPA-GMP.
17
17
18
-
Sourceforge does not allow a direct download link, however, the specific file required is [sdpa_{{page.sdpa_latest_version}}.tar.gz](https://downloads.sourceforge.net/project/sdpa/sdpa/sdpa_{{page.sdpa_latest_version}}.tar.gz).
18
+
If you choose to use **SDPA Multiprecision**, please follow the instructions in the README of its [GitHub repository](https://github.com/sdpa-python/sdpa-multiprecision), and then skip directly to the [next section](#obtaining-and-installing-sdpa-python-wrapper) on building the Python wrapper.
19
+
20
+
If you choose to use the **regular SDPA package**, please download it from the [official website](http://sdpa.sourceforge.net/download.html). Currently, the latest version is {{page.sdpa_latest_version}}. Sourceforge does not allow a direct download link, however, the specific file required is [sdpa_{{page.sdpa_latest_version}}.tar.gz](https://downloads.sourceforge.net/project/sdpa/sdpa/sdpa_{{page.sdpa_latest_version}}.tar.gz).
19
21
20
22
Once downloaded, unzip it using:
21
23
@@ -92,13 +94,15 @@ This should complete a test run the `sdpa` binary using one of the provided exam
92
94
93
95
## Obtaining and installing SDPA Python wrapper
94
96
95
-
Once you have built and done a test run on `sdpa`, you have a working SDPA binary, it's finally time to build and install `sdpa-python`.
97
+
Once you have built and done a test run on `sdpa` (or `sdpa_gmp` if using the Multiprecision backend), you have a working SDPA binary, it's finally time to build and install `sdpa-python`.
96
98
97
99
We need SPOOLES for building `sdpa-python`.
98
100
99
-
### Obtaining SPOOLES library and headers
101
+
### Obtaining and building the SPOOLES library and headers
102
+
103
+
If you are using the **SDPA Multiprecision** backend, it contains SPOOLES and will build it as part of the buildsystem. In that case, you can skip directly to the next subsection.
100
104
101
-
On macOS we have to download as well as build the SPOOLES library.
105
+
If you are using the regular SDPA backend, you will have to download as well as build the SPOOLES library.
102
106
103
107
SPOOLES can be obtained from the official [SPOOLES webpage](http://www.netlib.org/linalg/spooles/spooles.2.2.html) or the [Debian package sources](http://ftp.de.debian.org/debian/pool/main/s/spooles/spooles_2.2.orig.tar.gz).
104
108
@@ -140,18 +144,17 @@ cd sdpa-python
140
144
There is a file `setupcfg.py`in the root of `sdpa-python`. We need to edit it and provide
141
145
142
146
143
-
1. The link to the `make.inc`in the `sdpa` folder (so it can find `libsdpa.a`). Assuming you extracted it on your Desktop:
144
-
145
-
Assuming you extracted it on your Desktop:
147
+
1. The location of SDPA headers and static library (i.e. `libsdpa.a` or `libsdpa_gmp.a`):
2. The location of SPOOLES library and headers. Assuming you extracted it on your Desktop:
153
+
2. Only if using the **regular SDPA** backend, the location of SPOOLES library and headers (for Multiprecision backend these variables need not be changed):
3. The location of `libgfortran.a` and `libquadmath.a`. Assuming you installed it from [this GitHub repository](https://github.com/fxcoudert/gfortran-for-macOS) with the default options:
@@ -160,6 +163,14 @@ There is a file `setupcfg.py` in the root of `sdpa-python`. We need to edit it a
160
163
GFORTRAN_LIBS ='/usr/local/gfortran/lib'
161
164
```
162
165
166
+
4. Only if using the **SDPA Multiprecision** backend, the location of GMP library and headers:
167
+
168
+
```python
169
+
GMP_DIR = '/path/to/gmp-version'
170
+
```
171
+
172
+
5. Lastly, if you are using the **SDPA Multiprecision** backend, please set`USEGMP = True`in this file.
173
+
163
174
### Install `sdpa-python` Package
164
175
165
176
Finally, build and install `sdpa-python` package. While still in the `sdpa-python` directory, do:
Copy file name to clipboardExpand all lines: docs/installation/windows.md
+23-21Lines changed: 23 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,11 +39,13 @@ This will give us the basic build tools, i.e. `make` and `gcc`/`g++`.
39
39
40
40
We will remain on the **MSYS2 MSYS** shell until the build step (when we will switch to **MSYS2 MinGW x64**).
41
41
42
-
## Obtaining and building SDPA
42
+
## Obtaining and building the backend
43
43
44
-
The primary software package containing SDPA is named simply `sdpa` and the source can be obtained from the [official website](http://sdpa.sourceforge.net/download.html). Currently, the latest version is {{page.sdpa_latest_version}}.
44
+
As a backend, we can use either the regular SDPA package, or the SDPA Multiprecision variant. SDPA Multiprecision is a fork of SDPA-GMP.
45
45
46
-
Sourceforge does not allow a direct download link, however, the specific file required is [sdpa_{{page.sdpa_latest_version}}.tar.gz](https://downloads.sourceforge.net/project/sdpa/sdpa/sdpa_{{page.sdpa_latest_version}}.tar.gz).
46
+
If you choose to use **SDPA Multiprecision**, please follow the instructions in the README of its [GitHub repository](https://github.com/sdpa-python/sdpa-multiprecision), and then skip directly to the [next section](#obtaining-and-installing-sdpa-python-wrapper) on building the Python wrapper.
47
+
48
+
If you choose to use the **regular SDPA package**, please download it from the [official website](http://sdpa.sourceforge.net/download.html). Currently, the latest version is {{page.sdpa_latest_version}}. Sourceforge does not allow a direct download link, however, the specific file required is [sdpa_{{page.sdpa_latest_version}}.tar.gz](https://downloads.sourceforge.net/project/sdpa/sdpa/sdpa_{{page.sdpa_latest_version}}.tar.gz).
47
49
48
50
Once downloaded, unzip it using:
49
51
@@ -129,27 +131,21 @@ This should complete a test run the `sdpa` binary using one of the provided exam
129
131
130
132
## Obtaining and installing SDPA Python wrapper
131
133
132
-
Once you have built and done a test run on `sdpa`, you have a working SDPA binary, it's finally time to build and install `sdpa-python`.
134
+
Once you have built and done a test run on `sdpa` (or `sdpa_gmp`if using the Multiprecision backend), you have a working SDPA binary, it's finally time to build and install `sdpa-python`.
133
135
134
136
We need SPOOLES for building `sdpa-python`.
135
137
136
-
### Obtaining SPOOLES headers
138
+
### Obtaining SPOOLES library and headers
137
139
138
140
On MSYS2, `libspooles` can be installed (from the **MSYS2 MSYS** shell) using
139
141
140
142
```bash
141
143
pacman -S mingw-w64-x86_64-spooles
142
144
```
143
145
144
-
The best way to verify installation is to compile a very basic Hello World program with `g++ hello.c -lspooles`.
145
-
146
-
You will however, still need to download it because SPOOLES headers are imported by `sdpa-python` (and you will need to provide the include path for it in `setupcfg.py`). It can be obtained from the official [SPOOLES webpage](http://www.netlib.org/linalg/spooles/spooles.2.2.html) or the [Debian package sources](http://ftp.de.debian.org/debian/pool/main/s/spooles/spooles_2.2.orig.tar.gz).
146
+
**Note**: SDPA Multiprecision also uses SPOOLES. If you successfully built SDPA Multiprecision, you should already have SPOOLES on your system.
4. Names of BLAS/LAPACK if you did not use the reference BLAS. Please use the same BLAS/LAPACK that you used while building `sdpa`. Assuming you used OpenBLAS:
204
+
4. Only if using the **regular SDPA** backend, the names of the BLAS/LAPACK implementation(s) that you intend to use. Please use the same one as you did while building the SDPA (backend) package. Assuming you used OpenBLAS:
209
205
210
206
```python
211
-
LAPACK_NAME = 'openblas'
212
-
BLAS_NAME = 'openblas'
207
+
BLAS_LAPACK_LIBS = ['openblas', 'gomp']
208
+
209
+
5. Only if using the **SDPA Multiprecision** backend, the location of GMP library and headers:
0 commit comments