diff --git a/CMakeLists.txt b/CMakeLists.txt index bbdabb4..953e515 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,16 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(MINIMUM_PYBIND11_VERSION 2.5.0) set(FETCH_PYBIND11_REPO https://github.com/pybind/pybind11) +# The latest VS needs an extra library VCRUNTIME140_1.dll which is not in +# the anaconda redistributable module (yet) - so disable it. +# https://developercommunity.visualstudio.com/content/problem/852548/vcruntime140-1dll-is-missing.html +if(WIN32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -d2FH4-") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -d2FH4-") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -d2:-FH4-") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -d2:-FH4-") +endif(WIN32) + if(WIN32) find_package(POWERSHELL REQUIRED) else() @@ -48,7 +58,7 @@ else() endif() # You can set a specific Matlab version folder here -#set(Matlab_ROOT_DIR "c:/Program Files/MATLAB/R2019b") +#set(Matlab_ROOT_DIR "c:/Program Files/MATLAB/R2020a") find_package(Matlab REQUIRED COMPONENTS MAIN_PROGRAM MEX_COMPILER MCC_COMPILER) get_filename_component(Matlab_LIBRARY_DIR "${Matlab_MEX_LIBRARY}" DIRECTORY) get_filename_component(Matlab_BIN_DIR "${Matlab_MAIN_PROGRAM}" DIRECTORY) diff --git a/VERSION b/VERSION index 6e8bf73..17e51c3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 +0.1.1 diff --git a/cmake/PACE.cmake b/cmake/PACE.cmake index f27d985..1a4f220 100644 --- a/cmake/PACE.cmake +++ b/cmake/PACE.cmake @@ -12,11 +12,11 @@ download( if(WIN32) download( PROJ HORACE - URL https://github.com/pace-neutrons/Horace/releases/download/v3.5.1/Horace-3.5.1-win64-R2019b.zip + URL https://github.com/pace-neutrons/Horace/releases/download/v3.5.2/Horace-3.5.2-win64-R2019b.zip ) else() download( PROJ HORACE - URL https://github.com/pace-neutrons/Horace/releases/download/v3.5.1/Horace-3.5.1-linux-R2019b.tar.gz + URL https://github.com/pace-neutrons/Horace/releases/download/v3.5.2/Horace-3.5.2-linux-R2019b.tar.gz ) endif() diff --git a/installer/pace_python_installer.m b/installer/pace_python_installer.m index 7fb7dda..cc38f4f 100644 --- a/installer/pace_python_installer.m +++ b/installer/pace_python_installer.m @@ -215,6 +215,7 @@ function install_pace(py_exec, info) function conda_exec = install_miniconda(inst_path, inst_jupyter, inst_spyder, info) % Check we don't already have conda installed on the path has_conda = false; + inst_path0 = inst_path; if ispc whichexec = 'where'; else @@ -304,22 +305,14 @@ function install_pace(py_exec, info) info.Text = sprintf('%sPlease wait while the pace-python module is installed\n', prefixtext); drawnow; % Install pace_python itself using pip - try - py_exec = [inst_path '/envs/pace_python/bin/python']; - pyenv('Version', py_exec, 'ExecutionMode', 'InProcess'); - pipe = py.subprocess.PIPE; - kwargs = pyargs('stdout', pipe, 'stderr', pipe); - out = py.subprocess.run([py.sys.executable '-m' 'pip' 'install' 'pace_python'], kwargs); - catch - if ispc - pip_exec = [inst_path '\envs\pace_python\Scripts\pip.exe']; - else - pip_exec = [inst_path '/envs/pace_python/bin/pip']; - end - [rv, out] = system([pip_exec ' install -i https://test.pypi.org/simple/ pace-python']); - if rv ~= 0 - error(sprintf('Could not install pace-python module: Error message is: %s', out)); - end + if ispc + pip_exec = [inst_path '\envs\pace_python\Scripts\pip.exe']; + else + pip_exec = [inst_path '/envs/pace_python/bin/pip']; + end + [rv, out] = system([pip_exec ' install -i https://test.pypi.org/simple/ pace-python']); + if rv ~= 0 + error(sprintf('Could not install pace-python module: Error message is: %s', out)); end info.Text = 'Installation Complete'; app.OKButton.Visible = 'on'; diff --git a/pace_python/Matlab.py b/pace_python/Matlab.py index 5460891..4f73c29 100644 --- a/pace_python/Matlab.py +++ b/pace_python/Matlab.py @@ -6,10 +6,11 @@ # On some systems we need to load the BLAS/LAPACK libraries with the DEEPBIND # flag so it doesn't conflict with Matlab's BLAS/LAPACK. # This only works if users `import pace_python` before they import scipy... -old_flags = sys.getdlopenflags() -sys.setdlopenflags(os.RTLD_NOW | os.RTLD_DEEPBIND) -import scipy.linalg -sys.setdlopenflags(old_flags) +if platform.system() == 'Linux': + old_flags = sys.getdlopenflags() + sys.setdlopenflags(os.RTLD_NOW | os.RTLD_DEEPBIND) + import scipy.linalg + sys.setdlopenflags(old_flags) # Store the Matlab engine as a module global wrapped inside a class # When the global ref is deleted (e.g. when Python exits) the __del__ method is called @@ -228,7 +229,7 @@ def register_ipython_magics(): global _has_registered_magic _has_registered_magic = True running_kernel = IPython.get_ipython() - if running_kernel is None: + if running_kernel is None or sys.__stdout__ is None or sys.__stderr__ is None: return None from . import IPythonMagics from traitlets import Instance