Skip to content

Instantly share code, notes, and snippets.

@connerbrooks
Created January 14, 2016 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connerbrooks/526833b69a91c45033fc to your computer and use it in GitHub Desktop.
Save connerbrooks/526833b69a91c45033fc to your computer and use it in GitHub Desktop.
LibDAI makefile for VS 2015
# This file is part of libDAI - http://www.libdai.org/
#
# Copyright (c) 2006-2011, The libDAI authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
# This template contains configurations for compiling libDAI with Visual C++
# under Windows (and GNU Make)
#
# To use it, simply copy this file to 'Makefile.conf' and adapt 'Makefile.conf'
# to your local setup
# OPERATING SYSTEM
# Choose OS from {LINUX, WINDOWS, CYGWIN, MACOSX}
OS=WINDOWS
# FILE EXTENSIONS
# Static library
LE=.lib
# Object file
OE=.obj
# Binary executable
EE=.exe
# MatLab compiled MEX file
ME=.mexw64
# DIRECTORIES
# Directories where third party libraries are located
BOOSTDIR=D:\libs\boost_1_60_0\boost_1_60_0
MPIRDIR=D:\libs\zips\mpir-2.7.2\mpir-2.7.2\dll\x64\Release
MPIRLIBDIR=D:\libs\zips\mpir-2.7.2\mpir-2.7.2\lib\x64\Release
# COMPILER
# Compile using Visual C++ Compiler
CC=cl
# Output filename option of the compiler
CCO=/Fe
# Flags for the C++ compiler
CCFLAGS=/EHac /GR /W3 /DWINDOWS /DNOMINMAX /MD
# For MatLab R2008b, the following flag seems to be necessary: /D_SECURE_SCL=0
# but it generates exceptions in normal executables... therefore, the MatLab
# interface is now built from source completely using mex
# Flags to add in debugging mode (if DEBUG=true)
CCDEBUGFLAGS=/Ox /Zi /DDAI_DEBUG /MD
# Flags to add in non-debugging mode (if DEBUG=false)
CCNODEBUGFLAGS=/Ox
# Standard include directories
CCINC=-Iinclude -I$(BOOSTDIR) -I$(MPIRDIR)
# LINKER
# Standard libraries to include
LIBS=/link $(LIB)/libdai$(LE)
# For linking with BOOST libraries
BOOSTLIBS_PO=/LIBPATH:$(BOOSTDIR)\stage\lib
BOOSTLIBS_UTF=/LIBPATH:$(BOOSTDIR)\stage\lib
# Additional library search paths for linker
# (For some reason, we have to add the VC library path, although it is in the environment)
CCLIB=/LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64" /LIBPATH:"$(MPIRLIBDIR)" mpirxx.lib /LIBPATH:"$(MPIRDIR)" mpir.lib /FORCE
# MATLAB
# MatLab version 7.3 (R2006b) or newer?
NEW_MATLAB=true
# Replace the following by the directory where MatLab has been installed
MATLABDIR="F:\Program Files\MATLAB\R2010a"
# The following should resolve to the MatLab mex compile command
MEX=$(MATLABDIR)\bin\mex.bat
# Flags for MEX
MEXFLAGS:=-DWINDOWS -DNOMINMAX
# Standard include directories for MEX
MEXINC:=$(CCINC)
# Standard libraries to include
MEXLIBS:=-lmpirxx -lmpir LINKFLAGS="$$LINKFLAGS /FORCE"
# Additional library search paths for MEX
MEXLIB:=-L"$(BOOSTDIR)\stage\lib" -L"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64" -L"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64" -L"$(MPIRDIR)"
# SWIG PYTHON INTERFACE
# The following should resolve to the SWIG command
SWIG=swig
# Location of Python header files
INCLUDE_PYTHON=C:\python2.5
# Location of Boost C++ library header files
INCLUDE_BOOST=$(BOOSTDIR)
# CIMG
# CImg version 1.3.0 or newer?
NEW_CIMG=true
# Include directory for image segmentation example
CIMGINC=-IE:\windows\CImg-1.3.9
# Libraries for image segmentation example
CIMGLIBS=gdi32.lib user32.lib shell32.lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment