Skip to content

Commit

Permalink
Merge 35ffce1 into a67d0aa
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Nov 25, 2019
2 parents a67d0aa + 35ffce1 commit 9290555
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 73 deletions.
141 changes: 76 additions & 65 deletions CMakeLists.txt
Expand Up @@ -994,10 +994,6 @@ if(USE_PREBUILT_QTWEBKIT_PACKAGE)
add_definitions(-DENABLE_TEST_PLUGINS)
endif()

# Let OpenCOR know that we want Python support

add_definitions(-DPYTHON_SUPPORT)

# Let OpenCOR know about the prebuilt version of our QtWebKit package
# being used

Expand All @@ -1023,6 +1019,18 @@ if(USE_PREBUILT_QTWEBKIT_PACKAGE)
endforeach()
endif()

# Keep track of whether we are building OpenCOR with Python support and, if so,
# let OpenCOR know about it

if(NOT "${PYTHON_SCRIPT_DIR}" STREQUAL "")
set(PYTHON_SUPPORT TRUE)

add_definitions(-DPYTHON_SUPPORT)

string(REPLACE "${PROJECT_BUILD_DIR}/" ""
RELATIVE_PYTHON_SCRIPT_DIR "${PYTHON_SCRIPT_DIR}")
endif()

# Fetch parts of our documentation and build it, if we are neither building
# Python nor QtWebKit
# Note: we need Python because we rely on Sphinx to build our documentation...
Expand Down Expand Up @@ -1085,7 +1093,7 @@ endif()
# Note: this is because the lookup scope changes for DSOs that are loaded using
# dlopen() (see https://www.akkadia.org/drepper/dsohowto.pdf)...

if(NOT WIN32 AND NOT APPLE)
if(NOT WIN32 AND NOT APPLE AND PYTHON_SUPPORT)
include_directories(${PYTHON_INCLUDE_DIR})

target_link_libraries(${CMAKE_PROJECT_NAME}
Expand Down Expand Up @@ -1279,9 +1287,6 @@ else()
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
endif()

string(REPLACE "${PROJECT_BUILD_DIR}/" ""
RELATIVE_PYTHON_SCRIPT_DIR "${PYTHON_SCRIPT_DIR}")

if(WIN32)
# Select NSIS, if available, and ZIP as the packagers on Windows

Expand Down Expand Up @@ -1364,37 +1369,39 @@ if(WIN32)
# skip them in that case (see
# https://github.com/opencor/opencor/issues/1255#issuecomment-550605710)...

if(RELEASE_MODE)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} ${RELATIVE_PYTHON_SCRIPT_DIR} runjupyter.bat)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} ${RELATIVE_PYTHON_SCRIPT_DIR} start_jupyter.py)

install(FILES ${PLATFORM_DISTRIB_DIR}/runjupyter.bat
${PLATFORM_DISTRIB_DIR}/start_jupyter.py
DESTINATION ${RELATIVE_PYTHON_SCRIPT_DIR})
if(PYTHON_SUPPORT)
if(RELEASE_MODE)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} ${RELATIVE_PYTHON_SCRIPT_DIR} runjupyter.bat)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} ${RELATIVE_PYTHON_SCRIPT_DIR} start_jupyter.py)

install(FILES ${PLATFORM_DISTRIB_DIR}/runjupyter.bat
${PLATFORM_DISTRIB_DIR}/start_jupyter.py
DESTINATION ${RELATIVE_PYTHON_SCRIPT_DIR})

set(JUPYTER_CONSOLE_FILENAME "${PROJECT_BUILD_DIR}/jupyterconsole.bat")

configure_file(${PLATFORM_DISTRIB_DIR}/jupyterconsole.bat.in ${JUPYTER_CONSOLE_FILENAME})
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyterlab.bat)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyterlab.vbs)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyternotebook.bat)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyternotebook.vbs)

install(FILES ${JUPYTER_CONSOLE_FILENAME}
${PLATFORM_DISTRIB_DIR}/jupyterlab.bat
${PLATFORM_DISTRIB_DIR}/jupyterlab.vbs
${PLATFORM_DISTRIB_DIR}/jupyternotebook.bat
${PLATFORM_DISTRIB_DIR}/jupyternotebook.vbs
DESTINATION .)
endif()

set(JUPYTER_CONSOLE_FILENAME "${PROJECT_BUILD_DIR}/jupyterconsole.bat")
set(PYTHON_SHELL_FILENAME "${PROJECT_BUILD_DIR}/pythonshell.bat")

