[sage-support] Re: problem building 5.4.1 on macosx 10.8.2

2012-12-14 Thread Greg Minshall
Volker,

 C_INCLUDE_PATH / CPLUS_INCLUDE_PATH are overriding the default gcc header 
 search path. This is why compilation is failing. Did fink put in these 
 system-wide environment variables? Thats seriously effed up.

no, they come from my .bashrc.  they've been there since 2008.  sadly,
i no longer remember (nor documented) the reason they ended up there.

the gcc man page is a bit ambiguous:

CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH

  Each variable's value is a list of directories separated by a special
  character, much like PATH, in which to look for header files.  The
  special character, PATH_SEPARATOR, is target-dependent and
  determined at GCC build time.  For Microsoft Windows-based targets it
  is a semicolon, and for almost all other targets it is a colon.

  CPATH specifies a list of directories to be searched as if specified
  with -I, but after any paths given with -I options on the command
  line.  This environment variable is used regardless of which language
  is being preprocessed.

  The remaining environment variables apply only when preprocessing the
  particular language indicated.  Each specifies a list of directories
  to be searched as if specified with -isystem, but after any paths
  given with -isystem options on the command line.

but i read (past and present tense) this as saying that C_INCLUDE_PATH
is searched *after* any -Idir statements on the command lines (in
which case, the -Idir statements Sage puts on the command line would
have had the local directories searched before these).  do you know, are
they, in fact, search *before* the -Idir?  that would certainly
explain it.

cheers, Greg

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: problem building 5.4.1 on macosx 10.8.2

2012-12-14 Thread Volker Braun
No its first -Idir, then *_INCLUDE_PATH, then the path thats hard-wired 
into the compiler. But since Sage builds its own compiler you are 
effectively overriding the search path.

On Friday, December 14, 2012 3:13:06 PM UTC, Greg Minshall wrote:

  C_INCLUDE_PATH / CPLUS_INCLUDE_PATH are overriding the default gcc 
 header 
  search path. This is why compilation is failing. Did fink put in these 
  system-wide environment variables? Thats seriously effed up. 

 no, they come from my .bashrc.  they've been there since 2008.  sadly, 
 i no longer remember (nor documented) the reason they ended up there. 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Symbolic Calculation in Sage

2012-12-14 Thread Santanu Sarkar
Is there any function in Sage   by which  this kind of symbolic calculation
is possible?
s=0
for i=1 to m
  if(ia+t)
s=s+2i
  else
 s=s+t

m,a,t are non negative integers.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Symbolic Calculation in Sage

2012-12-14 Thread William Stein
On Fri, Dec 14, 2012 at 12:31 PM, Santanu Sarkar 
sarkar.santanu@gmail.com wrote:
 Is there any function in Sage   by which  this kind of symbolic
calculation
 is possible?

 s=0
 for i=1 to m
   if(ia+t)
 s=s+2i
   else
  s=s+t

 m,a,t are non negative integers.

I have no idea what you're asking, but you might find this snippet of Sage
code relevant:

m = 10; a = 5; t = 3
s = 0
for i in [1..m]:
if ia+t:
s += 2*i
else:
s += t
print s



 --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.





-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Symbolic Calculation in Sage

2012-12-14 Thread William Stein
On Fri, Dec 14, 2012 at 2:44 PM, Santanu Sarkar 
sarkar.santanu@gmail.com wrote:

 No, as s will be a function of a,m,t,
 I need that function. For my toy example it will be easy.


You wrote  s=0 right in your question, so I don't think I'll be able
to help you further.  I hope somebody else can.




 On 14 December 2012 14:37, William Stein wst...@gmail.com wrote:



 On Fri, Dec 14, 2012 at 12:31 PM, Santanu Sarkar 
 sarkar.santanu@gmail.com wrote:
  Is there any function in Sage   by which  this kind of symbolic
 calculation
  is possible?
 
  s=0
  for i=1 to m
if(ia+t)
  s=s+2i
else
   s=s+t
 
  m,a,t are non negative integers.

 I have no idea what you're asking, but you might find this snippet of
 Sage code relevant:

 m = 10; a = 5; t = 3
 s = 0
 for i in [1..m]:
 if ia+t:
 s += 2*i
 else:
 s += t
 print s


 
  --
  You received this message because you are subscribed to the Google
 Groups
  sage-support group.
  To post to this group, send email to sage-support@googlegroups.com.
  To unsubscribe from this group, send email to
  sage-support+unsubscr...@googlegroups.com.
  Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 



 --
 William Stein
 Professor of Mathematics
 University of Washington
 http://wstein.org

 --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.




  --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To post to this group, send email to sage-support@googlegroups.com.
 To unsubscribe from this group, send email to
 sage-support+unsubscr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support?hl=en.






