That is when C++ sucks

Moderator: BarsMonster

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

That is when C++ sucks

Post by BarsMonster » Fri Jan 09, 2009 2:21 am

It appeared that you just cannot compile (without spending the whole day) Boost using Intel C++ 11 compiler. (And another piece of problems comes with 64bit mode)
This sucks. No portable library which working fine under any compiler and both 32/64bit :-S

pthreads is portable, but still not fully migrated to 64-bit, and I don't feel like I can spend a day compiling it and investigation why yet another thing does not work in 64-bit :wall:

So I have to get rid of Boost, or Linux support, or Intel C++.. Or write my own yet-another library which will launch threads/support mutexes under windows, and will wrap pthreads under linux :wall:

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Fri Jan 09, 2009 2:22 am

Or probably I am just falling into depression :crazy:

Maratyszcza
Posts: 3
Joined: Mon Dec 22, 2008 9:33 pm
Location: Moscow, Russia
Contact:

Re: That is when C++ sucks

Post by Maratyszcza » Fri Jan 09, 2009 12:52 pm

Intel Compiler 11 comes with Intel Threading Building Blocks - a platform-independent library of concurrent primitives. Use could use them instead of Boost.Threads

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Fri Jan 09, 2009 1:42 pm

I don't need that much threads :-)
Also, not sure if I would loose ability to compile the code with MSVC & GNUC when needed

Corni
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by Corni » Fri Jan 09, 2009 2:20 pm

Why do you need to spend the whole day compiling boost? I remember me doing a build of boost under linux 32bit with gcc, and it took just ~1-2hours building, but nothing complicated to start the build :P
Why are you using the Intel compiler anyway? Just use gcc for all platforms => done :P

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Fri Jan 09, 2009 2:50 pm

Corni wrote:Why do you need to spend the whole day compiling boost? I remember me doing a build of boost under linux 32bit with gcc, and it took just ~1-2hours building, but nothing complicated to start the build :P
Why are you using the Intel compiler anyway? Just use gcc for all platforms => done :P
Because it does not compile out of the box with Intel C++ 11, thread discussing this on the boost forum ended that they need to wait while Intel would fix the compiler :-)
Intel C++ offers 10-15% higher performance than MSVC on my tests.
It would be nice to know how gcc works, but I guess Intel C++ is still faster, as they still release it under linux :-)

Corni
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by Corni » Fri Jan 09, 2009 9:08 pm

yeah, if you test with latest intel processors, intel compiler will probably produce the best optimized code. But does this really matter for you? I don't know about GPGPU, but the GPU speed shouldn't be affected by this, as compiling this is up to CUDA, isn't it?
Btw lol@intel compiler not being able to compile boost. SPEC should include boost speed checks, guess how fast boost would be supported then ;)

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Sat Jan 10, 2009 5:58 pm

Well, It always happens with new major version(11) released :-)
Thing here and there stopping working :-)

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Tue Jan 13, 2009 4:42 am

I must admit that was dumb me, not Intel :crazy: (Damn, why all the time I am being dumb, but not AMD, nVidia, Intel and Microsoft? :crazy:)
Just needed to run iclvars_intel64.bat (bjam was trying to launch it, but had a double forwardslash, and therefore, path was wrong) and everything became fine, but that was quite a random luck :-) I cannot imagine how not having some env variables causes windows popups saying that it does not know how to open .rsp files :-)

Just a record for myself:

Code: Select all

bjam --toolset=intel-win address-model=64 --with-thread stage --target=release
Anyway, that is too late for Boost, everything was already migrated to Poco (although Intel C++ hangs while compiling my code :crazy: still need to find a workaround), and Poco looks better when working with threads(especially threads - it have thread priority crossplatform, and it has both recursive and faster non-recursive mutexes (which I am using, hope they are faster than Boost's ones)) and timer-stuff(at least they try to support 100ns accuracy).

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Tue Jan 13, 2009 6:53 am

Intel C++ fun:

class algo {
virtual method a;
}

class algo_md5 : public algo
{
method a;
method b;
}

algo *tmp = new algo_md5();


(algo_md5*)tmp->a();
(algo_md5*)tmp->b();

This code hangs Intel C++ compiler :-) Making both a & b virtual in base class solves the problem. :crazy:

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Tue Jan 13, 2009 7:16 am

It appeared that it hangs only if method b have alot of SSE2 code (around 70% of MD5 :crazy:)

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Wed Feb 18, 2009 10:12 pm

Intel guys confirmed that my bug was fixed, and new version of Intel C++ released with this fix :crazy:

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Mon Jan 11, 2010 4:31 am

One more mistery that ate like 15 hours of debugging and hitting my head over the wall :wall:
I had crashes inside POCO network library for misterious reason. I was really frustrated about it. I haven't seen other way of solving this issue but asking their support forums (not very active unfortunately..)
Google had 0 info about any of similar problems... Finally, how can you write software that supposed to work on large variety of hardware, when it crashes on your own PC? Non-reliable library? How can I trust it?

I was nearly ready to get rid of POCO and go with platform-specific network code...

Today I had yet another multi-hour debilitating debugging session..
After useless trials to find an issue in Poco (googlling, trying different versions, checking support forums, e.t.c) I've gone standard way of solving (virtually) unsolvable problems:
I got rid of Intel C++, 99% of the code, and gone down to copy&pasted httpget example from poco... It worked in the POCO project, but not inside Salty Cracker project, where it horibly crashed every time while resolving hostname, or sending request... Crash places were different with different config (static/dll POCO, static/dll CRT). So, I supposed it was project settings, and started to "unify" them one-by-one until...

It was simple.

_SECURE_SCL=0

I needed that to build Boost, and had that in main Salty_cracker project. But I haven't used it when compiling Poco library, so libs were just incompatible :crazy:

During all these longs hours of head-scratching the only through made me feel a little better: I was thinking that someday I will say "Wow, that was so simple, it is so great and reliable now!" :crazy: :joy: :crazy:

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by BarsMonster » Mon Jan 11, 2010 4:41 am

I feel so great... :crazy:
No more heroin, Let's stick to solving tough problems since today :crazy:

User avatar
LordMike
Posts: 184
Joined: Tue Feb 10, 2009 8:34 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: That is when C++ sucks

Post by LordMike » Mon Jan 11, 2010 7:52 am

lol.. :P

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 1 guest