configure_file(${PLATFORM_DISTRIB_DIR}/jupyterconsole.bat.in ${JUPYTER_CONSOLE_FILENAME})
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyterlab.bat)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyterlab.vbs)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyternotebook.bat)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyternotebook.vbs)
configure_file(${PLATFORM_DISTRIB_DIR}/pythonshell.bat.in ${PYTHON_SHELL_FILENAME})

install(FILES ${JUPYTER_CONSOLE_FILENAME}
${PLATFORM_DISTRIB_DIR}/jupyterlab.bat
${PLATFORM_DISTRIB_DIR}/jupyterlab.vbs
${PLATFORM_DISTRIB_DIR}/jupyternotebook.bat
${PLATFORM_DISTRIB_DIR}/jupyternotebook.vbs
install(FILES ${PYTHON_SHELL_FILENAME}
DESTINATION .)
endif()

set(PYTHON_SHELL_FILENAME "${PROJECT_BUILD_DIR}/pythonshell.bat")

configure_file(${PLATFORM_DISTRIB_DIR}/pythonshell.bat.in ${PYTHON_SHELL_FILENAME})

install(FILES ${PYTHON_SHELL_FILENAME}
DESTINATION .)

# File type association
# Note: the calls to SHChangeNotify are to ensure that Windows refreshes
# file icons (so that it is clear to the user that an extension has
Expand Down Expand Up @@ -1444,26 +1451,28 @@ elseif(APPLE)

# Shell scripts to setup and run Python and Jupyter

set(RUN_JUPYTER_FILENAME ${PYTHON_SCRIPT_DIR}/runjupyter)
if(PYTHON_SUPPORT)
set(RUN_JUPYTER_FILENAME ${PYTHON_SCRIPT_DIR}/runjupyter)

configure_file(${PLATFORM_DISTRIB_DIR}/runjupyter.in ${RUN_JUPYTER_FILENAME} @ONLY)
configure_file(${PLATFORM_DISTRIB_DIR}/runjupyter.in ${RUN_JUPYTER_FILENAME} @ONLY)

set(JUPYTER_CONSOLE_FILENAME ${PROJECT_BUILD_DIR}/jupyterconsole)
set(JUPYTER_LAB_FILENAME ${PROJECT_BUILD_DIR}/jupyterlab)
set(JUPYTER_NOTEBOOK_FILENAME ${PROJECT_BUILD_DIR}/jupyternotebook)
set(PYTHON_SHELL_FILENAME ${PROJECT_BUILD_DIR}/pythonshell)
set(JUPYTER_CONSOLE_FILENAME ${PROJECT_BUILD_DIR}/jupyterconsole)
set(JUPYTER_LAB_FILENAME ${PROJECT_BUILD_DIR}/jupyterlab)
set(JUPYTER_NOTEBOOK_FILENAME ${PROJECT_BUILD_DIR}/jupyternotebook)
set(PYTHON_SHELL_FILENAME ${PROJECT_BUILD_DIR}/pythonshell)

configure_file(${PLATFORM_DISTRIB_DIR}/jupyterconsole.in ${JUPYTER_CONSOLE_FILENAME} @ONLY)
configure_file(${PLATFORM_DISTRIB_DIR}/jupyterlab.in ${JUPYTER_LAB_FILENAME} @ONLY)
configure_file(${PLATFORM_DISTRIB_DIR}/jupyternotebook.in ${JUPYTER_NOTEBOOK_FILENAME} @ONLY)
configure_file(${PLATFORM_DISTRIB_DIR}/pythonshell.in ${PYTHON_SHELL_FILENAME} @ONLY)
configure_file(${PLATFORM_DISTRIB_DIR}/jupyterconsole.in ${JUPYTER_CONSOLE_FILENAME} @ONLY)
configure_file(${PLATFORM_DISTRIB_DIR}/jupyterlab.in ${JUPYTER_LAB_FILENAME} @ONLY)
configure_file(${PLATFORM_DISTRIB_DIR}/jupyternotebook.in ${JUPYTER_NOTEBOOK_FILENAME} @ONLY)
configure_file(${PLATFORM_DISTRIB_DIR}/pythonshell.in ${PYTHON_SHELL_FILENAME} @ONLY)

install(FILES ${JUPYTER_CONSOLE_FILENAME}
${JUPYTER_LAB_FILENAME}
${JUPYTER_NOTEBOOK_FILENAME}
${PYTHON_SHELL_FILENAME}
DESTINATION .
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES ${JUPYTER_CONSOLE_FILENAME}
${JUPYTER_LAB_FILENAME}
${JUPYTER_NOTEBOOK_FILENAME}
${PYTHON_SHELL_FILENAME}
DESTINATION .
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
else()
# Select TGZ as the packager on Linux

Expand Down Expand Up @@ -1538,26 +1547,28 @@ else()

# Shell scripts to setup and run Python and Jupyter

copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} ${RELATIVE_PYTHON_SCRIPT_DIR} runjupyter)
if(PYTHON_SUPPORT)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} ${RELATIVE_PYTHON_SCRIPT_DIR} runjupyter)

