Browse Source

Merge branch 'add_install_target' into develop

Conflicts:
	Changelog.txt
tags/v0.1alpha2^2
Xianyi Zhang 15 years ago
parent
commit
2e6e9272fe
5 changed files with 94 additions and 0 deletions
  1. +2
    -0
      Changelog.txt
  2. +63
    -0
      Makefile
  3. +3
    -0
      Makefile.rule
  4. +5
    -0
      README
  5. +21
    -0
      openblas_config_template.h

+ 2
- 0
Changelog.txt View File

@@ -20,6 +20,8 @@ common:
* Fixed a bug about detecting underscore prefix in c_check.
* Print the wall time (cycles) with enabling FUNCTION_PROFILE
* Fixed #35 a build bug with NO_LAPACK=1 & DYNAMIC_ARCH=1
* Added install target. You can use "make install". (Refs #20)


x86/x86_64:
* Fixed #28 a wrong result of dsdot on x86_64.


+ 63
- 0
Makefile View File

@@ -15,6 +15,10 @@ ifdef SANITY_CHECK
BLASDIRS += reference
endif

ifndef PREFIX
PREFIX = /opt/OpenBLAS
endif

SUBDIRS = $(BLASDIRS)
ifneq ($(NO_LAPACK), 1)
SUBDIRS += lapack
@@ -111,6 +115,7 @@ ifdef DYNAMIC_ARCH
do $(MAKE) GOTOBLAS_MAKEFILE= -C kernel TARGET_CORE=$$d kernel || exit 1 ;\
done
endif
touch lib.grd

prof : prof_blas prof_lapack

@@ -230,6 +235,63 @@ lapack-test :

dummy :

lib.grd :
$(error OpenBLAS: Please run "make" firstly)

install : lib.grd
@-mkdir -p $(PREFIX)
@echo Generating openblas_config.h in $(PREFIX)
#for inc
@echo \#ifndef OPENBLAS_CONFIG_H > $(PREFIX)/openblas_config.h
@echo \#define OPENBLAS_CONFIG_H >> $(PREFIX)/openblas_config.h
@cat config.h >> $(PREFIX)/openblas_config.h
@echo \#define VERSION \" OpenBLAS $(VERSION) \" >> $(PREFIX)/openblas_config.h
@cat openblas_config_template.h >> $(PREFIX)/openblas_config.h
@echo \#endif >> $(PREFIX)/openblas_config.h

@echo Generating f77blas.h in $(PREFIX)
@echo \#ifndef OPENBLAS_F77BLAS_H > $(PREFIX)/f77blas.h
@echo \#define OPENBLAS_F77BLAS_H >> $(PREFIX)/f77blas.h
@echo \#include \"openblas_config.h\" >> $(PREFIX)/f77blas.h
@cat common_interface.h >> $(PREFIX)/f77blas.h
@echo \#endif >> $(PREFIX)/f77blas.h

@echo Generating cblas.h in $(PREFIX)
@sed 's/common/openblas_config/g' cblas.h > $(PREFIX)/cblas.h

#for install static library
@echo Copy the static library to $(PREFIX)
@cp $(LIBNAME) $(PREFIX)
@-ln -fs $(PREFIX)/$(LIBNAME) $(PREFIX)/libopenblas.$(LIBSUFFIX)
#for install shared library
@echo Copy the shared library to $(PREFIX)
ifeq ($(OSNAME), Linux)
-cp $(LIBSONAME) $(PREFIX)
-ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so
endif
ifeq ($(OSNAME), FreeBSD)
-cp $(LIBSONAME) $(PREFIX)
-ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so
endif
ifeq ($(OSNAME), NetBSD)
-cp $(LIBSONAME) $(PREFIX)
-ln -fs $(PREFIX)/$(LIBSONAME) $(PREFIX)/libopenblas.so
endif
ifeq ($(OSNAME), Darwin)
-cp $(LIBDYNNAME) $(PREFIX)
-ln -fs $(PREFIX)/$(LIBDYNNAME) $(PREFIX)/libopenblas.dylib
endif
ifeq ($(OSNAME), WINNT)
-cp $(LIBDLLNAME) $(PREFIX)
-ln -fs $(PREFIX)/$(LIBDLLNAME) $(PREFIX)/libopenblas.dll
endif
ifeq ($(OSNAME), CYGWIN_NT)
-cp $(LIBDLLNAME) $(PREFIX)
-ln -fs $(PREFIX)/$(LIBDLLNAME) $(PREFIX)/libopenblas.dll
endif

@echo Install OK!

clean ::
@for d in $(SUBDIRS_ALL) ; \
do if test -d $$d; then \
@@ -245,4 +307,5 @@ endif
echo deleting lapack-3.1.1; \
rm -rf lapack-3.1.1 ;\
fi
@rm -f *.grd
@echo Done.

+ 3
- 0
Makefile.rule View File

@@ -91,6 +91,9 @@ VERSION = 0.1alpha2
# SANITY_CHECK to compare the result with reference BLAS.
# UTEST_CHECK = 1

# The installation directory.
# PREFIX = /opt/OpenBLAS

# Common Optimization Flag; -O2 is enough.
# DEBUG = 1



+ 5
- 0
README View File

@@ -22,6 +22,11 @@ make BINARY=64 CC=mips64el-unknown-linux-gnu-gcc FC=mips64el-unknown-linux-gnu-g
3)Debug version
make DEBUG=1

4)Intall to the directory (Optional)
e.g.
make install PREFIX=your_installation_directory
The default directory is /opt/OpenBLAS

3.Support CPU & OS
Please read GotoBLAS_01Readme.txt



+ 21
- 0
openblas_config_template.h View File

@@ -0,0 +1,21 @@
/*This is only for "make install" target.*/

#ifdef NEEDBUNDERSCORE
#define BLASFUNC(FUNC) FUNC##_
#else
#define BLASFUNC(FUNC) FUNC
#endif

#if defined(OS_WINDOWS) && defined(__64BIT__)
typedef long long BLASLONG;
typedef unsigned long long BLASULONG;
#else
typedef long BLASLONG;
typedef unsigned long BLASULONG;
#endif

#ifdef USE64BITINT
typedef BLASLONG blasint;
#else
typedef int blasint;
#endif

Loading…
Cancel
Save