Changes between Version 8 and Version 9 of G2onPy3


Ignore:
Timestamp:
Jan 18, 2021 1:57:09 PM (10 months ago)
Author:
toby
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • G2onPy3

    v8 v9  
    11= GSAS-II with Python 3.x =
     2
     3***This page is out of date but is being retained to keep build information at bottom***
    24
    35GSAS-II has been packaged with Python 3.6, wxPython 4.0 and the lastest compatible versions of all other packages into a single-download installer. While a single set of files is used to run GSAS-II, regardless of platform or Python/package versions, there are potential differences in how some code behaves with these changes. We consider these packages to be somewhat experimental until we gain more experience and would encourage experienced users to try them out, before removing their existing Python 2.7-based GSAS-II installation.
     
    6365
    6466
    65 
     67== Windows 64 build commands ==
     68{{{
     69rem ========== Configure
     70set condaHome=C:\jenkins\conda37-64
     71set sysType=win-64
     72rem ========== Anaconda stuff
     73call %condaHome%\Scripts\activate
     74REM call conda update conda -y
     75REM call conda create -n py37n119 python=3.7 numpy=1.19 matplotlib=3.3 wxpython=4 conda scipy pillow svn imageio anaconda-client constructor conda-build pyopengl h5py hdf5 pywin32 scons m2w64-gcc-fortran -y
     76call %condaHome%\Scripts\activate py37n119
     77REM call conda install m2w64-gcc-fortran -y
     78REM call conda install -c msys2 m2w64-ntldd-git
     79REM call conda list
     80REM ====================================================================================
     81REM rmdir .\GSASII /s /q
     82REM mkdir .\GSASII
     83rmdir .\GSASII\AllBinaries /s /q
     84mkdir .\GSASII\AllBinaries
     85svn co https://subversion.xray.aps.anl.gov/pyGSAS/trunk/fsource .\GSASII\fsource
     86cd GSASII\fsource
     87where gfortran
     88where scons
     89call scons -c
     90call scons install=T
     91REM LIBGCC=T LIBGFORTRAN=T removed
     92cd ..
     93rem #=# find the build dir name; add info to Build notes
     94for /f "usebackq" %%i in ( `dir .\AllBinaries /ad /b` ) do set newdir=%%i
     95echo %newdir%
     96echo on
     97REM ========== Create a note on how binaries were created =======================
     98echo Built with Jeeves from %JOB_NAME% from G2 version %SVN_REVISION% on %NODE_LABELS% >> AllBinaries\%newdir%\Build.notes.txt
     99REM systeminfo | findstr /B /C:"OS Name" /C:"OS Version" >> AllBinaries\%newdir%\Build.notes.txt
     100call conda list -f python | findstr /B /C:# /V >> AllBinaries\%newdir%\Build.notes.txt
     101call conda list -f numpy | findstr /B /C:# /V  >> AllBinaries\%newdir%\Build.notes.txt
     102call conda list -f m2w64-gcc-fortran | findstr /B /C:# /V >> AllBinaries\%newdir%\Build.notes.txt
     103REM ============ End of note on how binaries were created =======================
     104svn co -q https://subversion.xray.aps.anl.gov/pyGSAS/Binaries .\Binaries
     105rmdir .\Binaries\%newdir% /s
     106mkdir .\Binaries\%newdir%
     107copy /y .\AllBinaries\%newdir%\* .\Binaries\%newdir%
     108REM
     109rem== Note: see https://anaconda.org/msys2/m2w64-ntldd-git for a utility that can find dependencies.
     110rem conda install -c msys2 m2w64-ntldd-git
     111ntldd .\Binaries\%newdir%\*.pyd
     112rem== (Diffax: files libquadmath-0.dll, libwinpthread-1.dll)
     113REM dir C:\Jenkins\conda37-64\envs\py37n119\Library\mingw-w64\bin
     114REM dir C:\Jenkins\conda37-64\envs\py37n119\Library\mingw-w64\lib
     115REM dir %condaHome%\envs\py37n119\Library\mingw-w64\bin\lib*.dll
     116copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libgfortran*.dll .\Binaries\%newdir%
     117ntldd .\Binaries\%newdir%\*.dll
     118copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libgcc*.dll .\Binaries\%newdir%
     119REM copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libgmp*.dll .\Binaries\%newdir%
     120copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libquadmath*.dll .\Binaries\%newdir%
     121copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libwinpthread*.dll .\Binaries\%newdir%
     122ntldd .\Binaries\%newdir%\*.dll
     123svn add --no-ignore .\Binaries\%newdir%
     124svn add --no-ignore .\Binaries\%newdir%\*
     125svn st .\Binaries\%newdir%
     126svn ci -m"Build with %JOB_NAME% on %NODE_LABELS%" --username <omitted> --password %JENKINS_PASS%  --non-interactive .\Binaries
     127rem =========== Build the conda package and upload
     128cd ..
     129cd GSAS-II\install
     130call conda build purge
     131python setversion.py
     132echo off
     133call conda build g2complete --output-folder C:\Jenkins\g2builds
     134rem =========== Build the self-installer & copy to web
     135del *.exe
     136call constructor --clean
     137call constructor g2full
     138for /f "usebackq" %%i in ( `dir gsas2full*.exe /b` ) do copy %%i gsas2full-Latest-Windows-x86_64.exe
     139for /f "usebackq" %%i in ( `dir gsas2full*.exe /b` ) do scp %%i <acct@node.aps.anl.gov>:/home/joule/SVN/subversion/pyGSAS/downloads
     140}}}
     141''(PKG_full_Win64 2021-01-16 20:17:56)''
     142
     143== Windows 32 build commands ==
     144{{{
     145rem ========== Configure
     146REM scp <acct@node.aps.anl.gov>:Miniconda3-latest-Windows-x86.exe .
     147REM mkdir C:\Jenkins\g2builds
     148dir C:\Jenkins\g2builds
     149set condaHome=C:\jenkins\conda37-32
     150set sysType=win-32
     151rem ========== Anaconda stuff
     152call %condaHome%\Scripts\activate
     153REM call conda update conda -y
     154REM call conda create -n py37n119 python=3.7 numpy=1.19 matplotlib=3.3 wxpython=4 conda scipy pillow svn imageio anaconda-client constructor conda-build pyopengl h5py hdf5 pywin32 scons m2w64-gcc-fortran libpython -y
     155call %condaHome%\Scripts\activate py37n119
     156call conda install -c msys2 m2w64-ntldd-git
     157REM call conda list
     158REM ====================================================================================
     159REM rmdir .\GSASII /s /q
     160REM mkdir .\GSASII
     161rmdir .\GSASII\AllBinaries /s /q
     162mkdir .\GSASII\AllBinaries
     163svn co https://subversion.xray.aps.anl.gov/pyGSAS/trunk/fsource .\GSASII\fsource
     164cd GSASII\fsource
     165where gfortran
     166REM====>>REM call scons -c
     167call scons install=T
     168REM removed LIBGFORTRAN=T LIBGCC=T
     169cd ..
     170rem #=# find the build dir name; add info to Build notes
     171for /f "usebackq" %%i in ( `dir .\AllBinaries /ad /b` ) do set newdir=%%i
     172echo %newdir%
     173echo on
     174REM ========== Create a note on how binaries were created =======================
     175echo Built with Jeeves from %JOB_NAME% from G2 version %SVN_REVISION% on %NODE_LABELS% >> AllBinaries\%newdir%\Build.notes.txt
     176REM systeminfo | findstr /B /C:"OS Name" /C:"OS Version" >> AllBinaries\%newdir%\Build.notes.txt
     177call conda list -f python | findstr /B /C:# /V >> AllBinaries\%newdir%\Build.notes.txt
     178call conda list -f numpy | findstr /B /C:# /V  >> AllBinaries\%newdir%\Build.notes.txt
     179call conda list -f m2w64-gcc-fortran | findstr /B /C:# /V >> AllBinaries\%newdir%\Build.notes.txt
     180REM ============ End of note on how binaries were created =======================
     181svn co -q https://subversion.xray.aps.anl.gov/pyGSAS/Binaries .\Binaries
     182rmdir .\Binaries\%newdir% /s
     183mkdir .\Binaries\%newdir%
     184copy /y .\AllBinaries\%newdir%\* .\Binaries\%newdir%
     185REM
     186rem== Note: see https://anaconda.org/msys2/m2w64-ntldd-git for a utility that can find dependencies.
     187rem conda install -c msys2 m2w64-ntldd-git
     188REM dir C:\Jenkins\conda37-32\envs\py37n119\Library\mingw-w64\bin
     189REM dir %condaHome%\Library\mingw-w64\bin
     190ntldd .\Binaries\%newdir%\*.pyd
     191copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libgfortran*.dll .\Binaries\%newdir%
     192copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libgcc*.dll .\Binaries\%newdir%
     193ntldd .\Binaries\%newdir%\*.dll
     194REM copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libgmp*.dll .\Binaries\%newdir%
     195copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libquadmath*.dll .\Binaries\%newdir%
     196copy /y %condaHome%\envs\py37n119\Library\mingw-w64\bin\libwinpthread*.dll .\Binaries\%newdir%
     197ntldd .\Binaries\%newdir%\*.dll
     198svn add --no-ignore .\Binaries\%newdir%
     199svn add --no-ignore .\Binaries\%newdir%\*
     200svn st .\Binaries\%newdir%
     201svn ci -m"Build with %JOB_NAME% on %NODE_LABELS%" --username <omitted> --password %JENKINS_PASS%  --non-interactive .\Binaries
     202rem =========== Build the conda package and upload
     203cd ..
     204cd GSAS-II\install
     205call conda build purge
     206python setversion.py
     207echo off
     208call conda build g2complete --output-folder C:\Jenkins\g2builds
     209rem =========== Build the self-installer & copy to web
     210del *.exe
     211call constructor --clean
     212call constructor g2full
     213for /f "usebackq" %%i in ( `dir gsas2full*.exe /b` ) do copy %%i gsas2full-Latest-Windows-x86.exe
     214for /f "usebackq" %%i in ( `dir gsas2full*.exe /b` ) do scp %%i <acct@node.aps.anl.gov>:/home/joule/SVN/subversion/pyGSAS/downloads
     215exit
     216}}}
     217''(PKG_full_Win32 2021-01-17 09:38:41)''
     218
     219== MacOS 64 build commands ==
     220{{{
     221condaHome=$WORKSPACE/conda37
     222sysType=osx-64
     223#========== Anaconda stuff
     224#curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh > ./Miniconda3-latest.sh
     225#bash ./Miniconda3-latest.sh -b -p $WORKSPACE/conda37
     226#rm ./Miniconda3-*.sh
     227set +x
     228echo 'source $condaHome/bin/activate'
     229source $condaHome/bin/activate
     230# wx, pyopengl, scons not available with Py39 in defaults
     231#echo conda create -n py39n1.19 python=3.9 numpy=1.19 matplotlib=3.3 conda scipy pillow svn h5py imageio gfortran_osx-64 -y
     232#     conda create -n py39n1.19 python=3.9 numpy=1.19 matplotlib=3.3 conda scipy pillow svn h5py imageio gfortran_osx-64 -y
     233# cant live without scons
     234#echo conda install scons -n py39n1.19 -c defaults -c conda-forge
     235#     conda install scons -n py39n1.19 -c defaults -c conda-forge
     236echo 'conda activate py39n1.19'
     237conda activate py39n1.19
     238
     239#
     240#echo conda update -n base -c defaults conda -y
     241#     conda update -n base -c defaults conda -y
     242#
     243#echo conda env remove -n py37n1.18
     244#     conda env remove -n py37n1.18
     245#
     246#echo conda create -n py37n1.18 python=3.7 numpy=1.18 matplotlib=3.3 wxpython=4.0 conda scipy pillow pyopengl svn h5py imageio python.app=2 anaconda-client constructor conda-build scons gfortran_osx-64 -y
     247#     conda create -n py37n1.18 python=3.7 numpy=1.18 matplotlib=3.3 wxpython=4.0 conda scipy pillow pyopengl svn h5py imageio python.app=2 anaconda-client constructor conda-build scons gfortran_osx-64 -y
     248#echo 'conda activate py37n1.18'
     249#conda activate py37n1.18
     250#conda info --envs
     251#==================================== Build of .so files ==================================
     252#ls -l  $CONDA_PREFIX/bin/*gfortran
     253# gfortran seems to be setup by conda
     254#ln -sf $CONDA_PREFIX/bin/x86_64-conda_cos6-linux-gnu-gfortran $CONDA_PREFIX/bin/gfortran
     255#
     256#
     257set -x
     258which python
     259#python -c 'import sys; print("py=",sys.version); import numpy; print("np=",numpy.__version__)'
     260#python -c 'import wx; print("wx=",wx.__version__); import matplotlib; print("mpl=",matplotlib.__version__)'
     261#=======================
     262# get source code
     263#=======================
     264rm -rf $WORKSPACE/GSASII
     265mkdir -p $WORKSPACE/GSASII
     266svn co https://subversion.xray.aps.anl.gov/pyGSAS/trunk/fsource $WORKSPACE/GSASII/fsource
     267########################
     268# start compile process
     269########################
     270gfortran -v
     271rm -rf GSASII/AllBinaries
     272cd $WORKSPACE/GSASII/fsource
     273gfortran -v
     274scons -c # cleanup old
     275set +x
     276#scons install=T FORTpath=$CONDA_PREFIX/bin
     277scons install=T LIBGFORTRAN=T  # seems OK on OSX
     278# document build
     279#=# find the build dir name; add info to Build notes
     280set -x
     281newdir=`cd ../AllBinaries/; ls -d mac*`
     282echo $newdir
     283echo "Built with Jeeves from $JOB_NAME from G2 version $SVN_REVISION on $NODE_LABELS" >> ../AllBinaries/$newdir/Build.notes.txt
     284sw_vers >> ../AllBinaries/$newdir/Build.notes.txt
     285conda list -f python | tail -1 >> ../AllBinaries/$newdir/Build.notes.txt
     286conda list -f numpy | tail -1 >> ../AllBinaries/$newdir/Build.notes.txt
     287conda list -f gfortran_linux-64 | tail -1 >> ../AllBinaries/$newdir/Build.notes.txt
     288#================
     289# Upload binaries
     290#================
     291svn co -q https://subversion.xray.aps.anl.gov/pyGSAS/Binaries $WORKSPACE/Binaries
     292if [ ! -d $WORKSPACE/Binaries/$newdir ]
     293then
     294    mkdir $WORKSPACE/Binaries/$newdir
     295    svn add $WORKSPACE/Binaries/$newdir
     296fi
     297python $WORKSPACE/Binaries/macRelink.py ../AllBinaries/$newdir
     298cp ../AllBinaries/$newdir/* $WORKSPACE/Binaries/$newdir
     299cp $CONDA_PREFIX/lib/libgcc_s.1.dylib $WORKSPACE/Binaries/$newdir/
     300cp $CONDA_PREFIX/lib/libquadmath.0.dylib $WORKSPACE/Binaries/$newdir/
     301svn add --force $WORKSPACE/Binaries/$newdir/*
     302svn st $WORKSPACE/Binaries
     303svn ci -m"Build with $JOB_NAME on $NODE_LABELS" --username <omitted> --password $JENKINS_PASS  --non-interactive $WORKSPACE/Binaries
     304#
     305exit
     306
     307#=========================== Build of g2complete package ==================================
     308#
     309#=============================
     310# Use commands below to build
     311#=============================
     312cd $WORKSPACE/GSAS-II/install
     313python setversion.py
     314mkdir -p ~/builds
     315rm -rf ~/builds/*
     316set +x
     317echo conda build purge
     318     conda build purge
     319echo conda build g2complete --numpy 1.18 --python 3.7 --output-folder ~/builds
     320     conda build g2complete --numpy 1.18 --python 3.7 --output-folder ~/builds
     321#
     322#=========================== Build/upload of g2full installer =============================
     323#
     324# Build the self-installer
     325rm -f *.sh
     326constructor g2full
     327set -x
     328ls -l *.sh
     329# copy to "Latest" and upload
     330cp gsas2full-*-MacOSX-x86_64.sh gsas2full-Latest-MacOSX-x86_64.sh
     331# copy to https://subversion.xray.aps.anl.gov/admin_pyGSAS/downloads/gsas2full-*-MacOSX-x86_64.sh
     332scp gsas2full-*.sh <acct@node.aps.anl.gov>:/home/joule/SVN/subversion/pyGSAS/downloads/
     333echo files found at https://subversion.xray.aps.anl.gov/admin_pyGSAS/downloads/gsas2full-*-MacOSX-x86_64.sh
     334ssh <acct@node.aps.anl.gov> ls -lt /home/joule/SVN/subversion/pyGSAS/downloads/gsas2full-*-MacOSX-*.sh
     335}}}
     336''(PKG_full_MacX86      2021-01-08 15:39:43)''
     337
     338== Linux 64 build commands ==
     339{{{
     340condaHome=/Jenkins/jenkins/conda37
     341sysType=linux-64
     342#========== Anaconda stuff
     343#curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh > ./Miniconda3-latest-Linux-x86_64.sh
     344#bash ./Miniconda3-latest-Linux-x86_64.sh -b -p /Jenkins/jenkins/conda37
     345#rm ./Miniconda3-*.sh
     346set +x
     347echo 'source $condaHome/bin/activate'
     348source $condaHome/bin/activate
     349# wx not available with Py38
     350#echo conda create -n py38n1.18 python=3.8 numpy=1.18 matplotlib=3.3 wxpython=4.0 conda scipy pillow pyopengl svn h5py imageio anaconda-client constructor conda-build scons gfortran_linux-64 -y
     351#     conda create -n py38n1.18 python=3.8 numpy=1.18 matplotlib=3.3 wxpython=4.0 conda scipy pillow pyopengl svn h5py imageio anaconda-client constructor conda-build scons gfortran_linux-64 -y
     352#conda info --envs
     353#echo 'conda activate py38n1.18'
     354#conda activate py38n1.18
     355#
     356#echo conda update -n base -c defaults conda -y
     357#     conda update -n base -c defaults conda -y
     358#
     359#echo conda env remove -n py37n1.18
     360#     conda env remove -n py37n1.18
     361#
     362#echo conda create -n py37n1.18 python=3.7 numpy=1.18 matplotlib=3.3 wxpython=4.0 conda scipy pillow pyopengl svn h5py imageio anaconda-client constructor conda-build scons gfortran_linux-64 -y
     363#     conda create -n py37n1.18 python=3.7 numpy=1.18 matplotlib=3.3 wxpython=4.0 conda scipy pillow pyopengl svn h5py imageio anaconda-client constructor conda-build scons gfortran_linux-64 -y
     364#conda info --envs
     365echo 'conda activate py37n1.18'
     366conda activate py37n1.18
     367which gfortran
     368ls -l  $CONDA_PREFIX/bin/x86_64-conda_cos6-linux-gnu-gfortran
     369ln -sf $CONDA_PREFIX/bin/x86_64-conda_cos6-linux-gnu-gfortran $CONDA_PREFIX/bin/gfortran
     370which gfortran
     371#
     372#
     373set -x
     374which python
     375python -c 'import sys; print("py=",sys.version); import numpy; print("np=",numpy.__version__)'
     376python -c 'import wx; print("wx=",wx.__version__); import matplotlib; print("mpl=",matplotlib.__version__)'
     377#=======================
     378# get source code
     379#=======================
     380#DEBUG#
     381rm -rf $WORKSPACE/GSASII
     382mkdir -p $WORKSPACE/GSASII
     383svn co https://subversion.xray.aps.anl.gov/pyGSAS/trunk/fsource $WORKSPACE/GSASII/fsource
     384########################
     385# start compile process
     386########################
     387gfortran -v
     388rm -rf GSASII/AllBinaries
     389cd $WORKSPACE/GSASII/fsource
     390which gfortran
     391gfortran -v
     392#DEBUG#
     393scons -c # cleanup old
     394set +x
     395#DEBUG#
     396scons install=T FORTpath=$CONDA_PREFIX/bin
     397#scons install=T LIBGFORTRAN=T  # does not work with Conda gfortran
     398# document build
     399#=# find the build dir name; add info to Build notes
     400set -x
     401newdir=`cd ../AllBinaries/; ls -d linux*`
     402echo $newdir
     403echo "Built with Jeeves from $JOB_NAME from G2 version $SVN_REVISION on $NODE_LABELS" >> ../AllBinaries/$newdir/Build.notes.txt
     404cat /etc/system-release >> ../AllBinaries/$newdir/Build.notes.txt
     405conda list -f python | tail -1 >> ../AllBinaries/$newdir/Build.notes.txt
     406conda list -f numpy | tail -1 >> ../AllBinaries/$newdir/Build.notes.txt
     407conda list -f gfortran_linux-64 | tail -1 >> ../AllBinaries/$newdir/Build.notes.txt
     408#================
     409# Upload binaries
     410#================
     411svn co -q https://subversion.xray.aps.anl.gov/pyGSAS/Binaries $WORKSPACE/Binaries
     412if [ ! -d $WORKSPACE/Binaries/$newdir ]
     413then
     414    mkdir $WORKSPACE/Binaries/$newdir
     415    svn add $WORKSPACE/Binaries/$newdir
     416    cp ../AllBinaries/$newdir/* $WORKSPACE/Binaries/$newdir
     417    cp $condaHome/lib/libgfortran.so.4.0.0 $WORKSPACE/Binaries/$newdir/
     418else
     419    cp ../AllBinaries/$newdir/* $WORKSPACE/Binaries/$newdir
     420    cp $CONDA_PREFIX/lib/libgfortran.so.4.0.0 $WORKSPACE/Binaries/$newdir/
     421fi
     422svn add --force $WORKSPACE/Binaries/$newdir/*
     423svn st $WORKSPACE/Binaries
     424#DEBUG#
     425svn ci -m"Build with $JOB_NAME on $NODE_LABELS" --username <omitted> --password $JENKINS_PASS  --non-interactive $WORKSPACE/Binaries
     426
     427#=============================
     428# Use commands below to build
     429#=============================
     430cd $WORKSPACE/GSAS-II/install
     431python setversion.py
     432mkdir -p ~/builds
     433set +x
     434echo conda build purge
     435     conda build purge
     436echo conda build g2complete --numpy 1.18 --python 3.7 --output-folder ~/builds
     437     conda build g2complete --numpy 1.18 --python 3.7 --output-folder ~/builds
     438#=========== Build the self-installer & copy (someday upload?)
     439rm -f *.sh
     440constructor g2full
     441set -x
     442ls -l *.sh
     443#=============================
     444cp gsas2full-*-Linux-x86_64.sh gsas2full-Latest-Linux-x86_64.sh
     445scp gsas2full-*.sh <acct@node.aps.anl.gov>:/home/joule/SVN/subversion/pyGSAS/downloads/
     446ssh <acct@node.aps.anl.gov> ls -lt /home/joule/SVN/subversion/pyGSAS/downloads/gsas2full-*-Linux-*.sh
     447}}}
     448''(PKG_full_Linux64     2021-01-08 15:44:21)''