wichtounet / eddic

Compiler of the EDDI programming language
MIT License
33 stars 4 forks source link

Build issue on Ubuntu 15.10 #53

Open ssarangi opened 8 years ago

ssarangi commented 8 years ago

I installed boost and then started the build for eddic. However, on ubuntu 15.10 I keep on hitting errors with ld unrecognized option.

-e \x1b[31;01m[debug]\x1b[0m Link \x1b[35;01mdebug/bin/eddic\x1b[0m ld: unrecognized option '--coverage' ld: use the --help option for usage information Makefile:46: recipe for target 'debug/bin/eddic' failed make: *\ [debug/bin/eddic] Error 1

The entire build seems to complete and then during linking I think I see this. I install gcovr hoping it would solve it but it didn't. If I remove --coverage, then I start seeing similar errors with "-std=c++1y".

gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) GNU ld (GNU Binutils for Ubuntu) 2.25.1

Any suggestions ?

wichtounet commented 8 years ago

Hello,

Could you tell which branch do you try to compile ? develop or master ?

I would guess develop given the error messages.

Normally coverage should not be enabled by default.

eddic is using make-utils which uses the variable CXX and LD to determine the compiler and linker. But it needs a compiler as linker (not very logical, I know :s ).

Can you try using:

CXX=g++-5.2.1 LD=g++-5.2.1 make

or

export CXX=g++-5.2.1 export LD=g++-5.2.1 make

?

ssarangi commented 8 years ago

Perfect :) That solved the problem. I was using develop... I have been following your project for quite a bit of time but this was the first time I managed to build it. Excellent work I should say. The LTAC representation you use is not SSA right ?

ssarangi commented 8 years ago

One more thing. How do you run this... I used the command from the readme and here is the output I get..

./debug/bin/eddic eddi_samples/problem.eddi Compile eddi_samples/problem.eddi Parsing failed Error at file eddi_samples/problem.eddi line 1 column 8 'include' ^- here Compilation took 6ms

wichtounet commented 8 years ago

Excellent work I should say. The LTAC representation you use is not SSA right ?

Right, neither MTAC nor LTAC are using SSA. I'd like to use it in the future for MTAC, but I haven't had time yet.

Regarding the second problem. I'm currently trying to port the parser to Boost Spirit X3, but it turns out that it is a lot more work than expected, so the develop branch is not always stable. It is possible that I broke something in the standard parser. I'll check again tonight when I'm at home.

You could try the master branch, there are only few changes yet, unless you want to play with X3, in which case only the develop branch has what you need.

ssarangi commented 8 years ago

I see.. I will try out the master branch. X3 :).. So any particular reason why you are shifting to Boost Spirit ?

And I guess the parser is broken for all tests. I tried quite a few of them.

wichtounet commented 8 years ago

I was already using Boost Spirit but the Qi version (call it the version 2). The version 3 (X3) has some substantial performance improvements at parsing time which is currently the bottleneck in the compiler. The X3 parser itself is ready, but it takes a lot of changes in the code to be able to use. And I didn't foresee this, so I'm kind of stuck with really boring porting now.

wichtounet commented 8 years ago

I can confirm that I broke the basic parser :P

The x3 parser is working as expected, but is not used as default parser. If you want to make tests on eddic, you should indeed use the master branch.

ssarangi commented 8 years ago

So I tried the master branch. So the build system is cmake right for this ? Since the cxxfiles and other things are not there.. So on cmake I get another error.

/home/ssarangi/dev/cpp/eddic/include/Utils.hpp:31:17: error: ambiguous overload for ‘operator!=’ (operand types are ‘const value_type {aka const boost::variant<eddic::ast::SimpleType, eddic::ast::ArrayType, eddic::ast::TemplateType, eddic::ast::PointerType>}’ and ‘const value_type {aka const boost::variant<eddic::ast::SimpleType, eddic::ast::ArrayType, eddic::ast::TemplateType, eddic::ast::PointerType>}’) if(a[i] != b[i]){ ^

wichtounet commented 8 years ago

Yes, cmake is necessary for the master branch. I dropped it since.

Which version of boost do you have ? And what compiler ?

I just tried with Boost 1.56 and gcc 4.9 and after some changes it worked. It seems that Boost broke quite some things. However, I did not encounter your issue.

ssarangi commented 8 years ago

I was using Boost 1.60. Let me give 1.56 a shot. You mentioned after some changes ? What changes did you have to make ?

wichtounet commented 8 years ago

I had to fix some things regarding exceptions. There were also some operators that were made explicit and a change with hash of boost::variant.

It should work with 1.60 normally. I can try with 1.59 that I have at home.

wichtounet commented 8 years ago

I tested with 1.59 and there is indeed more issues. I fixed them for 1.59. They added overloads for boost variant and apparently changed the rules for relaxed/strict get.

ssarangi commented 8 years ago

So any reason of moving away from cmake ? It would have been easier to get it working on windows too if possible :+1:

wichtounet commented 8 years ago

Yes, several reasons:

For Windows: I don't develop on Windows, the only reason I still have a Windows machine at home next to my Linux is to play games, so even if eddic would compile on Windows, I would not be able to maintain this compatibility.