#7013: [with code, needs review] prime_pi and nth_prime
--------------------------------------+-------------------------------------
 Reporter:  kevin.stueve              |       Owner:  kevin.stueve            
     Type:  enhancement               |      Status:  new                     
 Priority:  major                     |   Milestone:  sage-4.1.2              
Component:  number theory             |    Keywords:  primes, sieve, table,LMO
 Reviewer:  was,robertwb,GeorgSWeber  |      Author:  Kevin Stueve            
   Merged:                            |  
--------------------------------------+-------------------------------------
Changes (by kevin.stueve):

 * cc: robertwb, GeorgSWeber, kevin.stueve (added)
  * reviewer:  was => was,robertwb,GeorgSWeber
  * milestone:  => sage-4.1.2


Comment:

 GeorgSWeber, I don't currently use Windows.  I made the lzma file on
 Ubuntu.  I am currently unable to single-handedly make build scripts for
 my code, because I don't have access to systems with every possible
 operating system on which Sage might be run.  Someone with access to
 different environments could help with the build script for their
 platform.

 Note: On 64bit Ubuntu on an Acer I get the following with Silva's code
 without using -m32 and installing special packages for 32bit mode.  Can
 anyone see how to make this better?
 static void *get_memory(u32 size)
 {
  u32 m;

  line 100:m = (u32)malloc(size + 255); // this assumes that
 sizeof(void *) = sizeof(u32)
  line 101:if((void *)m == NULL)
    exit(1);
  m = (m + 255) & ~255;
  line 104:return (void *)m; // pointer aligned on a 256 byte boundary
 }

 ~/Documents/Silva$ bash compile
 Silva.c: In function ‘get_memory’:
 Silva.c:100: warning: cast from pointer to integer of different size
 Silva.c:101: warning: cast to pointer from integer of different size
 Silva.c:104: warning: cast to pointer from integer of different size
 ~/Documents/Silva$ ./Silva
 Segmentation fault

 Please note that the Silva c and LMO c code work fine without any special
 compiler options or libraries on a MacBookPro.  The Silva c code works on
 64bit Ubuntu when the proper -m32 compiler option is specified and a
 library is installed that allows 32 bit mode (just Google the error you
 get without it).  The LMO c code on 64 bit Ubuntu I believe requires the
 -m32 flag and additional libraries for 32 bit mode.

 Currently, my Python code calls Silva's code and the LMO code from the
 command line using the subprocess module.

 Kevin Stueve

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7013#comment:5>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to