- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may not have a recent enough g++ compiler to use built-in atomics (it's not clear what version of TBB you have or whether it supports any available built-in atomics yet, but it doesn't seem to be the most recent one), so you may have to provide definitions for those macros for best performance or if the compiler really doesn't have built-in atomics. Start with a more recent TBB version to try the built-in atomics. Then, if the compiler doesn't have them, you can't upgrade the compiler to a version that does, you feel up to the challenge and don't mind ultimate disappointment, follow the porting directions in build/index.html (even if they are not quite complete). (I might be tempted to join your efforts at some point, without promising anything.)
BTW, how does "amd64" get in there? And if you don't know because this just came in the Linux distribution on such a system, somebody must have missed similar problems building the library.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that a root cause of all compilation errors is:
...
error: #error Minimal requirements for tbb_machine.h not satisfied In file included from
/home/parsec-2.1/pkgs/libs/tbblib/inst/amd64-linux.alpha-gcc-tbb/include/tbb/aligned_space.h:33
...
There is a statement in 'tbb_machine.h' header file that:
...
/** This header provides basic platform abstraction layer by hooking up appropriate
architecture/OS/compiler specific headers from the /include/tbb/machine directory.
If a plug-in header does not implement all the required APIs, it must specify
the missing ones by setting one or more of the following macros:
__TBB_USE_GENERIC_PART_WORD_CAS
__TBB_USE_GENERIC_PART_WORD_FETCH_ADD
__TBB_USE_GENERIC_PART_WORD_FETCH_STORE
__TBB_USE_GENERIC_FETCH_ADD
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, yes, but it seemed more helpful to go straight to sketching out an appropriate course of action.
BTW, those built-in atomics are only a stopgap measure (they're more expensive than they should be), so a native port may still be a good idea later on. But, as already implied, the Alpha is also likely to require an unpredictable amount of extra porting work beyond getting the atomics right.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
chenxuhao,
As has been previously mentioned the shortest way you can take is possibly
to try Generic GCC* Atomics Support . For that you need :
- the minimal tbb version is : TBB 3.0 Update 7
- the gcc version is 4.3.6 (4.1.2 might also work, but probably require
some hacking)
during a build the port should be enabled automatically. For sure macro
TBB_USE_GCC_BUILTINS should be defined in the build command. E.g. like
this:
make compiler=gcc CXXFLAGS="-DTBB_USE_GCC_BUILTINS"
Once the tbb is built it is a good idea to run tbb unit tests, as the Alpha is greatly
differ in memory semantics from all other platform TBB is able working on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
version is 4.3.2, so it may be due to this. I will try it again using 4.3.6...
A port of some library to a different platform is a complex process and it consists of many phases. Currently,
you're trying to solve some low level problem.A different approach could be more eficient:
- Phase 1 - If there is a compilation problem(s),due to some piece of code,comment it out or replace itwith
an empty piece of code. For example, a '__TBB_machine_load8' causes some compilation
problems because it is not declared.In that case, declare it as follows, or something like this:
( Note: don't spend time on internals and continue with another compilation problem )
#ifdef _PLATFORM_DEC_ALPHA
...
#define _TBB_machine_load8( ... ) //???
...
#endif
and mark it with '//???' label. After first a couple of hours of porting you could have lots of
commented pieces of code withlabels '//???'. The most important thing is thatin Phase 1
the source codes have to be compiled. A total number of detected issues or problems
is unpredictable.
- Phase 2 - Review all cases marked with '//???' and start fixing them. It is recommended that all easy
cases are fixed first, and more complex cases are fixedlast. But, it is really hard to predict what has to
be fixed first.Then a Phase 3 comes ahead.
- Phase 3 - Create some set of simpletests.Tests for all fixedcases (previously marked with '//???' ) also
have to be done.
and so on.
In overall, the process I just desribed is a 'Top-to-Down' process. From my point of view your current
approach is opposite, that is 'Down-to-Top'. Also, I don't think thatyour currentcompilation problems are
related to an older version ofGCC compiler.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please see #5. We're not guessing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please see #5. We're not guessing.
Thanks for the note. I missed that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not confident that it could resolve all these compilation errors because in 'tbb_machine.h' header file
there is a piece of code:
...
#ifndef __TBB_64BIT_ATOMICS
#define __TBB_64BIT_ATOMICS 1
#endif
...
and it defines that macro again. Anyway, you could try and please post results of your attempt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First compilation errors are related to 'tbb::internal::machine_load_store' template classand
'__TBB_machine_load8' function. The second error recommends you to look at a line 525 in
'tbb_machine.h' header file. A couple of lines above there is a piece of codes:
...
#if __TBB_USE_GENERIC_DWORD_LOAD_STORE
inline void __TBB_machine_store8 (volatile void *ptr, int64_t value) {
for(;;) {
int64_t result = *(int64_t *)ptr;
if( __TBB_machine_cmpswp8(ptr,value,result)==result ) break;
}
}
inline int64_t __TBB_machine_load8 (const volatile void *ptr) {
// Comparand and new value may be anything, they only must be equal, and
// the value should have a low probability to be actually found in 'location'.
const int64_t anyvalue = 2305843009213693951;
return __TBB_machine_cmpswp8(const_cast
}
#endif /* __TBB_USE_GENERIC_DWORD_LOAD_STORE */
...
If the macro __TBB_USE_GENERIC_DWORD_LOAD_STORE is not defined there will be a compilation error(s).
What is a state of that macro? Is that defined or not in your build environment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is a state of that macro? Is that defined or not in your build environment?
That's a good catch. Actually, the most recent TBB update fixed a bug in previous versions that do not have this macro defined in gcc_generic.h. Sochenxuhaoneeds to make sure the latest TBB release (4.0 Update 3)is used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, please set __TBB_64BIT_ATOMICS to 0, or comment, or undefine itand please try to concentrate
your efforts on resolving first two compilation errors related to my comments in Post #17.
Best regards,
Sergey
PS: Could you verify a complete version of TBB installed on your computer? Look at 'tbb_stddef.h' header file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. There are many cases when __TBB_64BIT_ATOMICS is used with __TBB_WORDSIZE, like:
...
#if __TBB_WORDSIZE==4 && __TBB_64BIT_ATOMICS
...
2. For 32-bit Windows platforms '__TBB_machine_store8' and '__TBB_machine_load8' functionsare
declared in 'windows_ia32.h' header file( not applicable in your case ) as follows:
...
extern "C" {
...
void __TBB_EXPORTED_FUNC __TBB_machine_store8 (volatile void *ptr, __int64 value );
__int64 __TBB_EXPORTED_FUNC __TBB_machine_load8 (const volatile void *ptr);
}
...
and when I commented these two lines I had these compilation errors:
------ Build started: Project: tbb, Configuration: Debug Win32 ------
Compiling...
concurrent_hash_map.cpp
c:\worklib\tbb40\include\tbb\tbb_machine.h(525) : error C3861: '__TBB_machine_load8': identifier not found
c:\worklib\tbb40\include\tbb\tbb_machine.h(524) : while compiling class template member function
'tbb::internal::int64_t tbb::internal::machine_load_store
with
[
T=tbb::internal::int64_t,
S=8
]
...
It also "breaks" on line 525 and it partially reproduces your compilation errors.
As you can see they are similar to your compilation errors. Also, implementations for both functions are
in 'atomic_support.asm' file.
3. I think it makes sense to try a simple test with declaration of these two functions in some header file, like:
...
void __TBB_EXPORTED_FUNC __TBB_machine_store8 (volatile void *ptr, __int64 value );
__int64 __TBB_EXPORTED_FUNC __TBB_machine_load8 (const volatile void *ptr);
...
and implementation for these two functions in some C/C++ file, like:
...
void __TBB_EXPORTED_FUNC __TBB_machine_store8 (volatile void *ptr, __int64 value )
{
}
__int64 __TBB_EXPORTED_FUNC __TBB_machine_load8 (const volatile void *ptr)
{
return ( __int64 )0;
}
...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page