Skip to content

Commit

Permalink
build on Windows using Visual C++ from cmd.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
by321 committed May 21, 2015
1 parent 7eae9da commit 2031498
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Makefile.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CXX = cl.exe
CFLAGS = /nologo /O2 /EHsc /D "_CRT_SECURE_NO_DEPRECATE" /D "USEOMP" /openmp

TARGET = windows

all: $(TARGET) $(TARGET)\bh_tsne.exe

$(TARGET)\bh_tsne.exe: tsne.obj sptree.obj
$(CXX) $(CFLAGS) tsne.obj sptree.obj -Fe$(TARGET)\bh_tsne.exe

sptree.obj: sptree.cpp sptree.h
$(CXX) $(CFLAGS) -c sptree.cpp

tsne.obj: tsne.cpp tsne.h sptree.h vptree.h
$(CXX) $(CFLAGS) -c tsne.cpp

.PHONY: $(TARGET)
$(TARGET):
-mkdir $(TARGET)

clean:
-erase /Q *.obj *.exe $(TARGET)\.
-rd $(TARGET)
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,24 @@ numDims = 2; pcaDims = 50; perplexity = 50; theta = .5;
map = fast_tsne(digits', numDims, pcaDims, perplexity, theta);
gscatter(map(:,1), map(:,2), labels');
```

=========================

Building on Windows Using Visual C++ from Command Line

1. Find the "vcvars64.bat" file in your Visual C++ installation directory.
This file may be named "vcvars64.bat", or something else. For example:

//Visual Studio 12
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\vcvars64.bat"

//Visual Studio 2013 Express:
C:\VisualStudioExp2013\VC\bin\x86_amd64\vcvarsx86_amd64.bat

2. From cmd.exe, go to the directory containing that .bat file and run it.

3. Go to bhtsne directory and run:

nmake -f Makefile.win all

The output EXE file is windows\bh_tsne.exe.

0 comments on commit 2031498

Please sign in to comment.