From ed2028d560c5dec8ea197569c71a059bb96e61a6 Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 23 Oct 2014 11:36:27 +0200 Subject: [PATCH 01/14] Removed Ian's Windows machines from the Python builds --- dev/buildbot/master/master.cfg | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index 3144d977..ee7cd942 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -647,22 +647,6 @@ c['builders'].append( ) ) -for conda_env in ['py33','py27','py34']: - for platform in ['OSX','windows']: - ctest_args, cmake_args = [], [] - if platform.startswith('windows'): - ctest_args = ['-C', 'Release'] - cmake_args = ['-G', '"Visual Studio 10 2010 Win64"'] - c['builders'].append( - BuilderConfig(name="Python-binaries-" + platform + '-' + conda_env, - slavenames=[platform + "-slave"], - factory = python_slave("BINARIES", - platform = platform, - conda_env = conda_env, - cmake_args = cmake_args) - ) - ) - # We centralise the Python builder configuration here # # Setting the appropriate installer options @@ -673,23 +657,20 @@ windowsDTUslave = PythonSlaveConfig("windows-DTU-slave") windowsDTUslave.pyact[getIDstr("windows", "32bit", 0 )] = "\"C:\\Program Files (x86)\\Miniconda32_27\\Scripts\\activate.bat\"" windowsDTUslave.pyact[getIDstr("windows", "64bit", 0 )] = "\"C:\\Program Files\\Miniconda64_27\\Scripts\\activate.bat\"" windowsDTUslave.pyenv[getIDstr("windows", 0 , "py27")] = "CoolProp27" +windowsDTUslave.pyenv[getIDstr("windows", 0 , "py33")] = "CoolProp33" windowsDTUslave.pyenv[getIDstr("windows", 0 , "py34")] = "CoolProp34" tmpins = baseins + ['bdist_wininst','--dist-dir', relinstFolder+'/Python'] windowsDTUslave.pyins[getIDstr("windows", "32bit", "py27")] = tmpins + ['--cmake-compiler', 'vc9' , '--cmake-bitness', '32'] +windowsDTUslave.pyins[getIDstr("windows", "32bit", "py33")] = tmpins + ['--cmake-compiler', 'vc10', '--cmake-bitness', '32'] windowsDTUslave.pyins[getIDstr("windows", "32bit", "py34")] = tmpins + ['--cmake-compiler', 'vc10', '--cmake-bitness', '32'] windowsDTUslave.pyins[getIDstr("windows", "64bit", "py27")] = tmpins + ['--cmake-compiler', 'vc9' , '--cmake-bitness', '64'] +windowsDTUslave.pyins[getIDstr("windows", "64bit", "py33")] = tmpins + ['--cmake-compiler', 'vc10', '--cmake-bitness', '64'] windowsDTUslave.pyins[getIDstr("windows", "64bit", "py34")] = tmpins + ['--cmake-compiler', 'vc10', '--cmake-bitness', '64'] -windowsIANslave = PythonSlaveConfig("windows-slave") -windowsIANslave.pyact[getIDstr("windows", "32bit", 0 )] = "C:\\Miniconda32bit\\Scripts\\activate" -windowsIANslave.pyact[getIDstr("windows", "64bit", 0 )] = "activate" -windowsIANslave.pyenv[getIDstr("windows", 0 , "py33")] = "py33" -windowsIANslave.pyins[getIDstr("windows", "32bit", "py33")] = tmpins + ['--cmake-compiler', 'vc10', '--cmake-bitness', '32'] -windowsIANslave.pyins[getIDstr("windows", "64bit", "py33")] = tmpins + ['--cmake-compiler', 'vc10', '--cmake-bitness', '64'] - linuxDTUslave = PythonSlaveConfig("linux32-slave") linuxDTUslave.pyact[getIDstr( "linux" , "32bit", 0 )] = "source /home/jowr/miniconda/bin/activate" linuxDTUslave.pyenv[getIDstr( "linux" , 0 , "py27")] = "CoolProp27" +linuxDTUslave.pyenv[getIDstr( "linux" , 0 , "py33")] = "CoolProp33" linuxDTUslave.pyenv[getIDstr( "linux" , 0 , "py34")] = "CoolProp34" linuxDTUslave.pyins[getIDstr( "linux" , "32bit", 0 )] = baseins @@ -700,7 +681,7 @@ osxIANslave.pyenv[getIDstr( "osx" , "64bit", "py33")] = "py33" osxIANslave.pyenv[getIDstr( "osx" , "64bit", "py34")] = "py34" osxIANslave.pyins[getIDstr( "osx" , 0 , 0 )] = baseins -pythonSlaves = [windowsDTUslave, windowsIANslave, linuxDTUslave, osxIANslave] +pythonSlaves = [windowsDTUslave, linuxDTUslave, osxIANslave] for slave in pythonSlaves: for pyID in slave.getIDs(): From ef4e2d799f45660ab69cb568c002931677bda608 Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 23 Oct 2014 11:48:21 +0200 Subject: [PATCH 02/14] Removed 32bit Windows builds --- dev/buildbot/master/master.cfg | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index ee7cd942..dce9fc9a 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -802,17 +802,6 @@ c['builders'].append( ) ) -for conda_env in ['py33','py27','py34']: - c['builders'].append( - BuilderConfig(name="Python-binaries-windows32bit-" + conda_env, - slavenames=["windows-slave"], - factory = python_slave("BINARIES", - platform = 'windows', - conda_env = conda_env, - bitness = 32) - ) - ) - swig_matlab_pre = BuilderConfig(name="SWIG-MATLAB-pre", slavenames=["linux-slave"], factory = swig_matlab_pre()) c['builders'].append(swig_matlab_pre) From 74475d20c72926a5f79edcc36492883a64286f2b Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 23 Oct 2014 12:15:25 +0200 Subject: [PATCH 03/14] Removed the old python slaves and added new upload dir, little documentation --- Web/develop/buildbot.rst | 9 ++++++++ dev/buildbot/master/master.cfg | 39 +--------------------------------- 2 files changed, 10 insertions(+), 38 deletions(-) diff --git a/Web/develop/buildbot.rst b/Web/develop/buildbot.rst index 1fa153fa..195e9b2a 100644 --- a/Web/develop/buildbot.rst +++ b/Web/develop/buildbot.rst @@ -104,6 +104,15 @@ POSIX specification. At the moment, it is not possible to use several slaves for the same build job. We have to find a new way to generate the configuration. + +Octave Slaves +------------- + +Octave requires MinGW for building the CoolProp wrapper. Install it from +`MinGW `_ to get the open-source toolchains needed. +This module also depends on `SWIG `_ and Python. + + Buildbot as a service (Windows) ------------------------------- diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index dce9fc9a..d7b17140 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -303,7 +303,7 @@ def pythonFactory(pyID, pyCFG=PythonSlaveConfig("name"), gitMode='incremental'): combinedCMD = " && ".join([activateCMD, installCMD]) factory.addStep(ShellCommand(command = combinedCMD, workdir = workingFolder, haltOnFailure = True)) # - factory.addStep(DirectoryUpload(slavesrc=uploadFolder, masterdest="public_html/bin", url="bin", compress="bz2")) + factory.addStep(DirectoryUpload(slavesrc=uploadFolder, masterdest="public_html/binaries", url="binaries", compress="bz2")) return factory @@ -387,43 +387,6 @@ def javascript_slave(platform, cmake_args = [], cmake_env = {}, build_args = [], return factory -def python_slave(key, platform, conda_env, cmake_args = [], cmake_env = {}, build_args = [], gitMode = 'incremental', bitness = 64): - - working_folder = "build/wrappers/Python" - - # Create the factory to add the actions to - factory = getBaseFactory(gitMode=gitMode) - - # Remove the temporary folder for installs - factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True)) - - if platform.find('OSX') > -1: - source = ['source','activate'] - elif 'win' in platform.lower() and bitness == 32: - source = ['c:\\Miniconda32bit\\Scripts\\activate'] - else: - source = ['activate'] - - if 'win' in platform.lower(): - if conda_env == 'py27': - vc = 'vc9' - else: - vc = 'vc10' - options = ['bdist_wheel','--dist-dir','../../install_root/Python','bdist_wininst','--dist-dir','../../install_root/Python', '--cmake-compiler', vc, '--cmake-bitness', str(bitness)] - elif 'OSX' in platform: - options = ['bdist_wheel','--dist-dir','../../install_root/Python'] - else: - raise ValueError() - - factory.addStep(ShellCommand(command = ' '.join(source + [conda_env,"&&","python", "setup.py"]+options), - env = cmake_env, - workdir= working_folder, - haltOnFailure = True)) - - factory.addStep(DirectoryUpload(slavesrc="install_root", masterdest="public_html/binaries", url="binaries", compress="bz2")) - - return factory - def python_source_slave(key, platform, conda_env, cmake_args = [], cmake_env = {}, build_args = [], gitMode = 'incremental'): working_folder = "build/build" From a6d3a84ea8b66ecc80ea5fe450fc27cc2310a057 Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 23 Oct 2014 12:55:44 +0200 Subject: [PATCH 04/14] Changed build config --- Web/coolprop/wrappers/index.rst | 2 ++ Web/develop/buildbot.rst | 15 +++------------ dev/buildbot/master/master.cfg | 16 +++++++++++++--- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Web/coolprop/wrappers/index.rst b/Web/coolprop/wrappers/index.rst index 3c792ea8..2ad85f62 100644 --- a/Web/coolprop/wrappers/index.rst +++ b/Web/coolprop/wrappers/index.rst @@ -55,6 +55,7 @@ For git, your best best is the installer from http://msysgit.github.io/. Check For the C++ compiler, the options are a bit more complicated. There are multiple (binary incompatible) versions of Visual Studio, as well as G++ ports for windows (MinGW). Unless you are compiling the python wrappers, you can compile with MinGW, so you should obtain the `MinGW installer `_ and run it. You should install all the packages available, and you must install to a path without spaces. ``C:\MinGW`` is recommended as an installation path. If you are compiling for Python 2.7, you can install Visual Studio 2008 Express from `VS2008Express installer `_. +Make sure you install ServicePack 1, otherwise your are going to get quite cryptic error messages during compilation. If you are compiling for Python 3.x, you can install Visual Studio 2010 Express from `VS2010Express installer `_. @@ -62,6 +63,7 @@ If you want to build 64-bit extensions, you MUST install VS2010 Professional, wh All three compilers should co-exist happily on the path, so you should be fine installing all three, but they are rather sizeable installs. + Linux ----- On debian based linux distributions (ubuntu, etc.), you can simply do:: diff --git a/Web/develop/buildbot.rst b/Web/develop/buildbot.rst index 195e9b2a..a88a2489 100644 --- a/Web/develop/buildbot.rst +++ b/Web/develop/buildbot.rst @@ -77,11 +77,7 @@ steps on a Windows machine:: pip install wheel deactivate -Please repeat the steps above for both 32bit and 64bit Python environments. In -addition to the Python tools, you also need the Microsoft compilers. Please -install Visual Studio 2010 for Python 3.4 and Visual Studio 2008 for Python 2.7. -The latter requires ServicePack 1, otherwise your are going to get quite cryptic -error messages during compilation. +Please repeat the steps above for both 32bit and 64bit Python environments. On a Linux system, things only change a little bit:: @@ -104,13 +100,8 @@ POSIX specification. At the moment, it is not possible to use several slaves for the same build job. We have to find a new way to generate the configuration. - -Octave Slaves -------------- - -Octave requires MinGW for building the CoolProp wrapper. Install it from -`MinGW `_ to get the open-source toolchains needed. -This module also depends on `SWIG `_ and Python. +Information on building the single wrappers can be found on +:ref:`this dedicated page`. Buildbot as a service (Windows) diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index d7b17140..61ee49e6 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -307,7 +307,7 @@ def pythonFactory(pyID, pyCFG=PythonSlaveConfig("name"), gitMode='incremental'): return factory -def cmakeFactory(mod_name, platform, gitMode = 'incremental', install = True, pre_cmd = [], cmake_args = [], build_args = [], ctest_args = [], cmake_env={}, test = True): +def cmakeFactory(mod_name = None, gitMode = 'incremental', install = True, pre_cmd = [], cmake_args = [], build_args = [], ctest_args = [], cmake_env={}, test = True): """ Parameters ---------- @@ -337,7 +337,10 @@ def cmakeFactory(mod_name, platform, gitMode = 'incremental', install = True, pr factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True)) # if not pre_cmd[-1]=="&&": pre_cmd.append("&&") - cmakeCMD = pre_cmd + ["cmake", "..", "-DCOOLPROP_"+mod_name.upper()+"_MODULE=ON","-DBUILD_TESTING=ON"]+cmake_args + if mod_name is not None: + cmake_args = ["-DCOOLPROP_"+mod_name.upper()+"_MODULE=ON","-DBUILD_TESTING=ON"]+cmake_args + + cmakeCMD = pre_cmd + ["cmake", ".."]+cmake_args factory.addStep(ShellCommand( command=' '.join(cmakeCMD), env = cmake_env, @@ -677,7 +680,14 @@ for slave in pythonSlaves: # ) # ) - +c['builders'].append( +BuilderConfig(name="StaticLibrary-binaries-windows-32bit-MinGW-ExternC", + slavenames=["windows-DTU-slave"], + factory = cmakeFactory(cmake_args=[ + "-DCOOLPROP_EXTERNC_STATIC_LIBRARY=ON", + "-G", "MinGW Makefiles"]) + ) + ) #Common boring 64-bit modules for windows, linux and OSX ### OSX From 8b5476eff0905b7a1eaadf0c034cafe48fc23b20 Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 23 Oct 2014 12:58:04 +0200 Subject: [PATCH 05/14] Wrong editor for cfg... --- dev/buildbot/master/master.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index 61ee49e6..9b16c6d0 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -337,7 +337,7 @@ def cmakeFactory(mod_name = None, gitMode = 'incremental', install = True, pre_c factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True)) # if not pre_cmd[-1]=="&&": pre_cmd.append("&&") - if mod_name is not None: + if mod_name is not None: cmake_args = ["-DCOOLPROP_"+mod_name.upper()+"_MODULE=ON","-DBUILD_TESTING=ON"]+cmake_args cmakeCMD = pre_cmd + ["cmake", ".."]+cmake_args From b7eb3f8c73f673bbd048faf5dbf27ca9a4843247 Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 23 Oct 2014 12:59:19 +0200 Subject: [PATCH 06/14] Added length check to pre_cmd --- dev/buildbot/master/master.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index 9b16c6d0..6aa838a9 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -336,7 +336,7 @@ def cmakeFactory(mod_name = None, gitMode = 'incremental', install = True, pre_c factory.addStep(MakeDirectory(dir=working_folder, haltOnFailure = True)) factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True)) # - if not pre_cmd[-1]=="&&": pre_cmd.append("&&") + if len(pre_cmd>0) and not pre_cmd[-1]=="&&": pre_cmd.append("&&") if mod_name is not None: cmake_args = ["-DCOOLPROP_"+mod_name.upper()+"_MODULE=ON","-DBUILD_TESTING=ON"]+cmake_args From 8ea0262e030255eda17d48f4e6cf040f2d56b3ec Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 23 Oct 2014 13:00:04 +0200 Subject: [PATCH 07/14] Commit marathon... --- dev/buildbot/master/master.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index 6aa838a9..addc6bb4 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -336,7 +336,7 @@ def cmakeFactory(mod_name = None, gitMode = 'incremental', install = True, pre_c factory.addStep(MakeDirectory(dir=working_folder, haltOnFailure = True)) factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True)) # - if len(pre_cmd>0) and not pre_cmd[-1]=="&&": pre_cmd.append("&&") + if len(pre_cmd)>0 and not pre_cmd[-1]=="&&": pre_cmd.append("&&") if mod_name is not None: cmake_args = ["-DCOOLPROP_"+mod_name.upper()+"_MODULE=ON","-DBUILD_TESTING=ON"]+cmake_args From b5e03e3fc73fdc268074cc7be8a7cc97b5ea11a3 Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 23 Oct 2014 15:13:00 +0200 Subject: [PATCH 08/14] Added Fortran wrappers to build slaves --- Web/coolprop/wrappers/index.rst | 2 +- dev/buildbot/master/master.cfg | 68 +++++++++++++++++++++++++++++---- 2 files changed, 61 insertions(+), 9 deletions(-) diff --git a/Web/coolprop/wrappers/index.rst b/Web/coolprop/wrappers/index.rst index 2ad85f62..affd2fd3 100644 --- a/Web/coolprop/wrappers/index.rst +++ b/Web/coolprop/wrappers/index.rst @@ -52,7 +52,7 @@ For git, your best best is the installer from http://msysgit.github.io/. Check C:\Users\XXXX>git --version git version 1.9.4.msysgit.0 -For the C++ compiler, the options are a bit more complicated. There are multiple (binary incompatible) versions of Visual Studio, as well as G++ ports for windows (MinGW). Unless you are compiling the python wrappers, you can compile with MinGW, so you should obtain the `MinGW installer `_ and run it. You should install all the packages available, and you must install to a path without spaces. ``C:\MinGW`` is recommended as an installation path. +For the C++ compiler, the options are a bit more complicated. There are multiple (binary incompatible) versions of Visual Studio, as well as G++ ports for windows (MinGW). Unless you are compiling the python wrappers, you can compile with MinGW, so you should obtain the `MinGW installer `_ and run it. You should install all the packages available, and you must install to a path without spaces. ``C:\MinGW`` is recommended as an installation path. Be sure to add the binaries in ``C:\MinGW\bin\`` to your PATH variable. If you are compiling for Python 2.7, you can install Visual Studio 2008 Express from `VS2008Express installer `_. Make sure you install ServicePack 1, otherwise your are going to get quite cryptic error messages during compilation. diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index addc6bb4..e1c8583b 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -48,7 +48,7 @@ c['change_source'].append(GitPoller( from buildbot.process.factory import BuildFactory from buildbot.steps.source.git import Git from buildbot.steps.shell import ShellCommand -from buildbot.steps.slave import MakeDirectory, RemoveDirectory +from buildbot.steps.slave import MakeDirectory, RemoveDirectory, CopyDirectory from buildbot.steps.transfer import DirectoryUpload, FileDownload from buildbot.process import properties @@ -368,6 +368,39 @@ def cmakeFactory(mod_name = None, gitMode = 'incremental', install = True, pre_c compress="bz2")) return factory + +def fortranFactory(platform=1): + working_folder = "build/build" # Same as in cmakeFactory + fortran_folder = "build/wrappers/Fortran/detailed_example" # + # + if platform==platformID["windows"]: + cmake_args = ["-DCOOLPROP_EXTERNC_STATIC_LIBRARY=ON","-G", "\"MinGW Makefiles\""] + cp_cmd = "copy /Y *.f90 ..\\..\\..\\build" + add_libs = "" + elif platform==platformID["linux"]: + cmake_args = ["-DCOOLPROP_EXTERNC_STATIC_LIBRARY=ON"] + cp_cmd = "cp *.f90 ../../../build/" + add_libs = " -ldl" + else: + raise ValueError("Unknown Fortran platform: {0}".format(platform)) + + # Create the factory to add the actions to + factory = cmakeFactory(cmake_args=cmake_args,install=False,test=False) + # + #factory.addStep(CopyDirectory(src=fortran_folder, dest=working_folder)) + factory.addStep(ShellCommand(command=cp_cmd, + workdir = fortran_folder,haltOnFailure = True)) + factory.addStep(ShellCommand( + command="gfortran -c -Wall cpinterface.f90 cool_fortran_bind.f90", + workdir = working_folder,haltOnFailure = True)) + factory.addStep(ShellCommand( + command="gfortran -o main *.o libCoolProp.a -lstdc++"+add_libs, + workdir = working_folder,haltOnFailure = True)) + factory.addStep(ShellCommand( + command="main", + workdir = working_folder,haltOnFailure = False)) + # + return factory @@ -680,14 +713,33 @@ for slave in pythonSlaves: # ) # ) +windowsDTUslave.pyact[getIDstr("windows", "32bit", 0 )] = "\"C:\\Program Files (x86)\\Miniconda32_27\\Scripts\\activate.bat\"" +windowsDTUslave.pyact[getIDstr("windows", "64bit", 0 )] = "\"C:\\Program Files\\Miniconda64_27\\Scripts\\activate.bat\"" +windowsDTUslave.pyenv[getIDstr("windows", 0 , "py27")] = "CoolProp27" + +#c['builders'].append( +#BuilderConfig(name="StaticLibrary-binaries-windows-32bit-MinGW-ExternC", +# slavenames=["windows-DTU-slave"], +# factory = cmakeFactory(cmake_args=[ +# "-DCOOLPROP_EXTERNC_STATIC_LIBRARY=ON", +# "-G", "\"MinGW Makefiles\""], +# install = False) +# ) +# ) c['builders'].append( -BuilderConfig(name="StaticLibrary-binaries-windows-32bit-MinGW-ExternC", - slavenames=["windows-DTU-slave"], - factory = cmakeFactory(cmake_args=[ - "-DCOOLPROP_EXTERNC_STATIC_LIBRARY=ON", - "-G", "MinGW Makefiles"]) - ) - ) + BuilderConfig( + name="Fortran-executable-windows-32bit-MinGW-ExternC", + slavenames=["windows-DTU-slave"], + factory = fortranFactory(platform=platformID["windows"]) + ) +) +c['builders'].append( + BuilderConfig( + name="Fortran-executable-linux-32bit-GCC-ExternC", + slavenames=["linux32-slave"], + factory = fortranFactory(platform=platformID["linux"]) + ) +) #Common boring 64-bit modules for windows, linux and OSX ### OSX From a9d5af5741311bafe72e75a5a8dcd76c599bae1c Mon Sep 17 00:00:00 2001 From: jowr Date: Thu, 23 Oct 2014 15:30:14 +0200 Subject: [PATCH 09/14] Imporoved Fortran builders --- dev/buildbot/master/master.cfg | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index e1c8583b..0fed362b 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -376,11 +376,15 @@ def fortranFactory(platform=1): if platform==platformID["windows"]: cmake_args = ["-DCOOLPROP_EXTERNC_STATIC_LIBRARY=ON","-G", "\"MinGW Makefiles\""] cp_cmd = "copy /Y *.f90 ..\\..\\..\\build" - add_libs = "" + build_cmd = "gfortran -c -Wall cpinterface.f90 cool_fortran_bind.f90" + link_cmd = "gfortran -o main *.o libCoolProp.a -lstdc++" + exec_cmd = "main" elif platform==platformID["linux"]: cmake_args = ["-DCOOLPROP_EXTERNC_STATIC_LIBRARY=ON"] cp_cmd = "cp *.f90 ../../../build/" - add_libs = " -ldl" + build_cmd = "gfortran -c -Wall cpinterface.f90 cool_fortran_bind.f90" + link_cmd = "gfortran -o main *.o libCoolProp.a -lstdc++ -ldl" + exec_cmd = "./main" else: raise ValueError("Unknown Fortran platform: {0}".format(platform)) @@ -388,22 +392,12 @@ def fortranFactory(platform=1): factory = cmakeFactory(cmake_args=cmake_args,install=False,test=False) # #factory.addStep(CopyDirectory(src=fortran_folder, dest=working_folder)) - factory.addStep(ShellCommand(command=cp_cmd, - workdir = fortran_folder,haltOnFailure = True)) - factory.addStep(ShellCommand( - command="gfortran -c -Wall cpinterface.f90 cool_fortran_bind.f90", - workdir = working_folder,haltOnFailure = True)) - factory.addStep(ShellCommand( - command="gfortran -o main *.o libCoolProp.a -lstdc++"+add_libs, - workdir = working_folder,haltOnFailure = True)) - factory.addStep(ShellCommand( - command="main", - workdir = working_folder,haltOnFailure = False)) - # + factory.addStep(ShellCommand(command=cp_cmd, workdir = fortran_folder, haltOnFailure = True)) + for cmd in [build_cmd,link_cmd,exec_cmd]: + factory.addStep(ShellCommand(command=cmd, workdir = working_folder, haltOnFailure = True)) return factory - def javascript_slave(platform, cmake_args = [], cmake_env = {}, build_args = [], gitMode = 'incremental'): working_folder = "build/Javascript" From 4a6fd1b55bd481cada616ce3c2ab22ee7e2c9c95 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Thu, 23 Oct 2014 19:29:21 +0200 Subject: [PATCH 10/14] Fixing build scripts for swig versions - scilab wrapper works now! --- dev/scripts/build_swig_matlab.py | 1 + dev/scripts/build_swig_scilab.py | 1 + 2 files changed, 2 insertions(+) diff --git a/dev/scripts/build_swig_matlab.py b/dev/scripts/build_swig_matlab.py index 5a5d8027..85cfd016 100644 --- a/dev/scripts/build_swig_matlab.py +++ b/dev/scripts/build_swig_matlab.py @@ -19,3 +19,4 @@ subprocess.check_call('./configure --disable-ccache --with-matlab=/usr/local/MAT subprocess.check_call('make', shell = True, stdout = sys.stdout, stderr = sys.stderr) subprocess.check_call('make install', shell = True, stdout = sys.stdout, stderr = sys.stderr) subprocess.check_call('cp swig swig3.0', shell = True, stdout = sys.stdout, stderr = sys.stderr, cwd='swig-matlab-bin/bin') +subprocess.check_call('cp swig swig2.0', shell = True, stdout = sys.stdout, stderr = sys.stderr, cwd='swig-matlab-bin/bin') diff --git a/dev/scripts/build_swig_scilab.py b/dev/scripts/build_swig_scilab.py index f855c143..8663e38c 100755 --- a/dev/scripts/build_swig_scilab.py +++ b/dev/scripts/build_swig_scilab.py @@ -17,3 +17,4 @@ subprocess.check_call('./configure --disable-ccache --with-scilab-inc=${SCILAB_H subprocess.check_call('make', shell = True, stdout = sys.stdout, stderr = sys.stderr) subprocess.check_call('make install', shell = True, stdout = sys.stdout, stderr = sys.stderr) subprocess.check_call('cp swig swig3.0', shell = True, stdout = sys.stdout, stderr = sys.stderr, cwd='swig-scilab-bin/bin') +subprocess.check_call('cp swig swig2.0', shell = True, stdout = sys.stdout, stderr = sys.stderr, cwd='swig-scilab-bin/bin') From 420606689a9eb35412bafb9c854ce094a4cbb964 Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Fri, 24 Oct 2014 12:54:49 +0100 Subject: [PATCH 11/14] Added forceable bitness --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 495bf37b..e04efeb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,14 @@ option (BUILD_TESTING "Enable testing for this given builder" OFF) +option (FORCE_BITNESS_32 + "Force a 32bit build regardless of the host" + OFF) + +option (FORCE_BITNESS_64 + "Force a 64bit build regardless of the host" + OFF) + ####################################### # FIND ALL SOURCES # #-------------------------------------# @@ -125,6 +133,12 @@ else() endif() endif() +IF(FORCE_BITNESS_32) + SET(BITNESS "32") +ELSEIF(FORCE_BITNESS_64) + SET(BITNESS "64") +ENDIF() + ####################################### # MAKE ARTIFACTS # #-------------------------------------# From 15dc8567cc552b1a3302b4324ade5b00d119e90e Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Fri, 24 Oct 2014 14:35:08 +0100 Subject: [PATCH 12/14] Added a new bitness treatment, should simplify the module sections --- CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e04efeb8..a8890693 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,12 +133,28 @@ else() endif() endif() +IF(MSVC AND (FORCE_BITNESS_32 OR FORCE_BITNESS_64)) + MESSAGE(STATUS "You cannot force a certain bitness for Visual Studio, use the generator settings for this purpose." ) + MESSAGE(STATUS "Pass '-G \"Visual Studio 10 2010 Win64\"' to CMake to make a 64bit binary using VS2010." ) + MESSAGE(STATUS "Pass '-G \"Visual Studio 10 2010\"' to CMake to make a 32bit binary using VS2010." ) + MESSAGE(STATUS "Pass '-G \"Visual Studio 9 2008 Win64\"' to CMake to make a 64bit binary using VS2008." ) + MESSAGE(STATUS "Pass '-G \"Visual Studio 9 2008\"' to CMake to make a 32bit binary using VS2008." ) + MESSAGE(FATAL_ERROR "Fix that and try again...") +ENDIF() + IF(FORCE_BITNESS_32) SET(BITNESS "32") ELSEIF(FORCE_BITNESS_64) SET(BITNESS "64") ENDIF() +if (!MSVC) + #set_target_properties(${app_name} PROPERTIES COMPILE_FLAGS "-m${BITNESS}" LINK_FLAGS "-m${BITNESS}") + #set_target_properties(${app_name} PROPERTIES COMPILE_FLAGS "-m${BITNESS}" LINK_FLAGS "-m${BITNESS}") + set_target_properties(${app_name} PROPERTIES APPEND_STRING PROPERTY COMPILE_FLAGS "-m${BITNESS}") + set_target_properties(${app_name} PROPERTIES APPEND_STRING PROPERTY LINK_FLAGS "-m${BITNESS}") +endif() + ####################################### # MAKE ARTIFACTS # #-------------------------------------# @@ -164,6 +180,8 @@ if (COOLPROP_STATIC_LIBRARY_MODULE OR COOLPROP_STATIC_LIBRARY OR COOLPROP_EXTERN install (TARGETS ${app_name} DESTINATION static_library/${CMAKE_SYSTEM_NAME}) endif() +### Process some more options ### + if (COOLPROP_EXTERNC_STATIC_LIBRARY) set_target_properties (${app_name} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DEXTERNC") endif() From 91f40327f50dbbf2fa1e016469db53141bd094fd Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Fri, 24 Oct 2014 14:37:03 +0100 Subject: [PATCH 13/14] Added cross-cimpilation toolchains for mingw --- .../Toolchains/linux_mingw_windows32.cmake | 47 +++++++++++++++++++ .../Toolchains/linux_mingw_windows64.cmake | 47 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 dev/cmake/Toolchains/linux_mingw_windows32.cmake create mode 100644 dev/cmake/Toolchains/linux_mingw_windows64.cmake diff --git a/dev/cmake/Toolchains/linux_mingw_windows32.cmake b/dev/cmake/Toolchains/linux_mingw_windows32.cmake new file mode 100644 index 00000000..35f32e8d --- /dev/null +++ b/dev/cmake/Toolchains/linux_mingw_windows32.cmake @@ -0,0 +1,47 @@ +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +####################################### +# Choose an appropriate compiler prefix +####################################### +# +# for classical mingw32 +# see http://www.mingw.org/ +#set(COMPILER_PREFIX "i586-mingw32msvc") +# +# for 32 or 64 bits mingw-w64 +# see http://mingw-w64.sourceforge.net/ +#set(COMPILER_PREFIX "i686-w64-mingw32") +#set(COMPILER_PREFIX "x86_64-w64-mingw32") +# +set(COMPILER_PREFIX "i686-w64-mingw32") +# +####################################### +# which compilers to use for C and C++ +####################################### +# +# Either search for the compiler ... +#find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres) +# +# ... or rely on the system path +#SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres) +# +find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres) +find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc) +find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++) +# +# +####################################### +# Where to look for target binaries +####################################### +# +# here is the target environment located +set(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX}) +# +# adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +# \ No newline at end of file diff --git a/dev/cmake/Toolchains/linux_mingw_windows64.cmake b/dev/cmake/Toolchains/linux_mingw_windows64.cmake new file mode 100644 index 00000000..c7b1a049 --- /dev/null +++ b/dev/cmake/Toolchains/linux_mingw_windows64.cmake @@ -0,0 +1,47 @@ +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +####################################### +# Choose an appropriate compiler prefix +####################################### +# +# for classical mingw32 +# see http://www.mingw.org/ +#set(COMPILER_PREFIX "i586-mingw32msvc") +# +# for 32 or 64 bits mingw-w64 +# see http://mingw-w64.sourceforge.net/ +#set(COMPILER_PREFIX "i686-w64-mingw32") +#set(COMPILER_PREFIX "x86_64-w64-mingw32") +# +set(COMPILER_PREFIX "x86_64-w64-mingw32") +# +####################################### +# which compilers to use for C and C++ +####################################### +# +# Either search for the compiler ... +#find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres) +# +# ... or rely on the system path +#SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres) +# +find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres) +find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc) +find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++) +# +# +####################################### +# Where to look for target binaries +####################################### +# +# here is the target environment located +set(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX}) +# +# adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +# \ No newline at end of file From 44394097c76f81ef2e6eb625bb5f2909cc5d58aa Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Fri, 24 Oct 2014 16:37:00 +0100 Subject: [PATCH 14/14] Tested the toolchains, they work --- dev/cmake/Toolchains/linux_mingw_windows32.cmake | 1 + dev/cmake/Toolchains/linux_mingw_windows64.cmake | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dev/cmake/Toolchains/linux_mingw_windows32.cmake b/dev/cmake/Toolchains/linux_mingw_windows32.cmake index 35f32e8d..3169c699 100644 --- a/dev/cmake/Toolchains/linux_mingw_windows32.cmake +++ b/dev/cmake/Toolchains/linux_mingw_windows32.cmake @@ -1,3 +1,4 @@ +# run with cmake -DCMAKE_TOOLCHAIN_FILE=... # the name of the target operating system SET(CMAKE_SYSTEM_NAME Windows) diff --git a/dev/cmake/Toolchains/linux_mingw_windows64.cmake b/dev/cmake/Toolchains/linux_mingw_windows64.cmake index c7b1a049..25c0ad7d 100644 --- a/dev/cmake/Toolchains/linux_mingw_windows64.cmake +++ b/dev/cmake/Toolchains/linux_mingw_windows64.cmake @@ -1,3 +1,4 @@ +# run with cmake -DCMAKE_TOOLCHAIN_FILE=... # the name of the target operating system SET(CMAKE_SYSTEM_NAME Windows) @@ -26,9 +27,12 @@ set(COMPILER_PREFIX "x86_64-w64-mingw32") # ... or rely on the system path #SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres) # -find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres) -find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc) -find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++) +#find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres) +#find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc) +#find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++) +SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres) +SET(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc) +SET(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++) # # #######################################