Skip to content

Commit 939452e

Browse files
authored
Merge pull request #1570 from xianyi/develop
Update release-0.3.0 branch to match develop
2 parents 07ed01e + f5959f2 commit 939452e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1475
-419
lines changed

.travis.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ language: c
77
jobs:
88
include:
99
- &test-ubuntu
10+
os: linux
1011
stage: test
1112
compiler: gcc
1213
addons:
@@ -57,7 +58,8 @@ jobs:
5758
- TARGET_BOX=LINUX32
5859
- BTYPE="BINARY=32"
5960

60-
- stage: test
61+
- os: linux
62+
stage: test
6163
compiler: gcc
6264
addons:
6365
apt:
@@ -77,6 +79,7 @@ jobs:
7779
# which is slower than container-based infrastructure used for jobs
7880
# that don't require sudo.
7981
- &test-alpine
82+
os: linux
8083
stage: test
8184
dist: trusty
8285
sudo: true
@@ -120,6 +123,7 @@ jobs:
120123
- BTYPE="BINARY=64 NO_AFFINITY=1 USE_OPENMP=0 NO_LAPACK=0 TARGET=core2"
121124

122125
- &test-cmake
126+
os: linux
123127
stage: test
124128
compiler: clang
125129
addons:
@@ -147,6 +151,23 @@ jobs:
147151
env:
148152
- CMAKE=1
149153

154+
- &test-macos
155+
os: osx
156+
stage: test
157+
osx_image: xcode8
158+
before_script:
159+
- COMMON_FLAGS="DYNAMIC_ARCH=1 TARGET=NEHALEM NUM_THREADS=32"
160+
- brew update
161+
- brew install gcc # for gfortran
162+
script:
163+
- travis_wait 45 make QUIET_MAKE=1 $COMMON_FLAGS $BTYPE
164+
env:
165+
- BTYPE="BINARY=64 INTERFACE64=1"
166+
167+
- <<: *test-macos
168+
env:
169+
- BTYPE="BINARY=32"
170+
150171
# whitelist
151172
branches:
152173
only:

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@ ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))
9191
@ln -fs $(LIBSONAME) $(LIBPREFIX).so
9292
@ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
9393
endif
94-
ifeq ($(OSNAME), FreeBSD)
95-
@$(MAKE) -C exports so
96-
@ln -fs $(LIBSONAME) $(LIBPREFIX).so
97-
endif
98-
ifeq ($(OSNAME), NetBSD)
94+
ifeq ($(OSNAME), $(filter $(OSNAME),FreeBSD OpenBSD NetBSD DragonFly))
9995
@$(MAKE) -C exports so
10096
@ln -fs $(LIBSONAME) $(LIBPREFIX).so
10197
endif

Makefile.install

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,7 @@ ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android))
7272
ln -fs $(LIBSONAME) $(LIBPREFIX).so ; \
7373
ln -fs $(LIBSONAME) $(LIBPREFIX).so.$(MAJOR_VERSION)
7474
endif
75-
ifeq ($(OSNAME), FreeBSD)
76-
@cp $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
77-
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
78-
ln -fs $(LIBSONAME) $(LIBPREFIX).so
79-
endif
80-
ifeq ($(OSNAME), NetBSD)
75+
ifeq ($(OSNAME), $(filter $(OSNAME),FreeBSD OpenBSD NetBSD DragonFly))
8176
@cp $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
8277
@cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
8378
ln -fs $(LIBSONAME) $(LIBPREFIX).so
@@ -101,8 +96,9 @@ endif
10196

10297
#Generating openblas.pc
10398
@echo Generating openblas.pc in "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)"
104-
@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
99+
@echo 'libdir='$(OPENBLAS_LIBRARY_DIR) > "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
105100
@echo 'includedir='$(OPENBLAS_INCLUDE_DIR) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
101+
@echo 'openblas_config= USE_64BITINT='$(USE_64BITINT) 'DYNAMIC_ARCH='$(DYNAMIC_ARCH) 'NO_CBLAS='$(NO_CBLAS) 'NO_LAPACK='$(NO_LAPACK) 'NO_LAPACKE='$(NO_LAPACKE) 'NO_AFFINITY='$(NO_AFFINITY) 'USE_OPENMP='$(USE_OPENMP) $(CORE) 'MAX_THREADS='$(NUM_THREADS)>> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
106102
@echo 'version='$(VERSION) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
107103
@echo 'extralib='$(EXTRALIB) >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
108104
@cat openblas.pc.in >> "$(DESTDIR)$(OPENBLAS_PKGCONFIG_DIR)/openblas.pc"
@@ -115,7 +111,7 @@ endif
115111

116112
ifndef NO_SHARED
117113
#ifeq logical or
118-
ifeq ($(OSNAME), $(filter $(OSNAME),Linux FreeBSD NetBSD))
114+
ifeq ($(OSNAME), $(filter $(OSNAME),Linux FreeBSD NetBSD OpenBSD DragonFly))
119115
@echo "SET(OpenBLAS_LIBRARIES ${OPENBLAS_LIBRARY_DIR}/$(LIBPREFIX).so)" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
120116
endif
121117
ifeq ($(OSNAME), $(filter $(OSNAME),WINNT CYGWIN_NT))

