![]() |
| | #1 |
| Deprecated Join Date: Oct 2004 Location: Canada
Posts: 1,032
| Compile GCC Branch
__________________ Warning: Have doubt in anything I post. GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101 |
| Dae is offline | |
| | #2 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| The lambda branch is compiled exactly like any other GCC source checkout. If there's a configure script, run Code: ./configure --help Code: svn co <gcc-url> gcc-lambda-src mkdir gcc-lambda-obj cd gcc-lambda-obj ../gcc-lambda-src/configure <options> make sudo make install 1) Disable GCJ and its libjava. It's huge and takes forever to compile. 2) Give the GCC binaries a prefix or suffix. This allows you to put them into the PATH without conflicts with your system GCC. If there's no configure script, you need to run autoconf in the source directory, but I think GCC policy commits the generated files. To get all build dependencies for GCC, if you have Debian/Ubuntu, you can run something like Code: sudo apt-get builddep gcc
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #3 | |
| Deprecated Join Date: Oct 2004 Location: Canada
Posts: 1,032
| Thanks for that CornedBee. sudo apt-get build-dep gcc was helpful. I was going through manually finding the dependencies. I keep running into this error though, after about 20 minutes of re-compiling. Quote:
That's using default configure: ../srcdir/configure. I also tried it with --disable-libgcj as you suggested. I can't find much help about mm_malloc on Google.
__________________ Warning: Have doubt in anything I post. GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101 Last edited by Dae; 08-31-2009 at 09:09 PM. | |
| Dae is offline | |
| | #4 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| mm_malloc is a malloc with an additional alignment parameter, used for allocating buffers that will be used with vectorized code. It's part of the compiler suport library, which is why the build script wants to copy it around. The file is apparently called gmm_intrin.h in the source tree (in $SRCDIR/gcc/config/i386) and the build system should rename it and copy it to the target. I have no idea why this fails. The build system is just as big a disaster as the rest of GCC.
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #5 | |
| Deprecated Join Date: Oct 2004 Location: Canada
Posts: 1,032
| I actually got it working Thanks for the help CornedBee, I appreciate it ![]() My final command list was as such. Quote:
I'll probably run into some roadblock. Just wait.
__________________ Warning: Have doubt in anything I post. GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101 | |
| Dae is offline | |
| | #6 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| How far along is the lambda branch, by the way? Is it actually usable?
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #7 |
| Deprecated Join Date: Oct 2004 Location: Canada
Posts: 1,032
| I'll let you know once I finish converting my project over to Linux. See if it survives Asio server/client and some other stuff.
__________________ Warning: Have doubt in anything I post. GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101 |
| Dae is offline | |
| | #8 |
| Deprecated Join Date: Oct 2004 Location: Canada
Posts: 1,032
| Phew, that was intense. I ran into a whole series of issues. First of all, there seems to be a bug in GCC 4.4 and 4.5 (which the lambda-branch uses) in rvalue references (&&). So I disabled rvalue ref macro in Boost, and undefined the c++0x macro in the STD library (which brought forth an #error definition, which I casually deleted This obviously means I cannot use the new stuff like std::thread and std::chrono. That's fine, because I tried them and they didn't seem complete (ie. this_thread::sleep which is now sleep_for apparently and is macro blocked, and not using std::seconds using std::chrono, etc). Then I ran into issues with libmysqld 5.1, switching to 5.4 didn't fix it, 4.1 worked but sucked, and after some tweaking 5.4 magically works.Rvalue bug: http://www.mail-archive.com/gcc-bugs...msg264019.html The end result? I've deleted my PoS "callback" macro (which only worked with vc9), and have 5000 lines of lambda, roughly 40 lambda definitions, working with thousands of sockets per second (multiple asynchronous servers) and not a problem in sight yet. Works great! ![]() This is pretty much exactly what I wanted (for now), your standard c/c++ (pre-0x), boost, and auto / lambda. I'll expand my use of lambdas / variadic templates / initializers etc. later, and the rest when we get them. I'll be back if I run into any problems ^^ you can bet on it.
__________________ Warning: Have doubt in anything I post. GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101 Last edited by Dae; 09-04-2009 at 09:00 AM. |
| Dae is offline | |
| | #9 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| Fun! Maybe I should implement lambdas for Clang now.
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #10 |
| Deprecated Join Date: Oct 2004 Location: Canada
Posts: 1,032
| Haha, it shouldn't be too hard if you allow local structs as template arguments, then just change the syntax (which is surprising since I don't believe GCC allows local structs as template arguments yet). Edit: actually recursion is working, it just has to be passed by reference not value.. obviously. my bad. Code: std::function<void()> hello = [&hello]() { hello(); };
__________________ Warning: Have doubt in anything I post. GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101 Last edited by Dae; 09-05-2009 at 07:53 PM. |
| Dae is offline | |
| | #11 | |
| Deprecated Join Date: Oct 2004 Location: Canada
Posts: 1,032
| I didn't realize how restrictive that known bug from the official page would be: Quote:
Rvalue references seem to be working for me, just not for parts of the STD/boost library (maybe an incompatibility issue - boost 1.4 only shows testing up to gcc 3.3 and some 3.4).
__________________ Warning: Have doubt in anything I post. GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101 | |
| Dae is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| gcc compiler for windows? | td4nos | C Programming | 8 | 07-19-2009 02:28 PM |
| gcc asm code syntax | Uberapa | C Programming | 4 | 06-15-2007 01:16 AM |
| gcc not for C++? | tin | C++ Programming | 4 | 09-15-2004 08:26 AM |
| GCC bool undefined | Stack Overflow | Linux Programming | 3 | 07-06-2004 12:54 PM |
| gcc compile on cmd line, then run, get: bash: hello: command not found | cjtotheg | Linux Programming | 4 | 11-14-2001 10:28 AM |