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

Compile errors on MacOS #1

Open
oneilm opened this issue Jun 14, 2017 · 0 comments
Open

Compile errors on MacOS #1

oneilm opened this issue Jun 14, 2017 · 0 comments

Comments

@oneilm
Copy link

oneilm commented Jun 14, 2017

Compilation for C-Type complex number code in for GCC 6.2 running on MacOS:

g++-6 utils.cpp -c
g++-6 complexmulttiming.cpp utils.o -o complexmulttimingc -Ofast -funroll-loops -D USE_C_TYPE_COMPLEX
complexmulttiming.cpp: In function 'int main(int, char**)':
complexmulttiming.cpp:115:5: error: 'complex' was not declared in this scope
complex double *z = (complex double *)malloc(sizeof(complex double)*M);
^~~~~~~
complexmulttiming.cpp:115:5: note: suggested alternative:
In file included from /usr/local/Cellar/gcc/6.2.0/include/c++/6.2.0/ccomplex:39:0,
from /usr/local/Cellar/gcc/6.2.0/include/c++/6.2.0/complex.h:32,
from complexmulttiming.cpp:4:
/usr/local/Cellar/gcc/6.2.0/include/c++/6.2.0/complex:63:32: note: 'std::complex'
template class complex;
^~~~~~~
complexmulttiming.cpp:116:13: error: expected ';' before 'double'
complex double *z2 = (complex double )malloc(sizeof(complex double)M);
^~~~~~
complexmulttiming.cpp:118:7: error: 'z' was not declared in this scope
z[i] = data1_re[i] + I
data1_im[i];
^
complexmulttiming.cpp:119:7: error: 'z2' was not declared in this scope
z2[i] = data2_re[i] + I
data2_im[i];
^~
complexmulttiming.cpp:123:7: error: 'z' was not declared in this scope
z[i] = z[i-1] + z[i] * z2[i];
^
complexmulttiming.cpp:123:30: error: 'z2' was not declared in this scope
z[i] = z[i-1] + z[i] * z2[i];
^~
complexmulttiming.cpp:126:89: error: 'z' was not declared in this scope
printf("%lld C-type complex mults in %.3g s\n\tresult = %.12f + %.12fI\n",M,t,creal(z[M-1]),cimag(z[M-1]));
^
complexmulttiming.cpp:127:19: error: 'z2' was not declared in this scope
free(z); free(z2);
^~

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

1 participant