Skip to content

Commit 3de585e

Browse files
Make improvements (#40)
* introduce FT_LIBBLAS with a default backup ==blas check if linking to gmp or mpir is necessary * position of libmath * FT_PREFIX seems simpler than FT_USE_PREDEFINED_LIBRARIES similarly for FT_LIBBLAS => FT_BLAS
1 parent 20834eb commit 3de585e

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ matrix:
1616
- image: Visual Studio 2015
1717

1818
build_script:
19-
- set CC=gcc && set FT_FFTW_WITH_COMBINED_THREADS=1
19+
- set CC=gcc && set FT_BLAS=openblas && set FT_FFTW_WITH_COMBINED_THREADS=1
2020
- gcc --version
2121
- mingw32-make lib
2222
- mingw32-make tests

Make.inc

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
LIB = fasttransforms
22
LIBDIR = .
3-
LIBFLAGS = -shared -lm -fPIC
3+
LIBFLAGS = -shared -fPIC
44

55
ifeq ($(OS), Windows_NT)
66
UNAME := Windows
@@ -29,9 +29,14 @@ endif
2929

3030
CFLAGS += -std=gnu99 -Ofast -march=native -mtune=native -mno-vzeroupper -I./src
3131

32-
ifeq ($(FT_USE_PREDEFINED_LIBRARIES), 1)
33-
CFLAGS += -I$(prefix)/include
34-
LDFLAGS += -L$(prefix)/lib
32+
ifdef FT_PREFIX
33+
ifeq ($(UNAME), Windows)
34+
CFLAGS += -I$(FT_PREFIX)\include
35+
LDFLAGS += -L$(FT_PREFIX)\bin
36+
else
37+
CFLAGS += -I$(FT_PREFIX)/include
38+
LDFLAGS += -L$(FT_PREFIX)/lib
39+
endif
3540
else
3641
ifeq ($(UNAME), Darwin)
3742
ifeq ($(FT_USE_APPLEBLAS), 1)
@@ -51,21 +56,15 @@ else
5156
CFLAGS += -Ic:\tools\vcpkg\installed\x64-windows\include\openblas
5257
CFLAGS += -Ic:\tools\vcpkg\installed\x64-windows\include
5358
LDFLAGS += -Lc:\tools\vcpkg\installed\x64-windows\bin
54-
LDFLAGS += -L.
5559
endif
5660
endif
5761

58-
LDLIBS += -lm -lquadmath -fopenmp -lfftw3
62+
ifndef FT_BLAS
63+
FT_BLAS = blas
64+
endif
65+
66+
LDLIBS += -fopenmp -lm -lquadmath -lmpfr -l$(FT_BLAS) -lfftw3
5967

6068
ifneq ($(FT_FFTW_WITH_COMBINED_THREADS), 1)
6169
LDLIBS += -lfftw3_threads
6270
endif
63-
64-
LDLIBS += -lmpfr
65-
ifeq ($(UNAME), Linux)
66-
LDLIBS += -lgmp -lblas
67-
else ifeq ($(UNAME), Darwin)
68-
LDLIBS += -lgmp -lblas
69-
else ifeq ($(OS), Windows_NT)
70-
LDLIBS += -lmpir -lopenblas
71-
endif

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The library makes use of OpenBLAS, FFTW3, and MPFR, which are easily installed v
1717
Apple's version of GCC does not support OpenMP. Sample installation:
1818
```
1919
brew install gcc@8 fftw mpfr
20-
export CC=gcc-8 && export FT_USE_APPLEBLAS=1 && make
20+
make CC=gcc-8 FT_USE_APPLEBLAS=1
2121
```
2222
On macOS, the OpenBLAS dependency is optional in light of the vecLib framework. In case the library is compiled with vecLib, then the environment variable `VECLIB_MAXIMUM_THREADS` partially controls the multithreading.
2323

@@ -26,7 +26,8 @@ On macOS, the OpenBLAS dependency is optional in light of the vecLib framework.
2626
To access functions from the library, you must ensure that you append the current library path to the default. Sample installation:
2727
```
2828
apt-get install gcc-8 libblas-dev libopenblas-base libfftw3-dev libmpfr-dev
29-
export CC=gcc-8 && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. && make
29+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
30+
make CC=gcc-8
3031
```
3132
See the [Travis build](https://github.com/MikaelSlevinsky/FastTransforms/blob/master/.travis.yml) for further details.
3233

@@ -35,7 +36,7 @@ See the [Travis build](https://github.com/MikaelSlevinsky/FastTransforms/blob/ma
3536
We use GCC 7.2.0 distributed through MinGW-w64 on Visual Studio 2017. Sample installation:
3637
```
3738
vcpkg install openblas:x64-windows fftw3[core,threads]:x64-windows mpir:x64-windows mpfr:x64-windows
38-
set CC=gcc && set FT_FFTW_WITH_COMBINED_THREADS=1 && mingw32-make
39+
mingw32-make CC=gcc FT_BLAS=openblas FT_FFTW_WITH_COMBINED_THREADS=1
3940
```
4041
See the [AppVeyor build](https://github.com/MikaelSlevinsky/FastTransforms/blob/master/.appveyor.yml) for further details.
4142

0 commit comments

Comments
 (0)