Skip to content

Commit

Permalink
- ensure crosscompiling works with libsedml
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Apr 15, 2024
1 parent 59db0be commit b577099
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ libsedml/_*
examples/python/*.xml
dev/temp_deviser_file.xml
setup.py
MANIFEST.in

# documentation
/doc/html/
Expand Down
12 changes: 8 additions & 4 deletions CMakeModules/FindEXPAT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ find_path(EXPAT_INCLUDE_DIR expat.h
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
NO_DEFAULT_PATH)
NO_DEFAULT_PATH
CMAKE_FIND_ROOT_PATH_BOTH)
endif ()

if (NOT EXPAT_INCLUDE_DIR)
find_path(EXPAT_INCLUDE_DIR expat.h)
find_path(EXPAT_INCLUDE_DIR expat.h
CMAKE_FIND_ROOT_PATH_BOTH)
endif ()

find_library(EXPAT_LIBRARY
Expand Down Expand Up @@ -81,11 +83,13 @@ find_library(EXPAT_LIBRARY
/opt/csw/lib # Blastwave
/opt/lib
/usr/freeware/lib64
NO_DEFAULT_PATH)
NO_DEFAULT_PATH
CMAKE_FIND_ROOT_PATH_BOTH)
endif()

if (NOT EXPAT_LIBRARY)
find_library(EXPAT_LIBRARY NAMES libexpat expat)
find_library(EXPAT_LIBRARY NAMES libexpat expat
CMAKE_FIND_ROOT_PATH_BOTH )
endif ()

mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
Expand Down
7 changes: 5 additions & 2 deletions CMakeModules/FindLIBNUML.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if (NOT ${LIBNUML_LIBRARY_NAME}_FOUND)
${CONAN_LIB_DIRS_LIBNUML}/cmake
${${_PROJECT_DEPENDENCY_DIR}}/lib/cmake
${${_PROJECT_DEPENDENCY_DIR}}/lib64/cmake
CMAKE_FIND_ROOT_PATH_BOTH
)
endif()

Expand Down Expand Up @@ -90,7 +91,8 @@ find_path(LIBNUML_INCLUDE_DIR numl/NMBase.h
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
NO_DEFAULT_PATH)
NO_DEFAULT_PATH
CMAKE_FIND_ROOT_PATH_BOTH)

if (NOT LIBNUML_INCLUDE_DIR)
find_path(LIBNUML_INCLUDE_DIR numl/NMBase.h)
Expand All @@ -117,7 +119,8 @@ find_library(LIBNUML_LIBRARY
/opt/csw/lib # Blastwave
/opt/lib
/usr/freeware/lib64
NO_DEFAULT_PATH)
NO_DEFAULT_PATH
CMAKE_FIND_ROOT_PATH_BOTH)

if (NOT LIBNUML_LIBRARY)
find_library(LIBNUML_LIBRARY
Expand Down
17 changes: 15 additions & 2 deletions CMakeModules/FindLIBSBML.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the
# Copyright (C) 2019 - 2023 by Pedro Mendes, Rector and Visitors of the
# University of Virginia, University of Heidelberg, and University
# of Connecticut School of Medicine.
# All rights reserved.
Expand Down Expand Up @@ -33,11 +33,21 @@ endif()

message (VERBOSE "Looking for ${LIBSBML_LIBRARY_NAME}")

find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET)

string(TOUPPER ${PROJECT_NAME} _UPPER_PROJECT_NAME)
set(_PROJECT_DEPENDENCY_DIR ${_UPPER_PROJECT_NAME}_DEPENDENCY_DIR)

find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET
PATHS ${${_PROJECT_DEPENDENCY_DIR}}/lib/cmake
${${_PROJECT_DEPENDENCY_DIR}}/lib64/cmake
${CONAN_LIB_DIRS_LIBSBML}/cmake
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)

if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET)
endif()

if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET
PATHS /usr/lib/cmake
Expand All @@ -48,6 +58,7 @@ if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
${${_PROJECT_DEPENDENCY_DIR}}/lib/cmake
${${_PROJECT_DEPENDENCY_DIR}}/lib64/cmake
${CONAN_LIB_DIRS_LIBSBML}/cmake
CMAKE_FIND_ROOT_PATH_BOTH
)
endif()

Expand Down Expand Up @@ -111,6 +122,7 @@ find_path(LIBSBML_INCLUDE_DIR sbml/SBase.h
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)

if (NOT LIBSBML_INCLUDE_DIR)
Expand Down Expand Up @@ -140,6 +152,7 @@ find_library(LIBSBML_LIBRARY
/opt/csw/lib # Blastwave
/opt/lib
/usr/freeware/lib64
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)

if (NOT LIBSBML_LIBRARY)
Expand Down
11 changes: 11 additions & 0 deletions dev/create-source-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# this script creates the python source package
cp ./src/bindings/python/setup.py .
cp ./src/bindings/python/MANIFEST.in .

# remove old source packages
rm ./dist/*.tar.gz

# create the source package
python3 setup.py sdist
17 changes: 10 additions & 7 deletions src/bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,18 @@
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext

def get_python_include():
dir = sysconfig.get_paths()['include']
if exists(dir):
return dir
dir = dir.replace('/local', '/')
if exists(dir):
return dir
def get_python_include():
temp = os.getenv('PYTHON_INCLUDE_DIR')
if temp:
return temp

path = sysconfig.get_paths()['include']
if exists(path):
return path
# for whatever reason 2.7 on centos returns a wrong path here
return sysconfig.get_config_vars()['INCLUDEPY']


def get_win_python_lib():
vars = sysconfig.get_config_vars()
for k in ['prefix', 'installed_base', 'installed_platbase']:
Expand Down
2 changes: 1 addition & 1 deletion submodules/libSBML
Submodule libSBML updated 497 files
2 changes: 1 addition & 1 deletion submodules/libSBML-dependencies

0 comments on commit b577099

Please sign in to comment.