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

Compiling from repository in Mac OS X error #13

Closed
MiguelPF opened this issue Mar 12, 2014 · 7 comments
Closed

Compiling from repository in Mac OS X error #13

MiguelPF opened this issue Mar 12, 2014 · 7 comments

Comments

@MiguelPF
Copy link

In OSX 10.9.2 with all the dependencies: autoconf, autolib, ocaml, ...
Downloading the repo and running:

./bootstrap.sh
make

Produces an error:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libsimd_sse2_nonportable.a(libsimd_sse2_nonportable_la-sse2-nonportable.o) has no symbols
libtool: link: ranlib .libs/libsimd_sse2_nonportable.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libsimd_sse2_nonportable.a(libsimd_sse2_nonportable_la-sse2-nonportable.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: warning for library: .libs/libsimd_sse2_nonportable.a the table of contents is empty (no object file members in the library define global symbols)
libtool: link: ( cd ".libs" && rm -f "libsimd_sse2_nonportable.la" && ln -s "../libsimd_sse2_nonportable.la" "libsimd_sse2_nonportable.la" )
Making all in dft
Making all in scalar
Making all in codelets
(cat ../../../COPYRIGHT ../../../support/codelet_prelude.dft; sh ../../../support/twovers.sh ../../../genfft/gen_notw.native -compact -variables 4 -pipeline-latency 4 -n 2 -name n1_2 -include "n.h") | sed -e s/@DATE@/"`date`"/ | indent -kr -cs -i5 -l800 -fca -nfc1 -sc -sob -cli4 -TR -Tplanner -TV >n1_2.c
indent: Command line: unknown parameter "-kr"
make[4]: *** [n1_2.c] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
@matteo-frigo
Copy link
Member

It looks like "indent" does not like the "-kr" option. "indent" is a program that reformats C code (we use it to pretty-print codelets); "-kr" specifies that we want the style from the K&R C book (the only true style). I am not familiar with OSX---perhaps it has a different version of indent.

Can you try editing support/Makefile.codelets, find the INDENT= line, and replace it with

INDENT = cat

Even better, please tell us how the OSX indent should be invoked so that we can patch FFTW.

Thanks,
Matteo

@stevengj
Copy link
Contributor

OSX has the BSD version of indent, which doesn't have the -kr option.

@MiguelPF
Copy link
Author

Seems that instead of the -kr option one should use(for BSD indent):

-nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs -nprs -npsl -saf -sai -saw -nsc -nsob -nss

Readed from here: http://stackoverflow.com/questions/1352104/how-do-i-tell-usr-bin-indent-on-mac-os-x-10-5-to-format-my-c-code-kr-style

However does not work, I end up installing gnu-indent and changing the line in support/Makefile.codelets to:

INDENT = gindent -kr -cs -i5 -l800 -fca -nfc1 -sc -sob -cli4 -TR -Tplanner -TV

Then I get the error:

libtool: link: gcc -D_THREAD_SAFE -O3 -fomit-frame-pointer -mtune=native -malign-double -fstrict-aliasing -fno-schedule-insns -ffast-math -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic -Wno-long-long -Wshadow -Wbad-function-cast -Wwrite-strings -Wstrict-prototypes -Wredundant-decls -Wnested-externs -o bench bench-bench.o bench-hook.o bench-fftw-bench.o  ../threads/.libs/libfftw3_threads.a /Users/miguelpousafreire/Lion/miguel-fftw3/fftw3/.libs/libfftw3.a ../.libs/libfftw3.a ../libbench2/libbench2.a -lm
Undefined symbols for architecture x86_64:
  "_fftw_codelet_n1_2", referenced from:
      _fftw_solvtab_dft_standard in libfftw3.a(codlist.o)
     (maybe you meant: _fftw_codelet_n1_25, _fftw_codelet_n1_20 )
  "_fftw_codelet_n1_3", referenced from:
      _fftw_solvtab_dft_standard in libfftw3.a(codlist.o)
     (maybe you meant: _fftw_codelet_n1_32)
  "_fftw_codelet_n1_4", referenced from:
      _fftw_solvtab_dft_standard in libfftw3.a(codlist.o)
  "_fftw_codelet_n1_5", referenced from:
      _fftw_solvtab_dft_standard in libfftw3.a(codlist.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bench] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

@stevengj
Copy link
Contributor

Did the codelet builds work? I assume you have ocaml installed?

@MiguelPF
Copy link
Author

Yes the codelet builds and ocaml is installed,
The error is produced when make is in tests 'section'

Making all in tests
/bin/sh ../libtool  --tag=CC   --mode=link gcc -D_THREAD_SAFE  -O3 -fomit-frame-pointer -mtune=native -malign-double -fstrict-aliasing -fno-schedule-insns -ffast-math -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align -pedantic -Wno-long-long -Wshadow -Wbad-function-cast -Wwrite-strings -Wstrict-prototypes -Wredundant-decls -Wnested-externs   -o bench bench-bench.o bench-hook.o bench-fftw-bench.o ../threads/libfftw3_threads.la ../libfftw3.la ../libbench2/libbench2.a  -lm 

rdolbeau added a commit that referenced this issue Apr 13, 2015
…ndent.

BSD 'indent' in e.g. MacOSX doesn't support -kr, which is the default style in FFTW3.
Fallback to 'indent' with no option for non-GNU 'indent', or 'cat' if 'indent' is not available.
This should fix GitHub issue #13.
@rdolbeau
Copy link
Contributor

The 'indent' issue should be fixed now.

As for the undefined symbols, it's likely the 'indent' failure caused empty codelet files to be generated. Remove them and try to rebuild (i.e. "find fftw3/ -type f -name '*.c' -size 0 -exec rm -f {} ;").

@sunjunlishi
Copy link

2> problem.c
2> rank-geq2.c
2> solve.c
2> vrank-geq1.c
2> conf.c
2> creating C:/bin/fftw37/Debug/fftw3.lib 和对象 C:/bin/fftw37/Debug/fftw3.exp
2>conf.c.obj : error LNK2001:unresolved _fftw_solvtab_dft_standard
2>conf.c.obj : error LNK2001: unresolved _fftw_solvtab_rdft_r2cf
2>conf.c.obj : error LNK2001: unresolved _fftw_solvtab_rdft_r2cb
2>conf.c.obj : error LNK2001: unresolved _fftw_solvtab_rdft_r2r
2>C:\bin\fftw37\Debug\fftw3.dll : fatal error LNK1120: 4 个 unresolved

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

5 participants