Makefile.prebuild

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ ifdef CPUIDEMU
1717
EXFLAGS = -DCPUIDEMU -DVENDOR=99
1818
endif
1919

20+
ifeq ($(TARGET), 1004K)
21+
TARGET_FLAGS = -mips32r2
22+
endif
23+
2024
ifeq ($(TARGET), P5600)
2125
TARGET_FLAGS = -mips32r5
2226
endif

Makefile.rule

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ VERSION = 0.3.0.dev
6060
# automatically detected by the the script.
6161
# NUM_THREADS = 24
6262

63+
# If you have enabled USE_OPENMP and your application would call
64+
# OpenBLAS's calculation API from multi threads, please comment it in.
65+
# This flag defines how many instances of OpenBLAS's calculation API can
66+
# actually run in parallel. If more threads call OpenBLAS's calculation API,
67+
# they need to wait for the preceding API calls to finish or risk data corruption.
68+
# NUM_PARALLEL = 2
69+
6370
# if you don't need to install the static library, please comment it in.
6471
# NO_STATIC = 1
6572

Makefile.system

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,24 @@ NETLIB_LAPACK_DIR = $(TOPDIR)/lapack-netlib
1717
# http://stackoverflow.com/questions/4029274/mingw-and-make-variables
1818
# - Default value is 'cc' which is not always a valid command (e.g. MinGW).
1919
ifeq ($(origin CC),default)
20+
21+
# Check if $(CC) refers to a valid command and set the value to gcc if not
22+
ifneq ($(findstring cmd.exe,$(SHELL)),)
23+
ifeq ($(shell where $(CC) 2>NUL),)
2024
CC = gcc
21-
# Change the default compile to clang on Mac OSX.
22-
# http://stackoverflow.com/questions/714100/os-detecting-makefile
23-
UNAME_S := $(shell uname -s)
24-
ifeq ($(UNAME_S),Darwin)
25-
CC = clang
26-
# EXTRALIB += -Wl,-no_compact_unwind
27-
endif
2825
endif
26+
else # POSIX-ish
27+
ifeq ($(shell command -v $(CC) 2>/dev/null),)
28+
ifeq ($(shell uname -s),Darwin)
29+
CC = clang
30+
# EXTRALIB += -Wl,-no_compact_unwind
31+
else
32+
CC = gcc
33+
endif # Darwin
34+
endif # CC exists
35+
endif # Shell is sane
36+
37+
endif # CC is set to default
2938

3039
# Default Fortran compiler (FC) is selected by f_check.
3140

@@ -175,6 +184,10 @@ endif
175184

176185
endif
177186

187+
ifndef NUM_PARALLEL
188+
NUM_PARALLEL = 1
189+
endif
190+
178191
ifndef NUM_THREADS
179192
NUM_THREADS = $(NUM_CORES)
180193
endif
@@ -230,7 +243,7 @@ endif
230243
MD5SUM = md5 -r
231244
endif
232245

233-
ifeq ($(OSNAME), FreeBSD)
246+
ifneq (,$(findstring $(OSNAME), FreeBSD OpenBSD DragonFly))
234247
MD5SUM = md5 -r
235248
endif
236249

@@ -424,7 +437,7 @@ CCOMMON_OPT += -fopenmp
424437
endif
425438

426439
ifeq ($(C_COMPILER), INTEL)
427-
CCOMMON_OPT += -openmp
440+
CCOMMON_OPT += -fopenmp
428441
endif
429442

430443
ifeq ($(C_COMPILER), PGI)
@@ -555,9 +568,14 @@ CCOMMON_OPT += -march=mips64
555568
FCOMMON_OPT += -march=mips64
556569
endif
557570

571+
ifeq ($(CORE), 1004K)
572+
CCOMMON_OPT += -mips32r2 $(MSA_FLAGS)
573+
FCOMMON_OPT += -mips32r2 $(MSA_FLAGS)
574+
endif
575+
558576
ifeq ($(CORE), P5600)
559-
CCOMMON_OPT += -mips32r5 -mnan=2008 -mtune=p5600 $(MSA_FLAGS)
560-
FCOMMON_OPT += -mips32r5 -mnan=2008 -mtune=p5600 $(MSA_FLAGS)
577+
CCOMMON_OPT += -mips32r5 -mnan=2008 -mtune=p5600 $(MSA_FLAGS)
578+
FCOMMON_OPT += -mips32r5 -mnan=2008 -mtune=p5600 $(MSA_FLAGS)
561579
endif
562580

563581
ifeq ($(CORE), I6400)
@@ -704,7 +722,7 @@ FCOMMON_OPT += -i8
704722
endif
705723
endif
706724
ifeq ($(USE_OPENMP), 1)
707-
FCOMMON_OPT += -openmp
725+
FCOMMON_OPT += -fopenmp
708726
endif
709727
endif
710728

@@ -952,6 +970,8 @@ endif
952970

953971
CCOMMON_OPT += -DMAX_CPU_NUMBER=$(NUM_THREADS)
954972

973+
CCOMMON_OPT += -DMAX_PARALLEL_NUMBER=$(NUM_PARALLEL)
974+
955975
ifdef USE_SIMPLE_THREADED_LEVEL3
956976
CCOMMON_OPT += -DUSE_SIMPLE_THREADED_LEVEL3
957977
endif

0 commit comments

Comments
 (0)