Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. # $OpenBSD: Makefile,v 1.5 2017/02/27 23:08:14 jca Exp $
  2. BROKEN-hppa= undefined refs to dtrsv/dgemv/dtrsm/dgemm/dger in libumfpack.a
  3. COMMENT= suite of sparse matrix algorithms
  4. DISTNAME= SuiteSparse-4.4.6
  5. PKGNAME= ${DISTNAME:L}
  6. CATEGORIES= math
  7. HOMEPAGE= http://faculty.cse.tamu.edu/davis/suitesparse.html
  8. MAINTAINER= Paul Irofti <pirofti@openbsd.org>
  9. SO_VERSION= 2.1
  10. .for _lib in \
  11. amd btf camd ccolamd cholmod colamd csparse cxsparse klu ldl rbio spqr \
  12. suitesparseconfig umfpack
  13. SHARED_LIBS += ${_lib} ${SO_VERSION}
  14. .endfor
  15. # GPLv2 - LGPLv2.1
  16. PERMIT_PACKAGE_CDROM= Yes
  17. WANTLIB += ${MODFORTRAN_WANTLIB} blas lapack m
  18. MASTER_SITES= http://faculty.cse.tamu.edu/davis/SuiteSparse/
  19. MODULES= fortran
  20. BUILD_DEPENDS= ${MODFORTRAN_BUILD_DEPENDS}
  21. LIB_DEPENDS= ${MODFORTRAN_LIB_DEPENDS} \
  22. math/lapack
  23. ALL_TARGET= default
  24. NO_TEST= Yes
  25. SUBST_VARS= WRKINST
  26. USE_GMAKE= Yes
  27. WRKDIST= ${WRKDIR}/SuiteSparse
  28. MAKE_FLAGS= CFLAGS="${CFLAGS} -fPIC" \
  29. CXX="${CXX}"
  30. pre-configure:
  31. ${SUBST_CMD} ${WRKSRC}/SuiteSparse_config/SuiteSparse_config.mk
  32. post-build:
  33. # build shared libraries
  34. cd ${WRKSRC}/SuiteSparse_config && \
  35. ${AR} x libsuitesparseconfig.a
  36. cd ${WRKSRC} && \
  37. ${CC} -shared -o \
  38. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  39. SuiteSparse_config/*.o -lm
  40. cd ${WRKSRC} && \
  41. ${CC} -shared -o libamd.so.${LIBamd_VERSION} \
  42. AMD/Lib/*.o \
  43. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  44. -lm
  45. cd ${WRKSRC} && \
  46. ${CC} -shared -o libbtf.so.${LIBbtf_VERSION} \
  47. BTF/Lib/*.o
  48. cd ${WRKSRC} && \
  49. ${CC} -shared -o libcamd.so.${LIBcamd_VERSION} \
  50. CAMD/Lib/*.o \
  51. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  52. -lm
  53. cd ${WRKSRC} && \
  54. ${CC} -shared -o libcolamd.so.${LIBcolamd_VERSION} \
  55. COLAMD/Lib/*.o \
  56. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  57. -lm
  58. cd ${WRKSRC} && \
  59. ${CC} -shared -o libccolamd.so.${LIBccolamd_VERSION} \
  60. CCOLAMD/Lib/*.o \
  61. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  62. -lm
  63. cd ${WRKSRC} && \
  64. ${CC} -shared -o libcholmod.so.${LIBcholmod_VERSION} \
  65. CHOLMOD/Lib/*.o libamd.so.${LIBamd_VERSION} \
  66. libcamd.so.${LIBcamd_VERSION} \
  67. libcolamd.so.${LIBcolamd_VERSION} \
  68. libccolamd.so.${LIBccolamd_VERSION} \
  69. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  70. -lm -L${LOCALBASE}/lib -lblas -lg2c -llapack
  71. cd ${WRKSRC} && \
  72. ${CC} -shared -o libcsparse.so.${LIBcsparse_VERSION} \
  73. CSparse/Lib/*.o -lm
  74. cd ${WRKSRC} && \
  75. ${CC} -shared -o libcxsparse.so.${LIBcxsparse_VERSION} \
  76. CXSparse/Lib/*.o -lm
  77. cd ${WRKSRC} && \
  78. ${CC} -shared -o libklu.so.${LIBklu_VERSION} \
  79. KLU/Lib/*.o libamd.so.${LIBamd_VERSION} \
  80. libbtf.so.${LIBbtf_VERSION} \
  81. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  82. -lm
  83. cd ${WRKSRC} && \
  84. ${CC} -shared -o libldl.so.${LIBldl_VERSION} \
  85. LDL/Lib/*.o -lm
  86. cd ${WRKSRC} && \
  87. ${CC} -shared -o libumfpack.so.${LIBumfpack_VERSION} \
  88. UMFPACK/Lib/*.o libamd.so.${LIBamd_VERSION} \
  89. libcholmod.so.${LIBcholmod_VERSION} \
  90. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  91. -lm -L${LOCALBASE}/lib -lblas -lg2c -llapack
  92. cd ${WRKSRC} && \
  93. ${CC} -shared -o libspqr.so.${LIBspqr_VERSION} \
  94. SPQR/Lib/*.o libcholmod.so.${LIBcholmod_VERSION} \
  95. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  96. -lm -L${LOCALBASE}/lib -lblas -lg2c -llapack
  97. cd ${WRKSRC} && \
  98. ${CC} -shared -o librbio.so.${LIBrbio_VERSION} \
  99. RBio/Lib/*.o \
  100. libsuitesparseconfig.so.${LIBsuitesparseconfig_VERSION} \
  101. -lm
  102. post-install:
  103. # remove versionned static archives, links and libcerbla
  104. # (not meant to be shipped)
  105. rm ${PREFIX}/lib/*.a
  106. for i in `find ${WRKBUILD} -type f -name '*.a'`; do \
  107. ${INSTALL_DATA} $${i} ${PREFIX}/lib/; \
  108. done
  109. rm ${PREFIX}/lib/libcerbla.a
  110. ${INSTALL_DATA} ${WRKBUILD}/lib*.so.?.? ${PREFIX}/lib/
  111. .include <bsd.port.mk>