- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everybody !
I really need some help, here's my problem : I have to work on a project in c++ and I have to parallelise it.
I have un computer with 8 CPU's (Windows 7)and I have to work with Eclipse and MinGW.
BUT how can I install TBB with MinGW ? I mean, I read a lot of articles and documentations on Windows installation but, that's usually talking about Visual Studio and I must not use that.
How could I do tobuild TBB? Do you have any solution ? I'm completly lost and quite tired. I have already lost a lot of time on this installation and I'm quite annoyed...
If someone had succeeded in that kind of installation, could you explain to me in details how you did so ?
Really, thanks in advance, I really need your help.
Thanks again.
Here's my compilator configuration :gcc
Link Copied
- « Previous
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
would the command
cmd /c"cmd /c mkdir "windows_ia32_gcc_mingw_release""
work on your machine and create the folder?
--Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you !
@Vladimir : I can't answer you now; actually, my motherboard is down, so I have to wait until tomorrow to get my computer back. I thought to install Win XP 64bits in place of Windows 7, maybe I'll have so many problems... Otherwise, I'll try your suggestion, and I'll tell you the result !
@Alexey Thank you! I'm looking forward to try it. I don't have the time at the moment to study it (I'm at school), but of course, I'll ask if I don't understand something.
Thank you, both of you !
Actually, here is the structure of my loops :
ClassFunct::ClassFunct() {
readFile();
// fill the matrix
int int_amount = int_vect.size();
for (int i=0; i
for (int j=i+1; j
//my code
}
}
}
And, I'm quite embarassed by the initialisation of second index : j : i+1
Does it create a dependence between the two loops ?
It is appropriated to use a parallel_for on the first loop ? Won't my data be corrupted ?
What do you think ?
Thanks !
- 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
It's a class member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[bash]#include//has declaration of task_scheduler_init #include //has declaration of parallel_for and blocked_range class Functor { public: Functor(int** matrix, size_t amount) : m_matrix(matrix), m_amount(amount){} void operator()(const tbb::blocked_range & range) const { for (size_t i = range.begin(), end = range.end(); i != end; ++i) { for (size_t j = i + 1; j < m_amount; ++j) { int& elementFromMatrix = matrix ; //please locate your code here } } } private: int** m_matrix; size_t m_amount; } void doMyTaskParallel() { size_t amount = //please init here int** matrix = //please init here tbb::parallel_for(tbb::blocked_range (0, amount), Functor(matrix, amount), tbb::auto_partitioner()); } int main() { tbb::task_scheduler_init init; doMyTaskParallel(); return 0; }[/bash]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To follow up on this and perhaps provide a solution, as I'm attempting the same thing:
- 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
Wanna step in and implement such support based on what we have for MinGW32? :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I don't know what could be wrong with running mingw32-make on Windows 7. I tried it on my workstation, all went just fine. I don't remember if you tried another make utility - if yes, was it any different?
But anyway you should not be blocked by that, as you don't have to recompile TBB on exactly the same machine where you plan to run your app. Just copy the binaries to that machine, set up the environment properly, and you should be fine.
I tried to make TBB on Windows 7 from package tbb30_20100406oss_src.tgz with mingw32-make (GNU Make 3.81)
with this command:
mingw32-make.exe compiler=gcc arch=ia32 runtime=mingw
It just hangs and prints nothing. According to Process Explorer the procedure hangs on attempt to execute
c:\Windows\system32\cmd.exe c:/ mkdir .\build\windows_ia32_gcc_mingw_release
It is definitely wrong command because of c:/ parameter. I investigated the issue a bit and it seems to be the problem in $(shell ...) function. It transforms "cmd /c mkdir" to "c:\Windows\system32\cmd.exe c:/ mkdir" by some reason. I tried to remove "cmd /c" from makefile's but got another errors.
Same issue on Windows 2003.
Solved!!! Just remove sh.exe from all paths in %PATH%.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Roughly speaking, how big a job is that (assuming strong kung fu)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have compiled the library.
I'm on windows and trying to setup this in eclipse cdt.
how exactly do i set cpath and library_path?(I did it via Properties>Environment>Add (i know this isnt eclipse forum))
visual aid: http://postimag
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know this thread is older now but I'm still hoping someone can point me in the right direction. I'm hoping to compile tbb with mingw32 as well. As far as I can tell everything built just fine however I'm not seeing any .a or .so files get generated. Is this expected? For the visual c version there's a .lib file and in linux there is a library as well, but of course I just installed that with the package manager.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello, for MinGW you need to link with dll:)
--Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm glad this topic was resurrected recently as it saves me apologising for doing so :)
I'm trying to compile the latest stable release (tbb42_20131003oss) under mingw-w64 with MSYS.
My mingw is from here https://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/64-bit/threads-win32/... - the rev5 version.
My MSYS is from here https://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/ - the rev13 package.
My build command for TBB is "make arch=ia32 compiler=gcc runtime=mingw SHELL=/bin/sh"
I've run into the exact same issue as others on this thread with the "mkdir" target - where there should be a /c on the resulting cmd command line, this is somehow translated to c:/, causing a hang.
I fixed this by simply removing the mkdir commands and making the directories manually.
Now my error is:
make -C ".\\build\\windows_ia32_gcc_mingw64_debug" -r -f ../../build/Makefile.t
bb cfg=debug
'\"cscript /nologo /E:jscript ../../build/detect.js /minversion gcc 4.4\""' is not recognized as an internal or external command, operable program or batch file.
make[1]: Entering directory `/c/Users/user/dev/tbb42_20131003oss/build/windows_ia32_gcc_mingw64_debug'
../../build/Makefile.tbb:39: CONFIG: cfg=debug arch=ia32 compiler=gcc target=windows runtime=mingw64
g++ -o concurrent_queue.o -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m32 -march=i686 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_queue.cpp
'ml' is not recognized as an internal or external command, operable program or batch file.
../../build/common_rules.inc:85: recipe for target `concurrent_queue.o' failed
make[1]: *** [concurrent_queue.o] Error 1
make[1]: Leaving directory `/c/Users/user/dev/tbb42_20131003oss/build/windows_ia32_gcc_mingw64_debug'
Makefile:40: recipe for target `tbb' failed
make: *** [tbb] Error 2
I note the failure to execute detect.js, which is similar to the failure to execute the same thing if you don't disable auto-detection of the runtime by specifying it explicitly.
I also note the user above who said his problem was solved by ensuring sh was not anywhere in %PATH% - I don't believe it is for me.
One other thing, if I run the g++ command in isolation in the appropriate directory, it works fine, so hopefully it's just the detect.js call which needs fixing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK I have a successful build. I was taking a slightly wrong approach.
Instead of building under MSYS, I did the following:
1) Ensure c:\mingw-w64 (or whatever) is part of %PATH%
2) Use PowerShell!!!! Not cmd.exe, not sh.exe, not bash.exe. PowerShell. As a primarily Linux developer this was completely non-obvious to me.
3) Run mingw32-make.exe compiler=gcc
I can't find instructions on doing this anywhere - perhaps a good thing to add to the current docs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used to build there in this way under cmd.exe. I'm not sure where it still works
mingw32-make.exe compiler=gcc SHELL=cmd.exe
--Vladimir

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
- Next »