build.bat 2.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
@echo off

rem Set the location of the MDANSE CI scripts
set BUILD_SCRIPT_DIR=%MDANSE_SOURCE_DIR%\\BuildServer\\Windows

rem Set the path to python executable
set PYTHON_EXE=%MDANSE_TEMPORARY_INSTALLATION_DIR%\\python.exe

rem Set the path to NetCDF resources
set NETCDF_RESOURCES_PATH=%MDANSE_DEPENDENCIES_DIR%\\NetCDF

rem This is the env var used by distutils to find the MSVC framework to be used for compiling extension
rem see https://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat for more info
rem For the sake of code safety, this should be the same framework used to build Python itself
rem see http://p-nand-q.com/python/building-python-27-with-vs2010.html for more info
set VS90COMNTOOLS=C:\Users\\ci\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\Common7\\Tools

rem copy target Python
rmdir /S /Q %MDANSE_TEMPORARY_INSTALLATION_DIR%
mkdir %MDANSE_TEMPORARY_INSTALLATION_DIR%
xcopy /E /Y /Q %MDANSE_DEPENDENCIES_DIR%\\Python %MDANSE_TEMPORARY_INSTALLATION_DIR%
rem move %MDANSE_TEMPORARY_INSTALLATION_DIR%\\..\\Python %MDANSE_TEMPORARY_INSTALLATION_DIR%

rem build the ILL version of ScientificPython
cd %MDANSE_TEMPORARY_INSTALLATION_DIR%
rmdir /S /Q scientific-python
git clone https://code.ill.fr/scientific-software/scientific-python.git
cd scientific-python
git checkout master
30
%PYTHON_EXE% setup.py build --netcdf_prefix="%MDANSE_DEPENDENCIES_DIR%\\NetCDF" --netcdf_dll="%MDANSE_DEPENDENCIES_DIR%\\NetCDF" install
31 32 33 34 35 36
set STATUS=%ERRORLEVEL%
rem Exit now if unable to build
if %STATUS% neq 0 (
    echo "Failed to build Scientific"
    exit %STATUS%
)
37

38
rem Copy netcdf dependencies
Remi Perenon's avatar
Remi Perenon committed
39 40
copy "%MDANSE_DEPENDENCIES_DIR%\\NetCDF\\netcdf.dll" "%MDANSE_TEMPORARY_INSTALLATION_DIR%\\Lib\\site-packages\\Scientific\\"
copy "%MDANSE_DEPENDENCIES_DIR%\\NetCDF\\netcdf.h" "%MDANSE_TEMPORARY_INSTALLATION_DIR%\\include\\Scientific\\"
41 42 43 44 45 46 47 48 49
cd ..
rmdir /S /Q scientific-python

rem build the ILL version of MMTK
cd %MDANSE_TEMPORARY_INSTALLATION_DIR%
rmdir /S /Q mmtk
git clone https://code.ill.fr/scientific-software/mmtk.git
cd mmtk
git checkout master
50
%PYTHON_EXE% setup.py build install
51 52 53 54 55 56
set STATUS=%ERRORLEVEL%
rem Exit now if unable to build
if %STATUS% neq 0 (
    echo "Failed to build MMTK"
    exit %STATUS%
)
57

58 59 60 61 62
cd ..
rmdir /S /Q mmtk

rem Go back to the MDANSE source directory and build and install it
cd "%MDANSE_SOURCE_DIR%"
63
%PYTHON_EXE% setup.py build install
64 65 66 67 68 69 70
set STATUS=%ERRORLEVEL%
rem Exit now if unable to build
if %STATUS% neq 0 (
    echo "Failed to build MDANSE"
    exit %STATUS%
)

71
cd %MDANSE_SOURCE_DIR%