armadillo/armadillo-tests.patch
Ismail Dönmez 2c7c50b2c0 Accepting request 438732 from home:badshah400:branches:devel:libraries:c_c++
- Add armadillo-install-pkgconfig.patch: Generate and install a
  pkgconfig file (PATCH-FEATURE-OPENSUSE for now, but in
  discussions with upstream to have this included).
- Add armadillo-tests.patch: Generate tests/Makefile by
  configuring tests/Makefile.in using cmake so that the tests can
  be run before actually installing the library. Then, use a
  make check section to test the built library
  (PATCH-FEATURE-OPENSUSE for now, but in discussions with
  upstream to have this included).

OBS-URL: https://build.opensuse.org/request/show/438732
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/armadillo?expand=0&rev=196
2016-11-05 08:45:31 +00:00

88 lines
2.4 KiB
Diff

Index: armadillo-7.500.0/tests/Makefile.in
===================================================================
--- /dev/null
+++ armadillo-7.500.0/tests/Makefile.in
@@ -0,0 +1,38 @@
+
+LIB_FLAGS = -L@PROJECT_SOURCE_DIR@ -larmadillo
+
+ifeq (${ARMA_USE_LAPACK},true)
+ LIB_FLAGS += -llapack
+endif
+ifeq (${ARMA_USE_BLAS},true)
+ LIB_FLAGS += -lblas
+endif
+ifeq (${ARMA_USE_SUPERLU},true)
+ LIB_FLAGS += -lsuperlu
+endif
+ifeq (${ARMA_USE_ARPACK},true)
+ LIB_FLAGS += -larpack
+endif
+
+#LIB_FLAGS = -lblas -llapack
+#LIB_FLAGS = -lopenblas -llapack
+
+CXX_FLAGS = -I@PROJECT_SOURCE_DIR@/include -std=c++11 -Wshadow -Wall -pedantic -O0
+#CXX_FLAGS = -std=c++11 -Wshadow -Wall -pedantic -O0 -DARMA_DONT_USE_WRAPPER
+#CXX_FLAGS = -std=c++11 -Wshadow -Wall -pedantic -O2
+
+OBJECTS = $(patsubst %.cpp,%.o,$(wildcard *.cpp))
+
+%.o: %.cpp $(DEPS)
+ $(CXX) $(CXX_FLAGS) -o $@ -c $<
+
+main: $(OBJECTS)
+ $(CXX) $(CXX_FLAGS) -o $@ $(OBJECTS) $(LIB_FLAGS)
+
+
+all: main
+
+.PHONY: clean
+
+clean:
+ rm -f main *.o
Index: armadillo-7.500.0/CMakeLists.txt
===================================================================
--- armadillo-7.500.0.orig/CMakeLists.txt
+++ armadillo-7.500.0/CMakeLists.txt
@@ -453,6 +453,10 @@ set(ARMADILLO_LIB_DIR "${PROJECT_BI
set(ARMADILLO_CMAKE_DIR "${PROJECT_BINARY_DIR}")
+# Configure tests/Makefile.in for running tests without installing first
+message(STATUS "Configuring tests/Makefile")
+configure_file(${PROJECT_SOURCE_DIR}/tests/Makefile.in ${PROJECT_SOURCE_DIR}/tests/Makefile)
+
message(STATUS "Generating '${PROJECT_BINARY_DIR}/ArmadilloConfig.cmake'")
# copy/change config and configVersion file (modify only the @xyz@ variables)
configure_file(${PROJECT_SOURCE_DIR}/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in
Index: armadillo-7.500.0/tests/Makefile
===================================================================
--- armadillo-7.500.0.orig/tests/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-
-LIB_FLAGS = -larmadillo
-#LIB_FLAGS = -lblas -llapack
-#LIB_FLAGS = -lopenblas -llapack
-
-CXX_FLAGS = -std=c++11 -Wshadow -Wall -pedantic -O0
-#CXX_FLAGS = -std=c++11 -Wshadow -Wall -pedantic -O0 -DARMA_DONT_USE_WRAPPER
-#CXX_FLAGS = -std=c++11 -Wshadow -Wall -pedantic -O2
-
-OBJECTS = $(patsubst %.cpp,%.o,$(wildcard *.cpp))
-
-%.o: %.cpp $(DEPS)
- $(CXX) $(CXX_FLAGS) -o $@ -c $< $
-
-main: $(OBJECTS)
- $(CXX) $(CXX_FLAGS) -o $@ $(OBJECTS) $(LIB_FLAGS)
-
-
-all: main
-
-.PHONY: clean
-
-clean:
- rm -f main *.o