zhaokg / Rbeast

Bayesian Change-Point Detection and Time Series Decomposition
208 stars 36 forks source link

abc_cpu lacks support for PowerPC #7

Open barracuda156 opened 1 year ago

barracuda156 commented 1 year ago
/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 commented 1 year ago

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 commented 1 year ago

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

barracuda156 commented 1 year ago

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

barracuda156 commented 1 year ago

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

barracuda156 commented 11 months ago

@zhaokg Any update on the matter?

barracuda156 commented 6 months ago

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 commented 6 months ago

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.