-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: problem building 5.4.1 on macosx 10.8.2

2012-12-14 Thread Greg Minshall
Volker,

No its first -Idir, then *_INCLUDE_PATH, then the path thats hard-wired 
 into the compiler. But since Sage builds its own compiler you are 
 effectively overriding the search path.


however, this doesn't explain the failure i was having, where

gcc  -c -I. -I../src/headers -I../src/language
-I/Users/minshall/src/import/sage/sage-5.4.1/local/include -O3 -Wall
-fno-strict-aliasing -fomit-frame-pointer  -g   -o gp_rl.o
../src/gp/gp_rl.c 

(i.e., with -I.../sage-5.4.1/local/include is on the command line)
appears to have picked up the readline/readline.h from /usr/include,
rather than from .../sage-5.4.1/local/include.

or, am i missing something?  (maybe i don't understand your second 
sentence?)

Greg

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: buggy integral

2012-12-14 Thread undy
Hi,
I was actually using a very old version of Sage (4.8). I have just tried 
with version 5.4.1 and... yes, it works perfectly now!
I should have thought of upgrading Sage earlier I am sorry about that.
Thank you,
Undy

Il giorno venerdì 14 dicembre 2012 15:01:10 UTC+1, kcrisman ha scritto:



 On Thursday, December 13, 2012 4:34:03 PM UTC-5, Emmanuel Charpentier 
 wrote:

 I can't reproduce your problem (using the server at www.sagenb.org). I 
 ask :


 Undy, is it possible that you have an older version of Sage?  We do update 
 Maxima (and hence our integration routines) periodically; in fact, we need 
 to do so again.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Symbolic Calculation in Sage

2012-12-14 Thread Keshav Kini
Santanu Sarkar sarkar.santanu@gmail.com writes:

 No, as s will be a function of a,m,t,

You can't have imperative code in a symbolic function, if that's what
you're asking. You can of course use an imperative (Python) function to
do what you want::

def s(m, a, t):
result = 0
for i in srange(1,m+1):
if i  a + t:
s += 2*i
else:
s += t
return result

But now this function cannot be used in some places where a symbolic
expression could. For example you will be hard pressed to plot a partial
evaluation of it without some wrapping gymnastics.

-Keshav

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: problem building 5.4.1 on macosx 10.8.2

2012-12-14 Thread Volker Braun
If the directory is already in the built-in search path (like 
/Users/minshall/src/import/sage/sage-5.4.1/local/include if you use the gcc 
that Sage compiled) then the -I option is ignored. 

-Idir
Add the directory dir to the head of the list of directories to be searched 
for header files. This can be used to override a system header file, 
substituting your own version, since these directories are searched before 
the system header file directories. However, you should not use this option 
to add directories that contain vendor-supplied system header files (use 
-isystem for that). If you use more than one -I option, the directories are 
scanned in left-to-right order; the standard system directories come after.
If a standard system include directory, or a directory specified with 
-isystem, is also specified with -I, the -I option will be ignored. The 
directory will still be searched but as a system directory at its normal 
position in the system include chain. This is to ensure that GCC's 
procedure to fix buggy system headers and the ordering for the include_next 
directive are not inadvertently changed. If you really need to change the 
search order for system directories, use the -nostdinc and/or -isystem 
options. 

http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Directory-Options.html#Directory-Options



On Friday, December 14, 2012 7:58:35 PM UTC, Greg Minshall wrote:

 Volker,

 No its first -Idir, then *_INCLUDE_PATH, then the path thats hard-wired 
 into the compiler. But since Sage builds its own compiler you are 
 effectively overriding the search path.


 however, this doesn't explain the failure i was having, where
 
 gcc  -c -I. -I../src/headers -I../src/language
 -I/Users/minshall/src/import/sage/sage-5.4.1/local/include -O3 -Wall
 -fno-strict-aliasing -fomit-frame-pointer  -g   -o gp_rl.o
 ../src/gp/gp_rl.c 
 
 (i.e., with -I.../sage-5.4.1/local/include is on the command line)
 appears to have picked up the readline/readline.h from /usr/include,
 rather than from .../sage-5.4.1/local/include.

 or, am i missing something?  (maybe i don't understand your second 
 sentence?)

 Greg


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: problem building 5.4.1 on macosx 10.8.2

