Skip to content

Commit

Permalink
Create release v0.3.104.
Browse files Browse the repository at this point in the history
  • Loading branch information
abi-git-user committed Sep 16, 2022
1 parent fe5afe2 commit 257fd83
Show file tree
Hide file tree
Showing 148 changed files with 334 additions and 265 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.10.2)

set(PROJECT_NAME libCellML)
set(PROJECT_URL https://libcellml.org)
set(_PROJECT_VERSION 0.3.103)
set(_PROJECT_VERSION 0.3.104)
set(PROJECT_DEVELOPER_VERSION )
project(${PROJECT_NAME} VERSION ${_PROJECT_VERSION} LANGUAGES CXX)

Expand Down
65 changes: 65 additions & 0 deletions cmake/TestUndefinedSymbolsAllowed.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Function: TestUndefinedSymbolsAllowed
#
# Test if the linker allows undefined symbols for shared libraries.
#
# UNDEFINED_SYMBOLS_ALLOWED - true if the linker will allow
# undefined symbols for shared libraries
#

function(Test_Undefined_Symbols_Allowed)

set(_VAR_NAME "UNDEFINED_SYMBOLS_ALLOWED")
set(_HASH_VAR_NAME "HASH_${_VAR_NAME}")

# hash the CMAKE_FLAGS passed and check cache to know if we need to rerun
string(MD5 cmake_flags_hash "${CMAKE_SHARED_LINKER_FLAGS}")

if(NOT DEFINED "${_HASH_VAR_NAME}")
unset("${_VAR_NAME}" CACHE)
elseif(NOT "${${_HASH_VAR_NAME}}" STREQUAL "${cmake_flags_hash}")
unset("${_VAR_NAME}" CACHE)
endif()

if(NOT DEFINED "${_VAR_NAME}")
message(STATUS "Performing Test ${_VAR_NAME} - ...")
set(test_project_dir "${PROJECT_BINARY_DIR}/CMakeTmp/${_VAR_NAME}")

file(WRITE "${test_project_dir}/CMakeLists.txt"
"
project(undefined CXX)
add_library(foo SHARED \"foo.cpp\")
")

file(WRITE "${test_project_dir}/foo.cpp"
"
extern int bar(void);
int foo(void) {return bar()+1;}
")

if(APPLE)
set(_rpath_arg "-DCMAKE_MACOSX_RPATH='${CMAKE_MACOSX_RPATH}'")
else()
set(_rpath_arg)
endif()

try_compile(${_VAR_NAME}
"${test_project_dir}"
"${test_project_dir}"
undefined
CMAKE_FLAGS
"-DCMAKE_SHARED_LINKER_FLAGS='${CMAKE_SHARED_LINKER_FLAGS}'"
${_rpath_arg}
OUTPUT_ _VAR_NAME output)

set(${_HASH_VAR_NAME} "${cmake_flags_hash}" CACHE INTERNAL "hashed try_compile flags")

if(${_VAR_NAME})
message(STATUS "Performing Test ${_VAR_NAME} - Success")
else()
message(STATUS "Performing Test ${_VAR_NAME} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing Test ${_VAR_NAME} failed with the following output:\n"
"${OUTPUT}\n")
endif()
endif()
endfunction()
10 changes: 0 additions & 10 deletions cmake/add_rpath_for_python.cmake

This file was deleted.

3 changes: 3 additions & 0 deletions cmake/environmentchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

include(CheckCXXCompilerFlag)
include(TestUndefinedSymbolsAllowed)

get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)

Expand All @@ -30,6 +31,8 @@ else ()
set(_FIND_PYTHON_DEVELOPMENT_TYPE Development)
endif()

test_undefined_symbols_allowed()

find_package(Python ${PREFERRED_PYTHON_VERSION} COMPONENTS Interpreter ${_FIND_PYTHON_DEVELOPMENT_TYPE})

find_program(BUILDCACHE_EXE buildcache)
Expand Down
15 changes: 15 additions & 0 deletions docs/changelogs/changelog_v0.3.104.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
libCellML v0.3.104 Changelog
============================

Python bindings
---------------

* Shift to use dynamic lookup for undefined symbols in shared libraries by `@hsorby <https://github.com/hsorby>`_ [`#1040 <https://github.com/cellml/libcellml/pull/1040>`_].

Contributors
------------

.. image:: https://avatars.githubusercontent.com/u/778048?v=4
:target: https://github.com/hsorby
:height: 32
:width: 32
1 change: 1 addition & 0 deletions docs/changelogs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelogs

.. toctree::

changelog_v0.3.104
changelog_v0.3.103
changelog_v0.3.102
changelog_v0.3.101
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Changelogs

.. toctree::

changelogs/changelog_v0.3.104
changelogs/changelog_v0.3.103
changelogs/changelog_v0.3.102
changelogs/changelog_v0.3.101
Expand Down
40 changes: 17 additions & 23 deletions src/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,25 @@ foreach(SWIG_INTERFACE_SRC ${SWIG_INTERFACE_SRCS})
if(NOT POLICY CMP0078)
set(MODULE_TARGET ${SWIG_MODULE_${MODULE_TARGET}_REAL_NAME})
endif()
target_link_libraries(${MODULE_TARGET} PRIVATE cellml)

if(FIND_PYTHON_DEVELOPMENT_MODULE)
target_link_libraries(${MODULE_TARGET} PRIVATE cellml Python::Module)
set(_PYTHON_LINK_TARGET Python::Module)
else()
target_link_libraries(${MODULE_TARGET} PRIVATE cellml Python::Python)
set(_PYTHON_LINK_TARGET Python::Python)
endif()

if (APPLE)
# Specifically allow dynamic lookup, here we are really targetting Python symbols.
set_target_properties(${MODULE_TARGET} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
# But, we do need to know about the Python include directories.
target_include_directories(${MODULE_TARGET} PRIVATE ${Python_INCLUDE_DIRS})
elseif (UNDEFINED_SYMBOLS_ALLOWED)
# Linker allows undefined symbols, so let's not link Python.
# But, we do need to know about the Python include directories.
target_include_directories(${MODULE_TARGET} PRIVATE ${Python_INCLUDE_DIRS})
else()
target_link_libraries(${MODULE_TARGET} PRIVATE ${_PYTHON_LINK_TARGET})
endif()
# Disable use of Debug Python libraries when not present on Windows
# See http://stackoverflow.com/questions/11311877/creating-a-dll-from-a-wrapped-cpp-file-with-swig
Expand Down Expand Up @@ -179,26 +194,6 @@ add_custom_command(TARGET python_bindings POST_BUILD
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${LIBCELLML_PYTHON_PACKAGE_DIR} ${SWIG_GENERATED_INTERMEDIARIES_FILES_DIR})

if(SKBUILD)
if(INSTALL_NAME_TOOL_AVAILABLE)
set(LIST_SEPARATOR "<sep>")
set(_ARGS)
foreach(_SOME ${SWIG_PYTHON_BINDINGS_TARGETS})
list(APPEND _ARGS $<TARGET_FILE:${_SOME}>)
endforeach()

set(_ARGS_STR "${_ARGS}")
string(REPLACE ";" "${LIST_SEPARATOR}" _ARGS_STR "${_ARGS_STR}")
add_custom_command(TARGET python_bindings POST_BUILD
COMMAND ${CMAKE_COMMAND}
-DSHARED_OBJECT_MODULES="${_ARGS_STR}"
-DLIST_SEPARATOR="${LIST_SEPARATOR}"
-DINSTALL_NAME_TOOL_EXE="${INSTALL_NAME_TOOL_EXE}"
-DPython_VERSION_MAJOR="${Python_VERSION_MAJOR}"
-DPython_VERSION_MINOR="${Python_VERSION_MINOR}"
-P ${PROJECT_SOURCE_DIR}/cmake/add_rpath_for_python.cmake
)
endif()

install(TARGETS ${SWIG_PYTHON_BINDINGS_TARGETS}
COMPONENT wheel
DESTINATION libcellml
Expand All @@ -221,4 +216,3 @@ if(SKBUILD)
DEPENDS ${SWIG_PYTHON_BINDINGS_TARGETS}
)
endif()

2 changes: 1 addition & 1 deletion tests/bindings/javascript/version.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ describe("Version tests", () => {
libcellml = await libCellMLModule();
});
test('Checking version string.', () => {
expect(libcellml.versionString()).toBe('0.3.103');
expect(libcellml.versionString()).toBe('0.3.104');
});
})
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#include "model.h"

#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.3.0";
const char LIBCELLML_VERSION[] = "0.3.103";
const char LIBCELLML_VERSION[] = "0.3.104";

const size_t VARIABLE_COUNT = 2;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#include "model.external.h"

#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.3.0";
const char LIBCELLML_VERSION[] = "0.3.103";
const char LIBCELLML_VERSION[] = "0.3.104";

const size_t VARIABLE_COUNT = 2;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# The content of this file was generated using the Python profile of libCellML 0.3.103.
# The content of this file was generated using the Python profile of libCellML 0.3.104.

from enum import Enum
from math import *


__version__ = "0.3.0"
LIBCELLML_VERSION = "0.3.103"
LIBCELLML_VERSION = "0.3.104"

VARIABLE_COUNT = 2

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# The content of this file was generated using the Python profile of libCellML 0.3.103.
# The content of this file was generated using the Python profile of libCellML 0.3.104.

from enum import Enum
from math import *


__version__ = "0.3.0"
LIBCELLML_VERSION = "0.3.103"
LIBCELLML_VERSION = "0.3.104"

VARIABLE_COUNT = 2

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#include "model.h"

#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.3.0";
const char LIBCELLML_VERSION[] = "0.3.103";
const char LIBCELLML_VERSION[] = "0.3.104";

const size_t VARIABLE_COUNT = 2;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# The content of this file was generated using the Python profile of libCellML 0.3.103.
# The content of this file was generated using the Python profile of libCellML 0.3.104.

from enum import Enum
from math import *


__version__ = "0.3.0"
LIBCELLML_VERSION = "0.3.103"
LIBCELLML_VERSION = "0.3.104"

VARIABLE_COUNT = 2

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#include "model.h"

#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.3.0";
const char LIBCELLML_VERSION[] = "0.3.103";
const char LIBCELLML_VERSION[] = "0.3.104";

const size_t VARIABLE_COUNT = 1;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# The content of this file was generated using the Python profile of libCellML 0.3.103.
# The content of this file was generated using the Python profile of libCellML 0.3.104.

from enum import Enum
from math import *


__version__ = "0.3.0"
LIBCELLML_VERSION = "0.3.103"
LIBCELLML_VERSION = "0.3.104"

VARIABLE_COUNT = 1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#include "model.h"

#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.3.0";
const char LIBCELLML_VERSION[] = "0.3.103";
const char LIBCELLML_VERSION[] = "0.3.104";

const size_t STATE_COUNT = 1;
const size_t VARIABLE_COUNT = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# The content of this file was generated using the Python profile of libCellML 0.3.103.
# The content of this file was generated using the Python profile of libCellML 0.3.104.

from enum import Enum
from math import *


__version__ = "0.3.0"
LIBCELLML_VERSION = "0.3.103"
LIBCELLML_VERSION = "0.3.104"

STATE_COUNT = 1
VARIABLE_COUNT = 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#include "model.h"

#include <math.h>
#include <stdlib.h>

const char VERSION[] = "0.3.0";
const char LIBCELLML_VERSION[] = "0.3.103";
const char LIBCELLML_VERSION[] = "0.3.104";

const size_t STATE_COUNT = 1;
const size_t VARIABLE_COUNT = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* The content of this file was generated using the C profile of libCellML 0.3.103. */
/* The content of this file was generated using the C profile of libCellML 0.3.104. */

#pragma once

Expand Down
Loading

0 comments on commit 257fd83

Please sign in to comment.