-
Notifications
You must be signed in to change notification settings - Fork 18
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
FIX: Bug when CMPLX
macro undefined.
#620
FIX: Bug when CMPLX
macro undefined.
#620
Conversation
* Specified double precision for complex numbers in rylm.c * Simplified complex number instantiation/multiplication in some places. Previously, some calculations were extracting the real and imaginary parts separately and using them in a CMPLX() call to create a new complex number, rather than simply using the already-complex number. * Answer at https://stackoverflow.com/a/59597456 explains that CMPLX is missing on MacOS when compiling with gcc because the responsibility of defining macros like CMPLX is not up to gcc.
I believe this also would address the problems of #475 |
I just tried compiling this branch on my computer. This does resolve the COMPLEX problem I encountered previously. However, I ran into the flag issue reported in #609. I tried the recent suggestion of removing the -D_DARWIN flag and that helped me get past |
I added another commit to remove the effect of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solves my compilation issues on OS X Sonoma.
@RemingtonRohel happy to merge or to allow another person to test. |
I'm not a maintainer, so I can't merge this myself. If it's fine with the normal RST workflow, by all means go ahead! |
Merged. |
Just to clarify, were the output of FITACF 2.5 or the |
I did not test before it was merged, I've got no good excuse. I just verified that fitacf2.5 yields identical results, but |
Targeting #619
NOTE: This branch has no conflicts with the main branch, so the target branch for this PR could be changed if this change would be better suited as a hotfix.
Changes
CMPLX(real, imag)
withreal + imag * I
as per https://stackoverflow.com/a/9860772rylm.c
CMPLX()
call to create a new complex number, rather than simply using the already-complex number.CMPLX
is missing on MacOS when compiling withgcc
because the responsibility of defining macros likeCMPLX
is not up togcc
, so it truly is not defined anywhere. This is not a linker issue nor an issue with thecomplex.h
header file missing/not found/wrong.