From 3690f664ddcd851b95f788db8a06c426e8352a2a Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Aug 27 2020 10:16:43 +0000 Subject: Fix builds on arm and ppc --- diff --git a/0001-Use-.so-suffix-for-all-arches.patch b/0001-Use-.so-suffix-for-all-arches.patch new file mode 100644 index 0000000..ebaa985 --- /dev/null +++ b/0001-Use-.so-suffix-for-all-arches.patch @@ -0,0 +1,33 @@ +From bf5527190a3309176282a49f2fc302bfa551866a Mon Sep 17 00:00:00 2001 +From: "Ankur Sinha (Ankur Sinha Gmail)" +Date: Thu, 27 Aug 2020 10:43:54 +0100 +Subject: [PATCH] Use .so suffix for all arches + +--- + python/setup.cmake.py | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/python/setup.cmake.py b/python/setup.cmake.py +index 17665e2cf..39637491c 100644 +--- a/python/setup.cmake.py ++++ b/python/setup.cmake.py +@@ -30,16 +30,7 @@ with open(os.path.join(script_dir, 'VERSION'), 'r') as f: + version = f.read() + print('Got %s from VERSION file' % version) + +-# importlib is available only for python3. Since we build wheels, prefer .so +-# extension. This way a wheel built by any python3.x will work with any python3. + suffix = '.so' +-try: +- import importlib.machinery +- suffix = importlib.machinery.EXTENSION_SUFFIXES[-1] +-except Exception as e: +- print('[WARN] Failed to determine importlib suffix') +- suffix = '.so' +-assert (suffix) + print('[INFO] Suffix for python SO: %s' % suffix) + + setup( +-- +2.26.2 + diff --git a/moose.spec b/moose.spec index d3fb92a..346eed0 100644 --- a/moose.spec +++ b/moose.spec @@ -4,7 +4,7 @@ Name: moose Version: 3.1.5 %global codename chamcham -Release: 1%{?dist}%{?prerelease:.%{prerelease}}%{?commit:.git%{shortcommit}} +Release: 2%{?dist}%{?prerelease:.%{prerelease}}%{?commit:.git%{shortcommit}} Summary: Multiscale Neuroscience and Systems Biology Simulator License: GPLv3 URL: http://moose.ncbs.res.in/ @@ -17,6 +17,8 @@ Source0: https://github.com/BhallaLab/moose-core/archive/v%{version}.tar. # Fix segfault on py3.9 # https://github.com/BhallaLab/moose-core/pull/420 Patch0: c570f7c057f9c0ca7360c82a8932bcb0df222da9.patch +# ppc defines a different suffix which breaks the build +Patch1: 0001-Use-.so-suffix-for-all-arches.patch ExcludeArch: s390x @@ -76,6 +78,12 @@ sed -i 's/-O3//' CMakeLists.txt %global py_setup setup.cmake.py %build +# On armv7 we get a failure with LTO. +# Disable LTO for armv7 +%ifarch armv7hl +%define _lto_cflags %{nil} +%endif + cmake_opts=( -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_SKIP_RPATH:BOOL=ON @@ -135,6 +143,10 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -c \ %doc README.md %changelog +* Thu Aug 27 2020 Ankur Sinha - 3.1.5-2 +- Add patch to fix ppc build +- Disable lto on arm + * Wed Aug 26 2020 Ankur Sinha - 3.1.5-1 - Update to 3.1.5 - Use new cmake macros