Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make not working on Mojave #26

Closed
dlfivefifty opened this issue Oct 1, 2018 · 10 comments
Closed

Make not working on Mojave #26

dlfivefifty opened this issue Oct 1, 2018 · 10 comments

Comments

@dlfivefifty
Copy link
Contributor

[solver-mbook:~/Projects/FastTransforms] solver% export CC=gcc-8 && make
make lib
gcc-8 -Ofast  -march=native -mtune=native -I./src -I/usr/local/opt/openblas/include -I/usr/local/opt/fftw/include -shared -lm -fPIC -fopenmp src/transforms.c src/rotations.c src/permute.c src/drivers.c src/fftw.c -L/usr/local/opt/openblas/lib -L/usr/local/opt/fftw/lib -lm -lblas -lfftw3 -lfftw3_threads -o libfasttransforms.dylib
In file included from src/transforms.c:3:
src/ftinternal.h:4:10: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
          ^~~~~~~~~~
compilation terminated.
In file included from /usr/local/opt/openblas/include/openblas_config.h:104,
                 from /usr/local/opt/openblas/include/cblas.h:5,
                 from src/fasttransforms.h:4,
                 from src/rotations.c:3:
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin17.7.0/8.2.0/include-fixed/stdio.h:78:10: fatal error: _stdio.h: No such file or directory
 #include <_stdio.h>
          ^~~~~~~~~~
compilation terminated.
In file included from src/permute.c:3:
src/ftinternal.h:4:10: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
          ^~~~~~~~~~
compilation terminated.
In file included from /usr/local/opt/openblas/include/openblas_config.h:104,
                 from /usr/local/opt/openblas/include/cblas.h:5,
                 from src/fasttransforms.h:4,
                 from src/drivers.c:3:
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin17.7.0/8.2.0/include-fixed/stdio.h:78:10: fatal error: _stdio.h: No such file or directory
 #include <_stdio.h>
          ^~~~~~~~~~
compilation terminated.
In file included from /usr/local/opt/openblas/include/openblas_config.h:104,
                 from /usr/local/opt/openblas/include/cblas.h:5,
                 from src/fasttransforms.h:4,
                 from src/fftw.c:3:
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin17.7.0/8.2.0/include-fixed/stdio.h:78:10: fatal error: _stdio.h: No such file or directory
 #include <_stdio.h>
          ^~~~~~~~~~
compilation terminated.
make[1]: *** [lib] Error 1
make: *** [all] Error 2
@MikaelSlevinsky
Copy link
Owner

This is the same compilation error that used to appear in Travis' macOS builds, even on High Sierra.

I fixed it via f623ae8, which I found from some other GitHub repository feeling the same effects.

I've never experienced this error on either of my macs, but look forward to it!

@MikaelSlevinsky
Copy link
Owner

Also, the default FT_FFTW_FLAGS is now FFTW_MEASURE, but this may be an unduly burdensome for live computations. (I think FFTW stores some of the microkernels it compares, so perhaps the overhead is just experienced the first time at fixed degree).

@dlfivefifty
Copy link
Contributor Author

The FFT time is non-negligible, right? Why not use MKL which is apparently much faster?

@MikaelSlevinsky
Copy link
Owner

Could be used, but would require some modifications since MKL is incomplete. In particular, it doesn't implement real-to-complex transforms with split storage, halfcomplex-to-real transforms, or multidimensional real-to-real transforms. https://software.intel.com/en-us/mkl-developer-reference-c-using-fftw3-wrappers

@MikaelSlevinsky
Copy link
Owner

BTW, I added a proposal for Julia wrapper here JuliaApproximation/FastTransforms.jl@ee98f40

@dlfivefifty
Copy link
Contributor Author

Fixed it!! Here's the instructions

  1. Run (from https://stackoverflow.com/questions/52509602/cant-compile-c-program-on-a-mac-after-upgrade-to-mojave)
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

to restore /usr/include and /usr/lib

  1. Add
CFLAGS += -I/usr/include
LDFLAGS += -L/usr/lib

to Make.inc

@MikaelSlevinsky
Copy link
Owner

Is 2. necessary? are they not default search paths for gcc (which is why it can't find the headers to begin with)?

@dlfivefifty
Copy link
Contributor Author

Probably: I tried without them.

@MikaelSlevinsky
Copy link
Owner

Fun fact that I've been experimenting with recently: you can compile one file into assembly using one compiler (gcc-8 on rotations.c => rotations.s) and then use a different compiler to turn the assembly into executables/libraries. Clang has significantly better control over OpenMP threads, which is pronounced for low degrees.

@dlfivefifty
Copy link
Contributor Author

Actually, I just needed to rebuild gcc (I deleted /usr/local and started from scratch with homebrew)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants