Openblas is an open source implementation of the BLAS (Basic Linear Algebra Subprograms) API with many hand-crafted optimizations for specific processor types.
Build Openblas on Windows:
Under MSYS prompt:
you can find the full documentation of compilation options from Makefile.rule
Compile the shared library on Windows:
Under the MSYS prompt:
cd /IPATH/ThirdParty/Metis
get.Metis
cd /IPATH
mkdir build
cd build
../configure --disable-static --enable-shared --enable-dependency-linking lt_cv_deplibs_check_method=pass_all --with-blas="-L/openblas/lib -lopenblas" --with-lapack="-L/openblas/lib -lopenblas" --prefix=/INSTALLPATH ADD_CXXFLAGS=-fopenmp ADD_CFLAGS=-fopenmp ADD_FFLAGS=-fopenmp
make
make test
make install
If failed, these configure options may help:
Compile and test the Fortran and C examples:
The Python Interface:
Modify the main_win32()
function as:
def main_win32():
IPOPT_ICLUDE_DIRS=['INSTALLPATH\\include\\coin', np.get_include()]
IPOPT_LIBS=['ipopt','coinhsl','coinmetis']
IPOPT_LIB_DIRS=['INSTALLPATH\\lib']
IPOPT_DLL=['libipopt-1.dll','libcoinhsl-1.dll','libcoinmetis-1.dll']
setup(
name=PACKAGE_NAME,
version=VERSION,
description=DESCRIPTION,
author=AUTHOR,
author_email=EMAIL,
url=URL,
packages=[PACKAGE_NAME],
cmdclass = {'build_ext': build_ext},
ext_modules = [
Extension(
PACKAGE_NAME + '.' + 'cyipopt',
['src/cyipopt.pyx'],
include_dirs=IPOPT_ICLUDE_DIRS,
libraries=IPOPT_LIBS,
library_dirs=IPOPT_LIB_DIRS,
extra_compile_args=['-O3', '-pipe', '-DNDEBUG', '-fopenmp'],
extra_link_args=['-O3', '-pipe', '-DNDEBUG', '-fopenmp','-lgomp','-lopenblas']
)
],
data_files=[(os.path.join(get_python_lib(), PACKAGE_NAME), [os.path.join(IPOPT_LIB_DIRS[0], dll) for dll in IPOPT_DLL])] if IPOPT_DLL else None
)
Then the usual python setup.py install
should work.
Source Code: C. Voglis, P.E. Hadjidoukas, I.E. Lagaris, D.G. Papageorgiou, A numerical differentiation library exploiting parallel architectures, Computer Physics Communications, Volume 180, Issue 8, August 2009, Pages 1404-1415, ISSN 0010-4655, http://dx.doi.org/10.1016/j.cpc.2009.02.004.
Compile the library on Windows:
A directory called ndl-1.0/ will be created with three subdirectories serial/, openmp/ and mpi/ containing the serial, OpenMP-parallel and MPI-parallel distributions respectively. Any of the three distributions can be installed by entering the corresponding directory and executing the following steps under MSYS prompt:
Serial version
./configure F77=gfortran --prefix=<install-dir>
Openmp version
./configure F77=gfortran FFLAGS=-fopenmp --prefix=<install-dir>
Make and install:
make
make install
You can get the official Win32 bit GUI program of Gambit from http://www.gambit-project.org/, but if want a x64 version or the Python library, you should compile it from source.
Compile the shared library on Windows:
Under the MSYS prompt:
cd /GPATH
./configure --prefix=/INSTALLPATH --disable-gui CXXFLAGS="-fpermissive"
make
make install
The Python Interface:
Modify the input of Extension()
in setup.py
as:
libgame = Extension("gambit.lib.libgambit",
sources=[ "gambit/lib/libgambit.pyx" ] +
glob.glob("gambit/lib/*.pxi") +
glob.glob("../libgambit/*.cc") +
glob.glob("../libagg/*.cc") +
glob.glob("../liblinear/*.cc") +
[ "../tools/lcp/nfglcp.cc",
"../tools/lcp/efglcp.cc",
"../tools/lcp/lhtab.cc",
"../tools/lcp/lemketab.cc",
"../tools/lp/nfglp.cc",
"../tools/lp/efglp.cc",
"../tools/logit/path.cc",
"../tools/logit/nfglogit.cc",
"../tools/logit/efglogit.cc" ],
language="c++",
include_dirs=[ "../..", ".." ],
extra_compile_args=['-fpermissive'],
extra_link_args=['-fpermissive'])
The usual python setup.py
should work, note that you should add the path of Gambit command line tools to system Path since Python will call these tools when computing Nash equilibria.