summaryrefslogtreecommitdiff
path: root/sci-libs/superlu
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sci-libs/superlu
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-libs/superlu')
-rw-r--r--sci-libs/superlu/Manifest11
-rw-r--r--sci-libs/superlu/files/superlu-4.3-autotools.patch584
-rw-r--r--sci-libs/superlu/files/superlu-4.3-format-security.patch16
-rw-r--r--sci-libs/superlu/files/superlu-5.2.1-no-implicits.patch153
-rw-r--r--sci-libs/superlu/files/superlu-5.2.1-pkgconfig.patch29
-rw-r--r--sci-libs/superlu/metadata.xml28
-rw-r--r--sci-libs/superlu/superlu-4.3-r1.ebuild73
-rw-r--r--sci-libs/superlu/superlu-5.2.1-r1.ebuild68
8 files changed, 962 insertions, 0 deletions
diff --git a/sci-libs/superlu/Manifest b/sci-libs/superlu/Manifest
new file mode 100644
index 000000000000..1f17b924827a
--- /dev/null
+++ b/sci-libs/superlu/Manifest
@@ -0,0 +1,11 @@
+AUX superlu-4.3-autotools.patch 18676 SHA256 6dea0fca12629825ec729fafa488ff2025cd950e93b768d5636fa4d05c760291 SHA512 62f868126af7acc3658bdff6eda8839d06dd14b5195d23a2b7bbbe1008e9258875ac3c9bc4ed40f4ac58443ac4aeef786499b02ff45f2adb304160f3b25b0bf3 WHIRLPOOL 68082a67aec45d6a94daa15d90727eebf2e2f67f3df85b7f6f08a253179c71d21b364822a15f1d9e2a107d56c1157ce995222ce42b5013d9b109bfa36adf8284
+AUX superlu-4.3-format-security.patch 312 SHA256 bd877b50b244617f5de8a7cd17e8743b00a79dffbfd043994cffca9c0e7f6730 SHA512 86072c671b946a73e8857fcf60499c589c0de8ca2433c2310701a2249eb32968e7ab83e638be1fcee3358d3b1432cba988cf11644962dbf09045b4907b9ebf6a WHIRLPOOL 924eb83342f1b99a01c668981ea38045baeb95252281dbcfc4cda9fbeabb1fcfd5dfdd64e4a9037ac5ea005245a393621d73d682ae47ae3ef7838ddec577377b
+AUX superlu-5.2.1-no-implicits.patch 4950 SHA256 c91906f2229f2c81944244612a2632b4e18b8196050da3a494d57ad2e7892495 SHA512 9bcf34847baddd7d330638d9115359cd2bd6d7630cc24a8fd9432b83485e6b2f1bb2500971f65b1fe26ec2ca70f7483105e1a02ba4083763ca79794dabe8551a WHIRLPOOL 501967ab12e8693cafa6709d3a2e871803149b93990dc146b205c46c82af311ed9bbbbb18b20e1f36e3deb2fdf85415c597bb168817c67dbda1a95b8a0918cc8
+AUX superlu-5.2.1-pkgconfig.patch 1013 SHA256 b69ca42c7c89335aaefc96677cf2b2fe6d8a5f1b852e0253e8bbf58e6eaedcb5 SHA512 f22dcbaaa6857008b75b8c6481b219b11c09ebcfe2dffe0a4d4f0cba6392f18fc9a5a870b2a8efa7c31df321b78186cbde7cf8739da59dc089fa3b6ae836bf36 WHIRLPOOL 158126f7dab0a599ec4b0c9d432f3754793c1024b076e9a301dc5d413e83512a3837d2278ee3c2d8ab5db5a6f8411087664adf45dc55a9a8516b9219873ca35e
+DIST superlu_4.3.tar.gz 2876631 SHA256 7aa08e75fba6b242aef20f10a31d7e052ad74ad29384e68d41a61d1d642f18da SHA512 5c13da47b79160be14719f62ccdf5d59142a172e25a988fa340eaeb001a64d7f45ba39e675cb7aa3571bec52cb3a7cda0bb7a708c9608184ba6251edb7990e8c WHIRLPOOL 034d924a736d101497df13f4f69d96b9e375c78a207df1615a7d22b639e24d755e9cb16e952c57ee8eece8d4ea7aa9f9d0576aaaee19ae0b0898698973864c15
+DIST superlu_5.2.1.tar.gz 2560875 SHA256 28fb66d6107ee66248d5cf508c79de03d0621852a0ddeba7301801d3d859f463 SHA512 30538b4c2809294b8f34646bce6445944f21a1dffaf3ec0a0f29a55d5261caa56e4279d7722bb95cc9d89450d36ded969617edc82ecce7d0f1dfb24040d80d07 WHIRLPOOL 25d08498b874ac2ee806759cb381b7cfc563a213da9793630031957bb9fe63983d8671f502b699b72615ffba9dd6a23ab33010bda67aba9663cba302414eeb8b
+EBUILD superlu-4.3-r1.ebuild 1625 SHA256 e859e71b774626ce7db21e9cd9559399ade127494f73dad62928740fae7079a6 SHA512 1f43902eb51afc5b238cda59885b85ad33cd310c7dd70fbc33b67222b39357d277b8f54b46c636101f232cc51b6ed2fb6456445cee35714e41882e0a9ee48909 WHIRLPOOL 436bf31efbe893793de0bdf3f352b10f26c9338904433043385a2a3fe3c1df52f84c184e94bbabb403062687f0ddd0fe93640516d327ee1b4f7d4b97b1967e46
+EBUILD superlu-5.2.1-r1.ebuild 1459 SHA256 29b9b0e15e261fb3ea078497d6ad69c3ae3ae47b75625f6ce3b969dfc9c0c543 SHA512 586d09b75c5f1517f035cd1979e3b47d8f26c372216437a09b3274494d7e04578c27426c8da522089fd1f7a72f5c8a952d48e028cbb725d818149e12f47f3ea7 WHIRLPOOL c0fac7cc95d6b82f4d189b6f0e9b13d2e5666d36acb5f5520618f1e9b08554fc7623e2a39022b603abf93884f683201f44d26b160de5e2baa3590e9612527b6c
+MISC ChangeLog 2851 SHA256 44f359dce2a3039299fa5fa9ff3e352c0326c7fbfadc51f102d6e2fb2dbc036c SHA512 ab4e4aea98bb65ad1df730d5315c27e254116b66818483fb79bdd92b9b6c7eb6fbb8223383702ff52ad20795204b5a840beb6c8a81db4ba58ed6b57b2f574366 WHIRLPOOL a411229a34b00ec6651444104412249169af9910b384e8abebadd0f1780fd6f255fbb426ae729be185ce13fa00a412f4b2e00ed192884b6841a47dbb92036413
+MISC ChangeLog-2015 5075 SHA256 20bd2312ceed248ef7ee7261d582962c9f4d13cde9f5aa59606a7e74f9243bbd SHA512 790a27620fb9efdef30073187a16c0bdbac1fcb745b9f43bb07836650a115892a70591cfb7625944fd7718212b94f025f59003dabd1460ad64086d3cb72f3d24 WHIRLPOOL 564f41836747b505a6016dddc5bab39af863279c4e761cda0034f7b58ffa00771458aa5b5966ebed54e89061cce04d24c3987b221e69192608df9079b12ae405
+MISC metadata.xml 1404 SHA256 51261bee09cffe52539937c7e23b1f7d6ee87798659ad00d25ca55779299c923 SHA512 8b758572ed599bdf43898050e265ce8ea82c4952af97471c09ee0013e56cf6928df3f3a436516c4fae7a38a13bba4a3437e130f294f942eaaae05125fa5fbdea WHIRLPOOL 71178833c9395ad75ab5fec4c3ba1c93373cdaaa07ba8421dfd2fc63a009c4a81ccf2716205797dfafb34ed3d47f284b0f2d546bf242a4c57253419ae8da2a2b
diff --git a/sci-libs/superlu/files/superlu-4.3-autotools.patch b/sci-libs/superlu/files/superlu-4.3-autotools.patch
new file mode 100644
index 000000000000..c5aae0159344
--- /dev/null
+++ b/sci-libs/superlu/files/superlu-4.3-autotools.patch
@@ -0,0 +1,584 @@
+ EXAMPLE/Makefile | 68 +++++++++---------
+ FORTRAN/Makefile | 14 ++--
+ Makefile.am | 4 +
+ SRC/Makefile.am | 110 +++++++++++++++++++++++++++++
+ ax_blas.m4 | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ configure.ac | 16 ++++
+ superlu.pc.in | 13 ++++
+ 7 files changed, 385 insertions(+), 41 deletions(-)
+
+diff --git a/EXAMPLE/Makefile b/EXAMPLE/Makefile
+index c286ded..37950dc 100644
+--- a/EXAMPLE/Makefile
++++ b/EXAMPLE/Makefile
+@@ -1,4 +1,3 @@
+-include ../make.inc
+
+ #######################################################################
+ # This makefile creates the example programs for the linear equation
+@@ -32,7 +31,9 @@ include ../make.inc
+ #
+ #######################################################################
+
+-HEADER = ../SRC
++HEADER = $(shell pkg-config --cflags superlu)
++LIBS = $(shell pkg-config --libs superlu)
++CDEFS = -DAdd_
+
+ SLINEXM = slinsol.o
+ SLINEXM1 = slinsol1.o
+@@ -67,7 +68,6 @@ ZLINXEXM2 = zlinsolx2.o
+ ZITSOL = zitersol.o zfgmr.o
+ ZITSOL1 = zitersol1.o zfgmr.o
+
+-
+ all: single double complex complex16
+
+ single: slinsol slinsol1 slinsolx slinsolx1 slinsolx2 sitersol sitersol1
+@@ -77,97 +77,97 @@ complex: clinsol clinsol1 clinsolx clinsolx1 clinsolx2 citersol citersol1
+ complex16: zlinsol zlinsol1 zlinsolx zlinsolx1 zlinsolx2 zitersol zitersol1
+
+ slinsol: $(SLINEXM) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(SLINEXM) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(SLINEXM) $(LIBS) -o $@
+
+ slinsol1: $(SLINEXM1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(SLINEXM1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(SLINEXM1) $(LIBS) -o $@
+
+ slinsolx: $(SLINXEXM) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(SLINXEXM) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(SLINXEXM) $(LIBS) -o $@
+
+ slinsolx1: $(SLINXEXM1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(SLINXEXM1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(SLINXEXM1) $(LIBS) -o $@
+
+ slinsolx2: $(SLINXEXM2) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(SLINXEXM2) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(SLINXEXM2) $(LIBS) -o $@
+
+ sitersol: $(SITSOL) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(SITSOL) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(SITSOL) $(LIBS) -o $@
+
+ sitersol1: $(SITSOL1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(SITSOL1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(SITSOL1) $(LIBS) -o $@
+
+ dlinsol: $(DLINEXM) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(DLINEXM) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(DLINEXM) $(LIBS) -o $@
+
+ dlinsol1: $(DLINEXM1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(DLINEXM1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(DLINEXM1) $(LIBS) -o $@
+
+ dlinsolx: $(DLINXEXM) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(DLINXEXM) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(DLINXEXM) $(LIBS) -o $@
+
+ dlinsolx1: $(DLINXEXM1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(DLINXEXM1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(DLINXEXM1) $(LIBS) -o $@
+
+ dlinsolx2: $(DLINXEXM2) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(DLINXEXM2) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(DLINXEXM2) $(LIBS) -o $@
+
+ superlu: $(SUPERLUEXM) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(SUPERLUEXM) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(SUPERLUEXM) $(LIBS) -o $@
+
+ ditersol: $(DITSOL) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(DITSOL) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(DITSOL) $(LIBS) -o $@
+
+ ditersol1: $(DITSOL1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(DITSOL1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(DITSOL1) $(LIBS) -o $@
+
+ clinsol: $(CLINEXM) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(CLINEXM) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(CLINEXM) $(LIBS) -o $@
+
+ clinsol1: $(CLINEXM1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(CLINEXM1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(CLINEXM1) $(LIBS) -o $@
+
+ clinsolx: $(CLINXEXM) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(CLINXEXM) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(CLINXEXM) $(LIBS) -o $@
+
+ clinsolx1: $(CLINXEXM1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(CLINXEXM1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(CLINXEXM1) $(LIBS) -o $@
+
+ clinsolx2: $(CLINXEXM2) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(CLINXEXM2) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(CLINXEXM2) $(LIBS) -o $@
+
+ citersol: $(CITSOL) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(CITSOL) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(CITSOL) $(LIBS) -o $@
+
+ citersol1: $(CITSOL1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(CITSOL1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(CITSOL1) $(LIBS) -o $@
+
+ zlinsol: $(ZLINEXM) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(ZLINEXM) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(ZLINEXM) $(LIBS) -o $@
+
+ zlinsol1: $(ZLINEXM1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(ZLINEXM1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(ZLINEXM1) $(LIBS) -o $@
+
+ zlinsolx: $(ZLINXEXM) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(ZLINXEXM) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(ZLINXEXM) $(LIBS) -o $@
+
+ zlinsolx1: $(ZLINXEXM1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(ZLINXEXM1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(ZLINXEXM1) $(LIBS) -o $@
+
+ zlinsolx2: $(ZLINXEXM2) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(ZLINXEXM2) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(ZLINXEXM2) $(LIBS) -o $@
+
+ zitersol: $(ZITSOL) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(ZITSOL) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAGS) $(ZITSOL) $(LIBS) -o $@
+
+ zitersol1: $(ZITSOL1) $(SUPERLULIB)
+- $(LOADER) $(LOADOPTS) $(ZITSOL1) $(LIBS) -lm -o $@
++ $(LD) $(LDFLAG) $(ZITSOL1) $(LIBS) -o $@
+
+ .c.o:
+- $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE)
++ $(CC) $(CFLAGS) $(CDEFS) $(HEADER) -c $< $(VERBOSE)
+
+ .f.o:
+- $(FORTRAN) $(FFLAGS) -c $< $(VERBOSE)
++ $(FC) $(FFLAGS) -c $< $(VERBOSE)
+
+ clean:
+ rm -f *.o *linsol *linsol1 *linsolx *linsolx1 *linsolx2 \
+diff --git a/FORTRAN/Makefile b/FORTRAN/Makefile
+index 23671a7..54da751 100644
+--- a/FORTRAN/Makefile
++++ b/FORTRAN/Makefile
+@@ -1,12 +1,12 @@
+-include ../make.inc
++#include ../make.inc
+
+ #######################################################################
+ # This makefile creates the Fortran example interface to use the
+ # C routines in SuperLU.
+ #######################################################################
+
+-HEADER = ../SRC
+-LIBS = $(SUPERLULIB) $(BLASLIB) -lm
++HEADER = $(shell pkg-config --cflags superlu)
++LIBS = $(shell pkg-config --libs superlu)
+
+ # double real
+ F77EXM = f77_main.o hbcode1.o c_fortran_dgssv.o
+@@ -17,19 +17,19 @@ ZF77EXM = z_f77_main.o zhbcode1.o c_fortran_zgssv.o
+ all: f77exm zf77exm
+
+ f77exm: $(F77EXM) $(SUPERLULIB)
+- $(FORTRAN) $(LOADOPTS) $(F77EXM) $(LIBS) -o $@
++ $(FC) $(LDFLAGS) $(F77EXM) $(LIBS) -o $@
+
+ zf77exm: $(ZF77EXM) $(SUPERLULIB)
+ $(FORTRAN) $(LOADOPTS) $(ZF77EXM) $(LIBS) -o $@
+
+ c_fortran_zgssv.o: c_fortran_zgssv.c
+- $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE)
++ $(CC) $(CFLAGS) $(CDEFS) $(HEADER) -c $< $(VERBOSE)
+
+ .c.o:
+- $(CC) $(CFLAGS) $(CDEFS) -I$(HEADER) -c $< $(VERBOSE)
++ $(CC) $(CFLAGS) $(CDEFS) $(HEADER) -c $< $(VERBOSE)
+
+ .f.o:
+- $(FORTRAN) $(FFLAGS) -c $< $(VERBOSE)
++ $(FC) $(FFLAGS) -c $< $(VERBOSE)
+
+ clean:
+ rm -f *.o f77exm zf77exm
+diff --git a/Makefile.am b/Makefile.am
+new file mode 100644
+index 0000000..7e51046
+--- /dev/null
++++ b/Makefile.am
+@@ -0,0 +1,4 @@
++SUBDIRS = SRC
++
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = superlu.pc
+diff --git a/SRC/Makefile.am b/SRC/Makefile.am
+new file mode 100644
+index 0000000..748e5e9
+--- /dev/null
++++ b/SRC/Makefile.am
+@@ -0,0 +1,110 @@
++AM_CPPFLAGS = -DAdd_
++
++### headers
++noinst_HEADERS = \
++ colamd.h \
++ html_mainpage.h
++
++src_includedir = $(includedir)/superlu
++src_include_HEADERS = \
++ slu_cdefs.h \
++ slu_ddefs.h \
++ slu_sdefs.h \
++ slu_zdefs.h \
++ slu_Cnames.h \
++ slu_dcomplex.h \
++ slu_scomplex.h \
++ slu_util.h \
++ superlu_enum_consts.h \
++ supermatrix.h
++
++### LAPACK
++LAAUX = lsame.c xerbla.c
++SLASRC = slacon.c
++DLASRC = dlacon.c
++CLASRC = clacon.c scsum1.c icmax1.c
++ZLASRC = zlacon.c dzsum1.c izmax1.c
++
++
++##################################
++# Do not optimize these routines #
++##################################
++CFLAGS_SAV=@CFLAGS@
++CFLAGS=
++noinst_LTLIBRARIES = libnoopt.la
++libnoopt_la_SOURCES = slamch.c dlamch.c superlu_timer.c
++libnoopt_la_CFLAGS = -O0
++
++### SuperLU
++ALLAUX = util.c memory.c get_perm_c.c mmd.c \
++ sp_coletree.c sp_preorder.c sp_ienv.c relax_snode.c \
++ heap_relax_snode.c colamd.c \
++ ilu_relax_snode.c ilu_heap_relax_snode.c mark_relax.c \
++ mc64ad.f qselect.f
++
++SLUSRC = \
++ sgssv.c sgssvx.c \
++ ssp_blas2.c ssp_blas3.c sgscon.c \
++ slangs.c sgsequ.c slaqgs.c spivotgrowth.c \
++ sgsrfs.c sgstrf.c sgstrs.c scopy_to_ucol.c \
++ ssnode_dfs.c ssnode_bmod.c \
++ spanel_dfs.c spanel_bmod.c sreadhb.c \
++ scolumn_dfs.c scolumn_bmod.c spivotL.c spruneL.c \
++ smemory.c sutil.c smyblas2.c \
++ sgsisx.c sgsitrf.c sldperm.c \
++ ilu_sdrop_row.c ilu_ssnode_dfs.c \
++ ilu_scolumn_dfs.c ilu_spanel_dfs.c ilu_scopy_to_ucol.c \
++ ilu_spivotL.c sdiagonal.c
++
++DLUSRC = \
++ dgssv.c dgssvx.c \
++ dsp_blas2.c dsp_blas3.c dgscon.c \
++ dlangs.c dgsequ.c dlaqgs.c dpivotgrowth.c \
++ dgsrfs.c dgstrf.c dgstrs.c dcopy_to_ucol.c \
++ dsnode_dfs.c dsnode_bmod.c \
++ dpanel_dfs.c dpanel_bmod.c dreadhb.c \
++ dcolumn_dfs.c dcolumn_bmod.c dpivotL.c dpruneL.c \
++ dmemory.c dutil.c dmyblas2.c \
++ dgsisx.c dgsitrf.c \
++ dldperm.c \
++ ilu_ddrop_row.c ilu_dsnode_dfs.c \
++ ilu_dcolumn_dfs.c ilu_dpanel_dfs.c ilu_dcopy_to_ucol.c \
++ ilu_dpivotL.c ddiagonal.c
++
++CLUSRC = \
++ scomplex.c cgssv.c cgssvx.c csp_blas2.c csp_blas3.c cgscon.c \
++ clangs.c cgsequ.c claqgs.c cpivotgrowth.c \
++ cgsrfs.c cgstrf.c cgstrs.c ccopy_to_ucol.c \
++ csnode_dfs.c csnode_bmod.c \
++ cpanel_dfs.c cpanel_bmod.c creadhb.c \
++ ccolumn_dfs.c ccolumn_bmod.c cpivotL.c cpruneL.c \
++ cmemory.c cutil.c cmyblas2.c \
++ cgsisx.c cgsitrf.c cldperm.c \
++ ilu_cdrop_row.c ilu_csnode_dfs.c \
++ ilu_ccolumn_dfs.c ilu_cpanel_dfs.c ilu_ccopy_to_ucol.c \
++ ilu_cpivotL.c cdiagonal.c
++
++ZLUSRC = \
++ dcomplex.c zgssv.c zgssvx.c zsp_blas2.c zsp_blas3.c zgscon.c \
++ zlangs.c zgsequ.c zlaqgs.c zpivotgrowth.c \
++ zgsrfs.c zgstrf.c zgstrs.c zcopy_to_ucol.c \
++ zsnode_dfs.c zsnode_bmod.c \
++ zpanel_dfs.c zpanel_bmod.c zreadhb.c \
++ zcolumn_dfs.c zcolumn_bmod.c zpivotL.c zpruneL.c \
++ zmemory.c zutil.c zmyblas2.c \
++ zgsisx.c zgsitrf.c zldperm.c \
++ ilu_zdrop_row.c ilu_zsnode_dfs.c \
++ ilu_zcolumn_dfs.c ilu_zpanel_dfs.c ilu_zcopy_to_ucol.c \
++ ilu_zpivotL.c zdiagonal.c
++
++lib_LTLIBRARIES = libsuperlu.la
++libsuperlu_la_SOURCES = \
++ $(NOOPTAUX) \
++ $(ALLAUX) $(LAAUX) \
++ $(SLUSRC) $(SLASRC) \
++ $(DLUSRC) $(DLASRC) \
++ $(CLUSRC) $(CLASRC) \
++ $(ZLUSRC) $(ZLASRC)
++libsuperlu_la_CFLAGS = $(CFLAGS_SAV)
++libsuperlu_la_LIBADD = $(BLAS_LIBS) libnoopt.la
++libsuperlu_la_LDFLAGS = -no-undefined -version-info 4:2:0
+diff --git a/ax_blas.m4 b/ax_blas.m4
+new file mode 100644
+index 0000000..e4f96cb
+--- /dev/null
++++ b/ax_blas.m4
+@@ -0,0 +1,201 @@
++# ===========================================================================
++# http://www.gnu.org/software/autoconf-archive/ax_blas.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
++#
++# DESCRIPTION
++#
++# This macro looks for a library that implements the BLAS linear-algebra
++# interface (see http://www.netlib.org/blas/). On success, it sets the
++# BLAS_LIBS output variable to hold the requisite library linkages.
++#
++# To link with BLAS, you should link with:
++#
++# $BLAS_LIBS $LIBS $FLIBS
++#
++# in that order. FLIBS is the output variable of the
++# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is
++# sometimes necessary in order to link with F77 libraries. Users will also
++# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same
++# reason.
++#
++# Many libraries are searched for, from ATLAS to CXML to ESSL. The user
++# may also use --with-blas=<lib> in order to use some specific BLAS
++# library <lib>. In order to link successfully, however, be aware that you
++# will probably need to use the same Fortran compiler (which can be set
++# via the F77 env. var.) as was used to compile the BLAS library.
++#
++# ACTION-IF-FOUND is a list of shell commands to run if a BLAS library is
++# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is
++# not found. If ACTION-IF-FOUND is not specified, the default action will
++# define HAVE_BLAS.
++#
++# LICENSE
++#
++# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation, either version 3 of the License, or (at your
++# option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program. If not, see <http://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 11
++
++AU_ALIAS([ACX_BLAS], [AX_BLAS])
++AC_DEFUN([AX_BLAS], [
++AC_PREREQ(2.50)
++AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
++ax_blas_ok=no
++
++AC_ARG_WITH(blas,
++ [AS_HELP_STRING([--with-blas=<lib>], [use BLAS library <lib>])])
++case $with_blas in
++ yes | "") ;;
++ no) ax_blas_ok=disable ;;
++ -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;;
++ *) BLAS_LIBS="-l$with_blas" ;;
++esac
++
++# Get fortran linker names of BLAS functions to check for.
++AC_F77_FUNC(sgemm)
++AC_F77_FUNC(dgemm)
++
++ax_blas_save_LIBS="$LIBS"
++LIBS="$LIBS $FLIBS"
++
++# First, check BLAS_LIBS environment variable
++if test $ax_blas_ok = no; then
++if test "x$BLAS_LIBS" != x; then
++ save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
++ AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS])
++ AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes], [BLAS_LIBS=""])
++ AC_MSG_RESULT($ax_blas_ok)
++ LIBS="$save_LIBS"
++fi
++fi
++
++# BLAS linked to by default? (happens on some supercomputers)
++if test $ax_blas_ok = no; then
++ save_LIBS="$LIBS"; LIBS="$LIBS"
++ AC_MSG_CHECKING([if $sgemm is being linked in already])
++ AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes])
++ AC_MSG_RESULT($ax_blas_ok)
++ LIBS="$save_LIBS"
++fi
++
++# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
++if test $ax_blas_ok = no; then
++ AC_CHECK_LIB(atlas, ATL_xerbla,
++ [AC_CHECK_LIB(f77blas, $sgemm,
++ [AC_CHECK_LIB(cblas, cblas_dgemm,
++ [ax_blas_ok=yes
++ BLAS_LIBS="-lcblas -lf77blas -latlas"],
++ [], [-lf77blas -latlas])],
++ [], [-latlas])])
++fi
++
++# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
++if test $ax_blas_ok = no; then
++ AC_CHECK_LIB(blas, $sgemm,
++ [AC_CHECK_LIB(dgemm, $dgemm,
++ [AC_CHECK_LIB(sgemm, $sgemm,
++ [ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"],
++ [], [-lblas])],
++ [], [-lblas])])
++fi
++
++# BLAS in Intel MKL library?
++if test $ax_blas_ok = no; then
++ AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl"])
++fi
++
++# BLAS in Apple vecLib library?
++if test $ax_blas_ok = no; then
++ save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
++ AC_MSG_CHECKING([for $sgemm in -framework vecLib])
++ AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
++ AC_MSG_RESULT($ax_blas_ok)
++ LIBS="$save_LIBS"
++fi
++
++# BLAS in Alpha CXML library?
++if test $ax_blas_ok = no; then
++ AC_CHECK_LIB(cxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lcxml"])
++fi
++
++# BLAS in Alpha DXML library? (now called CXML, see above)
++if test $ax_blas_ok = no; then
++ AC_CHECK_LIB(dxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-ldxml"])
++fi
++
++# BLAS in Sun Performance library?
++if test $ax_blas_ok = no; then
++ if test "x$GCC" != xyes; then # only works with Sun CC
++ AC_CHECK_LIB(sunmath, acosp,
++ [AC_CHECK_LIB(sunperf, $sgemm,
++ [BLAS_LIBS="-xlic_lib=sunperf -lsunmath"
++ ax_blas_ok=yes],[],[-lsunmath])])
++ fi
++fi
++
++# BLAS in SCSL library? (SGI/Cray Scientific Library)
++if test $ax_blas_ok = no; then
++ AC_CHECK_LIB(scs, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lscs"])
++fi
++
++# BLAS in SGIMATH library?
++if test $ax_blas_ok = no; then
++ AC_CHECK_LIB(complib.sgimath, $sgemm,
++ [ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"])
++fi
++
++# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
++if test $ax_blas_ok = no; then
++ AC_CHECK_LIB(blas, $sgemm,
++ [AC_CHECK_LIB(essl, $sgemm,
++ [ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas"],
++ [], [-lblas $FLIBS])])
++fi
++
++# Generic BLAS library?
++if test $ax_blas_ok = no; then
++ AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"])
++fi
++
++AC_SUBST(BLAS_LIBS)
++
++LIBS="$ax_blas_save_LIBS"
++
++# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
++if test x"$ax_blas_ok" = xyes; then
++ ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])
++ :
++else
++ ax_blas_ok=no
++ $2
++fi
++])dnl AX_BLAS
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 0000000..f6707be
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,16 @@
++# -*- Autoconf -*-
++AC_PREREQ(2.59)
++AC_INIT(superlu, 4.3, xsli@lbl.gov)
++AM_INIT_AUTOMAKE([foreign])
++AC_CONFIG_HEADER([config.h])
++AC_PROG_INSTALL
++AC_PROG_LIBTOOL
++AC_PROG_F77
++sinclude(ax_blas.m4)
++AX_BLAS
++if test x"$BLAS_LIBS" = x; then
++ AC_MSG_ERROR([Cannot find blas libraries])
++fi
++AC_CHECK_LIB([m], [floor])
++AC_CONFIG_FILES([Makefile SRC/Makefile superlu.pc])
++AC_OUTPUT
+diff --git a/superlu.pc.in b/superlu.pc.in
+new file mode 100644
+index 0000000..7bf9942
+--- /dev/null
++++ b/superlu.pc.in
+@@ -0,0 +1,13 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: @PACKAGE_NAME@
++Description: Sparse LU factorization library
++Version: @PACKAGE_VERSION@
++URL: http://crd.lbl.gov/~xiaoye/SuperLU/
++Libs: -L${libdir} -lsuperlu
++Libs.private: -lm @FLIBS@
++Requires: blas
++Cflags: -I${includedir}/superlu
diff --git a/sci-libs/superlu/files/superlu-4.3-format-security.patch b/sci-libs/superlu/files/superlu-4.3-format-security.patch
new file mode 100644
index 000000000000..809408a166ab
--- /dev/null
+++ b/sci-libs/superlu/files/superlu-4.3-format-security.patch
@@ -0,0 +1,16 @@
+ SRC/util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/SRC/util.c b/SRC/util.c
+index 858fbbc..c038ccf 100644
+--- a/SRC/util.c
++++ b/SRC/util.c
+@@ -29,7 +29,7 @@
+
+ void superlu_abort_and_exit(char* msg)
+ {
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ exit (-1);
+ }
+
diff --git a/sci-libs/superlu/files/superlu-5.2.1-no-implicits.patch b/sci-libs/superlu/files/superlu-5.2.1-no-implicits.patch
new file mode 100644
index 000000000000..587380ce2e35
--- /dev/null
+++ b/sci-libs/superlu/files/superlu-5.2.1-no-implicits.patch
@@ -0,0 +1,153 @@
+diff --git a/SRC/clacon2.c b/SRC/clacon2.c
+index 107bb64..39deb83 100644
+--- a/SRC/clacon2.c
++++ b/SRC/clacon2.c
+@@ -106,6 +106,11 @@ clacon2_(int *n, complex *v, complex *x, float *est, int *kase, int isave[3])
+ extern float smach(char *);
+ extern int icmax1_slu(int *, complex *, int *);
+ extern double scsum1_slu(int *, complex *, int *);
++#ifdef _CRAY
++ extern int CCOPY(int *, complex *, int *, complex [], int *);
++#else
++ extern int ccopy_(int *, complex *, int *, complex [], int *);
++#endif
+
+ safmin = smach("Safe minimum"); /* lamch_("Safe minimum"); */
+ if ( *kase == 0 ) {
+diff --git a/SRC/dmach.c b/SRC/dmach.c
+index 73beacb..cafdf1c 100644
+--- a/SRC/dmach.c
++++ b/SRC/dmach.c
+@@ -11,6 +11,7 @@ at the top-level directory.
+ #include <float.h>
+ #include <math.h>
+ #include <stdio.h>
++#include <string.h>
+
+ double dmach(char *cmach)
+ {
+diff --git a/SRC/ilu_cdrop_row.c b/SRC/ilu_cdrop_row.c
+index 4987548..09b8a93 100644
+--- a/SRC/ilu_cdrop_row.c
++++ b/SRC/ilu_cdrop_row.c
+@@ -28,6 +28,7 @@ extern void caxpy_(int *, complex *, complex [], int *, complex [], int *);
+ extern void ccopy_(int *, complex [], int *, complex [], int *);
+ extern float scasum_(int *, complex *, int *);
+ extern float scnrm2_(int *, complex *, int *);
++extern void scopy_(int *, float [], int *, float [], int *);
+ extern double dnrm2_(int *, double [], int *);
+ extern int icamax_(int *, complex [], int *);
+
+diff --git a/SRC/ilu_zdrop_row.c b/SRC/ilu_zdrop_row.c
+index f434dd9..2de1226 100644
+--- a/SRC/ilu_zdrop_row.c
++++ b/SRC/ilu_zdrop_row.c
+@@ -29,6 +29,7 @@ extern void zcopy_(int *, doublecomplex [], int *, doublecomplex [], int *);
+ extern double dzasum_(int *, doublecomplex *, int *);
+ extern double dznrm2_(int *, doublecomplex *, int *);
+ extern double dnrm2_(int *, double [], int *);
++extern void dcopy_(int *, double [], int *, double [], int *);
+ extern int izamax_(int *, doublecomplex [], int *);
+
+ static double *A; /* used in _compare_ only */
+diff --git a/SRC/slacon2.c b/SRC/slacon2.c
+index 7c93341..50efe78 100644
+--- a/SRC/slacon2.c
++++ b/SRC/slacon2.c
+@@ -157,7 +157,7 @@ L40:
+ #ifdef _CRAY
+ isave[1] = ISAMAX(n, &x[0], &c__1); /* j */
+ #else
+- isave[1] = idamax_(n, &x[0], &c__1); /* j */
++ isave[1] = isamax_(n, &x[0], &c__1); /* j */
+ #endif
+ --isave[1]; /* --j; */
+ isave[2] = 2; /* iter = 2; */
+diff --git a/SRC/smach.c b/SRC/smach.c
+index fff6c5f..0b69991 100644
+--- a/SRC/smach.c
++++ b/SRC/smach.c
+@@ -11,6 +11,7 @@ at the top-level directory.
+ #include <float.h>
+ #include <math.h>
+ #include <stdio.h>
++#include <string.h>
+
+ float smach(char *cmach)
+ {
+diff --git a/SRC/sp_ienv.c b/SRC/sp_ienv.c
+index 855d901..ce2865e 100644
+--- a/SRC/sp_ienv.c
++++ b/SRC/sp_ienv.c
+@@ -24,6 +24,7 @@ at the top-level directory.
+ * History: Modified from lapack routine ILAENV
+ */
+ #include "slu_Cnames.h"
++extern int input_error(char *, int *);
+
+ /*! \brief
+
+diff --git a/SRC/zlacon2.c b/SRC/zlacon2.c
+index b43c619..ed5f2b7 100644
+--- a/SRC/zlacon2.c
++++ b/SRC/zlacon2.c
+@@ -106,6 +106,11 @@ zlacon2_(int *n, doublecomplex *v, doublecomplex *x, double *est, int *kase, int
+ extern double dmach(char *);
+ extern int izmax1_slu(int *, doublecomplex *, int *);
+ extern double dzsum1_slu(int *, doublecomplex *, int *);
++#ifdef _CRAY
++ extern int CCOPY(int *, doublecomplex *, int *, doublecomplex *, int *);
++#else
++ extern int zcopy_(int *, doublecomplex *, int *, doublecomplex *, int *);
++#endif
+
+ safmin = dmach("Safe minimum"); /* lamch_("Safe minimum"); */
+ if ( *kase == 0 ) {
+diff --git a/TESTING/zdrive.c b/TESTING/zdrive.c
+index 23e96fc..1e7d0aa 100644
+--- a/TESTING/zdrive.c
++++ b/TESTING/zdrive.c
+@@ -21,6 +21,7 @@ at the top-level directory.
+ * Purpose: MAIN test program
+ */
+ #include <string.h>
++#include <unistd.h>
+ #include "slu_zdefs.h"
+
+ #define NTESTS 5 /* Number of test types */
+diff --git a/TESTING/cdrive.c b/TESTING/cdrive.c
+index 8bc8d10..00fe0d8 100644
+--- a/TESTING/cdrive.c
++++ b/TESTING/cdrive.c
+@@ -21,6 +21,7 @@ at the top-level directory.
+ * Purpose: MAIN test program
+ */
+ #include <string.h>
++#include <unistd.h>
+ #include "slu_cdefs.h"
+
+ #define NTESTS 5 /* Number of test types */
+diff --git a/TESTING/sdrive.c b/TESTING/sdrive.c
+index 5b98038..cba0c83 100644
+--- a/TESTING/sdrive.c
++++ b/TESTING/sdrive.c
+@@ -21,6 +21,7 @@ at the top-level directory.
+ * Purpose: MAIN test program
+ */
+ #include <string.h>
++#include <unistd.h>
+ #include "slu_sdefs.h"
+
+ #define NTESTS 5 /* Number of test types */
+diff --git a/TESTING/ddrive.c b/TESTING/ddrive.c
+index 2c3f6fe..35685c5 100644
+--- a/TESTING/ddrive.c
++++ b/TESTING/ddrive.c
+@@ -21,6 +21,7 @@ at the top-level directory.
+ * Purpose: MAIN test program
+ */
+ #include <string.h>
++#include <unistd.h>
+ #include "slu_ddefs.h"
+
+ #define NTESTS 5 /* Number of test types */
diff --git a/sci-libs/superlu/files/superlu-5.2.1-pkgconfig.patch b/sci-libs/superlu/files/superlu-5.2.1-pkgconfig.patch
new file mode 100644
index 000000000000..63252dffdb57
--- /dev/null
+++ b/sci-libs/superlu/files/superlu-5.2.1-pkgconfig.patch
@@ -0,0 +1,29 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d8abc1b..5883b34 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -143,3 +143,6 @@ endif()
+ # ${CMAKE_C_COMPILER} )
+ configure_file(${CMAKE_SOURCE_DIR}/make.inc.in ${CMAKE_SOURCE_DIR}/make.inc)
+
++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/superlu.pc.in ${CMAKE_CURRENT_BINARY_DIR}/superlu.pc @ONLY)
++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/superlu.pc
++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+diff --git a/superlu.pc.in b/superlu.pc.in
+new file mode 100644
+index 0000000..09b1fff
+--- /dev/null
++++ b/superlu.pc.in
+@@ -0,0 +1,12 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
++includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
++
++Name: @CMAKE_PROJECT_NAME@
++Description: Direct solution of large, sparse systems of linear equations
++Version: @PROJECT_VERSION@
++URL: http://crd-legacy.lbl.gov/~xiaoye/SuperLU/
++
++Libs: -L${libdir} -lsuperlu
++Libs.private: @BLAS_LIB@ -lm
++Cflags: -I${includedir}
diff --git a/sci-libs/superlu/metadata.xml b/sci-libs/superlu/metadata.xml
new file mode 100644
index 000000000000..01512c58f866
--- /dev/null
+++ b/sci-libs/superlu/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ SuperLU is a general purpose library for the direct solution of large,
+ sparse, nonsymmetric systems of linear equations on high performance
+ machines. The library is written in C and is callable from either C or
+ Fortran. The library routines will perform an LU decomposition with
+ partial pivoting and triangular system solves through forward and back
+ substitution. The LU factorization routines can handle non-square
+ matrices but the triangular solves are performed only for square
+ matrices. The matrix columns may be preordered (before factorization)
+ either through library or user supplied routines. This preordering for
+ sparsity is completely separate from the factorization. Working
+ precision iterative refinement subroutines are provided for improved
+ backward stability. Routines are also provided to equilibrate the
+ system, estimate the condition number, calculate the relative backward
+ error, and estimate error bounds for the refined solutions.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">xiaoyeli/superlu</remote-id>
+ </upstream>
+
+</pkgmetadata>
diff --git a/sci-libs/superlu/superlu-4.3-r1.ebuild b/sci-libs/superlu/superlu-4.3-r1.ebuild
new file mode 100644
index 000000000000..27da140292af
--- /dev/null
+++ b/sci-libs/superlu/superlu-4.3-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils fortran-2 toolchain-funcs multilib
+
+MY_PN=SuperLU
+
+DESCRIPTION="Sparse LU factorization library"
+HOMEPAGE="http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
+SRC_URI="${HOMEPAGE}/${PN}_${PV}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ppc ppc64 x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples static-libs test"
+
+RDEPEND="
+ virtual/blas"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( app-shells/tcsh )"
+
+S="${WORKDIR}/${MY_PN}_${PV}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-autotools.patch
+ "${FILESDIR}"/${P}-format-security.patch
+ )
+
+src_prepare() {
+ unset VERBOSE
+ sed \
+ -e "s:= ar:= $(tc-getAR):g" \
+ -e "s:= ranlib:= $(tc-getRANLIB):g" \
+ -i make.inc || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=( --with-blas="$($(tc-getPKG_CONFIG) --libs blas)" )
+ autotools-utils_src_configure
+ rm EXAMPLE/*itersol1 || die
+}
+
+src_test() {
+ cd "${BUILD_DIR}"/TESTING
+ emake -j1 \
+ CC="$(tc-getCC)" \
+ FORTRAN="$(tc-getFC)" \
+ LOADER="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ FFLAGS="${FFLAGS}" \
+ LOADOPTS="${LDFLAGS}" \
+ BLASLIB="$($(tc-getPKG_CONFIG) --libs blas)" \
+ SUPERLULIB="${S}/SRC/.libs/libsuperlu$(get_libname)" \
+ LD_LIBRARY_PATH="${S}/SRC/.libs" \
+ DYLD_LIBRARY_PATH="${S}/SRC/.libs"
+}
+
+src_install() {
+ autotools-utils_src_install
+ use doc && dodoc DOC/ug.pdf && dohtml DOC/html/*
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r EXAMPLE FORTRAN
+ fi
+}
diff --git a/sci-libs/superlu/superlu-5.2.1-r1.ebuild b/sci-libs/superlu/superlu-5.2.1-r1.ebuild
new file mode 100644
index 000000000000..8f2fa083bb98
--- /dev/null
+++ b/sci-libs/superlu/superlu-5.2.1-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+FORTRAN_STANDARD=77
+
+inherit cmake-utils fortran-2
+
+MY_PN=SuperLU
+
+if [[ ${PV} != *9999* ]]; then
+ inherit versionator
+ SRC_URI="http://crd-legacy.lbl.gov/~xiaoye/SuperLU//${PN}_${PV}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+ SLOT="0/$(get_major_version)"
+ S="${WORKDIR}/SuperLU_${PV}"
+else
+ inherit git-r3
+ GIT_ECLASS="git-r3"
+ EGIT_REPO_URI="https://github.com/xiaoyeli/${PN}"
+ SLOT="0/9999"
+ KEYWORDS="~arm64 ~hppa ~ia64"
+fi
+
+DESCRIPTION="Sparse LU factorization library"
+HOMEPAGE="http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
+LICENSE="BSD"
+
+IUSE="doc examples test"
+
+RDEPEND="virtual/blas"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( app-shells/tcsh )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-no-implicits.patch
+ "${FILESDIR}"/${P}-pkgconfig.patch
+)
+
+S="${WORKDIR}/${MY_PN}_${PV}"
+
+src_prepare() {
+ default
+ # respect user's CFLAGS
+ sed -i -e 's/O3//' CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs+=(
+ -DCMAKE_INSTALL_INCLUDEDIR="include/superlu"
+ -DBUILD_SHARED_LIBS=ON
+ -Denable_blaslib=OFF
+ -Denable_tests=$(usex test)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ use doc && dodoc -r DOC/html
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins -r EXAMPLE FORTRAN
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+}