Add test of installed <openblas_config.h>
authorRiver Dillon <oss@outerpassage.net>
Sat, 10 Jul 2021 07:39:52 +0000 (00:39 -0700)
committerRiver Dillon <oss@outerpassage.net>
Sat, 10 Jul 2021 08:26:05 +0000 (01:26 -0700)
Makefile
test_install/Makefile [new file with mode: 0644]
test_install/test_sched_include.c [new file with mode: 0644]

index 555d1c4..d31cc9c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,9 +34,9 @@ endif
 
 LAPACK_NOOPT := $(filter-out -O0 -O1 -O2 -O3 -Ofast,$(LAPACK_FFLAGS))
 
-SUBDIRS_ALL = $(SUBDIRS) test ctest utest exports benchmark ../laswp ../bench cpp_thread_test
+SUBDIRS_ALL = $(SUBDIRS) test ctest utest test_install exports benchmark ../laswp ../bench cpp_thread_test
 
-.PHONY : all libs netlib $(RELA) test ctest shared install
+.PHONY : all libs netlib $(RELA) test ctest test_install shared install
 .NOTPARALLEL : all libs $(RELA) prof lapack-test install blas-test
 
 all :: libs netlib $(RELA) tests shared
@@ -155,6 +155,11 @@ endif
 endif
 endif
 
+test_install :
+       mkdir -p install
+       PREFIX=install $(MAKE) install
+       $(MAKE) -C test_install all
+
 libs :
 ifeq ($(CORE), UNKNOWN)
        $(error OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail.)
@@ -399,4 +404,5 @@ endif
        @$(MAKE) -C relapack clean
        @rm -f *.grd Makefile.conf_last config_last.h
        @(cd $(NETLIB_LAPACK_DIR)/TESTING && rm -f x* *.out testing_results.txt)
+       @rm -rf install
        @echo Done.
diff --git a/test_install/Makefile b/test_install/Makefile
new file mode 100644 (file)
index 0000000..29cd813
--- /dev/null
@@ -0,0 +1,15 @@
+#
+# tests of installed headers and libs
+#
+
+INSTALLDIR = ../install
+
+.PHONY: all
+all: test_sched_include
+
+test_sched_include: test_sched_include.c
+       $(CC) -c -I$(INSTALLDIR)/include $<
+
+.PHONY: clean
+clean:
+       rm -f *.o
diff --git a/test_install/test_sched_include.c b/test_install/test_sched_include.c
new file mode 100644 (file)
index 0000000..aea3568
--- /dev/null
@@ -0,0 +1,5 @@
+// tests that inclusion of openblas_config.h works with musl
+
+#include <openblas_config.h>
+
+cpu_set_t* cpu_set = NULL;