# Clone the current repository git clone https://github.com/xianyi/OpenBLAS
# Compile and install # macOS MacPorts users may not use USE_OPENMP=1 option, and need to omit it. cd OpenBLAS make USE_OPENMP=1 CC=gcc FC=gfortran make PREFIX="~/local" install
# (compile flags for use with GCC are as in linux makefile) CFLAGS +=
# If you're getting warning messages of the form: # ld: warning: object file (lib-static/libfinufft.a(finufft1d.o)) was built for # newer OSX version (10.13) than being linked (10.9) # Then you can uncomment the following two lines with the older version number # (in this example -mmacosx-version-min=10.9) # #CFLAGS += "-mmacosx-version-min=<OLDER OSX VERSION NUMBER>"
# if you are macOS homebrew users, uncomment this. # (assuming that /usr/local is your homebrew's PREFIX) #CFLAGS += -I src -I/usr/local/include #LIBS += -L/usr/local/lib
# if you are macOS MacPorts users, uncomment this. # (assuming that /opt/local is your MacPorts' PREFIX) #CFLAGS += -I src -I/opt/local/include #LIBS += -L/opt/local/lib
# You can keep them FFLAGS = $(CFLAGS) CXXFLAGS = $(CFLAGS) -DNEED_EXTERN_C
# OpenMP with GCC on OSX needs following... OMPFLAGS = -fopenmp OMPLIBS = -lgomp # since fftw3_omp doesn't work in OSX, you need to uncomment this #FFTWOMPSUFFIX=threads
开始编译库
1
$ make lib
新建finufft.pc文件,内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13
# This is an example pkg-config file. Here is an brief instruction. # (1) Please change finufftdir depending on your install directory. # (2) please change its filename to finufft.sample.pc and # copy to a directory specified in $PKG_CONFIG_PATH finufftdir=$(HOME)/local/finufft libdir=${finufftdir}/lib-static includedir=${finufftdir}/include
Name: FINUFFT Description: Flatiron Institute Nonuniform Fast Fourier Transform libraries Version: github Libs: -L${libdir} -lfinufft Cflags: -I${includedir}