-
Notifications
You must be signed in to change notification settings - Fork 641
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
meep build failure for ppc64 architecture #13
Comments
I received the following comments that pointed to the reason of the failure, but no obvious solution: the problem seems to be in the harminv library: #if defined(__cplusplus) includeextern "C" { #elif defined(_Complex_I) && defined(complex) && defined(I) #else where the type "harminv_complex" is defined in three different ways. Note that the third variant is obviously never used, since it would However, the harminv library itself it compiled in C, using the while the meep application is compiled in C++, using the first Note that those are two different types! Now, on some platforms, the ABI happens to be defined in a way such However, on ppc64 (and ppc, I think), the ABI for those two types This mismatch causes the crash you're seeing. Not sure what the best way to fix this would be. On the one hand, |
@michelmno, those definitions date from when I was using The solution is to modify extern void harminv_get_omega(harminv_complex *omega, harminv_data d, int k); and then to modify Meep to call it as such. |
as suggested I have two patches (1) for harminv (2) for meep, (1) https://build.opensuse.org/package/view_file/home:michel_mno:branches:science/harminv/harminv_change_protos_with_harminv_complex.patch?expand=1 |
Thanks @michelmno, can you please file git pull requests against the harminv repo and the meep repo? |
for ppc/ppc64 but not for ppc64le.
in generated assembly code when calling harminv_get_amplitude from do_harminv
(1_) https://build.opensuse.org/package/show/openSUSE:Factory:PowerPC/meep
=== extract of tests/test-suite.log:
harminv: failure on line 853 of harminv.c: argument out of range in harminv_get_amplitude
(2_) what is abnormal is the assembly code when calling harminv_get_amplitude
that is passing 3 registers r3 r4 r5 (with hd in r4 and 0 in r5)
while the library is expecting only r3 r4 (with hd in r3 and 0 in r4)
Breakpoint 2, 0x00003fffb7276204 in .harminv_get_amplitude () from /usr/lib64/libharminv.so.2
(gdb) bt
#0 0x00003fffb7276204 in .harminv_get_amplitude () from /usr/lib64/libharminv.so.2
#1 0x00003fffb7ee97b4 in meep::do_harminv (data=, n=, dt=0.0025000000000000001, fmin=0, fmax=1, maxbands=, amps=0x3fffffffe730,
freq_re=0x3fffffffe6b0, freq_im=0x3fffffffe6f0, errors=0x0, spectral_density=, Q_thresh=50, rel_err_thresh=1e+20, err_thresh=0.01, rel_amp_thresh=-1,
amp_thresh=-1) at bands.cpp:472
#2 0x00000000100020a0 in main (argc=1, argv=0x3ffffffff8e8) at aniso_disp.cpp:131
0x00003fffb7ee97a0 meep::do_harminv()+784: ld r2,40(r1)
0x00003fffb7ee97a4 meep::do_harminv()+788: mr r3,r22
0x00003fffb7ee97a8 meep::do_harminv()+792: mr r4,r31
0x00003fffb7ee97ac meep::do_harminv()+796: li r5,0
0x00003fffb7ee97b0 meep::do_harminv()+800: bl 0x3fffb7edd028 <00000017.plt_call.harminv_get_amplitude>
0x00003fffb7ee97b4 meep::do_harminv()+804: ld r2,40(r1)
=> 0x00003fffb7276204 <.harminv_get_amplitude+20>: blt- cr7,0x3fffb727628c <.harminv_get_amplitude+156>
0x00003fffb7276208 <.harminv_get_amplitude+24>: lwz r9,20(r3)
0x00003fffb727620c <.harminv_get_amplitude+28>: mr r31,r3
0x00003fffb7276210 <.harminv_get_amplitude+32>: cmpw cr7,r9,r4
0x00003fffb7276214 <.harminv_get_amplitude+36>: ble- cr7,0x3fffb727628c <.harminv_get_amplitude+156>
The text was updated successfully, but these errors were encountered: