Skip to content

Commit

Permalink
Update to Horace 3.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mducle committed Jun 27, 2021
1 parent ff16eb2 commit a37cb89
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.1.1
4 changes: 2 additions & 2 deletions cmake/PACE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
25 changes: 9 additions & 16 deletions installer/pace_python_installer.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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';
Expand Down
11 changes: 6 additions & 5 deletions pace_python/Matlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a37cb89

Please sign in to comment.