install(FILES ${PLATFORM_DISTRIB_DIR}/runjupyter
DESTINATION ${RELATIVE_PYTHON_SCRIPT_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES ${PLATFORM_DISTRIB_DIR}/runjupyter
DESTINATION ${RELATIVE_PYTHON_SCRIPT_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

set(JUPYTER_CONSOLE_FILENAME ${PROJECT_BUILD_DIR}/jupyterconsole)
set(PYTHON_SHELL_FILENAME ${PROJECT_BUILD_DIR}/pythonshell)
set(JUPYTER_CONSOLE_FILENAME ${PROJECT_BUILD_DIR}/jupyterconsole)
set(PYTHON_SHELL_FILENAME ${PROJECT_BUILD_DIR}/pythonshell)

configure_file(${PLATFORM_DISTRIB_DIR}/jupyterconsole.in ${JUPYTER_CONSOLE_FILENAME} @ONLY)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyterlab)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyternotebook)
configure_file(${PLATFORM_DISTRIB_DIR}/pythonshell.in ${PYTHON_SHELL_FILENAME} @ONLY)
configure_file(${PLATFORM_DISTRIB_DIR}/jupyterconsole.in ${JUPYTER_CONSOLE_FILENAME} @ONLY)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyterlab)
copy_file_to_build_dir(DIRECT ${PLATFORM_DISTRIB_DIR} . jupyternotebook)
configure_file(${PLATFORM_DISTRIB_DIR}/pythonshell.in ${PYTHON_SHELL_FILENAME} @ONLY)

install(FILES ${JUPYTER_CONSOLE_FILENAME}
${PLATFORM_DISTRIB_DIR}/jupyterlab
${PLATFORM_DISTRIB_DIR}/jupyternotebook
${PYTHON_SHELL_FILENAME}
DESTINATION .
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES ${JUPYTER_CONSOLE_FILENAME}
${PLATFORM_DISTRIB_DIR}/jupyterlab
${PLATFORM_DISTRIB_DIR}/jupyternotebook
${PYTHON_SHELL_FILENAME}
DESTINATION .
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
endif()

# Specify the package file name, depending on whether we are generating a
Expand Down
8 changes: 4 additions & 4 deletions distrib/linux/mesa/CMakeLists.txt
Expand Up @@ -3,11 +3,11 @@ project(Mesa)
# Name and version of our package

set(PACKAGE_NAME Mesa)
set(PACKAGE_VERSION 19.2.1)
set(PACKAGE_VERSION 19.2.6)

# Git tag for our library

set(GIT_TAG v19.2.1)
set(GIT_TAG v19.2.6)

# Specify where our local package will be installed

Expand All @@ -30,9 +30,9 @@ if(USE_PREBUILT_MESA_PACKAGE)
# Retrieve the library's package

retrieve_package_file(${PACKAGE_NAME} ${PACKAGE_VERSION}
${FULL_LOCAL_EXTERNAL_PACKAGE_DIR} 33424e212f7f31f046041a6950d8b64fa8599346
${FULL_LOCAL_EXTERNAL_PACKAGE_DIR} 0943cd1413a302c943d6e613f44775ca216e8374
SHA1_FILES ${SHA1_FILES}
SHA1_VALUES 3f90abfbe269daeb47909a2d4b728283e0f10479)
SHA1_VALUES 6d8f2e89ef80e7f0f3fc4307e3b286a212664dd7)
else()
# Build Mesa as an external project

