2015-02-15 18:30:13 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package libadjoint
|
|
|
|
|
#
|
2025-01-05 17:23:00 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2015-02-15 18:30:13 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
|
#
|
|
|
|
|
|
2022-08-01 14:40:12 +00:00
|
|
|
%define sover 2017
|
|
|
|
|
|
|
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
|
|
2025-01-05 17:23:00 +00:00
|
|
|
%if !0%{?is_opensuse} && 0%{?sle_version:1} && 0%{?sle_version} < 150200
|
|
|
|
|
%define DisOMPI3 ExclusiveArch: do_not_build
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if 0%{?suse_version} > 1550
|
|
|
|
|
%define DisOMPI3 ExclusiveArch: do_not_build
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if !0%{?is_opensuse} && 0%{?sle_version:1} && 0%{?sle_version} < 150600
|
|
|
|
|
%define DisOMPI4 ExclusiveArch: do_not_build
|
|
|
|
|
%endif
|
|
|
|
|
|
2022-08-01 14:40:12 +00:00
|
|
|
%if "%flavor" == ""
|
|
|
|
|
ExclusiveArch: do_not_build
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if "%flavor" == "openmpi3"
|
|
|
|
|
%{?DisOMPI3}
|
|
|
|
|
%define mpi_family openmpi
|
|
|
|
|
%define mpi_ver 3
|
|
|
|
|
%endif
|
|
|
|
|
|
2025-01-05 17:23:00 +00:00
|
|
|
%if "%flavor" == "openmpi4"
|
|
|
|
|
%{?DisOMPI4}
|
|
|
|
|
%define mpi_family openmpi
|
|
|
|
|
%define mpi_ver 4
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if "%flavor" == "openmpi5"
|
|
|
|
|
%{?DisOMPI5}
|
|
|
|
|
%define mpi_family openmpi
|
|
|
|
|
%define mpi_ver 5
|
|
|
|
|
%endif
|
|
|
|
|
|
2022-08-01 14:40:12 +00:00
|
|
|
%if 0%{?mpi_family:1}
|
|
|
|
|
%{bcond_without mpi}
|
|
|
|
|
%else
|
|
|
|
|
%{bcond_with mpi}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with mpi}
|
|
|
|
|
%define my_prefix %{_libdir}/mpi/gcc/%{mpi_family}%{?mpi_ver}
|
|
|
|
|
%define my_libdir %{my_prefix}/%{_lib}
|
|
|
|
|
%define libname libadjoint%{sover}-%{mpi_family}%{?mpi_ver}
|
|
|
|
|
%else
|
|
|
|
|
%define my_prefix %{_prefix}
|
|
|
|
|
%define my_libdir %{_libdir}
|
|
|
|
|
%define libname libadjoint%{sover}
|
|
|
|
|
%endif
|
|
|
|
|
|
2015-02-15 18:30:13 +00:00
|
|
|
Name: libadjoint
|
2022-08-01 14:40:12 +00:00
|
|
|
Version: 2017.2.0
|
|
|
|
|
Release: 0
|
|
|
|
|
License: LGPL-3.0-only
|
|
|
|
|
Summary: A library for adjoining computational models
|
|
|
|
|
URL: https://bitbucket.org/dolfin-adjoint/libadjoint
|
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
|
Source0: https://bitbucket.org/dolfin-adjoint/libadjoint/downloads/%{name}-%{version}.tar.gz
|
|
|
|
|
Patch0: fix-python-install.patch
|
2025-01-05 17:23:00 +00:00
|
|
|
# PATCH-FIX-OPENSUSE
|
|
|
|
|
Patch1: 0001-Remove-broken-EPSMonitorSet-call.patch
|
2015-02-15 18:30:13 +00:00
|
|
|
BuildRequires: blas-devel
|
|
|
|
|
BuildRequires: cmake
|
2022-08-01 14:40:12 +00:00
|
|
|
BuildRequires: gcc-c++
|
2015-02-15 18:30:13 +00:00
|
|
|
BuildRequires: lapack-devel
|
|
|
|
|
BuildRequires: libstdc++-devel
|
2022-08-01 14:40:12 +00:00
|
|
|
#BuildRequires: python3-devel
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2017-03-16 14:40:50 +00:00
|
|
|
BuildRequires: python3-xml
|
2022-08-01 14:40:12 +00:00
|
|
|
%if %{with mpi}
|
|
|
|
|
BuildRequires: %{mpi_family}%{?mpi_ver}-devel
|
|
|
|
|
BuildRequires: petsc-%{mpi_family}%{?mpi_ver}-devel
|
|
|
|
|
BuildRequires: slepc-%{mpi_family}%{?mpi_ver}-devel
|
|
|
|
|
# FIXME: resolve ambiguity
|
|
|
|
|
BuildRequires: parpack-%{mpi_family}%{?mpi_ver}-devel
|
|
|
|
|
%else
|
|
|
|
|
BuildRequires: petsc-devel
|
|
|
|
|
BuildRequires: slepc-devel
|
|
|
|
|
BuildRequires: arpack-devel
|
|
|
|
|
%endif
|
2015-02-15 18:30:13 +00:00
|
|
|
BuildRequires: suitesparse-devel
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Libadjoint is a library for adjointing computational models. It aims to
|
|
|
|
|
make adjointing models easy (or rather, as easy as possible). Its fundamental
|
|
|
|
|
abstraction is that a model is a sequence of linear solves.
|
|
|
|
|
|
|
|
|
|
It provides an API by which the model developer may build a "tape" of
|
|
|
|
|
what the model does, in terms of the linear solves that it executes.
|
|
|
|
|
This tape may then be "rewound" by libadjoint to compute the adjoint
|
|
|
|
|
equation associated with every forward linear solve. It may also
|
|
|
|
|
be "replayed", to compare the genuine forward model output against
|
|
|
|
|
libadjoint's interpretation of the forward model.
|
|
|
|
|
|
|
|
|
|
The library is mainly used by dolfin-adjoint.
|
|
|
|
|
|
2022-08-01 14:40:12 +00:00
|
|
|
%package -n %{libname}
|
2015-02-15 18:30:13 +00:00
|
|
|
Summary: A library for adjoining computational models - openmpi support
|
|
|
|
|
Group: Development/Libraries/C and C++
|
2022-08-01 14:40:12 +00:00
|
|
|
%if %{with mpi}
|
|
|
|
|
Requires: %{mpi_family}%{?mpi_ver}
|
|
|
|
|
Requires: libpetsc3-%{mpi_family}%{?mpi_ver}
|
|
|
|
|
Requires: libslepc3-%{mpi_family}%{?mpi_ver}
|
|
|
|
|
%endif
|
2015-02-15 18:30:13 +00:00
|
|
|
|
2022-08-01 14:40:12 +00:00
|
|
|
%description -n %{libname}
|
2015-02-15 18:30:13 +00:00
|
|
|
Libadjoint is a library for adjointing computational models. It aims to
|
|
|
|
|
make adjointing models easy (or rather, as easy as possible). Its fundamental
|
|
|
|
|
abstraction is that a model is a sequence of linear solves.
|
|
|
|
|
|
|
|
|
|
It provides an API by which the model developer may build a "tape" of
|
|
|
|
|
what the model does, in terms of the linear solves that it executes.
|
|
|
|
|
This tape may then be "rewound" by libadjoint to compute the adjoint
|
|
|
|
|
equation associated with every forward linear solve. It may also
|
|
|
|
|
be "replayed", to compare the genuine forward model output against
|
|
|
|
|
libadjoint's interpretation of the forward model.
|
|
|
|
|
|
|
|
|
|
The library is mainly used by dolfin-adjoint.
|
|
|
|
|
|
|
|
|
|
This package contains the binaries build with openmpi support.
|
|
|
|
|
|
2022-08-01 14:40:12 +00:00
|
|
|
%package -n %{name}%{?mpi_family:-%{mpi_family}%{?mpi_ver}}-devel
|
|
|
|
|
Summary: A library for adjointing computational models - openmpi support
|
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
|
Requires: %{libname} = %{version}
|
|
|
|
|
%if %{with mpi}
|
|
|
|
|
Requires: petsc-%{mpi_family}%{?mpi_ver}-devel
|
|
|
|
|
Requires: slepc-%{mpi_family}%{?mpi_ver}-devel
|
|
|
|
|
Requires: %{mpi_family}%{?mpi_ver}-devel
|
|
|
|
|
%else
|
|
|
|
|
Requires: petsc-devel
|
|
|
|
|
Requires: slepc-devel
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%description -n %{name}%{?mpi_family:-%{mpi_family}%{?mpi_ver}}-devel
|
2015-02-15 18:30:13 +00:00
|
|
|
Libadjoint is a library for adjointing computational models. This package
|
|
|
|
|
contains the development headers needed to link against libadjoint build
|
|
|
|
|
with openmpi support.
|
|
|
|
|
|
2022-08-01 14:40:12 +00:00
|
|
|
%package -n python3-%{name}%{?mpi_family:-%{mpi_family}%{?mpi_ver}}
|
|
|
|
|
Summary: A library for adjointing computational models (python bindings w/ openmpi)
|
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
|
Requires: %{libname} = %{version}
|
|
|
|
|
%if %{without mpi}
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
%endif
|
2015-02-15 18:30:13 +00:00
|
|
|
|
2022-08-01 14:40:12 +00:00
|
|
|
%description -n python3-%{name}%{?mpi_family:-%{mpi_family}%{?mpi_ver}}
|
2015-02-15 18:30:13 +00:00
|
|
|
Libadjoint is a library for adjointing computational models. This package
|
|
|
|
|
contains the Python bindings for the library (generated by ctypes) with
|
|
|
|
|
openmpi support.
|
|
|
|
|
|
|
|
|
|
%prep
|
2022-08-01 14:40:12 +00:00
|
|
|
%autosetup -n %{name} -p1
|
|
|
|
|
sed -i -e 's/\r//' README.md
|
2015-02-15 18:30:13 +00:00
|
|
|
|
|
|
|
|
%build
|
2022-08-01 14:40:12 +00:00
|
|
|
%define petsc_ver %(rpm -q petsc-%{mpi_family}%{?mpi_ver}-devel --queryformat %%{VERSION})
|
|
|
|
|
# export CC=mpicc CXX=mpic++ FC=mpif90
|
|
|
|
|
ls %{my_prefix}/bin/
|
|
|
|
|
ls %{my_libdir}/petsc/3.*/
|
|
|
|
|
|
|
|
|
|
export PETSC_DIR=`echo %{my_libdir}/petsc/3.*/*`
|
|
|
|
|
export SLEPC_DIR=`echo %{my_libdir}/slepc/3.*/*`
|
|
|
|
|
%cmake \
|
2017-03-16 14:40:50 +00:00
|
|
|
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
|
2022-08-01 14:40:12 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH=%{my_prefix} \
|
2015-02-15 18:30:13 +00:00
|
|
|
-DINSTALL_LIB_DIR:PATH=%{_lib} \
|
|
|
|
|
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF \
|
|
|
|
|
-DDOLFIN_SKIP_BUILD_TESTS:BOOL=ON \
|
2022-08-01 14:40:12 +00:00
|
|
|
%{nil}
|
|
|
|
|
%cmake_build
|
2015-02-15 18:30:13 +00:00
|
|
|
|
|
|
|
|
%install
|
2022-08-01 14:40:12 +00:00
|
|
|
%cmake_install
|
|
|
|
|
rm -f %{buildroot}%{my_libdir}/*.a
|
|
|
|
|
|
|
|
|
|
%post -n %{libname} -p /sbin/ldconfig
|
|
|
|
|
|
|
|
|
|
%postun -n %{libname} -p /sbin/ldconfig
|
|
|
|
|
|
|
|
|
|
%files -n %{libname}
|
|
|
|
|
%doc AUTHORS README.md
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%{my_libdir}/*.so.%{sover}*
|
|
|
|
|
|
|
|
|
|
%files -n %{name}%{?mpi_family:-%{mpi_family}%{?mpi_ver}}-devel
|
|
|
|
|
%dir %{my_prefix}/include/%{name}
|
|
|
|
|
%{my_prefix}/include/%{name}/*
|
|
|
|
|
%{my_libdir}/*.so
|
|
|
|
|
|
|
|
|
|
%files -n python3-%{name}%{?mpi_family:-%{mpi_family}%{?mpi_ver}}
|
|
|
|
|
%if %{with mpi}
|
|
|
|
|
%dir %{my_prefix}/lib
|
|
|
|
|
%endif
|
|
|
|
|
%dir %{my_prefix}/lib/python%{py3_ver}
|
|
|
|
|
%dir %{my_prefix}/lib/python%{py3_ver}/site-packages/
|
|
|
|
|
%dir %{my_prefix}/lib/python%{py3_ver}/site-packages/%{name}
|
|
|
|
|
%{my_prefix}/lib/python%{py3_ver}/site-packages/%{name}/*
|
|
|
|
|
%{my_prefix}/lib/python%{py3_ver}/site-packages/%{name}-*.egg-info
|
2015-02-15 18:30:13 +00:00
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
|