在Mac OS X上出错:libtool:编译:无法识别的选项'-c'

问题描述 投票:0回答:1

我正在尝试制作一个名为seqpp的工具。但是我得到这个错误:

/bin/sh ../libtool --tag=F77   --mode=compile    -c -o fcdiv.lo fcdiv.f
libtool: compile: unrecognized option `-c'
libtool: compile: Try `libtool --help' for more information.

我使用MacOSx 10.9.5 Mavericks我想到了2个问题:

  • 缺少fortran编译器,
  • 或libtool软件包有问题。

    所以我通过使用Macports重新安装gcc编译器来安装gfortran:sudo port install gcc46 + gfortran。然后我使用MacPorts重新安装了libtool。我还安装了最新版本的开发人员工具,以防万一。

libtool似乎已正确安装:$哪个libtool/ usr / bin / libtool

我真的不知道如何检查gfortran的安装。而且可能还不行。正如您在日志中看到的:检查f77 ...否那是正确的问题吗?如果是,如何解决?

谢谢您的宝贵帮助!

这是安装的整个日志(“ ./configure”后跟“ make”命令):

   $ ./configure
    checking for a BSD-compatible install... /usr/bin/install -c  
    checking whether build environment is sane... yes  
    checking for a thread-safe mkdir -p... ./install-sh -c -d  
    checking for gawk... no  
    checking for mawk... no  
    checking for nawk... no  
    checking for awk... awk  
    checking whether make sets $(MAKE)... yes  
    checking for gawk... (cached) awk  
    checking for g++... g++  
    checking for C++ compiler default output file name... a.out  
    checking whether the C++ compiler works... yes  
    checking whether we are cross compiling... no  
    checking for suffix of executables...   
    checking for suffix of object files... o  
    checking whether we are using the GNU C++ compiler... yes  
    checking whether g++ accepts -g... yes  
    checking for style of include used by make... GNU  
    checking dependency style of g++... gcc3  
    checking for g77... no  
    checking for xlf... no  
    checking for f77... no  
    checking for frt... no  
    checking for pgf77... no  
    checking for cf77... no  
    checking for fort77... no  
    checking for fl32... no  
    checking for af77... no  
    checking for xlf90... no  
    checking for f90... no  
    checking for pgf90... no  
    checking for pghpf... no  
    checking for epcf90... no  
    checking for gfortran... no  
    checking for g95... no  
    checking for xlf95... no  
    checking for f95... no  
    checking for fort... no  
    checking for ifort... no  
    checking for ifc... no  
    checking for efc... no  
    checking for pgf95... no  
    checking for lf95... no  
    checking for ftn... no  
    checking whether we are using the GNU Fortran 77 compiler... no  
    checking whether  accepts -g... no  
    checking for a BSD-compatible install... /usr/bin/install -c  
    checking whether ln -s works... yes  
    checking build system type... i386-apple-darwin13.4.0  
    checking host system type... i386-apple-darwin13.4.0  
    checking for gcc... gcc  
    checking whether we are using the GNU C compiler... yes  
    checking whether gcc accepts -g... yes  
    checking for gcc option to accept ISO C89... none needed  
    checking dependency style of gcc... gcc3  
    checking for a sed that does not truncate output... /usr/bin/sed  
    checking for grep that handles long lines and -e... /usr/bin/grep  
    checking for egrep... /usr/bin/grep -E  
    checking for fgrep... /usr/bin/grep -F  
    checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains  /XcodeDefault.xctoolchain/usr/bin/ld  
    checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains  /XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no  
    checking for BSD- or MS-compatible name lister (nm)... /opt/local/bin/nm  
    checking the name lister (/opt/local/bin/nm) interface... BSD nm  
    checking the maximum length of command line arguments... 196608  
    checking whether the shell understands some XSI constructs... yes  
    checking whether the shell understands "+="... yes  
    checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain  /usr/bin/ld option to reload object files... -r  
    checking how to recognize dependent libraries... pass_all  
    checking for ar... ar  
    checking for strip... strip  
    checking for ranlib... ranlib  
    checking command to parse /opt/local/bin/nm output from gcc object... ok  
    checking for dsymutil... dsymutil  
    checking for nmedit... nmedit  
    checking for lipo... lipo
    checking for otool... otool
    checking for otool64... no
    checking for -single_module linker flag... yes
    checking for -exported_symbols_list linker flag... yes
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... rm: conftest.dSYM: is a directory
    rm: conftest.dSYM: is a directory
    yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking whether we are using the GNU C++ compiler... (cached) yes  
    checking whether g++ accepts -g... (cached) yes  
    checking dependency style of g++... (cached) gcc3  
    checking how to run the C++ preprocessor... g++ -E  
    checking for g77... no  
    checking for xlf... no  
    checking for f77... no  
    checking for frt... no  
    checking for pgf77... no  
    checking for cf77... no  
    checking for fort77... no  
    checking for fl32... no  
    checking for af77... no  
    checking for xlf90... no  
    checking for f90... no  
    checking for pgf90... no  
    checking for pghpf... no  
    checking for epcf90... no  
    checking for gfortran... no  
    checking for g95... no  
    checking for xlf95... no  
    checking for f95... no  
    checking for fort... no  
    checking for ifort... no  
    checking for ifc... no  
    checking for efc... no  
    checking for pgf95... no  
    checking for lf95... no  
    checking for ftn... no  
    checking whether we are using the GNU Fortran 77 compiler... (cached) no  
    checking whether  accepts -g... (cached) no
    checking for objdir... .libs
    rm: conftest.dSYM: is a directory
    checking if gcc supports -fno-rtti -fno-exceptions... yes
    checking for gcc option to produce PIC... -fno-common -DPIC
    checking if gcc PIC flag -fno-common -DPIC works... yes
    checking if gcc static flag -static works... no
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... darwin13.4.0 dyld
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
    checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
    checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking for g++ option to produce PIC... -fno-common -DPIC
    checking if g++ PIC flag -fno-common -DPIC works... yes
    checking if g++ static flag -static works... no
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... darwin13.4.0 dyld
    checking how to hardcode library paths into programs... immediate
    checking for gsl-config... /usr/local/bin/gsl-config
    checking for doxygen... no
    checking libintl.h usability... no
    checking libintl.h presence... no
    checking for libintl.h... no
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking for strings.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking getopt.h usability... yes
    checking getopt.h presence... yes
    checking for getopt.h... yes
    checking for getopt.h... (cached) yes
    checking for an ANSI C-conforming const... yes
    checking for size_t... yes
    checking for strchr... yes
    checking for strcspn... yes
    checking for strrchr... yes
    checking for strtol... yes
    checking for main in -lm... yes
    checking for ANSI C header files... (cached) yes
    checking for an ANSI C-conforming const... (cached) yes
    checking for inline... inline
    checking whether make sets $(MAKE)... (cached) yes
    configure: creating ./config.status
    config.status: creating seqpp.spec
    config.status: creating Makefile
    config.status: creating seqpp/Makefile
    config.status: creating doc/Makefile
    config.status: creating doc/doxyfiles/config.dox
    config.status: creating doc/doxyfiles/header.html
    config.status: creating doc/doxyfiles/footer.html
    config.status: creating doc/html/Makefile
    config.status: creating doc/man/Makefile
    config.status: creating argtable2/Makefile
    config.status: creating src/Makefile
    config.status: creating alphabet/Makefile
    config.status: creating data/Makefile
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: executing depfiles commands
    config.status: executing libtool commands
    configure: WARNING: "Note that XML Library libxml2 NOT FOUND or XML Modules NOT ACTIVATED by --enable-xml => XML output disabled."
    pc17:seqpp-4.2.0 iryna$ make
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
    Making all in seqpp
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    `/usr/local/bin/gsl-config --cflags` `` -O3 -MT Coder.lo -MD -MP -MF .deps/Coder.Tpo -c -o Coder.lo Coder.cc
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT Coder.lo -MD -MP -MF .deps/Coder.Tpo -c Coder.cc  -fno-common -DPIC -o .libs/Coder.o
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT Coder.lo -MD -MP -MF .deps/Coder.Tpo -c Coder.cc -o Coder.o >/dev/null 2>&1
    mv -f .deps/Coder.Tpo .deps/Coder.Plo
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    `/usr/local/bin/gsl-config --cflags` `` -O3 -MT arnoldi.lo -MD -MP -MF .deps/arnoldi.Tpo -c -o arnoldi.lo arnoldi.cc
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT arnoldi.lo -MD -MP -MF .deps/arnoldi.Tpo -c arnoldi.cc  -fno-common -DPIC -o .libs/arnoldi.o
    arnoldi.cc:218:51: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
                  cerr<<"arnoldi: no convergence, too many it<E9>rations !"<<endl;
                                                             ^~~~
    arnoldi.cc:482:51: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
                  cerr<<"arnoldi: no convergence, too many it<E9>rations !"<<endl;
                                                             ^~~~
    arnoldi.cc:744:51: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
                  cerr<<"arnoldi: no convergence, too many it<E9>rations !"<<endl;
                                                             ^~~~
    arnoldi.cc:1009:51: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
                  cerr<<"arnoldi: no convergence, too many it<E9>rations !"<<endl;
                                                             ^~~~
    4 warnings generated.
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT arnoldi.lo -MD -MP -MF .deps/arnoldi.Tpo -c arnoldi.cc -o arnoldi.o >/dev/null 2>&1
    mv -f .deps/arnoldi.Tpo .deps/arnoldi.Plo
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    `/usr/local/bin/gsl-config --cflags` `` -O3 -MT Sequence.lo -MD -MP -MF .deps/Sequence.Tpo -c -o Sequence.lo Sequence.cc
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT Sequence.lo -MD -MP -MF .deps/Sequence.Tpo -c Sequence.cc  -fno-common -DPIC -o .libs/Sequence.o
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT Sequence.lo -MD -MP -MF .deps/Sequence.Tpo -c Sequence.cc -o Sequence.o >/dev/null 2>&1
    mv -f .deps/Sequence.Tpo .deps/Sequence.Plo
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    `/usr/local/bin/gsl-config --cflags` `` -O3 -MT PrimarySequence.lo -MD -MP -MF .deps/PrimarySequence.Tpo -c -o PrimarySequence.lo PrimarySequence.cc
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT PrimarySequence.lo -MD -MP -MF .deps/PrimarySequence.Tpo -c PrimarySequence.cc  -fno-common -DPIC -o .libs/PrimarySequence.o
    PrimarySequence.cc:19:26: warning: comparison of unsigned expression < 0 is
          always false [-Wtautological-compare]
      if ( ( beg>stop )||(beg<0)||(stop>=_length) ){
                          ~~~^~
    PrimarySequence.cc:36:26: warning: comparison of unsigned expression < 0 is
          always false [-Wtautological-compare]
      if ( ( beg>stop )||(beg<0)||(stop>=_length) ){
                          ~~~^~
    2 warnings generated.
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT PrimarySequence.lo -MD -MP -MF .deps/PrimarySequence.Tpo -c PrimarySequence.cc -o PrimarySequence.o >/dev/null 2>&1
    mv -f .deps/PrimarySequence.Tpo .deps/PrimarySequence.Plo
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    `/usr/local/bin/gsl-config --cflags` `` -O3 -MT SequenceSet.lo -MD -MP -MF .deps/SequenceSet.Tpo -c -o SequenceSet.lo SequenceSet.cc
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT SequenceSet.lo -MD -MP -MF .deps/SequenceSet.Tpo -c SequenceSet.cc  -fno-common -DPIC -o .libs/SequenceSet.o
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT SequenceSet.lo -MD -MP -MF .deps/SequenceSet.Tpo -c SequenceSet.cc -o SequenceSet.o >/dev/null 2>&1
    mv -f .deps/SequenceSet.Tpo .deps/SequenceSet.Plo
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    `/usr/local/bin/gsl-config --cflags` `` -O3 -MT PhasedMarkov.lo -MD -MP -MF .deps/PhasedMarkov.Tpo -c -o PhasedMarkov.lo PhasedMarkov.cc
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT PhasedMarkov.lo -MD -MP -MF .deps/PhasedMarkov.Tpo -c PhasedMarkov.cc  -fno-common -DPIC -o .libs/PhasedMarkov.o
    In file included from PhasedMarkov.cc:1:
    ../seqpp/PhasedMarkov.h:31:17: warning: using directive refers to
          implicitly-defined namespace 'std'
    using namespace std;
                    ^
    PhasedMarkov.cc:63:20: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
            cerr<<"\"# Phase n<B0>\" line missing or mispositionned"<<endl;
                              ^~~~
    PhasedMarkov.cc:935:46: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
                    cerr<<"arnoldi: no convergence, too many it<E9>rations !"<<endl;
                                                               ^~~~
    PhasedMarkov.cc:1396:5: warning: add explicit braces to avoid dangling else
          [-Wdangling-else]
        else{
        ^
    PhasedMarkov.cc:1413:4: warning: add explicit braces to avoid dangling else
          [-Wdangling-else]
              else{
              ^
    PhasedMarkov.cc:1426:2: warning: add explicit braces to avoid dangling else
          [-Wdangling-else]
            else{
            ^
    PhasedMarkov.cc:1458:6: warning: add explicit braces to avoid dangling else
          [-Wdangling-else]
         else{       
         ^
    PhasedMarkov.cc:1619:70: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
      ...PhasedMarkov::distVarTot\n, Pi ou Mu ne sont pas d<E9>finis pour une de...
                                                           ^~~~
    PhasedMarkov.cc:1677:19: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
            Out << "# Phase n<B0>" << p <<endl;
                             ^~~~
    9 warnings generated.
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT PhasedMarkov.lo -MD -MP -MF .deps/PhasedMarkov.Tpo -c PhasedMarkov.cc -o PhasedMarkov.o >/dev/null 2>&1
    mv -f .deps/PhasedMarkov.Tpo .deps/PhasedMarkov.Plo
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    `/usr/local/bin/gsl-config --cflags` `` -O3 -MT Markov.lo -MD -MP -MF .deps/Markov.Tpo -c -o Markov.lo Markov.cc
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT Markov.lo -MD -MP -MF .deps/Markov.Tpo -c Markov.cc  -fno-common -DPIC -o .libs/Markov.o
    In file included from Markov.cc:1:
    In file included from ../seqpp/Markov.h:31:
    ../seqpp/PhasedMarkov.h:31:17: warning: using directive refers to
          implicitly-defined namespace 'std'
    using namespace std;
                    ^
    1 warning generated.
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT Markov.lo -MD -MP -MF .deps/Markov.Tpo -c Markov.cc -o Markov.o >/dev/null 2>&1
    mv -f .deps/Markov.Tpo .deps/Markov.Plo
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    `/usr/local/bin/gsl-config --cflags` `` -O3 -MT Translator.lo -MD -MP -MF .deps/Translator.Tpo -c -o Translator.lo Translator.cc
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT Translator.lo -MD -MP -MF .deps/Translator.Tpo -c Translator.cc  -fno-common -DPIC -o .libs/Translator.o
    Translator.cc:183:37: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
            cout<<_iter_si->first<<" est associ<E9> <E0> "
                                               ^~~~ ~~~~
    Translator.cc:190:37: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
            cout<<_iter_ci->first<<" est associ<E9> <E0> "
                                               ^~~~ ~~~~
    Translator.cc:202:37: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
            cout<<_iter_si->first<<" est associ<E9> <E0> "
                                               ^~~~ ~~~~
    Translator.cc:207:17: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
        cout<<"Compl<E9>mentaire"<<endl;
                    ^~~~
    Translator.cc:211:37: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
            cout<<_iter_si->first<<" est associ<E9> <E0> "
                                               ^~~~ ~~~~
    Translator.cc:218:28: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
          cout<<i<<" est associ<E9> <E0> "
                               ^~~~ ~~~~
    Translator.cc:223:28: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
          cout<<i<<" est associ<E9> <E0> "
                               ^~~~ ~~~~
    Translator.cc:353:37: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
            cout<<_iter_si->first<<" est associ<E9> <E0> "
                                               ^~~~ ~~~~
    Translator.cc:360:37: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
            cout<<_iter_ci->first<<" est associ<E9> <E0> "
                                               ^~~~ ~~~~
    Translator.cc:372:37: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
            cout<<_iter_si->first<<" est associ<E9> <E0> "
                                               ^~~~ ~~~~
    Translator.cc:379:28: warning: illegal character encoding in string literal
          [-Winvalid-source-encoding]
          cout<<i<<" est associ<E9> <E0> "
                               ^~~~ ~~~~
    11 warnings generated.
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -MT Translator.lo -MD -MP -MF .deps/Translator.Tpo -c Translator.cc -o Translator.o >/dev/null 2>&1
    mv -f .deps/Translator.Tpo .deps/Translator.Plo
    /bin/sh ../libtool --tag=F77   --mode=compile    -c -o fcdiv.lo fcdiv.f
    libtool: compile: unrecognized option `-c'
    libtool: compile: Try `libtool --help' for more information.
    make[2]: *** [fcdiv.lo] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
macos fortran fortran77 libtool
1个回答
0
投票

实际上,我发现了问题:确实是由于缺少fortran编译器。如我所知,我已经从Macports下载了一个包含fortran的gcc编译器,其中包括:

sudo端口安装gcc46 + gfortran

然后,我必须将此编译器设置为默认编译器:1)从Macports安装gcc_selectsudo端口安装gcc_select

2)查看所有gcc编译器,并将其中之一默认设置为编译器(我的编译器为mp-gcc46):端口选择--list gcc须藤端口选择--set gcc mp-gcc46

3)您可以检查编译器是否已被修改:gcc --version

就是这样,我希望它能对某人有所帮助

© www.soinside.com 2019 - 2024. All rights reserved.