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.3 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. ifndef NO_CBLAS
  30. @echo Generating cblas.h in $(OPENBLAS_INCLUDE_DIR)
  31. @sed 's/common/openblas_config/g' cblas.h > $(OPENBLAS_INCLUDE_DIR)/cblas.h
  32. endif
  33. ifndef NO_LAPACKE
  34. @echo Copying LAPACKE header files to $(OPENBLAS_LIBRARY_DIR)
  35. @-cp $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke.h $(OPENBLAS_INCLUDE_DIR)/lapacke.h
  36. @-cp $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_config.h $(OPENBLAS_INCLUDE_DIR)/lapacke_config.h
  37. @-cp $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_mangling_with_flags.h $(OPENBLAS_INCLUDE_DIR)/lapacke_mangling.h
  38. @-cp $(NETLIB_LAPACK_DIR)/lapacke/include/lapacke_utils.h $(OPENBLAS_INCLUDE_DIR)/lapacke_utils.h
  39. endif
  40. #for install static library
  41. @echo Copy the static library to $(OPENBLAS_LIBRARY_DIR)
  42. @cp $(LIBNAME) $(OPENBLAS_LIBRARY_DIR)
  43. @-ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).$(LIBSUFFIX)
  44. #for install shared library
  45. @echo Copy the shared library to $(OPENBLAS_LIBRARY_DIR)
  46. ifeq ($(OSNAME), Linux)
  47. -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)
  48. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).so
  49. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).so.$(MAJOR_VERSION)
  50. endif
  51. ifeq ($(OSNAME), FreeBSD)
  52. -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)
  53. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).so
  54. endif
  55. ifeq ($(OSNAME), NetBSD)
  56. -cp $(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)
  57. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBSONAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).so
  58. endif
  59. ifeq ($(OSNAME), Darwin)
  60. -cp $(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)
  61. -install_name_tool -id $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME)
  62. -ln -fs $(OPENBLAS_LIBRARY_DIR)/$(LIBDYNNAME) $(OPENBLAS_LIBRARY_DIR)/$(LIBPREFIX).dylib
  63. endif
  64. ifeq ($(OSNAME), WINNT)
  65. -cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)
  66. endif
  67. ifeq ($(OSNAME), CYGWIN_NT)
  68. -cp $(LIBDLLNAME) $(OPENBLAS_LIBRARY_DIR)
  69. endif
  70. @echo Install OK!