Skip to content

Commit 720ddea

Browse files
committed
removed obsolete NEED_EXTERN_C flag, fixes #90
1 parent 1d136cd commit 720ddea

7 files changed

+29
-22
lines changed

CHANGELOG

+16-8
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,27 @@ V 1.2 (June 2020)
55
* a major change to code, internally, and major improvements to operation and
66
language interfaces.
77
WARNING: Here are all the interface changes from 1.1.2:
8-
- opts is always passed as a pointer in C++/C, not pass-by-reference
9-
as in v1.1.2 or earlier.
8+
- opts (nufft_opts) is always passed as a pointer in C++/C, not
9+
pass-by-reference as in v1.1.2 or earlier.
1010
- Fortran simple calls are now finufft?d?(..) not finufft?d?_f(..), and
1111
they add a penultimate opts argument.
12-
-
13-
These changes were deemed necessary to rationalize and improve FINUFFT.
12+
- ier=1 is now a warning not an error; this indicates requested tol
13+
was too small, but that a transform *was* done at the best possible
14+
accuracy.
15+
- opts.nthreads was removed in language interfaces. Control of the
16+
number of available OpenMP threads is up to the user.
17+
- opts.fftw directly controls the FFTW plan mode consistently in all
18+
language interfaces (this changes the meaning of fftw=0 in MATLAB).
19+
These changes were deemed necessary to rationalize and improve FINUFFT
20+
for the long term.
1421

1522
...
1623
* completely new Fortran interface, allowing >2^31 sized (int64) arrays,
17-
all simple, many-vector and guru interface, with options control.
18-
* all simple and many-vector interfaces call guru interface.
19-
* new guru interface, by Andrea Malleo and Alex Barnett, allowing easier
20-
language wrapping and control of point-setting, reuse of sorting and FFTW plans. This finally bypasses the 0.1ms/thread cost of FFTW looking up previous wisdom, which slowed down performance for many small problems.
24+
all simple, many-vector and guru interface, with full options control.
25+
* all simple and many-vector interfaces now call guru interface, for much
26+
better maintainability and less code repetition.
27+
* new guru interface, by Andrea Malleo and Alex Barnett, allowing easier language wrapping and control of point-setting, reuse of sorting and FFTW plans. This finally bypasses the 0.1ms/thread cost of FFTW looking up previous wisdom, which slowed down performance for many small problems.
28+
* removed obsolete -DNEED_EXTERN_C flag.
2129

2230
V 1.1.2 (1/31/20)
2331

make.inc.GCC7

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
# example override compiler choices in makefile. Here we use GCC 7.
1+
# example of how to override compiler choices in makefile.
2+
# Here we use GCC 7 in linux ubuntu 16.40 LTS (provides /usr/bin/g++-7, etc)
3+
# You should make your own.
24

35
CXX=g++-7
46
CC=gcc-7
57
FC=gfortran-7
8+
9+
CXXFLAGS += -g -Wall

make.inc.linux_ICC

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# makefile overrides to use Intel ICC compiler & libiomp5. double prec only.
2-
# fixed the fatal mistake of leaving -lgomp in the compile line, 6/4/20.
2+
# (fixed the fatal mistake of leaving -lgomp in the compile line! 6/4/20)
33

44
CXX=icpc
55
CC=icc

make.inc.macosx_clang

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# (note that /usr/bin/g++,gcc are aliased to clang/LLVM, so CXX,CC unchanged)
1010

1111
# compile flags for use with clang: (note absence of -march, etc)
12-
CFLAGS = -fPIC -O3
12+
CFLAGS = -O3
1313

1414
# If you're getting warning messages of the form:
1515
# ld: warning: object file (lib-static/libfinufft.a(finufft1d.o)) was built for
@@ -25,7 +25,7 @@ CC=clang
2525
# taken from makefile...
2626
CFLAGS += -I include -I/usr/local/include
2727
FFLAGS = $(CFLAGS)
28-
CXXFLAGS = $(CFLAGS) -DNEED_EXTERN_C
28+
CXXFLAGS = $(CFLAGS)
2929
LIBS += -L/usr/local/lib
3030

3131
# OpenMP with clang needs following...
@@ -38,5 +38,5 @@ FFTWOMPSUFFIX=threads
3838
# some of these will depend on your FFTW library location...
3939
MFLAGS += -I/usr/local/include -L/usr/local/lib -lm
4040
# edit for your MATLAB version location...
41-
MEX = $(shell ls -d /Applications/MATLAB_R201*.app)/bin/mex
41+
MEX = $(shell ls -d /Applications/MATLAB_R20**.app)/bin/mex
4242
# Also see docs/install.rst for possible edits to MATLAB's MEX XML file.

make.inc.macosx_gcc-8

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CFLAGS +=
2828
# as in makefile, but with the brew /usr/local/ stuff...
2929
CFLAGS += -I src -I/usr/local/include
3030
FFLAGS = $(CFLAGS)
31-
CXXFLAGS = $(CFLAGS) -DNEED_EXTERN_C
31+
CXXFLAGS = $(CFLAGS)
3232
LIBS += -L/usr/local/lib
3333

3434
# OpenMP with GCC on OSX needs following...
@@ -41,5 +41,5 @@ FFTWOMPSUFFIX=threads
4141
# some of these will depend on your FFTW library location...
4242
MFLAGS += -I/usr/local/include -L/usr/local/lib -lm
4343
# edit for your MATLAB version location...
44-
MEX = $(shell ls -d /Applications/MATLAB_R201*.app)/bin/mex
44+
MEX = $(shell ls -d /Applications/MATLAB_R20**.app)/bin/mex
4545
# Also see docs/install.rst for possible edits to MATLAB's MEX XML file.

makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ INCL = -Iinclude
5151
# (Please look in make.inc.* for ideas)
5252
-include make.inc
5353

54-
# now come flags that should be added, whatever you overrode in make.inc
55-
# the NEED_EXTERN_C directive tells common.cpp to include plain C header
54+
# Now come flags that should be added, whatever you overrode in make.inc.
5655
# -fPIC (position-indep code) needed to build dyn lib (.so)
5756
# Also, we force return (via :=) to the land of simply-expanded variables...
58-
CXXFLAGS := $(CXXFLAGS) $(INCL) -fPIC -std=c++14 -DNEED_EXTERN_C
57+
CXXFLAGS := $(CXXFLAGS) $(INCL) -fPIC -std=c++14
5958
CFLAGS := $(CFLAGS) $(INCL) -fPIC
6059
# /usr/include needed for fftw3.f...
6160
FFLAGS := $(FFLAGS) $(INCL) -I/usr/include -fPIC

src/common.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@
1010
#include <stdlib.h>
1111
#include <vector>
1212

13-
#ifdef NEED_EXTERN_C
1413
extern "C" {
1514
#include "../contrib/legendre_rule_fast.h"
1615
}
17-
#else
18-
#include "../contrib/legendre_rule_fast.h"
19-
#endif
2016

2117
void finufft_default_opts(nufft_opts *o)
2218
// Sets default nufft opts. See finufft.h for definition of opts.

0 commit comments

Comments
 (0)