You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile.install 3.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. TOPDIR = .
  2. export GOTOBLAS_MAKEFILE = 1
  3. -include $(TOPDIR)/Makefile.conf_last
  4. include ./Makefile.system
  5. OPENBLAS_INCLUDE_DIR:=$(PREFIX)/include
  6. OPENBLAS_LIBRARY_DIR:=$(PREFIX)/lib
  7. .PHONY : install
  8. .NOTPARALLEL : install
  9. lib.grd :
  10. $(error OpenBLAS: Please run "make" firstly)
  11. install : lib.grd
  12. @-mkdir -p $(PREFIX)
  13. @-mkdir -p $(OPENBLAS_INCLUDE_DIR)
  14. @-mkdir -p $(OPENBLAS_LIBRARY_DIR)
  15. @echo Generating openblas_config.h in $(OPENBLAS_INCLUDE_DIR)
  16. #for inc
  17. @echo \#ifndef OPENBLAS_CONFIG_H > $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  18. @echo \#define OPENBLAS_CONFIG_H >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  19. @cat config_last.h >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  20. @echo \#define VERSION \" OpenBLAS $(VERSION) \" >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  21. @cat openblas_config_template.h >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  22. @echo \#endif \/\* OPENBLAS_CONFIG_H \*\/ >> $(OPENBLAS_INCLUDE_DIR)/openblas_config.h
  23. @echo Generating f77blas.h in $(OPENBLAS_INCLUDE_DIR)
  24. @echo \#ifndef OPENBLAS_F77BLAS_H > $(OPENBLAS_INCLUDE_DIR)/f77blas.h
  25. @echo \#define OPENBLAS_F77BLAS_H >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h
  26. @echo \#include \"openblas_config.h\" >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h
  27. @cat common_interface.h >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h
  28. @echo \#endif >> $(OPENBLAS_INCLUDE_DIR)/f77blas.h
  29. @echo Generating cblas.h in $(OPENBLAS_INCLUDE_DIR)
  30. @sed 's/common/openblas_config/g' cblas.h > $(OPENBLAS_INCLUDE_DIR)/cblas.h
  31. ifndef NO_LAPACKE
  32. @echo Copying LAPACKE header files to $(OPENBLAS_LIBRARY_DIR)
  33. @-cp $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke.h $(OPENBLAS_INCLUDE_DIR)/lapacke.h
  34. @-cp $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_config.h $(OPENBLAS_INCLUDE_DIR)/lapacke_config.h
  35. @-cp $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_utils.h $(OPENBLAS_INCLUDE_DIR)/lapacke_utils.h
  36. endif
  37. #for install static library
  38. @echo Copy the static library to $(OPENBLAS_LIBRARY_DIR)
  39. @cp $(LIBNAME) $(OPENBLAS_LIBRARY_DIR)
  40. @-ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).$(LIBSUFFIX)
  41. #for install shared library
  42. @echo Copy the shared library to $(OPENBLAS_LIBRARY_DIR)
  43. ifeq ($(OSNAME), Linux)
  44. -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)
  45. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).so
  46. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).so.$(MAJOR_VERSION)
  47. endif
  48. ifeq ($(OSNAME), FreeBSD)
  49. -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)
  50. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).so
  51. endif
  52. ifeq ($(OSNAME), NetBSD)
  53. -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)
  54. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).so
  55. endif
  56. ifeq ($(OSNAME), Darwin)
  57. -cp $(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)
  58. -install_name_tool -id $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME)
  59. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).dylib
  60. endif
  61. ifeq ($(OSNAME), WINNT)
  62. -cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)
  63. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).dll
  64. endif
  65. ifeq ($(OSNAME), CYGWIN_NT)
  66. -cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)
  67. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).dll
  68. endif
  69. @echo Install OK!