Skip to content

Commit

Permalink
changes needed to build on cygwin; also make it possible to start wit…
Browse files Browse the repository at this point in the history
…h having twisted or gap installed.
  • Loading branch information
williamstein committed Mar 25, 2007
1 parent 097f083 commit bc333c7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
11 changes: 7 additions & 4 deletions src/sage/all.py
Expand Up @@ -241,10 +241,13 @@ def quit_sage(verbose=True):
from sage.misc.misc import delete_tmpfiles
delete_tmpfiles()

# stop the twisted reactor
from twisted.internet import reactor
if reactor.running:
reactor.callFromThread(reactor.stop)
try:
# stop the twisted reactor
from twisted.internet import reactor
if reactor.running:
reactor.callFromThread(reactor.stop)
except ImportError:
pass

def _quit_sage_(self):
import sage.misc.preparser_ipython
Expand Down
2 changes: 1 addition & 1 deletion src/sage/dsage/all.py
@@ -1,7 +1,7 @@
"""nodoctest
"""
from sage.dsage.dsage import dsage
from sage.dsage.dist_functions.all import *
#from sage.dsage.dist_functions.all import *

def DSage(server=None, port=8081, username=None,
pubkey_file=None, privkey_file=None):
Expand Down
4 changes: 2 additions & 2 deletions src/sage/interfaces/gap.py
Expand Up @@ -167,8 +167,6 @@

def gap_command(use_workspace_cache=True):
if use_workspace_cache:
if not os.path.exists(WORKSPACE):
gap_reset_workspace()
return "%s -L %s"%(gap_cmd, WORKSPACE), False
else:
return gap_cmd, True
Expand Down Expand Up @@ -231,6 +229,8 @@ def _read_in_file_command(self, filename):


def _start(self):
if self.__use_workspace_cache and not os.path.exists(WORKSPACE):
gap_reset_workspace()
global first_try
n = self._session_number
try:
Expand Down
3 changes: 2 additions & 1 deletion src/sage/monoids/string_monoid.py
Expand Up @@ -18,7 +18,6 @@
from free_monoid import FreeMonoid_class
from string_monoid_element import StringMonoidElement
from string_ops import strip_encoding
from Crypto.Util.number import bytes_to_long

import weakref

Expand Down Expand Up @@ -337,6 +336,7 @@ def encoding(self,S,padic=False):
sage: S.encoding(' ',padic=True)
00000100
"""
from Crypto.Util.number import bytes_to_long
bit_string = [ ]
for i in range(len(S)):
n = int(bytes_to_long(S[i]))
Expand Down Expand Up @@ -494,6 +494,7 @@ def encoding(self,S,padic=False):
sage: S.encoding(' ',padic=True)
02
"""
from Crypto.Util.number import bytes_to_long
hex_string = [ ]
for i in range(len(S)):
n = int(bytes_to_long(S[i]))
Expand Down
2 changes: 1 addition & 1 deletion src/sage/monoids/string_monoid_element.py
Expand Up @@ -20,7 +20,6 @@
#*****************************************************************************

import operator
from Crypto.Util.number import long_to_bytes
from sage.rings.integer import Integer
from sage.rings.real_mpfr import RealField
from sage.structure.element import MonoidElement
Expand Down Expand Up @@ -231,6 +230,7 @@ def decoding(self,padic=False):
'A..Za..z'
"""
S = self.parent()
from Crypto.Util.number import long_to_bytes
if isinstance(S,string_monoid.AlphabeticStringMonoid):
return ''.join([ long_to_bytes(65+i) for i in self._element_list ])
n = self.__len__()
Expand Down
13 changes: 6 additions & 7 deletions src/setup.py
Expand Up @@ -101,7 +101,7 @@

ntl = Extension('sage.libs.ntl.ntl',
sources = ["sage/libs/ntl/ntl.pyx"],
libraries = ["ntl", "gmp", "gmpxx", "m", "stdc++"]
libraries = ["csage", "ntl", "gmp", "gmpxx", "m", "stdc++"]
)

mwrank = Extension("sage.libs.mwrank.mwrank",
Expand Down Expand Up @@ -169,8 +169,7 @@

linbox = Extension('sage.libs.linbox.linbox',
['sage/libs/linbox/linbox.pyx'],
libraries = ['linboxwrap', 'linbox', 'ntl', 'gmp', 'gmpxx', 'stdc++', 'givaro'],

libraries = ['ntl', 'linboxwrap', 'linbox', 'gmp', 'gmpxx', 'stdc++', 'givaro', BLAS],
language = 'c++')

matrix_modn_dense = Extension('sage.matrix.matrix_modn_dense',
Expand Down Expand Up @@ -446,11 +445,11 @@
Extension('sage.rings.integer',
sources = ['sage/ext/arith.pyx', 'sage/rings/integer.pyx', \
'sage/ext/mpn_pylong.c', 'sage/ext/mpz_pylong.c'],
libraries=['gmp']), \
libraries=['ntl', 'gmp']), \

Extension('sage.rings.integer_ring',
sources = ['sage/rings/integer_ring.pyx'],
libraries=['gmp']), \
libraries=['ntl', 'gmp']), \

Extension('sage.rings.memory', \
sources = ['sage/rings/memory.pyx'], \
Expand All @@ -474,7 +473,7 @@
'sage/ext/arith.pyx', \
'sage/rings/integer.pyx', \
'sage/ext/mpn_pylong.c', 'sage/ext/mpz_pylong.c'],
libraries=['gmp']), \
libraries=['ntl', 'gmp']), \

Extension('sage.rings.sparse_poly',
sources = ['sage/rings/sparse_poly.pyx'],
Expand Down Expand Up @@ -563,7 +562,7 @@
#ext_modules.append(mpc)

for m in ext_modules:
m.libraries += ['csage']
m.libraries = ['csage'] + m.libraries + ['stdc++']
m.library_dirs += ['%s/lib' % SAGE_LOCAL]


Expand Down

0 comments on commit bc333c7

Please sign in to comment.