2012-12-14 Thread Greg Minshall
Volker,

 If the directory is already in the built-in search path (like
 /Users/minshall/src/import/sage/sage-5.4.1/local/include if you use
 the gcc that Sage compiled) then the -I option is ignored.

ah!  got it.  so, the Sage-compiled gcc includes .../local/include as
a standard system directory (and, is also on the command line via
-I).  that explains it.

thanks!

Greg

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Symbolic Calculation in Sage

2012-12-14 Thread Nils Bruin

On Friday, December 14, 2012 12:41:57 PM UTC-8, Keshav Kini wrote:

 Santanu Sarkar sarkar.sa...@gmail.com javascript: writes: 

  No, as s will be a function of a,m,t, 

 You can't have imperative code in a symbolic function, if that's what 
 you're asking. You can of course use an imperative (Python) function to 
 do what you want:: 

 def s(m, a, t): 
 result = 0 
 for i in srange(1,m+1): 
 if i  a + t: 
 s += 2*i 
 else: 
 s += t 
 return result 


Ah, so perhaps you want something along the lines of:

sage: var('i')
sage: s(m,a,t)=sum(2*i*heaviside(i-a*t)+t*heaviside(a*t-i),i,1,m)

I'm not sure whether sage can do anything useful with it. Also, the 
heaviside step function in sage is undefined at the value where it steps. 
Substitute with a cunning combination of max, min, floor, ceil, etc. to 
create the step you want if you care for values where a*t is an integer.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] unit test failure: expected …'dynamic_class.pyc', got …'dynamic_class.py'

2012-12-14 Thread zooko
I ran make check and this is what I got. This is on Ubuntu 12.04

HACK zompu:~/playground/sage/sage-5.4.1$ ./sage -t  -force_lib 
devel/sage/sage/structure/dynamic_class.py
  
sage -t -force_lib devel/sage/sage/structure/dynamic_class.py
**
File 
/home/zooko/playground/sage/sage-5.4.1/devel/sage/sage/structure/dynamic_class.py,
 line 289:
sage: inspect.getfile(Foo2)
Expected:
'.../sage/structure/dynamic_class.pyc'
Got:

'/home/zooko/playground/sage/sage-5.4.1/local/lib/python/site-packages/sage/structure/dynamic_class.py'
**
File 
/home/zooko/playground/sage/sage-5.4.1/devel/sage/sage/structure/dynamic_class.py,
 line 291:
sage: inspect.getfile(Foo3)
Expected:
'.../sage/structure/dynamic_class.pyc'
Got:

'/home/zooko/playground/sage/sage-5.4.1/local/lib/python/site-packages/sage/structure/dynamic_class.py'
**
1 items had failures:
   2 of  22 in __main__.example_2
***Test Failed*** 2 failures.
For whitespace errors, see the file 
/home/zooko/.sage//tmp/dynamic_class_11687.py
 [14.4 s]
 
--
The following tests failed:


sage -t -force_lib devel/sage/sage/structure/dynamic_class.py
Total time for all tests: 14.6 seconds

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: unit test failure: expected …'dynamic_class.pyc', got …'dynamic_class.py'

2012-12-14 Thread zooko
Aha, it probably has to do with this environment variable that I have set:

PYTHONDONTWRITEBYTECODE=1


I set this years ago in my bash init files in order to work-around some 
other bug in some other software package, the details of which I've now 
forgotten...

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: unit test failure: expected …'dynamic_class.pyc', got …'dynamic_class.py'

2012-12-14 Thread zooko


On Friday, December 14, 2012 9:16:26 PM UTC-7, zooko wrote:

 Aha, it probably has to do with this environment variable that I have set:

 PYTHONDONTWRITEBYTECODE=1


Confirmed that unsetting PYTHONDONTWRITEBYTECODE, rerunning make, and 
then rerunning this test caused the test to pass.

So, you could ignore this as a not-a-bug, or you could figure out how to 
make that test work even when the PYTHONDONTWRITEBYTECODE variable is set.

Regards,

Zooko 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.