-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Fresh build fail to compile sample #975
Comments
Can an option like |
You can use -C to only check the code. |
I cannot reproduce this with the given input. |
I'm testing it with this now:
And I'm getting this:
|
My fresh
|
Also when I do a
|
If you are compiling a standard library file, then things will end up going bad since the standard library is by default added to the files included. So do exclude anything in /lib/std |
Let's start again from scratch (that worked some time ago):
|
Looking at this, the only explanation I have would be that you're missing std/core/builtin_comparison.c3. Can you list all the files in |
If it's there, do you find the |
|
The files you should be able to test are the ones in |
And yes it's there and has:
|
After doing this changes:
Again:
Then changing
But when try to compile the full file it takes 98 seconds:
See attached the files that I'm using to compile: |
This doesn't make any sense at all. What Linux distro are you on? You could try a super simple program like: fn void main()
{
min(1, 2);
} And see what happens. |
Without the changes I showed above and using you simple example:
|
My system is Ubuntu-18.04:
Notice that some time ago (months) I was able to build and execute it as I'm trying now. |
When using
|
Here is a report where another related project also has trouble with compile/execute this files vovkos/jancy#8 (comment) . |
Ok, so the time it takes to compile this is because LLVM goes crazy trying to compile these things, but -O0 will give you somewhat better turnaround... or -O3. -O0: 5s |
That's something that prabably can be fixed because |
I finally found the bug @mingodad. It had to do with module ordering, so I had to hack the compiler to randomly order module evaluation until I got an ordering that reproduced the error. It's a special case that only occurs when two (or more) namespaced functions are registered before the builtin one. 😅 |
Yes it's building and compiling now, although slow for |
And I still need to install the |
I appreciate a patch for the CMake script to move the lib to an appropriate folder. It will be able to auto detect it if it's in the same dir as the binary or in a sub folder. I don't know the most Linux friendly placement. |
I'd like to add exprtk_functional_test.c3 as a test source, would you like to contribute it? |
Yes no problem !
|
Attached is the
|
Well, if you say Clang, then probably, since it's going to share semantics with LLVM. |
Here it compiled with clang:
|
I've noticed that if you don't enable SSE, then you'll get worse precision. Try |
Good catch !
And it seems to start happen with
|
Oddly enough I get 7286 with C3 and --x86cpu=sse4. Do you see the same? |
My compilers do not recognize
|
Ok it's a
Looking through |
Odd enough it's because the change in
Probably |
Or internally stick with |
This is an fma optimization that I do as well, following Clang. Turning it off is certainly possible. |
Also I did the same some time ago #728 and I don't remember |
There are two codegen options for "default" builds, and currently it takes slightly more optimized path. Usually that path is almost like the non-optimized one, but sometimes, like in this case, it completely blows up. I've discussed on the discord for C3 about changing the possible compilation defaults, as there are several things you might want:
Then finally 6-8 but with single module builds. It THINK these are the main build options people will pick. There are certainly even more possibilities, but these are the main ones. So possibly people might need some broad categories. Clearly the default here is not great in all cases. |
Even on -O0? |
Which option is it ? |
|
Ok ! on my laptop
But there is machines that do not have |
Actually it's the other way around. sse4 disables the fma instruction in avx so that fma instructions aren't generated. |
This mean that without |
Yes, you can use --x86cpu=baseline to target any x64 processor. Possible CPU targets in order are: |
Wouldn't better if |
With
|
No, because baseline would be the very first AMD 64 bit processors, which are very very old at this point, and pretty much no-one has them. So optimizing for that would not be reasonable. |
With the latest changes the build time is fine now :
The output:
Adding
Output:
Would be nice to get the last output without any extra command line to the |
It should default to not doing the optimization now. |
Thank you ! |
Thank you for testing things! |
After a fresh build of
c3c
and testing the sample shown bellow I'm getting several errors:Output of invoking compilation:
The text was updated successfully, but these errors were encountered: