From f49875ec07605e11ddffb6497f122defb2ad0ace Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 16 Apr 2021 08:22:54 +0900 Subject: [PATCH] Fix build error change install path, rpath fix spec file --- AMD/Lib/Makefile | 2 +- BTF/Lib/Makefile | 2 +- CAMD/Lib/Makefile | 2 +- CCOLAMD/Lib/Makefile | 2 +- CHOLMOD/Lib/Makefile | 2 +- CHOLMOD/Tcov/Makefile | 2 +- COLAMD/Lib/Makefile | 2 +- CXSparse/Lib/Makefile | 2 +- CXSparse_newfiles/Lib/Makefile | 2 +- GPUQREngine/Lib/Makefile | 2 +- KLU/Lib/Makefile | 2 +- KLU/Tcov/Makefile | 2 +- LDL/Lib/Makefile | 2 +- Makefile | 6 ++-- RBio/Lib/Makefile | 2 +- SPQR/Lib/Makefile | 2 +- SuiteSparse_GPURuntime/Lib/Makefile | 2 +- SuiteSparse_config/SuiteSparse_config.mk | 2 +- UMFPACK/Lib/Makefile | 2 +- UMFPACK/Tcov/Make.1 | 2 +- UMFPACK/Tcov/Make.2 | 2 +- UMFPACK/Tcov/Make.3 | 2 +- UMFPACK/Tcov/Make.4 | 2 +- UMFPACK/Tcov/Make.5 | 2 +- UMFPACK/Tcov/Make.6 | 2 +- UMFPACK/Tcov/Make.7 | 2 +- UMFPACK/Tcov/Make.8 | 2 +- packaging/suitesparse.spec | 42 ++++++++++++++++++++---- 28 files changed, 64 insertions(+), 36 deletions(-) diff --git a/AMD/Lib/Makefile b/AMD/Lib/Makefile index 3b92f6a..0afd2de 100644 --- a/AMD/Lib/Makefile +++ b/AMD/Lib/Makefile @@ -11,7 +11,7 @@ default: library include ../../SuiteSparse_config/SuiteSparse_config.mk # AMD depends on SuiteSparse_config -LDLIBS += -lsuitesparseconfig +LDLIBS += -L../../lib -lsuitesparseconfig # compile and install in SuiteSparse/lib library: diff --git a/BTF/Lib/Makefile b/BTF/Lib/Makefile index 85b7a26..a82789e 100644 --- a/BTF/Lib/Makefile +++ b/BTF/Lib/Makefile @@ -11,7 +11,7 @@ default: library include ../../SuiteSparse_config/SuiteSparse_config.mk # BTF depends on SuiteSparse_config -LDLIBS += -lsuitesparseconfig +LDLIBS += -L../../lib -lsuitesparseconfig ccode: all diff --git a/CAMD/Lib/Makefile b/CAMD/Lib/Makefile index b3ae159..d080e9e 100644 --- a/CAMD/Lib/Makefile +++ b/CAMD/Lib/Makefile @@ -11,7 +11,7 @@ default: library include ../../SuiteSparse_config/SuiteSparse_config.mk # CAMD depends on SuiteSparse_config -LDLIBS += -lsuitesparseconfig +LDLIBS += -L../../lib -lsuitesparseconfig # compile and install in SuiteSparse/lib library: diff --git a/CCOLAMD/Lib/Makefile b/CCOLAMD/Lib/Makefile index 52c52eb..644bc45 100644 --- a/CCOLAMD/Lib/Makefile +++ b/CCOLAMD/Lib/Makefile @@ -11,7 +11,7 @@ default: library include ../../SuiteSparse_config/SuiteSparse_config.mk # CCOLAMD depends on SuiteSparse_config -LDLIBS += -lsuitesparseconfig +LDLIBS += -L../../lib -lsuitesparseconfig # compile and install in SuiteSparse/lib library: diff --git a/CHOLMOD/Lib/Makefile b/CHOLMOD/Lib/Makefile index 09b3871..757dd97 100644 --- a/CHOLMOD/Lib/Makefile +++ b/CHOLMOD/Lib/Makefile @@ -14,7 +14,7 @@ include ../../SuiteSparse_config/SuiteSparse_config.mk # CHOLMOD depends on AMD, SuiteSparse_config, LAPACK, BLAS, # and optionally METIS, CAMD, and CCOLAMD if the Partition Module is in use -LDLIBS += -lamd -lcolamd -lsuitesparseconfig \ +LDLIBS += -L../../lib -lamd -lcolamd -lsuitesparseconfig \ $(LIB_WITH_PARTITION) $(LAPACK) $(BLAS) SO_OPTS += $(CFOPENMP) diff --git a/CHOLMOD/Tcov/Makefile b/CHOLMOD/Tcov/Makefile index 8314940..0f9663a 100644 --- a/CHOLMOD/Tcov/Makefile +++ b/CHOLMOD/Tcov/Makefile @@ -30,7 +30,7 @@ C = $(CC) $(CF) $(CHOLMOD_CONFIG) $(NANTESTS) # default LAPACK and BLAS from SuiteSparse_config.mk: LDLIBS = -L../../lib \ - -lmetis -lm $(LAPACK) $(BLAS) -lrt -Wl,-rpath=$(SUITESPARSE)/lib + -lmetis -lm $(LAPACK) $(BLAS) -lrt -Wl,-rpath=$(RUNPATH) # LAPACK and the Fortran reference BLAS, compiled with gfortran -g -O: # LDLIBS = $(METIS) -lm -llapack_plain -lblas_plain -lg2c diff --git a/COLAMD/Lib/Makefile b/COLAMD/Lib/Makefile index 2d0c5aa..1a60941 100644 --- a/COLAMD/Lib/Makefile +++ b/COLAMD/Lib/Makefile @@ -11,7 +11,7 @@ default: library include ../../SuiteSparse_config/SuiteSparse_config.mk # COLAMD depends on SuiteSparse_config -LDLIBS += -lsuitesparseconfig +LDLIBS += -L../../lib -lsuitesparseconfig # compile and install in SuiteSparse/lib library: diff --git a/CXSparse/Lib/Makefile b/CXSparse/Lib/Makefile index a21e360..6345dcd 100644 --- a/CXSparse/Lib/Makefile +++ b/CXSparse/Lib/Makefile @@ -11,7 +11,7 @@ default: library include ../../SuiteSparse_config/SuiteSparse_config.mk # CXSparse depends on SuiteSparse_config -LDLIBS += -lsuitesparseconfig +LDLIBS += -L../../lib -lsuitesparseconfig # compile and install in SuiteSparse/lib library: diff --git a/CXSparse_newfiles/Lib/Makefile b/CXSparse_newfiles/Lib/Makefile index a21e360..6345dcd 100644 --- a/CXSparse_newfiles/Lib/Makefile +++ b/CXSparse_newfiles/Lib/Makefile @@ -11,7 +11,7 @@ default: library include ../../SuiteSparse_config/SuiteSparse_config.mk # CXSparse depends on SuiteSparse_config -LDLIBS += -lsuitesparseconfig +LDLIBS += -L../../lib -lsuitesparseconfig # compile and install in SuiteSparse/lib library: diff --git a/GPUQREngine/Lib/Makefile b/GPUQREngine/Lib/Makefile index adf4603..df75b0d 100644 --- a/GPUQREngine/Lib/Makefile +++ b/GPUQREngine/Lib/Makefile @@ -13,7 +13,7 @@ ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk # GPUQREngine depends on SuiteSparse_config, CUDA, and SuiteSparse_GPURuntime -LDLIBS += -lSuiteSparse_GPURuntime -lsuitesparseconfig $(CUDART_LIB) +LDLIBS += -L../../lib -lSuiteSparse_GPURuntime -lsuitesparseconfig $(CUDART_LIB) # compile and install in SuiteSparse/lib library: diff --git a/KLU/Lib/Makefile b/KLU/Lib/Makefile index 2dc62cb..01d5109 100644 --- a/KLU/Lib/Makefile +++ b/KLU/Lib/Makefile @@ -13,7 +13,7 @@ ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk # KLU depends on BTF, AMD, COLAMD, and SuiteSparse_config -LDLIBS += -lamd -lcolamd -lbtf -lsuitesparseconfig +LDLIBS += -L../../lib -lamd -lcolamd -lbtf -lsuitesparseconfig # compile and install in SuiteSparse/lib library: diff --git a/KLU/Tcov/Makefile b/KLU/Tcov/Makefile index 787c0a0..d330c69 100644 --- a/KLU/Tcov/Makefile +++ b/KLU/Tcov/Makefile @@ -27,7 +27,7 @@ C = $(CC) $(CF) LDLIBS = -L../../lib -lamd -lcolamd -lcholmod -lcamd -lccolamd \ -lmetis -lsuitesparseconfig \ $(LAPACK) $(BLAS) $(CUDART_LIB) $(CUBLAS_LIB) -lm -lrt \ - -Wl,-rpath=$(SUITESPARSE)/lib -lstdc++ + -Wl,-rpath=$(RUNPATH) -lstdc++ I = -I../../include -I../Include -I../User -I../../BTF/Include diff --git a/LDL/Lib/Makefile b/LDL/Lib/Makefile index 604ffa2..01ed070 100644 --- a/LDL/Lib/Makefile +++ b/LDL/Lib/Makefile @@ -11,7 +11,7 @@ default: library include ../../SuiteSparse_config/SuiteSparse_config.mk # LDL depends on SuiteSparse_config -LDLIBS += -lsuitesparseconfig +LDLIBS += -L../../lib -lsuitesparseconfig # compile and install in SuiteSparse/lib library: diff --git a/Makefile b/Makefile index 80f147c..84eec1d 100644 --- a/Makefile +++ b/Makefile @@ -65,9 +65,9 @@ ifeq (,$(MY_METIS_LIB)) @mkdir -p $(INSTALL_LIB) @mkdir -p $(INSTALL_INCLUDE) @mkdir -p $(INSTALL_DOC) - - $(CP) lib/libmetis.* $(INSTALL_LIB) - - $(CP) metis-5.1.0/manual/manual.pdf $(INSTALL_DOC)/METIS_manual.pdf - - $(CP) metis-5.1.0/README.txt $(INSTALL_DOC)/METIS_README.txt + - $(CP) -f lib/libmetis.* $(INSTALL_LIB) + - $(CP) -f metis-5.1.0/manual/manual.pdf $(INSTALL_DOC)/METIS_manual.pdf + - $(CP) -f metis-5.1.0/README.txt $(INSTALL_DOC)/METIS_README.txt # the following is needed only on the Mac, so *.dylib is hardcoded: $(SO_INSTALL_NAME) $(INSTALL_LIB)/libmetis.dylib $(INSTALL_LIB)/libmetis.dylib - $(CP) include/metis.h $(INSTALL_INCLUDE) diff --git a/RBio/Lib/Makefile b/RBio/Lib/Makefile index 056715d..8bc69e6 100644 --- a/RBio/Lib/Makefile +++ b/RBio/Lib/Makefile @@ -13,7 +13,7 @@ ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk # RBio depends on SuiteSparse_config -LDLIBS += -lsuitesparseconfig +LDLIBS += -L../../lib -lsuitesparseconfig # compile and install in SuiteSparse/lib library: diff --git a/SPQR/Lib/Makefile b/SPQR/Lib/Makefile index 94a0484..4af48c5 100644 --- a/SPQR/Lib/Makefile +++ b/SPQR/Lib/Makefile @@ -13,7 +13,7 @@ ccode: all include ../../SuiteSparse_config/SuiteSparse_config.mk # SPQR depends on CHOLMOD, AMD, COLAMD, LAPACK, the BLAS and SuiteSparse_config -LDLIBS += -lamd -lcolamd -lcholmod -lsuitesparseconfig $(LAPACK) $(BLAS) $(TBB) +LDLIBS += -L../../lib -lamd -lcolamd -lcholmod -lsuitesparseconfig $(LAPACK) $(BLAS) $(TBB) # compile and install in SuiteSparse/lib library: diff --git a/SuiteSparse_GPURuntime/Lib/Makefile b/SuiteSparse_GPURuntime/Lib/Makefile index 31f536a..d1c6d58 100644 --- a/SuiteSparse_GPURuntime/Lib/Makefile +++ b/SuiteSparse_GPURuntime/Lib/Makefile @@ -11,7 +11,7 @@ default: library include ../../SuiteSparse_config/SuiteSparse_config.mk # SuiteSparse_GPURuntime depends on SuiteSparse_config and CUDA -LDLIBS += -lsuitesparseconfig $(CUDART_LIB) +LDLIBS += -L../../lib -lsuitesparseconfig $(CUDART_LIB) # compile and install in SuiteSparse/lib library: diff --git a/SuiteSparse_config/SuiteSparse_config.mk b/SuiteSparse_config/SuiteSparse_config.mk index b4e5979..5de25cb 100644 --- a/SuiteSparse_config/SuiteSparse_config.mk +++ b/SuiteSparse_config/SuiteSparse_config.mk @@ -348,7 +348,7 @@ SUITESPARSE_VERSION = 5.2.0 ifeq ($(UNAME),Linux) # add the realtime library, librt, and SuiteSparse/lib - LDLIBS += -lrt -Wl,-rpath=$(INSTALL_LIB) + LDLIBS += -lrt -Wl,-rpath=$(RUNPATH) endif #--------------------------------------------------------------------------- diff --git a/UMFPACK/Lib/Makefile b/UMFPACK/Lib/Makefile index 8e4dbd2..62ce806 100644 --- a/UMFPACK/Lib/Makefile +++ b/UMFPACK/Lib/Makefile @@ -12,7 +12,7 @@ include ../../SuiteSparse_config/SuiteSparse_config.mk # UMFPACK depends on AMD, SuiteSparse_config, LAPACK, and the BLAS. # It optionally relies on CHOLMOD -LDLIBS += -lamd -lsuitesparseconfig $(LAPACK) $(BLAS) +LDLIBS += -L../../lib -lamd -lsuitesparseconfig $(LAPACK) $(BLAS) # compile and install in SuiteSparse/lib library: diff --git a/UMFPACK/Tcov/Make.1 b/UMFPACK/Tcov/Make.1 index d03f676..0a07bdb 100644 --- a/UMFPACK/Tcov/Make.1 +++ b/UMFPACK/Tcov/Make.1 @@ -12,7 +12,7 @@ CF = -O0 -g --coverage -fPIC -fopenmp LDFLAGS = --coverage UMFPACK_CONFIG = -DNBLAS -DTEST_FOR_INTEGER_OVERFLOW -DTESTING LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ - -Wl,-rpath=lib $(LIB2) -lgcov + -Wl,-rpath=$(RUNPATH) $(LIB2) -lgcov ifneq ($(CUDA),no) CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") diff --git a/UMFPACK/Tcov/Make.2 b/UMFPACK/Tcov/Make.2 index cb8a21a..576c5dd 100644 --- a/UMFPACK/Tcov/Make.2 +++ b/UMFPACK/Tcov/Make.2 @@ -12,7 +12,7 @@ CF = -O0 -g --coverage -fPIC -fopenmp LDFLAGS = --coverage UMFPACK_CONFIG = -DTESTING LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ - -Wl,-rpath=lib -lgcov + -Wl,-rpath=$(RUNPATH) -lgcov ifneq ($(CUDA),no) CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") diff --git a/UMFPACK/Tcov/Make.3 b/UMFPACK/Tcov/Make.3 index 4888f41..67460ac 100644 --- a/UMFPACK/Tcov/Make.3 +++ b/UMFPACK/Tcov/Make.3 @@ -11,7 +11,7 @@ CC = gcc CF = -O3 -fPIC -fopenmp UMFPACK_CONFIG = -DNBLAS -DTEST_FOR_INTEGER_OVERFLOW -DTESTING LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ - -Wl,-rpath=lib + -Wl,-rpath=$(RUNPATH) ifneq ($(CUDA),no) CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") diff --git a/UMFPACK/Tcov/Make.4 b/UMFPACK/Tcov/Make.4 index b97ffd7..1bfb5a8 100644 --- a/UMFPACK/Tcov/Make.4 +++ b/UMFPACK/Tcov/Make.4 @@ -11,7 +11,7 @@ CC = gcc CF = -O3 -fPIC -fopenmp UMFPACK_CONFIG = -DTESTING LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ - -Wl,-rpath=lib + -Wl,-rpath=$(RUNPATH) ifneq ($(CUDA),no) CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") diff --git a/UMFPACK/Tcov/Make.5 b/UMFPACK/Tcov/Make.5 index 1774a0b..6926282 100644 --- a/UMFPACK/Tcov/Make.5 +++ b/UMFPACK/Tcov/Make.5 @@ -12,7 +12,7 @@ CF = -O0 -g --coverage -fPIC -fopenmp LDFLAGS = --coverage UMFPACK_CONFIG = -DNBLAS -DTEST_FOR_INTEGER_OVERFLOW -DTESTING -DNRECIPROCAL LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ - -Wl,-rpath=lib -lgcov + -Wl,-rpath=$(RUNPATH) -lgcov ifneq ($(CUDA),no) CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") diff --git a/UMFPACK/Tcov/Make.6 b/UMFPACK/Tcov/Make.6 index d73b3e5..d21fb1d 100644 --- a/UMFPACK/Tcov/Make.6 +++ b/UMFPACK/Tcov/Make.6 @@ -12,7 +12,7 @@ CF = -O0 -g --coverage -fPIC -fopenmp LDFLAGS = --coverage UMFPACK_CONFIG = -DTESTING -DNTIMER LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ - -Wl,-rpath=lib -lgcov + -Wl,-rpath=$(RUNPATH) -lgcov ifneq ($(CUDA),no) CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") diff --git a/UMFPACK/Tcov/Make.7 b/UMFPACK/Tcov/Make.7 index 2f7ad33..752936b 100644 --- a/UMFPACK/Tcov/Make.7 +++ b/UMFPACK/Tcov/Make.7 @@ -12,7 +12,7 @@ CF = -O0 -g --coverage -fPIC -fopenmp LDFLAGS = --coverage UMFPACK_CONFIG = -DNBLAS -DTEST_FOR_INTEGER_OVERFLOW -DTESTING -DNO_DIVIDE_BY_ZERO LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ - -Wl,-rpath=lib -lgcov + -Wl,-rpath=$(RUNPATH) -lgcov ifneq ($(CUDA),no) CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") diff --git a/UMFPACK/Tcov/Make.8 b/UMFPACK/Tcov/Make.8 index 80e29fc..14d3489 100644 --- a/UMFPACK/Tcov/Make.8 +++ b/UMFPACK/Tcov/Make.8 @@ -12,7 +12,7 @@ CF = -O0 -g --coverage -fPIC -fopenmp LDFLAGS = --coverage UMFPACK_CONFIG = -DTESTING -DNO_DIVIDE_BY_ZERO LDLIBS = -L$(INSTALL)/lib -llapack -lrefblas -lgfortran -lm -lrt \ - -Wl,-rpath=lib -lgcov + -Wl,-rpath=$(RUNPATH) -lgcov ifneq ($(CUDA),no) CUDA_PATH = $(shell which nvcc 2>/dev/null | sed "s/\/bin\/nvcc//") diff --git a/packaging/suitesparse.spec b/packaging/suitesparse.spec index a63d95f..593fe0b 100644 --- a/packaging/suitesparse.spec +++ b/packaging/suitesparse.spec @@ -1,13 +1,13 @@ -Name: suitesparse -Summary: %{name} -Version: 5.2.0 +Name: suitesparse +Summary: A collection of sparse matrix libraries +Version: 5.2.0 Release: 0 # ========================================================== -License: Apache-2.0 +License: GPL2.0+ AND LGPL2.1+ # ========================================================== -Group: Development/ROS +Group: Development/Libraries/C and C++ Source0: %{name}-%{version}.tar.gz Source1001: %{name}.manifest @@ -16,10 +16,17 @@ Source1001: %{name}.manifest # specifies build-time dependencies for the package # ========================================================== BuildRequires: cmake +BuildRequires: lapack-devel +BuildRequires: openblas-devel %description %{name} version %{version} +%package devel +Summary: A collection of sparse matrix libraries + +%description devel +%{name}-devel version %{version} %prep %setup -q @@ -30,6 +37,7 @@ cp %{SOURCE1001} . # how to actually build the software we are packaging # ========================================================== %build +%{make_build} library # ========================================================== @@ -37,8 +45,19 @@ cp %{SOURCE1001} . # how to actually build the software we are packaging # ========================================================== %install +mkdir -p %{buildroot}%{_libdir} +mkdir -p %{buildroot}%{_includedir} +mkdir -p %{buildroot}%{_datadir}/doc + +INSTALL_LIB=%{buildroot}%{_libdir} \ +INSTALL_INCLUDE=%{buildroot}%{_includedir} \ +INSTALL_DOC=%{buildroot}%{_datadir}/doc \ +RUNPATH=%{_libdir} \ +%{__make} install + +%remove_docs -%clean +%clean %post -p /sbin/ldconfig @@ -46,9 +65,18 @@ cp %{SOURCE1001} . # ========================================================== # files section -# The list of files that will be installed in the end +# The list of files that will be installed in the end # user’s system. # ========================================================== %files %manifest %{name}.manifest +%{_libdir}/libmetis.so +%{_libdir}/*.so.* + +%files devel +%manifest %{name}.manifest +%{_includedir}/*.h +%{_includedir}/*.hpp +%exclude %{_libdir}/libmetis.so +%{_libdir}/*.so -- 2.34.1