Skip to content
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

abc_cpu lacks support for PowerPC #7

Open
barracuda156 opened this issue Apr 27, 2023 · 7 comments
Open

abc_cpu lacks support for PowerPC #7

barracuda156 opened this issue Apr 27, 2023 · 7 comments

Comments

@barracuda156
Copy link

/opt/local/bin/gcc-mp-12 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -isystem/opt/local/include/LegacySupport -I/opt/local/include  -DR_RELEASE   -fPIC  -pipe -Os -arch ppc  -c abc_cpu.c -o abc_cpu.o
abc_cpu.c:102:5: error: #error "No cpuid intrinsic defined for processor architecture."
  102 | #   error "No cpuid intrinsic defined for processor architecture."
      |     ^~~~~
abc_cpu.c: In function 'detect_OS_AVX':
abc_cpu.c:115:40: error: '_XCR_XFEATURE_ENABLED_MASK' undeclared (first use in this function)
  115 |         uint64_t xcrFeatureMask=xgetbv(_XCR_XFEATURE_ENABLED_MASK);
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
abc_cpu.c:115:40: note: each undeclared identifier is reported only once for each function it appears in
abc_cpu.c: In function 'detect_OS_AVX512':
abc_cpu.c:123:36: error: '_XCR_XFEATURE_ENABLED_MASK' undeclared (first use in this function)
  123 |     uint64_t xcrFeatureMask=xgetbv(_XCR_XFEATURE_ENABLED_MASK);
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [abc_cpu.o] Error 1
@zhaokg
Copy link
Owner

zhaokg commented Jun 16, 2023

Dear barracuda156, Appreciate the feedbacks, together with an apology for the slow response. Indeed, when I first implemented the C code, I didn't consider PowerPC. Frankly speaking, I never used a PowerPC machine before and don't have one for testing, either. Regardless, in the new version Rbeast-v0.9.9 posted on CRAN, I revised the code and my best guess is that it should pass the compilation on PowerPC. If not plus if you are still interested in giving it a try on PowerPC, please let me know.

@barracuda156
Copy link
Author

@zhaokg Thank you very much! Sure, I will give it a go today and update you accordingly.

@barracuda156
Copy link
Author

Not on CRAN yet, apparently, but I will test it as soon as it shows up.

@barracuda156
Copy link
Author

@zhaokg Or maybe you could make a branch for that, so I can test it?

@barracuda156
Copy link
Author

@zhaokg Any update on the matter?

@barracuda156
Copy link
Author

The latest version from CRAN now fails a bit differently:

/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -isystem/opt/local/include/LegacySupport -I/opt/local/include   -DR_RELEASE   -fPIC  -pipe -Os -arch ppc  -c abc_cpu.c -o abc_cpu.o
abc_cpu.c: In function 'i386_cpuid_caches':
abc_cpu.c:274:13: error: inconsistent operand constraints in an 'asm'
  274 |             __asm__ (
      |             ^~~~~~~
abc_cpu.c:274:13: error: inconsistent operand constraints in an 'asm'
make: *** [abc_cpu.o] Error 1

P. S. By the way, OpenBLAS has the code for cpu type detection which is confirmed to work on macOS PowerPC (I believe, it works on Linux and BSD too). If that can be helpful.

@zhaokg
Copy link
Owner

zhaokg commented Dec 29, 2023

Dear barracuda156,

Sorry for not being able to track and tackle this issue sooner. As you might have guessed, I couldn't find a powerPC machine to test and debug the code. Thanks again for your patience and continued interest. as well as the pointer to the openBLAS code.

I fixed the compilation error you showed and created a new version of Rbeast and posted it here at Github . (CRAN has a policy about the submission frequency, and I have to wait at least two months to submit it to CRAN again).

Do you mind giving it a try using the command below? Fingers crossed and hopefully the compilation passes.

install.packages("https://github.com/zhaokg/Rbeast/raw/master/R/Rbeast_1.0.1.tar.gz",  repos = NULL, type="source")

As always, appreciate your feedback and patience.

Kaiguang

The latest version from CRAN now fails a bit differently:

/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -D_REENTRANT -DR_RELEASE  -isystem/opt/local/include/LegacySupport -I/opt/local/include   -DR_RELEASE   -fPIC  -pipe -Os -arch ppc  -c abc_cpu.c -o abc_cpu.o
abc_cpu.c: In function 'i386_cpuid_caches':
abc_cpu.c:274:13: error: inconsistent operand constraints in an 'asm'
  274 |             __asm__ (
      |             ^~~~~~~
abc_cpu.c:274:13: error: inconsistent operand constraints in an 'asm'
make: *** [abc_cpu.o] Error 1

P. S. By the way, OpenBLAS has the code for cpu type detection which is confirmed to work on macOS PowerPC (I believe, it works on Linux and BSD too). If that can be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants