From owner-freebsd-users-jp@freebsd.org Fri Aug 24 02:06:53 2018 Return-Path: Delivered-To: freebsd-users-jp@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7BE9109E172 for ; Fri, 24 Aug 2018 02:06:52 +0000 (UTC) (envelope-from kh@mogami.com) Received: from mail.mogami.com (mail.mogami.com [122.103.163.237]) by mx1.freebsd.org (Postfix) with ESMTP id 2BEBF71E7A for ; Fri, 24 Aug 2018 02:06:51 +0000 (UTC) (envelope-from kh@mogami.com) Received: from ana (ana [192.168.2.130]) by mail.mogami.com (Postfix) with SMTP id 8E35518CC3A for ; Fri, 24 Aug 2018 11:06:43 +0900 (JST) Date: Fri, 24 Aug 2018 11:06:43 +0900 From: Kouichi Hirabayashi To: freebsd-users-jp@freebsd.org Message-Id: <20180824110643.16b6f63c4a31dedf696c1fdb@mogami.com> In-Reply-To: <20180821204725.543a729a216c70bc5cc0a440@mogami.com> References: <20180611144018.f90de42d7d9a3713f86b8e4e@mogami.com> <20180615073842.961e6e59b803165b171f2b87@mogami.com> <57cd8d34-b8aa-b55e-afd6-07b331e0f13f@fmp.to> <20180618200817.b4e564b0b0c99d2b5dee27b2@mogami.com> <7cc354e1-5c75-a256-befe-5aa8dd3f8232@fmp.to> <20180620172334.8bb52c2a3beaa71947c8c2de@mogami.com> <20180622120023.a76633b9ebd8ab335a2ab4e7@mogami.com> <8f160012-28c6-5265-28e6-66da804feac2@fmp.to> <20180623093352.68ffe98669dd7f41bd92a079@dec.sakura.ne.jp> <20180628142026.be52082bc4e9a983b3ef9f6b@mogami.com> <7a620cc5-9c98-600f-115d-d91f814427ab@fmp.to> <20180629110545.393b1c9b6fc9c90f45749cdf@mogami.com> <20180809200439.5318d0a6ee84c58fb5945ab6@mogami.com> <0c87c945-b11e-6150-4638-cb8af73b165f@fmp.to> <20180820184612.14cd9960430a7100844e9fcd@mogami.com> <20180821204725.543a729a216c70bc5cc0a440@mogami.com> Organization: MIT Inc. X-Mailer: Sylpheed 3.3.0 (GTK+ 2.24.17; i386-portbld-freebsd8.4) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Subject: [FreeBSD-users-jp 96301] Re: =?iso-2022-jp?b?RnJlZUZlbSsrIBskQiROJSQlcyU5JUghPCVrTGQbKEI=?= =?iso-2022-jp?b?GyRCQmobKEI=?= X-BeenThere: freebsd-users-jp@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussion relevant to FreeBSD communities in Japan List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2018 02:06:53 -0000 FreeBSD-11.2 で FreeFem++ を gcc+gfortran で compile した場合 のライブラリ不整合の根本的対策として gcc-free で compile する方法を 考えてみました。 現時点の FreeBSD としては、前回の gcc で compile した libGLU.so.a を作って static link する方法より、この方針のほうが利点が大きいと思い ます。 以下、ports のメカニズムを使わずに compile する方法を書きますが、 shells/bash, ftp/wget, lang/perl5X, graphics/freeglut, devel/flang は前もって ports から install しておいてください。 freefem++-3.61-1.tar.gz を展開したディレクトリで下記の手順でコンパ イルします。 1) freefem++-3.61-1.tar.gz を展開し、下記のパッチをあてる --- src/femlib/CheckPtr.cpp.orig 2018-03-28 16:02:20.000000000 +0900 +++ src/femlib/CheckPtr.cpp 2018-08-23 11:24:23.000000000 +0900 @@ -27,6 +27,8 @@ */ #if __APPLE__ #include +#elif __FreeBSD__ +#include #else #include #endif --- src/medit/Makefile.am.orig 2018-06-20 21:46:49.000000000 +0900 +++ src/medit/Makefile.am 2018-08-23 11:27:40.000000000 +0900 @@ -25,7 +25,7 @@ ffmedit_DEPENDENCIES=picking.$(OBJEXT) picking.$(OBJEXT):picking.c - ${CC} -c $< $(CNOFLAGS) -o $@ + ${CC} -c $< $(CNOFLAGS) $(CFLAGS) -o $@ #pinking.no-optffmedit$(EXEEXT):picking.c # rm picking.$(OBJEXT) --- src/medit/Makefile.in.orig 2018-07-12 18:59:19.000000000 +0900 +++ src/medit/Makefile.in 2018-08-23 19:31:55.000000000 +0900 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -845,7 +845,7 @@ compil.date: $(ffmedit_SOURCES) echo "#define COMPIL " '"' `date` '(with ff++ $(VERSION))''"' > compil.date picking.$(OBJEXT):picking.c - ${CC} -c $< $(CNOFLAGS) -o $@ + ${CC} -c $< $(CNOFLAGS) $(CFLAGS) -o $@ #pinking.no-optffmedit$(EXEEXT):picking.c # rm picking.$(OBJEXT) --- download/blas/Makefile.am.orig 2018-03-28 16:02:20.000000000 +0900 +++ download/blas/Makefile.am 2018-08-23 18:05:26.000000000 +0900 @@ -109,7 +109,7 @@ BLAS/fait:$(BLAS_TGZ) mkdir -p ../include ../lib - pxerbla=`tar tf $(BLAS_TGZ) | grep xerbla.f`; \ + pxerbla=`tar tf $(BLAS_TGZ) | grep _xerbla.f`; \ dirblas=`dirname $$pxerbla` ;\ case $$dirblas in \ BLAS) tar xvzf $(BLAS_TGZ) ;; \ --- download/blas/Makefile.in.orig 2018-07-12 18:59:19.000000000 +0900 +++ download/blas/Makefile.in 2018-08-23 19:31:54.000000000 +0900 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -4282,7 +4282,7 @@ BLAS/fait:$(BLAS_TGZ) mkdir -p ../include ../lib - pxerbla=`tar tf $(BLAS_TGZ) | grep xerbla.f`; \ + pxerbla=`tar tf $(BLAS_TGZ) | grep _xerbla.f`; \ dirblas=`dirname $$pxerbla` ;\ case $$dirblas in \ BLAS) tar xvzf $(BLAS_TGZ) ;; \ --- download/fftw/Makefile.am.orig 2018-03-28 16:02:20.000000000 +0900 +++ download/fftw/Makefile.am 2018-08-24 07:39:31.000000000 +0900 @@ -17,7 +17,7 @@ $(MAKE) WHERE $(SRCDIR)/FAIT:$(SRCDIR)/FAIT-1 - cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP='gcc -E' CXXFLAGS="$(CXXFLAGS)" + cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CXXCPP)" CXXFLAGS="$(CXXFLAGS)" cd $(SRCDIR) && make cd $(SRCDIR) && make install touch $(SRCDIR)/FAIT --- download/fftw/Makefile.in.orig 2018-08-23 19:31:54.000000000 +0900 +++ download/fftw/Makefile.in 2018-08-24 07:41:13.000000000 +0900 @@ -607,7 +607,7 @@ $(MAKE) WHERE $(SRCDIR)/FAIT:$(SRCDIR)/FAIT-1 - cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP='gcc -E' CXXFLAGS="$(CXXFLAGS)" + cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CXXCPP)" CXXFLAGS="$(CXXFLAGS)" cd $(SRCDIR) && make cd $(SRCDIR) && make install touch $(SRCDIR)/FAIT --- download/fftw/Makefile.am.orig 2018-03-28 16:02:20.000000000 +0900 +++ download/fftw/Makefile.am 2018-08-24 07:39:31.000000000 +0900 @@ -17,7 +17,7 @@ $(MAKE) WHERE $(SRCDIR)/FAIT:$(SRCDIR)/FAIT-1 - cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP='gcc -E' CXXFLAGS="$(CXXFLAGS)" + cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CXXCPP)" CXXFLAGS="$(CXXFLAGS)" cd $(SRCDIR) && make cd $(SRCDIR) && make install touch $(SRCDIR)/FAIT --- download/fftw/Makefile.in.orig 2018-08-23 19:31:54.000000000 +0900 +++ download/fftw/Makefile.in 2018-08-24 07:41:13.000000000 +0900 @@ -607,7 +607,7 @@ $(MAKE) WHERE $(SRCDIR)/FAIT:$(SRCDIR)/FAIT-1 - cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP='gcc -E' CXXFLAGS="$(CXXFLAGS)" + cd $(SRCDIR) && ./configure --disable-dependency-tracking --disable-fortran --prefix=`pwd`/../.. CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS)" CPP="$(CXXCPP)" CXXFLAGS="$(CXXFLAGS)" cd $(SRCDIR) && make cd $(SRCDIR) && make install touch $(SRCDIR)/FAIT -- patch をあてた後、下記を実行しておきます。 $ autoreconf -i Makefile の patch は今まで表面化しなかった bug を考えて良いと思います。 2) 環境を Linux に合わせる # ln -s /usr/local/bin/wget /usr/bin/wget # ln -s /usr/local/bin/perl /usr/bin/perl # ln -s /usr/local/bin/bash /bin/bash # mv /usr/bin/make /usr/bin/make.bsd # ln -s /usr/local/bin/gmake /usr/bin/make この部分は wget, perl, bash を絶対 PATH で指定している build/download, build/cleancrlf, build/ff-md5, build/links2files, build/orgindex, download/getall, examples++-load/ff-pkg-download.in などを FreeBSD 用に書き換えて も良いと思いますが、最終的に ports メカニズムで解決でしょうか。gmake を 使う部分は compile 時点で gmake への link を ~/bin にでも置いて、 PATH 変数で一時的に /usr/bin より先に見付けるようにしても良いと思います。 3) freefem++-3.61-1 を compile する $ ./configure --enable-download -without-mpi CC=clang CXX=clang++ FC=flang \ CXXCPP="flang -E" \ F77=flang -with-glut="-lglut -lGLU -lGL" \ CFLAGS="-I/usr/local/include -Wno-comment" \ CXXFLAGS="-I/usr/local/include -DHAVE_DRAND48" $ make # やりなおす場合は make clean 実行後 4) install する # cd freefem++-3.61-1 # make install # make clean # 動作確認後 5) 環境を BSD に戻す # rm /usr/bin/wget /usr/bin/perl /bin/bash # rm /usr/bin/make # ln -s /usr/local/bin/make.bsd /usr/bin/make 注意 - flang が存在しない古い FreeBSD では使えませんが、fc2 を 使うとか Intel の compiler で対応できるかもしれません。 平林 浩一