Re: [Tinycc-devel] Compilation error while including LAPACKE
Hello, you can have an insight from Apple code here https://opensource.apple.com/source/Libm/Libm-47.1/ -Original Message- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Christopher Choi Sent: Thursday, April 14, 2022 12:04 To: tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] Compilation error while including LAPACKE Just curious, if I do need complex how hard is it to implement it? I presume if the user wants to use LAPACKE or similar numerical library they will run into similar problems Any pointers would be much appreciated. Many thanks Chris On Sat, 9 Apr 2022 at 17:45, Domingo Alvarez Duarte wrote: > > After your last message I've tried defining "_Complex" to empty and for > the simple test it compiled, probably if you are not using complex this > trick could work: > > = > > #include > #define _Complex //make it e noop > #include > > int main() { >printf("Hello World!\n"); >return 0; > } > > > > Output: > > > > ../tcc cmath.c > >Exit code: 0 > ./a.out > >./a.out > Hello World! > >Exit code: 0 > > > > On 9/4/22 18:14, Christopher Choi wrote: > > Sorry I guess I'm not familiar with TCC, but I suppose this is > > something TCC hasn't implemented yet? having dug into the archives a > > little more the only other mention of complex type support with TCC > > was in 2015. > > > > https://www.mail-archive.com/tinycc-devel@nongnu.org/msg06428.html > > > > If complex types are not supported are there known work-arounds other > > than "dont use them"? > > > > Thanks > > Chris > > > > On Sat, 9 Apr 2022 at 09:03, Domingo Alvarez Duarte > > wrote: > >> The problem seem to be related with "Complex" rather than "lapacke": > >> > >> > >> > >> #include > >> #include > >> > >> int main() { > >> printf("Hello World!\n"); > >> return 0; > >> } > >> > >> > >> > >> Output: > >> > >> > >> > >> tcc -c cmath.c > >> In file included from cmath.c:2: > >> In file included from /usr/include/complex.h:106: > >> /usr/include/x86_64-linux-gnu/bits/cmathcalls.h:55: error: ';' expected > >> (got "cacos") > >> > >> > >> > >> Output of preprocessing: > >> > >> > >> > >> /tcc -E cmath.c > >> > >> ... > >> > >> # 106 "/usr/include/complex.h" > >> # 1 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" 1 > >> # 55 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" > >> extern double _Complex cacos (double _Complex __z) ; extern double > >> _Complex __cacos (double _Complex __z) ; > >> > >> ... > >> > >> > >> > >> On 9/4/22 2:03, Christopher Choi wrote: > >>> #include > >>> #include > >>> > >>> int main() { > >>> printf("Hello World!\n"); > >>> return 0; > >>> } > >> ___ > >> Tinycc-devel mailing list > >> Tinycc-devel@nongnu.org > >> https://lists.nongnu.org/mailman/listinfo/tinycc-devel > > ___ > > Tinycc-devel mailing list > > Tinycc-devel@nongnu.org > > https://lists.nongnu.org/mailman/listinfo/tinycc-devel > > ___ > Tinycc-devel mailing list > Tinycc-devel@nongnu.org > https://lists.nongnu.org/mailman/listinfo/tinycc-devel ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] Compilation error while including LAPACKE
Just curious, if I do need complex how hard is it to implement it? I presume if the user wants to use LAPACKE or similar numerical library they will run into similar problems Any pointers would be much appreciated. Many thanks Chris On Sat, 9 Apr 2022 at 17:45, Domingo Alvarez Duarte wrote: > > After your last message I've tried defining "_Complex" to empty and for > the simple test it compiled, probably if you are not using complex this > trick could work: > > = > > #include > #define _Complex //make it e noop > #include > > int main() { >printf("Hello World!\n"); >return 0; > } > > > > Output: > > > > ../tcc cmath.c > >Exit code: 0 > ./a.out > >./a.out > Hello World! > >Exit code: 0 > > > > On 9/4/22 18:14, Christopher Choi wrote: > > Sorry I guess I'm not familiar with TCC, but I suppose this is > > something TCC hasn't implemented yet? having dug into the archives a > > little more the only other mention of complex type support with TCC > > was in 2015. > > > > https://www.mail-archive.com/tinycc-devel@nongnu.org/msg06428.html > > > > If complex types are not supported are there known work-arounds other > > than "dont use them"? > > > > Thanks > > Chris > > > > On Sat, 9 Apr 2022 at 09:03, Domingo Alvarez Duarte > > wrote: > >> The problem seem to be related with "Complex" rather than "lapacke": > >> > >> > >> > >> #include > >> #include > >> > >> int main() { > >> printf("Hello World!\n"); > >> return 0; > >> } > >> > >> > >> > >> Output: > >> > >> > >> > >> tcc -c cmath.c > >> In file included from cmath.c:2: > >> In file included from /usr/include/complex.h:106: > >> /usr/include/x86_64-linux-gnu/bits/cmathcalls.h:55: error: ';' expected > >> (got "cacos") > >> > >> > >> > >> Output of preprocessing: > >> > >> > >> > >> /tcc -E cmath.c > >> > >> ... > >> > >> # 106 "/usr/include/complex.h" > >> # 1 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" 1 > >> # 55 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" > >> extern double _Complex cacos (double _Complex __z) ; extern double > >> _Complex __cacos (double _Complex __z) ; > >> > >> ... > >> > >> > >> > >> On 9/4/22 2:03, Christopher Choi wrote: > >>> #include > >>> #include > >>> > >>> int main() { > >>> printf("Hello World!\n"); > >>> return 0; > >>> } > >> ___ > >> Tinycc-devel mailing list > >> Tinycc-devel@nongnu.org > >> https://lists.nongnu.org/mailman/listinfo/tinycc-devel > > ___ > > Tinycc-devel mailing list > > Tinycc-devel@nongnu.org > > https://lists.nongnu.org/mailman/listinfo/tinycc-devel > > ___ > Tinycc-devel mailing list > Tinycc-devel@nongnu.org > https://lists.nongnu.org/mailman/listinfo/tinycc-devel ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] Compilation error while including LAPACKE
After your last message I've tried defining "_Complex" to empty and for the simple test it compiled, probably if you are not using complex this trick could work: = #include #define _Complex //make it e noop #include int main() { printf("Hello World!\n"); return 0; } Output: ../tcc cmath.c >Exit code: 0 ./a.out >./a.out Hello World! >Exit code: 0 On 9/4/22 18:14, Christopher Choi wrote: Sorry I guess I'm not familiar with TCC, but I suppose this is something TCC hasn't implemented yet? having dug into the archives a little more the only other mention of complex type support with TCC was in 2015. https://www.mail-archive.com/tinycc-devel@nongnu.org/msg06428.html If complex types are not supported are there known work-arounds other than "dont use them"? Thanks Chris On Sat, 9 Apr 2022 at 09:03, Domingo Alvarez Duarte wrote: The problem seem to be related with "Complex" rather than "lapacke": #include #include int main() { printf("Hello World!\n"); return 0; } Output: tcc -c cmath.c In file included from cmath.c:2: In file included from /usr/include/complex.h:106: /usr/include/x86_64-linux-gnu/bits/cmathcalls.h:55: error: ';' expected (got "cacos") Output of preprocessing: /tcc -E cmath.c ... # 106 "/usr/include/complex.h" # 1 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" 1 # 55 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" extern double _Complex cacos (double _Complex __z) ; extern double _Complex __cacos (double _Complex __z) ; ... On 9/4/22 2:03, Christopher Choi wrote: #include #include int main() { printf("Hello World!\n"); return 0; } ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] Compilation error while including LAPACKE
Sorry I guess I'm not familiar with TCC, but I suppose this is something TCC hasn't implemented yet? having dug into the archives a little more the only other mention of complex type support with TCC was in 2015. https://www.mail-archive.com/tinycc-devel@nongnu.org/msg06428.html If complex types are not supported are there known work-arounds other than "dont use them"? Thanks Chris On Sat, 9 Apr 2022 at 09:03, Domingo Alvarez Duarte wrote: > > The problem seem to be related with "Complex" rather than "lapacke": > > > > #include > #include > > int main() { >printf("Hello World!\n"); >return 0; > } > > > > Output: > > > > tcc -c cmath.c > In file included from cmath.c:2: > In file included from /usr/include/complex.h:106: > /usr/include/x86_64-linux-gnu/bits/cmathcalls.h:55: error: ';' expected > (got "cacos") > > > > Output of preprocessing: > > > > /tcc -E cmath.c > > ... > > # 106 "/usr/include/complex.h" > # 1 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" 1 > # 55 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" > extern double _Complex cacos (double _Complex __z) ; extern double > _Complex __cacos (double _Complex __z) ; > > ... > > > > On 9/4/22 2:03, Christopher Choi wrote: > > #include > > #include > > > > int main() { > >printf("Hello World!\n"); > >return 0; > > } > > ___ > Tinycc-devel mailing list > Tinycc-devel@nongnu.org > https://lists.nongnu.org/mailman/listinfo/tinycc-devel ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] Compilation error while including LAPACKE
The problem seem to be related with "Complex" rather than "lapacke": #include #include int main() { printf("Hello World!\n"); return 0; } Output: tcc -c cmath.c In file included from cmath.c:2: In file included from /usr/include/complex.h:106: /usr/include/x86_64-linux-gnu/bits/cmathcalls.h:55: error: ';' expected (got "cacos") Output of preprocessing: /tcc -E cmath.c ... # 106 "/usr/include/complex.h" # 1 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" 1 # 55 "/usr/include/x86_64-linux-gnu/bits/cmathcalls.h" extern double _Complex cacos (double _Complex __z) ; extern double _Complex __cacos (double _Complex __z) ; ... On 9/4/22 2:03, Christopher Choi wrote: #include #include int main() { printf("Hello World!\n"); return 0; } ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
[Tinycc-devel] Compilation error while including LAPACKE
Hello all, Trying to use tinycc to compile a code base that uses LAPACKE. But as soon as I include the header I run into problems, I get the following error: ``` In file included from main.c:1: In file included from /usr/include/lapacke.h:37: In file included from /usr/include/lapack.h:55: In file included from /usr/include/complex.h:106: /usr/include/x86_64-linux-gnu/bits/cmathcalls.h:55: error: ';' expected (got "cacos") ``` where main.c is: ``` #include #include int main() { printf("Hello World!\n"); return 0; } ``` compiled using `tcc main.c -o a.out` Any help would be appreciated, thanks! Chris ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel