Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up the environment for Windows users #5

Open
AugustineTan opened this issue Feb 5, 2015 · 10 comments
Open

Setting up the environment for Windows users #5

AugustineTan opened this issue Feb 5, 2015 · 10 comments

Comments

@AugustineTan
Copy link

Some notes on the set up:

  1. The compilation using cygwin with make should run into errors regarding undefined references. This is a problem with the cygwin linker. If you want to use make in windows it needs to be done on MinGW.
  2. Dr Thomas recommended using nmake in the visual studio command prompt instead. The files will compile. However, there is an extra step for those unfamiliar with C compiled executables. You will need to either copy the required library files .dll into the folder which contains the .exe files or set the environment path to include the location of the TBB library files. This can be found in the /bin folder of the TBB installer. TBB includes a bin/tbbvars.bat to help with this. But it may or may not work for your system. In my case, it did not work for my windows 8.1 64bit machine. My solutions to this is to add the following lines to your ./bash_profile to set up the environment path in cygwin. Edit the path accordingly for your set up.
PATH=$PATH:/cygdrive/d/GitHub/hpce_2014_cw3/TBB/tbb43_20141204oss_win/bin/intel64/vc12
export PATH

Note that this only allows you to run the file through cygwin. Double clicking the file in Windows will throw the error that tbb.dll is missing. Not that you should require to, but y'know for science. 😄

@bwh10
Copy link

bwh10 commented Feb 5, 2015

Just to add on, in the Visual Studio command shell, just type in the following commands to build your source files:

nmake -f makefile.mk all

It's not very obvious and I had to spend some time figuring that out.

m8pple added a commit that referenced this issue Feb 6, 2015
@shakesbear
Copy link

I tried to do the steps as described above but when I do nmake -f makefile.mk all I get the following error.
capture
Does anyone know how i can solve this? Thanks

@chungcyk
Copy link

chungcyk commented Feb 8, 2015

^ I got the same error :/ Probably a stupid question but can I just check which folder you mean for the ".exe" folder (the notes didn't quite elaborate either)?
I'm so close to go and install ubuntu...

@yuchen-w
Copy link

yuchen-w commented Feb 9, 2015

I fixed that error by changing the TBBDIR in the makefile to where you have installed TBB eg TBB_DIR = C:\tbb43_20141204oss

But after that I get a linker error:
fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

@yuchen-w
Copy link

yuchen-w commented Feb 9, 2015

I managed to fix the linker error, although I'm not sure how. I did the following:
Pointed the Path to the 64 bit libraries
Changed the compiler to 64 bit with the command: "vcvarsall amd64"
Deleted all of the .obj files that was built previously and did a clean build

@AugustineTan
Copy link
Author

@shakesbear the compiler seems to be complaining that it cannot file the TBB header files which you would usually #include at the top of cpp code.

To use nmake you need to edit the file make.mk that comes with the repo. Inside you have to edit the TODOs as such

# TODO : Indicate where you have put the TBB installer
TBB_DIR = D:\GitHub\hpce_2014_cw3\TBB\tbb43_20141204oss_win

TBB_INC_DIR = $(TBB_DIR)\include

# TODO: Choose the correct library for your build
TBB_LIB_DIR = $(TBB_DIR)\lib\intel64\vc12

I did not need to do anything extra to get nmake to compile. I also did not encounter the issues faced by @yuchen-w so I am not too sure what is causing them.

@m8pple
Copy link
Contributor

m8pple commented Feb 9, 2015

@shakesbear I agree with @AugustineTan, it looks like your headers are not set up correctly. I notice that the screen-shot includes the line:

/I..\local\include

which is where it is looking for the tbb headers. If the thing it is missing is tbb/tick_count.h, it
is worth doing:

dir ..\local\include

to see what is at that path. If you can work out the path XXX such that dir XXX lists tbb, and
dir XXX\tbb lists tick_count.h, then XXX is the include path you want. There is a bit more
information about windows specific stuff in the lecture notes, though
it doesn't help much when things go wrong.

@m8pple
Copy link
Contributor

m8pple commented Feb 9, 2015

@yuchen-w I think what is happening is that you compiled once using the 32-bit compiler, and
got 32-bit object files. When you switched the environment to 64-bit, the object files were
still newer than the source files, so nmake didn't bother to rebuild them. Deleting the .obj
caused them to be recompiled as 64-bit, so the whole thing could link.

@m8pple
Copy link
Contributor

m8pple commented Feb 9, 2015

@chungcyk Do you mean where I say "Copy tbb.dll and tbb_debug.dll to same directory as .exe"? I
meant whichever directory contains the executable you want to run that is linked against TBB. So
for the default (time and test) programs it will be the bin directory, but you might put yours elsewhere.

But installing Ubuntu is not such a bad thing :) Having a little ubuntu virtual machine for testing
is a good way of working, and git makes it very easy to move the code between machines without
losing changes.

@wongruiming
Copy link

It seems the library files in TBB 4.3 are too different from 4.2 causing errors for make all (Ubuntu 14.0.4, Intel64 GCC4.4). I did not investigate further but switched to the earliest version of TBB 4.2 and the makefile ran fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants