Open carlosal1015 opened 7 months ago
Hi @carlosal1015, can you clarify what you're trying to package? I see both C++ and Python dependencies mixed together even though those are separate packages.
There is already a good Python package on PyPI (built using the standard Python build methods), so I assume you're interested in packaging the C++ library? If so, drop all dependencies with python
in their name.
For C++, the only dependency is a C++ 17 build system.
Eigen, Blaze, GraphBLAS, Armadillo, and such are optional test dependencies, to test the bindings for those libraries. FMM does not depend on those libraries in any way. To run the tests without these libraries, set FAST_MATRIX_MARKET_TEST_EXTERNAL_APPS
to OFF.
https://github.com/alugowski/fast_matrix_market/blob/4477fc30975592196bf03830844a0f6828cee380/tests/CMakeLists.txt#L92C8-L92C45
That would drop all test dependencies apart from GTest, and I believe would not fetchcontent any of them.
Another option for just testing if the library is installed is to compile one of the tiny example problems instead of the entire test suite. If the sample1
example builds and runs then FMM is working. No GTest required at all. If I were packaging for Conan or vcpkg I'd do this.
If running the entire test suite is desired then I'm open to suggestions on how to pull in GTest. Note that this CMakeLists.txt needs to work on Windows and macOS too, not just Linux.
Couple questions:
CMAKE_CXX_STANDARD
? And why to 23 and not 17?FAST_MATRIX_MARKET_BENCH
or set it to OFF. The benchmark pulls in Google Benchmark (which itself needs GTest).Thanks for the hint -DFAST_MATRIX_MARKET_TEST_EXTERNAL_APPS=OFF
helped, no more files put over /usr/include/blaze
, /usr/include/eigen3
.
I setup C++23, because in this line it uses, but I move to C++ 17 now. Now is simplified, in this step I will focus only C+++ side.
pkgname=fast_matrix_market
pkgdesc="Fast and full-featured Matrix Market I/O library"
pkgver=1.7.6
pkgrel=1
arch=(x86_64)
url="https://github.com/alugowski/${pkgname}"
license=(BSD-2-Clause)
depends=(gcc-libs)
makedepends=(cmake)
optdepends=('eigen' 'blaze' 'armadillo')
source=(${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz)
sha512sums=('e97da2daf76770502e862a13b7b61aaf8797d9bec9d33f182ff28c2a0b3f8e8b078b559643d980d6c7f3ff57da9cf52bde8807120b9373e61851fd57373d51aa')
build() {
cmake \
-S ${pkgname}-${pkgver} \
-B build \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=TRUE \
-DCMAKE_CXX_STANDARD=17 \
-DFAST_MATRIX_MARKET_BENCH=OFF \
-DFAST_MATRIX_MARKET_TEST=ON \
-DFAST_MATRIX_MARKET_TEST_EXTERNAL_APPS=OFF \
-DFMM_USE_DRAGONBOX=ON \
-DFMM_USE_FAST_FLOAT=ON \
-DFMM_USE_RYU=ON \
-Wno-dev
cmake --build build --target all
}
check() {
ctest --verbose --output-on-failure --test-dir build
}
package() {
DESTDIR="${pkgdir}" cmake --build build --target install
install -Dm 644 ${pkgname}-${pkgver}/LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
rm -r ${pkgdir}/usr/include/{gtest,gmock}
rm -r ${pkgdir}/usr/lib/cmake/GTest
rm -r ${pkgdir}/usr/lib/libgmock*
rm -r ${pkgdir}/usr/lib/libgtest*
rm -r ${pkgdir}/usr/lib/pkgconfig/gmock*
rm -r ${pkgdir}/usr/lib/pkgconfig/gtest*
}
/usr/lib/fast_matrix_market.so
or /usr/lib/fast_matrix_market.so
or /usr/include/fast_matrix_market/fast_matrix_market.hpp
, therefore the script will not install fast_matrix_market.-DFAST_MATRIX_MARKET_TEST=ON
it will pull gtest
, sometimes is nice if user has gtest
installed, check if gtest
version is compatible and try to use, otherwise pull from internet (for examples offline installation could be fail).#include <fast_matrix_market/fast_matrix_market.hpp>
it does not exists with the above installation.gtest
files are over /usr
and we do not like this behavior. Thanks.I can try help test almost over GitHub action for Windows or Mac.
Hi, I would like to ask if is possible to change the following behavior. In Linux many dependencies are are available in the repositories, for instance,
gtest
eigen
blaze
suitesparse
provides GraphBLAS. and so on.I am trying to package, but I noticed that
FetchContent
download and later will install togetherfast_matrix_market
.The solution could be manually delete files in order to avoid duplication for
gtest
,blaze
,eigen
, and so on post cmake installation