Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/build/pkgs/cvxopt/patches/setup.py.patch
8821 views
1
diff -ru src/setup.py b/setup.py
2
--- src/setup.py 2013-04-22 08:44:28.000000000 +0200
3
+++ b/setup.py 2013-05-15 10:43:21.332392968 +0200
4
@@ -2,26 +2,38 @@
5
from glob import glob
6
7
# Modifiy this if BLAS and LAPACK libraries are not in /usr/lib.
8
-BLAS_LIB_DIR = '/usr/lib'
9
+
10
+import os
11
+SAGE_LIB = os.environ['SAGE_LOCAL']+'/lib'
12
+SAGE_INCLUDE = os.environ['SAGE_LOCAL']+'/include'
13
14
# Default names of BLAS and LAPACK libraries
15
-BLAS_LIB = ['blas']
16
LAPACK_LIB = ['lapack']
17
BLAS_EXTRA_LINK_ARGS = []
18
19
+if os.environ['UNAME'] == 'CYGWIN':
20
+ BLAS_LIB =['blas', 'gfortran']
21
+ BLAS_LIB_DIR = '/usr/lib'
22
+elif os.environ['UNAME'] == 'Darwin':
23
+ BLAS_LIB =['blas','gfortran','m']
24
+ BLAS_LIB_DIR = '/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/'
25
+else:
26
+ BLAS_LIB =['f77blas','cblas','gfortran','atlas','m']
27
+ BLAS_LIB_DIR = SAGE_LIB
28
+
29
# Set environment variable BLAS_NOUNDERSCORES=1 if your BLAS/LAPACK do
30
# not use trailing underscores
31
BLAS_NOUNDERSCORES = False
32
33
# Set to 1 if you are using the random number generators in the GNU
34
# Scientific Library.
35
-BUILD_GSL = 0
36
+BUILD_GSL = 1
37
38
# Directory containing libgsl (used only when BUILD_GSL = 1).
39
-GSL_LIB_DIR = '/usr/lib'
40
+GSL_LIB_DIR = SAGE_LIB
41
42
# Directory containing the GSL header files (used only when BUILD_GSL = 1).
43
-GSL_INC_DIR = '/usr/include/gsl'
44
+GSL_INC_DIR = SAGE_INCLUDE
45
46
# Set to 1 if you are installing the fftw module.
47
BUILD_FFTW = 0
48
@@ -33,13 +45,13 @@
49
FFTW_INC_DIR = '/usr/include'
50
51
# Set to 1 if you are installing the glpk module.
52
-BUILD_GLPK = 0
53
+BUILD_GLPK = 1
54
55
# Directory containing libglpk (used only when BUILD_GLPK = 1).
56
-GLPK_LIB_DIR = '/usr/lib'
57
+GLPK_LIB_DIR = SAGE_LIB
58
59
# Directory containing glpk.h (used only when BUILD_GLPK = 1).
60
-GLPK_INC_DIR = '/usr/include'
61
+GLPK_INC_DIR = SAGE_INCLUDE
62
63
# Set to 1 if you are installing the DSDP module.
64
BUILD_DSDP = 0
65
@@ -77,7 +89,7 @@
66
extmods += [fftw];
67
68
if BUILD_GLPK:
69
- glpk = Extension('glpk', libraries = ['glpk'],
70
+ glpk = Extension('glpk', libraries = ['glpk', 'gmp', 'z'],
71
include_dirs = [ GLPK_INC_DIR ],
72
library_dirs = [ GLPK_LIB_DIR ],
73
sources = ['src/C/glpk.c'] )
74
75