Expand Down
2 changes: 1 addition & 1 deletion doc/downloads/index.js
Expand Up @@ -41,7 +41,7 @@ var jsonData = { "versions": [
{ "change": "<strong>Python support:</strong> update the PATH using <code>\\</code> rather than <code>/</code> on Windows (see issue <a href=\"https://github.com/opencor/opencor/issues/2219\">#2219</a>)." },
{ "change": "<strong>SED-ML support:</strong> added support left and right triangle symbols (see issue <a href=\"https://github.com/opencor/opencor/issues/2173\">#2173</a>)." },
{ "change": "<strong>Simulation Experiment view:</strong> properly handle the Graph Panel properties (see issue <a href=\"https://github.com/opencor/opencor/issues/2171\">#2171</a>). Make sure that curves are plotted with all of their original settings when reloading a SED-ML file (see issue <a href=\"https://github.com/opencor/opencor/issues/2176\">#2176</a>). Make sure that all of a solver's properties get saved to a SED-ML file (see issue <a href=\"https://github.com/opencor/opencor/issues/2185\">#2185</a>)." },
{ "change": "<strong>Third-party libraries:</strong> upgraded the <a href=\"https://www.openssl.org/\">OpenSSL</a> library to version 1.1.1d (see issue <a href=\"https://github.com/opencor/opencor/issues/2157\">#2157</a>). Upgraded <a href=\"http://www.llvm.org/\">LLVM</a>+<a href=\"http://clang.llvm.org/\">Clang</a> to version 9.0.0 (see issue <a href=\"https://github.com/opencor/opencor/issues/2161\">#2161</a>). Upgraded <a href=\"https://www.mesa3d.org/\">Mesa</a> to version 19.2.1 (see issue <a href=\"https://github.com/opencor/opencor/issues/2197\">#2197</a>). Upgraded the <a href=\"http://computation.llnl.gov/projects/sundials\">SUNDIALS</a> library to version 5.0.0 (see issue <a href=\"https://github.com/opencor/opencor/issues/2198\">#2198</a>). Upgraded <a href=\"https://riverbankcomputing.com/software/qscintilla/intro\">QScintilla</a> to version 2.11.3 (see issue <a href=\"https://github.com/opencor/opencor/issues/2208\">#2208</a>)." }
{ "change": "<strong>Third-party libraries:</strong> upgraded the <a href=\"https://www.openssl.org/\">OpenSSL</a> library to version 1.1.1d (see issue <a href=\"https://github.com/opencor/opencor/issues/2157\">#2157</a>). Upgraded <a href=\"http://www.llvm.org/\">LLVM</a>+<a href=\"http://clang.llvm.org/\">Clang</a> to version 9.0.0 (see issue <a href=\"https://github.com/opencor/opencor/issues/2161\">#2161</a>). Upgraded the <a href=\"http://computation.llnl.gov/projects/sundials\">SUNDIALS</a> library to version 5.0.0 (see issue <a href=\"https://github.com/opencor/opencor/issues/2198\">#2198</a>). Upgraded <a href=\"https://riverbankcomputing.com/software/qscintilla/intro\">QScintilla</a> to version 2.11.3 (see issue <a href=\"https://github.com/opencor/opencor/issues/2208\">#2208</a>). Upgraded <a href=\"https://www.mesa3d.org/\">Mesa</a> to version 19.2.6 (see issue <a href=\"https://github.com/opencor/opencor/issues/2230\">#2230</a>)." }
]
},
{ "major": 0, "minor": 5, "patch": 0, "day": 15, "month": 10, "year": 2016, "type": 0, "license": 1,
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Expand Up @@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

//==============================================================================

#ifdef Q_OS_LINUX
#if defined(PYTHON_SUPPORT) && defined(Q_OS_LINUX)
#include "Python.h"
// Note: this needs to be included before <QObject> to prevent name clashes...
#endif
Expand Down Expand Up @@ -72,7 +72,7 @@ int main(int pArgC, char *pArgV[])
// using dlopen() (see
// https://www.akkadia.org/drepper/dsohowto.pdf)...

#ifdef Q_OS_LINUX
#if defined(PYTHON_SUPPORT) and defined(Q_OS_LINUX)
Py_NoUserSiteDirectory = 1;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/thirdParty/Python/CMakeLists.txt
Expand Up @@ -459,7 +459,7 @@ set(PYTHON_LIBRARY ${ROOT_DIR}/${LIBRARY_DIR}/${IMPORT_LIBRARY} PARENT_SCOPE)
set(PYTHON_EXECUTABLE ${ROOT_DIR}/${PYTHON_EXECUTABLE} PARENT_SCOPE)

set(PYTHON_RELATIVE_SCRIPT_DIR ${SCRIPT_DIR} PARENT_SCOPE)
set(PYTHON_SCRIPT_DIR ${ROOT_DIR}/${SCRIPT_DIR} PARENT_SCOPE)
set(PYTHON_SCRIPT_DIR ${ROOT_DIR}/${SCRIPT_DIR} PARENT_SCOPE)

set(PYTHON_RELATIVE_RUNTIME_DIR ${RUNTIME_DIR} PARENT_SCOPE)

Expand Down

0 comments on commit 9290555

Please sign in to comment.