mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Added new MATLAB factory for the DTU slave
This commit is contained in:
@@ -551,38 +551,35 @@ def swig_matlab_builder(platform, gitMode = 'incremental', cmake_args = [], cmak
|
||||
"""
|
||||
|
||||
working_folder = "build/build"
|
||||
|
||||
def prepend_path(cmd):
|
||||
if platform == 'windows':
|
||||
pre_path = 'set "PATH=swig-matlab-bin\\bin;C:\\Program Files\\7-Zip\\;%PATH%" && set "SWIG_LIB=swig-matlab-bin\\share\\swig\\3.0.3" && '
|
||||
else:
|
||||
pre_path = 'export PATH=swig-matlab-bin/bin:${PATH} && export SWIG_LIB=swig-matlab-bin/share/swig/3.0.3 && '
|
||||
return pre_path+cmd
|
||||
|
||||
# Create the factory to add the actions to
|
||||
factory = getBaseFactory(gitMode=gitMode)
|
||||
#
|
||||
# Download files from nightly build for swig
|
||||
factory.addStep(FileDownload(mastersrc = 'public_html/nightly/swig+MATLAB/'+platform+'/swig_MATLAB.7z', slavedest = 'swig_MATLAB.7z', haltOnFailure = True))
|
||||
factory.addStep(FileDownload(mastersrc = 'public_html/nightly/swig+MATLAB/'+platform+'/swig_MATLAB.7z',
|
||||
slavedest = 'swig_MATLAB.7z', haltOnFailure = True))
|
||||
# Directory for build
|
||||
factory.addStep(MakeDirectory(dir='build/build', haltOnFailure = True))
|
||||
# Unzip
|
||||
if platform == 'windows':
|
||||
factory.addStep(ShellCommand(command = 'set PATH=C:\\Program Files\\7-Zip\\;%PATH% && 7z -y -obuild x swig_MATLAB.7z', workdir = 'build', haltOnFailure = True))
|
||||
else:
|
||||
factory.addStep(ShellCommand(command = '7z -y -obuild x swig_MATLAB.7z', workdir = 'build', haltOnFailure = True))
|
||||
|
||||
if platform == 'windows':
|
||||
command = ["set", '"PATH=swig-matlab-bin\\bin;%PATH%"', "&&", "cmake", "..", "-DCOOLPROP_MATLAB_SWIG_MODULE=ON","-DSWIG_DIR=swig-matlab-bin/bin"] + cmake_args
|
||||
else:
|
||||
command = ["PATH=swig-matlab-bin/bin:${PATH}", "cmake", "..", "-DCOOLPROP_MATLAB_SWIG_MODULE=ON","-DSWIG_DIR=swig-matlab-bin/bin"] + cmake_args
|
||||
|
||||
factory.addStep(ShellCommand(command=' '.join(command),
|
||||
workdir= "build/build",
|
||||
env = cmake_env,
|
||||
haltOnFailure = True))
|
||||
if platform == 'windows':
|
||||
command = ["set", '"SWIG_LIB=swig-matlab-bin\\share\\swig\\3.0.3"', "&&", "cmake", "--build", ".", "--target", "install"]
|
||||
else:
|
||||
command = ["SWIG_LIB=swig-matlab-bin/share/swig/3.0.3", "cmake", "--build", ".", "--target", "install"]
|
||||
factory.addStep(ShellCommand(command=' '.join(command),
|
||||
workdir= "build/build",
|
||||
haltOnFailure = True))
|
||||
factory.addStep(ShellCommand(command = prepend_path('7z -y -obuild x swig_MATLAB.7z'),
|
||||
workdir = 'build' , haltOnFailure = True))
|
||||
# Call cmake
|
||||
factory.addStep(ShellCommand(
|
||||
command=prepend_path('cmake .. -DCOOLPROP_MATLAB_SWIG_MODULE=ON -DSWIG_DIR=swig-matlab-bin/bin' + ' '.join(cmake_args)),
|
||||
workdir= "build/build", env = cmake_env, haltOnFailure = True))
|
||||
# Build the binaries
|
||||
factory.addStep(ShellCommand(command=prepend_path('cmake --build . --target install'),
|
||||
workdir= "build/build" , haltOnFailure = True))
|
||||
# Upload the files
|
||||
factory.addStep(DirectoryUpload(slavesrc="install_root",masterdest="public_html/binaries",url="binaries",compress="bz2"))
|
||||
# Return the object
|
||||
return factory
|
||||
|
||||
def swig_scilab_builder(platform, gitMode = 'incremental'):
|
||||
@@ -837,7 +834,7 @@ c['builders'].append(
|
||||
)
|
||||
c['builders'].append(
|
||||
BuilderConfig(
|
||||
name="Fortran-executable-linux-64bit-GCC",
|
||||
name="Fortran-executable-linux-64bit-GCC-ExternC",
|
||||
slavenames=["linux64-slave"],
|
||||
factory = fortranFactory(platform=platformID["linux"],bitness=bitnessID["64bit"])
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user