mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
First cut at matlab wrapper
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -281,47 +281,32 @@ def cmake_slave(mod_name, platform, git_mode = 'incremental', install = True, cm
|
||||
|
||||
def swig_matlab_pre(git_mode = 'incremental'):
|
||||
"""
|
||||
Download SWIG+MATLAB version, use it to build _wrap file for MATLAB builder, upload back to master
|
||||
Download SWIG+MATLAB version, use it to build _wrap file for MATLAB builder, upload generated file back to master.
|
||||
|
||||
The generated _wrap file is not platform dependent
|
||||
These generated files are needed for the other swig builders and are cross-platform
|
||||
"""
|
||||
factory = BuildFactory()
|
||||
working_folder = "build/build"
|
||||
|
||||
factory.addStep(ShellCommand(command=cleanCommand, description='fullclean?', workdir=""))
|
||||
# Download files from nightly build for swig
|
||||
factory.addStep(FileDownload(mastersrc = 'public_html/nightly/swig/swig_MATLAB.tar.gz', slavedest = 'swig_MATLAB.tar.gz', haltOnFailure = True))
|
||||
# Directory for incompressible files
|
||||
factory.addStep(MakeDirectory(dir='build/Web/_static/fluid_properties/incompressible', haltOnFailure = True))
|
||||
factory.addStep(FileDownload(mastersrc = 'public_html/nightly/swig/swig_MATLAB.tar.bz2', slavedest = 'swig_MATLAB.tar.gz', haltOnFailure = True))
|
||||
# Directory for build
|
||||
factory.addStep(MakeDirectory(dir='build/build', haltOnFailure = True))
|
||||
# Untar
|
||||
factory.addStep(ShellCommand(command = 'tar -C Web/_static/fluid_properties/incompressible -xzvf swig_MATLAB.tar.gz', workdir = 'build', haltOnFailure = True))
|
||||
factory.addStep(ShellCommand(command = 'tar -C build -xf swig_MATLAB.tar.bz2', workdir = 'build', haltOnFailure = True))
|
||||
|
||||
|
||||
# check out the source
|
||||
factory.addStep(Git(repourl='git://github.com/CoolProp/CoolProp', mode=git_mode, submodules = True, progress=True, haltOnFailure = True))
|
||||
factory.addStep(MakeDirectory(dir=working_folder+'/32bitDLL', haltOnFailure = True))
|
||||
factory.addStep(MakeDirectory(dir=working_folder+'/64bitDLL', haltOnFailure = True))
|
||||
factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True))
|
||||
# Make 32-bit __stdcall DLL
|
||||
factory.addStep(ShellCommand(command=["cmake", "../..", "-DCOOLPROP_32BIT_STDCALL_SHARED_LIBRARY=ON","-G", "Visual Studio 10"],
|
||||
workdir= working_folder+'/32bitDLL',
|
||||
factory.addStep(ShellCommand(command=["cmake", "..", "-DCOOLPROP_SWIG_MATLAB_MODULE=ON"],
|
||||
workdir= "build/build",
|
||||
haltOnFailure = True))
|
||||
factory.addStep(ShellCommand(command=["cmake", "--build", ".", "--target", "install"], workdir = working_folder+'/32bitDLL', haltOnFailure = True))
|
||||
# Make 64-bit DLL
|
||||
factory.addStep(ShellCommand(command=["cmake", "../..", "-DCOOLPROP_64BIT_SHARED_LIBRARY=ON","-G", "Visual Studio 10 Win64"],
|
||||
workdir= working_folder+'/64bitDLL',
|
||||
factory.addStep(ShellCommand(command=["cmake", "--build", "."],
|
||||
workdir= "build/build",
|
||||
haltOnFailure = True))
|
||||
factory.addStep(ShellCommand(command=["cmake", "--build", ".", "--target", "install"], workdir = working_folder+'/64bitDLL', haltOnFailure = True))
|
||||
|
||||
factory.addStep(MakeDirectory(dir='build\\bin\\MicrosoftExcel', haltOnFailure = True))
|
||||
# Copy the created DLL
|
||||
factory.addStep(ShellCommand(command=' '.join(["copy", "/Y", "install_root\\shared_library\\Windows\\32bit__stdcall_calling_convention\\*.dll", "bin\\MicrosoftExcel"]), workdir = 'build', haltOnFailure = True))
|
||||
factory.addStep(ShellCommand(command=' '.join(["move", "CoolProp.dll", "CoolProp_x64.dll"]), workdir = 'build/install_root/shared_library/Windows/64bit', haltOnFailure = True))
|
||||
factory.addStep(ShellCommand(command=' '.join(["copy", "/Y", "install_root\\shared_library\\Windows\\64bit\\*.dll", "bin\\MicrosoftExcel"]), workdir = 'build', haltOnFailure = True))
|
||||
# Copy other files
|
||||
factory.addStep(ShellCommand(command=["copy", "wrappers\Excel\CoolProp.xlam", "bin\MicrosoftExcel"], workdir = 'build', haltOnFailure = True))
|
||||
factory.addStep(ShellCommand(command=["copy", "wrappers\Excel\CoolProp.xla", "bin\MicrosoftExcel"], workdir = 'build', haltOnFailure = True))
|
||||
factory.addStep(ShellCommand(command=["copy", "wrappers\Excel\TestExcel.xlsx", "bin\MicrosoftExcel"], workdir = 'build', haltOnFailure = True))
|
||||
factory.addStep(MakeDirectory(dir='build/bin', haltOnFailure = True))
|
||||
# Collect the generated files
|
||||
factory.addStep(ShellCommand(command=["cp", "CoolProp", "build/bin"], workdir= "build/build", haltOnFailure = True))
|
||||
factory.addStep(ShellCommand(command=["cp", "CoolProp*.cpp", "build/bin"], workdir= "build/build", haltOnFailure = True))
|
||||
|
||||
# Upload the files
|
||||
factory.addStep(DirectoryUpload(slavesrc="bin",masterdest="public_html/binaries",url="MicrosoftExcel",compress="bz2"))
|
||||
return factory
|
||||
@@ -506,6 +491,9 @@ for conda_env in ['py33','py27','py34']:
|
||||
bitness = 32)
|
||||
)
|
||||
)
|
||||
|
||||
swig_matlab_pre = BuilderConfig(name="MATLAB-pre", slavenames=["windows-slave"], factory = swig_matlab_pre())
|
||||
c['builders'].append(swig_matlab_pre)
|
||||
|
||||
all_builder_names = [builder.name for builder in c['builders']]
|
||||
|
||||
@@ -553,11 +541,11 @@ c['schedulers'].append(Nightly(name='nightly',
|
||||
hour=[3, 15],
|
||||
minute=0))
|
||||
|
||||
#from buildbot.schedulers import basic
|
||||
#swig_matlab_dependent_scheduler = basic.Dependent(name="build-package",
|
||||
# upstream=swig_matlab_pre, # <- no quotes!
|
||||
# builderNames=["swig_matlab"])
|
||||
#c['schedulers'] = [swig_matlab_pre, swig_matlab_scheduler]
|
||||
from buildbot.schedulers import basic
|
||||
swig_matlab_dependent_scheduler = basic.Dependent(name="swig-matlab-dependency",
|
||||
upstream=swig_matlab_pre, # <- no quotes!
|
||||
builderNames=["MATLAB32-windows"])
|
||||
c['schedulers'] = [swig_matlab_pre, swig_matlab_scheduler]
|
||||
|
||||
####### STATUS TARGETS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user