-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make install fail #11
Comments
Hi, I can confirm this bug is present in primecount <= 4.2. I actually found this bug myself about a month ago, it is a bug in primesieve's CMake script. Here is the fix kimwalisch/primesieve@48557d1 in primesieve. After I fixed the bug in primesieve I also fixed the bug in primecount by updating to the latest primesieve version. Can you please test whether If it works for you, I will release primecount-4.3 on the weekend. |
It is even worse on the main git branch
|
OK, thanks for the detailed bug report. I'll have a look at it. |
Hi, I have found the issue. Here are default options in primecount's option(BUILD_SHARED_LIBS "Build shared libprimecount" OFF)
option(BUILD_STATIC_LIBS "Build static libprimecount" ON) By default Your cmake command:
turns off both
|
Indeed I thought that shared would be turned on by default (I should have checked). Thanks! I will try again. |
|
|
But then why running |
And: tests pass on my computer! |
Great! I think I will add a check to
GNU Autotools follows the standard GNU practice but CMake is different, it follows its own standard. In CMake when testing is enabled the tests will by default be built using |
Good. I am waiting the new release to go further with SageMath integration (see https://trac.sagemath.org/ticket/24966). |
One more question: Does SageMath still care about big-endian CPU architectures? Currently primecount only supports little-endian CPU architectures, hence it runs on x86, x64, ARM, ARM64, IBM POWER >= 8 and so forth but not on PowerPC and Sparc. |
I think it does (but I am sure we are lacking computers to actually test it). |
I've just tested the latest release on Sparc Solaris 11. It appears to work. However, I'd like to run its own tests in test/, but there are no instructions as to how to actually do this. |
Hi Vincent, There is another issue for integrating primecount into sagemath, by default primecount uses the POPCNT instruction on x86 and x64. When primecount is compiled using POPCNT it won't work on x86 and x64 CPUs that have been built before 2010. I already thought about this issue in the past so there is a build option to turn off POPCNT: Currently the portable code path (that does not use POPCNT) is not much optimized, I can easily achieve a 30% speed. Personally I think this is a good trade-off, the primecount version used in sagemath will run on any CPU (maximum portability) at the expense of running 30% slower on x86 and x64 (compared to POPCNT version). I think this sounds reasonable. Any comments or questions? |
I don't really understand the problem. We are mostly interested in building from source. The option |
Yes, the choice whether primecount will use POPCNT on x86 is done at configuration time i.e. when you run cmake. I don't fully understand yet how you want to use primecount in sagemath but let's suppose you build sagemath with primecount from source on x86 and then distribute this binary package to users via the Internet. Now primecount won't work for all users with x86 CPUs older than 2010 because these CPUs don't have the POPCNT instruction. If you don't plan to distribute primecount to end users then this may not be an issue. E.g. if you plan to install primecount on a few x86 cloud servers and you know these servers support POPCNT then of course you should enable POPCNT. |
We will turn popcount off for building binaries. Thanks for mentioning that point! |
I have released primecount-4.3. The documentation has been improved considerably i.e. there is a new "C++ library" section in the main |
with
I obtain
The text was updated successfully, but these errors were encountered: