# I think we can drop modules like ComplexFloat.Type. # They contain only one type definition, # and we can replace that one using Perl. # We are using Perl substitution anyway. TYPES = Float Double ComplexFloat ComplexDouble TEST_MODULES = test/Test/Main.hs \ $(patsubst %, test/Test/%/Main.hs, $(TYPES)) TESTABLE = \ src/Numeric/BLAS/Vector.hs \ src/Numeric/BLAS/Vector/Slice.hs \ src/Numeric/BLAS/Matrix/RowMajor.hs \ src/Numeric/BLAS/Matrix/RowMajor/Square.hs \ src/Numeric/BLAS/Matrix/RowMajor/Block.hs \ src/Numeric/BLAS/Matrix/RowMajor/Mutable.hs \ src/Numeric/BLAS/Matrix/TransposablePrivate.hs CABAL_NIX_OPTS = -j3 --ghc-option=-j3 --disable-documentation CABAL = cabal-3.12.1 run-test: update-test runhaskell Setup configure --user --enable-tests runhaskell Setup build runhaskell Setup haddock runhaskell Setup test comfort-blas-test --show-details=streaming update-test: $(TEST_MODULES) test/Test/Main.hs: src/Numeric/BLAS/Slice.hs src/Numeric/BLAS/Subobject/View.hs src/Numeric/BLAS/Subobject/View/Matrix.hs doctest-extract-0.1 -i src/ -o test/ --module-prefix Test --library-main Main \ Numeric.BLAS.Subobject.View.Matrix \ Numeric.BLAS.Subobject.View # Numeric.BLAS.Slice test/Test/%/Main.hs: test-module.list $(TESTABLE) doctest-extract-0.1 -i src/ -o test/ --module-prefix Test.$* --library-main Main $$(cat test-module.list) for file in $$(find test/Test/$*/Numeric -name "*.hs"); \ do perl -i -p -e "s:NumberType_:$*:" $$file; \ done test-module.list: comfort-blas.cabal grep '^ \+Test\.Float\.Numeric\.BLAS\.' $< | cut -d. -f3- >$@ run-test-nix: run-test-plain run-test-openblas run-test-flame-blis run-test-blis run-test-mkl run-test-plain: cabal.project-tmpl update-test $(CABAL) run comfort-blas-test --project-file=$< --builddir=/ram/cabal $(CABAL_NIX_OPTS) run-test-openblas: cabal.project.openblas update-test $(CABAL) run comfort-blas-test --project-file=$< --builddir=/ram/cabal-openblas $(CABAL_NIX_OPTS) run-test-flame-blis: cabal.project.flame-blis update-test $(CABAL) run comfort-blas-test --project-file=$< --builddir=/ram/cabal-flame-blis $(CABAL_NIX_OPTS) run-test-blis: cabal.project.blis update-test nix-shell amd-blis.nix \ --run 'cabal run comfort-blas-test --project-file=$< --builddir=/ram/cabal-blis $(CABAL_NIX_OPTS)' # nix-shell -p amd-blis ghc cabal-install \ # --run 'cabal run comfort-blas-test --project-file=$< --builddir=/ram/cabal-blis $(CABAL_NIX_OPTS)' # nix-shell -p blis gmp numactl gfortran --run 'cabal-3.10.3 run comfort-blas-test --project-file=$< --builddir=/ram/cabal-blis $(CABAL_NIX_OPTS) --extra-lib-dirs=/nix/store/pcrz3w2wcj0gp2rn75hb83jy6ks7cvm0-gfortran-12.3.0-lib/lib' run-test-mkl: cabal.project.mkl update-test NIXPKGS_ALLOW_UNFREE=1 nix-shell mkl.nix \ --run 'cabal run comfort-blas-test --project-file=$< --builddir=/ram/cabal-mkl $(CABAL_NIX_OPTS)' # NIXPKGS_ALLOW_UNFREE=1 nix-shell -p mkl ghc cabal-install \ # --run 'cabal run comfort-blas-test --project-file=$< --builddir=/ram/cabal-mkl $(CABAL_NIX_OPTS)' # NIXPKGS_ALLOW_UNFREE=1 nix-shell -p mkl gmp numactl gfortran --run 'cabal-3.10.3 run comfort-blas-test --project-file=$< --builddir=/ram/cabal-mkl -j3 --ghc-option=-j3 --extra-lib-dirs=/nix/store/pcrz3w2wcj0gp2rn75hb83jy6ks7cvm0-gfortran-12.3.0-lib/lib' cabal.project.%: cabal.project-tmpl # perl -p -e 's:' $< >$@ (cat $<; echo ; echo "package cblas-ffi"; echo " flags: +$*") >$@