編譯mysql時的問題請教

edited 十月 2013 in 伺服器環境
以下是我安裝mysql的時候遇到的問題(紅字部分),
我是首次安裝為何她說我的舊檔案比新檔案還新呢?
還是我的編譯環境不符? (我用: gcc4.0)


[[email protected] mysql-4.1.13a]# CFLAGS="-03" CXX=gcc CXXFLAGS="-03 \
> -felide-constructors -fno-exceptions -fno-rtti" \
> ./configure -prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=all-static \
> --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=big5 --with-debug

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... configure: error: newly created file is older than distributed files!
Check your system clock


原始討論: http://twpug.net/x/modules/newbb/viewtopic.php?topic_id=758

評論

  • edited 八月 2005
    錯誤訊息應該很清楚?
    新建立的檔案比現有的檔案還舊,請檢查你的系統時間
  • edited 八月 2005
    是這樣喔,
    不知什麼原因,我裝完linux後就發現到時間與現實不符(慢於實際時間的差距越來越大,目前竟是7月10日),
    我是用VMware在xp上裝linux(centOS4)的...

    為何時間不對會影響軟體的編譯與安裝呢?

    我是首次安裝編譯mysql,為何有所謂的舊檔案?

    ...那麼我該怎麼調教/處理此一問題呢?

    謝謝#
  • edited 八月 2005
    我比較好奇的是,你希望做什麼?

    你問的問題大部分我都沒有經歷過,所以我也無從回答起。
  • edited 八月 2005
    上述問題在我將系統時間調教正確後已解決,
    不好意思喔..現在又出現錯誤訊息如下:
    checking for gcc...no
    configure:error: no acceptable C compiler found in $PATH

    我做了如下動作:
    # rpm -qa | grep gcc
    libgcc-3.4.3-9.EL4
    gcc4-4.0.0-0.14.EL4
    如此,為何會說我沒有gcc呢?

    下方是我做的查詢:
    #rpm -qi gcc4-4.0.0-0.14.EL4
    Summary: Preview of GCC version 4.0

    #rpm -qi libgcc-3.4.3-9.EL4
    Summary: GCC version3.4 shared support library.
  • edited 八月 2005
    首先請教以我的情形(既然我已安裝)為何編譯時會說找不到gcc?
    checking for gcc...no
    configure:error: no acceptable C compiler found in $PATH

    還有我是否要執行如下動作才能解決?
    #ln -s /usr/bin/gcc4 gcc

    最後是,$PATH 又該怎麼加入呢?
    (我當初是以yum方式安裝gcc4的,為何她沒有自動幫我加到$PATH,這表示以後我都要自己做這動作嗎 )
  • edited 八月 2005
    我知了,
    因為我升級成gcc4的關係,所以compiler已不再是/usr/bin/gcc而是/usr/bin/gcc4,或許這就是編譯mysql時會說找不到gcc的原因所在.

    總之我做了#ln -s /usr/bin/gcc4 gcc動作後就解決了....THANKS A LOT!!

    現在我已執行過./configure了,但當執行 #make ,她又回報說:
    make: ->->-> No targets specified and no makefile found. Stop.

    於是我看了一下source目錄下有:
    Makefile.am
    Makefile.in
    不知道這是不是其所要的makefile??...還是還有其他問題?
  • edited 八月 2005
    由於懷疑是 gcc4 太新的關係,
    我後來已經移除 gcc4 套件,並裝上 gcc 3.4.3-22.1 (還有 cpp , libgcc 也都是同樣版),
    但還是出現如上文一樣的 err message .

    p.s 我都是用 yum 所以關於相依性,套件版本是否符合正確的OS...等等,應該都沒什麼問題!


    以下是我執行過 ./configure 後的訊息(stdout),不知有什麼嚴重疏失導致無法正確產生Makefile??
    ==========================================================
    [[email protected] mysql-4.1.13a]# CFLAGS="-03" CXX=gcc CXXFLAGS="-03 \
    > -felide-constructors -fno-exceptions -fno-rtti" \
    > ./configure -prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=all-static \
    > --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=big5 --with-debug
    checking build system type... i686-pc-linux-gnu
    checking host system type... i686-pc-linux-gnu
    checking target system type... i686-pc-linux-gnu
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking whether build environment is sane... yes
    checking whether make sets $(MAKE)... (cached) yes
    checking for gawk... (cached) gawk
    checking for gcc... gcc
    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 gcc accepts -g... yes
    checking for gcc option to accept ANSI C... none needed
    checking for style of include used by make... GNU
    checking dependency style of gcc... gcc3
    checking whether we are using the GNU C++ compiler... no
    checking whether gcc accepts -g... no
    checking dependency style of gcc... gcc3
    checking how to run the C preprocessor... gcc -E
    checking "C Compiler version"... "gcc gcc (GCC) 4.0.0 20041214 (Red Hat 4.0.0-0.14.EL4)"
    checking "C++ compiler version"... "gcc gcc (GCC) 4.0.0 20041214 (Red Hat 4.0.0-0.14.EL4)"
    checking for ranlib... ranlib
    checking for a sed that does not truncate output... /bin/sed
    checking for egrep... grep -E
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for /usr/bin/ld option to reload object files... -r
    checking for BSD-compatible nm... /usr/bin/nm -B
    checking whether ln -s works... yes
    checking how to recognise dependent libraries... pass_all
    checking for ANSI C header files... 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 dlfcn.h usability... yes
    checking dlfcn.h presence... yes
    checking for dlfcn.h... yes
    checking how to run the C++ preprocessor... /lib/cpp
    configure: error: C++ preprocessor "/lib/cpp" fails sanity check
    See `config.log' for more details.
    ==========================================================

    -> 由最後一行來看,之所以沒能正確產生出 Makefile ,
    看來好像是我沒裝 c++ compiler 的關係(其他行末處為"no"字眼的,我也不大懂是否有關),


    但是:


    我是參考 tarball 文件的(位於: source 目錄 /docs/mysql.info),我不是很懂,總之我列出如下:

    If you are using `gcc' and don't have `libg++' or
    `libstdc++' installed, you can tell `configure' to use
    `gcc' as your C++ compiler:

    shell> CC=gcc CXX=gcc ./configure

    When you use `gcc' as your C++ compiler, it does not attempt
    to link in `libg++' or `libstdc++'. This may be a good idea
    to do even if you have these libraries installed, because
    some versions of them have caused strange problems for MySQL
    users in the past.



    -> 感覺上她的意思是若無 c++ compiler 者,也可告訴 ./configure 指定以 gcc 來編譯 c++'s source,且我還符合她的其他條件就是: 我系統上也無`libg++' 及 `libstdc++' ....
    所以當看到錯誤訊息中有以下這行真的有點給她混亂
    configure: error: C++ preprocessor "/lib/cpp" fails sanity check
  • edited 八月 2005
    關於:
    configure: error: C++ preprocessor "/lib/cpp" fails sanity check

    -> cpp 鷹該是 C 的 Preprocessor ,為何她說是 C++ 呢??

    p.s 我 ls -al /lib/cpp ,發現此是一個連結檔, link 到 /usr/bin/cpp


    還有,
    以下是官方網站提到的一段話,不知是否與此有關??
    P.S 我的 gcc 版本是 : 3.4.3-22.1

    ==========================================================================
    Source downloads
    Compiler Advisory: Several users have reported random crashes and table corruptions when using MySQL binaries compiled with gcc 2.96 on the x86 Linux platform. We suggest that you use gcc 2.95 or gcc 2.91 to compile your own binaries. It should also be safe to use gcc 3.2.

    For maximum stability and performance, we recommend that you use the binaries we provide.
    ==========================================================================
  • edited 八月 2005
    可以編譯了...

    我大概有點懂了,由於我的 ./configure 參數指定了以 gcc 來作為 c++ compiler,
    問題就在於我目前的 gcc-3.4.3-22.1 package 尚無 c++ 的 support,所以才會一
    直過不了關,直至我裝了 gcc-c++-3.4.3-22.1 package 才無此問題!.....不知我這樣想對不對??

    ->
    另外,請問下面這行是何意義?
    configure: error: C++ preprocessor "/lib/cpp" fails sanity check


    最後,回報:
    make install 還是沒過關...
    嗯,以下貼出 make install 的 stderr 與 ./configure 的參數設定:
    =============================================
    gcc: all-static: No such file or directory
    gcc: unrecognized option `-03'
    make[3]: *** [mysql_tzinfo_to_sql] Error 1
    make[2]: *** [install-recursive] Error 1
    make[1]: *** [install] Error 2
    make: *** [install-recursive] Error 1
    =============================================

    # CFLAGS="-03" CXX=gcc CXXFLAGS="-03 \
    > -felide-constructors -fno-exceptions -fno-rtti" \
    > ./configure -prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=all-static \
    > --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=big5 --with-debug

    會不會是與下面的這段話有關??
    (因為我有安裝: libstdc++ 套件)
    If you are using `gcc' and don't have `libg++' or
    `libstdc++' installed, you can tell `configure' to use
    `gcc' as your C++ compiler:

    shell> CC=gcc CXX=gcc ./configure

    When you use `gcc' as your C++ compiler, it does not attempt
    to link in `libg++' or `libstdc++'. This may be a good idea
    to do even if you have these libraries installed,because
    some versions of them have caused strange problems for MySQL
    users in the past.


    還有我 configure 與 make 的時間一共花了 8,90 分鐘,這正常嗎? (跟灌 xp 有得比)
Sign In or Register to comment.