<div dir="ltr">Additionally, the dependency port:xorg-libX11 does not seem necessary: I don't see any evidence in the build log that it is used, and the build succeeds without it being active.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 16, 2016 at 5:23 PM, David Strubbe <span dir="ltr"><<a href="mailto:dstrubbe@macports.org" target="_blank">dstrubbe@macports.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Let me add a few comments.</div><div>- The dependency for BLAS is wrong: the port OpenBLAS provides a library -lopenblas not -lblas. Apparently the "lapack" port includes BLAS anyway. To be simpler and more flexible, I suggest use of the linear algebra port group I created to handle all this and also provide choices of different optimized implementations (ATLAS, Accelerate, or OpenBLAS -- the port has lapack included). See patch below.</div><div>- You are installing a lot of Makefiles and C source files -- is this on purpose? It is somewhat unusual.</div><div>- You are putting everything in the lib directory. This should be reserved for libraries. Headers should go in include; documentation or miscellaneous things should go in share; etc.</div><div>- Since there are tests apparently available, you should create a test phase rather than install their files, so that users can run "port test".</div><div><br></div><div>David</div><div><br></div><div><div>Index: Portfile</div><div>==============================<wbr>==============================<wbr>=======</div><div>--- Portfile (revision 153958)</div><div>+++ Portfile (working copy)</div><div>@@ -3,6 +3,7 @@</div><div> </div><div> PortSystem 1.0</div><div> PortGroup compilers 1.0</div><div>+PortGroup linear_algebra 1.0</div><div> </div><div> cvs.date 20160908</div><div> </div><div>@@ -29,9 +30,7 @@</div><div> sha256 <wbr>ef797abc51ed8ae27c200f5b71fd0a<wbr>3824d1fa310392dac57067de2e4232<wbr>22ed</div><div> worksrcdir ${distname}-${version}+dfsg</div><div> </div><div>-depends_lib port:OpenBLAS \</div><div>- port:lapack \</div><div>- port:gsl \</div><div>+depends_lib port:gsl \</div><div> port:fftw-3 \</div><div> port:pgplot \</div><div> port:xorg-libX11</div><div>@@ -47,6 +46,7 @@</div><span class=""><div> reinplace -W ${worksrcpath} "s|@FFLAGS@|${configure.<wbr>fflags}|g" local_settings</div></span><span class=""><div> reinplace -W ${worksrcpath} "s|@LDFLAGS@|${configure.<wbr>ldflags}|g" local_settings</div></span><span class=""><div> reinplace -W ${worksrcpath} "s|@LIB_FORTRAN@|${compilers.<wbr>libfortran}|g" local_settings</div></span><div>+ reinplace -W ${worksrcpath} "s|@LIB_LAPACK@|${linalglib}|<wbr>g" local_settings</div><div> }</div><div> </div><div> build.env-append HOME_LORENE=${worksrcpath}</div><div>Index: files/local_settings</div><div>==============================<wbr>==============================<wbr>=======</div><div>--- files/local_settings (revision 153958)</div><div>+++ files/local_settings (working copy)</div><div>@@ -74,7 +74,7 @@</div><span class=""><div> </div><div> # Linear Algebra Package (LAPACK) library</div></span><div> # ------------------------------<wbr>---------</div><div>-LIB_LAPACK = -llapack -lblas</div><div>+LIB_LAPACK = @LIB_LAPACK</div><span class=""><div> </div><div> # Graphical libraries: PGPLOT, PNG and X11</div></span><div> # ------------------------------<wbr>----------</div></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 16, 2016 at 1:27 PM, Ryan Schmidt <span dir="ltr"><<a href="mailto:ryandesign@macports.org" target="_blank">ryandesign@macports.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On Oct 16, 2016, at 12:41 PM, <a href="mailto:thibaut@macports.org" target="_blank">thibaut@macports.org</a> wrote:<br>
><br>
> Revision<br>
> 153943<br>
> Author<br>
> <a href="mailto:thibaut@macports.org" target="_blank">thibaut@macports.org</a><br>
> Date<br>
> 2016-10-16 10:41:08 -0700 (Sun, 16 Oct 2016)<br>
> Log Message<br>
><br>
> New port: LORENE<br>
> Added Paths<br>
><br>
> • trunk/dports/science/LORENE/<br>
> • trunk/dports/science/LORENE/Po<wbr>rtfile<br>
> • trunk/dports/science/LORENE/fi<wbr>les/<br>
> • trunk/dports/science/LORENE/fi<wbr>les/local_settings<br>
> Diff<br>
><br>
> Added: trunk/dports/science/LORENE/Po<wbr>rtfile (0 => 153943)<br>
><br>
> --- trunk/dports/science/LORENE/Po<wbr>rtfile (rev 0)<br>
> +++ trunk/dports/science/LORENE/Po<wbr>rtfile 2016-10-16 17:41:08 UTC (rev 153943)<br>
> @@ -0,0 +1,67 @@<br>
> +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:<wbr>ts=4:sts=4<br>
> +# $Id$<br>
<br>
The whitespace of this portfile does not conform to this modeline. Tabs should be replaced with spaces.<br>
<br>
<br>
> +PortSystem 1.0<br>
> +PortGroup compilers 1.0<br>
> +<br>
> +cvs.date 20160908<br>
> +<br>
> +name LORENE<br>
> +version 0.0.0~cvs${cvs.date}<br>
> +<br>
> +categories science<br>
> +maintainers thibaut openmaintainer<br>
> +description Langage Objet pour la RElativité NumériquE<br>
> +long_description LORENE is a set of C++ classes to solve various problems \<br>
> + arising in numerical relativity, and more generally in \<br>
> + computational astrophysics. It provides tools to solve \<br>
> + partial differential equations by means of multi-domain \<br>
> + spectral methods.<br>
> +<br>
> +license gpl-2+<br>
> +platforms darwin<br>
> +<br>
> +homepage <a href="http://www.lorene.obspm.fr/" rel="noreferrer" target="_blank">http://www.lorene.obspm.fr/</a><br>
> +master_sites <a href="https://people.debian.org/~thibaut/debian/pool/main/l/lorene/" rel="noreferrer" target="_blank">https://people.debian.org/~th<wbr>ibaut/debian/pool/main/l/loren<wbr>e/</a><br>
> +distname lorene<br>
> +distfiles ${distname}_${version}+dfsg.or<wbr>ig.tar.xz<br>
<br>
Because this is not a tar.gz file but a tar.xz file, you must use "use_xz yes" to tell MacPorts how to decompress it. (Mavericks (?) and later can figure it out automatically, but our policy is not to rely on that, and to specify it correctly in the Portfile.)<br>
<br>
<br>
> +checksums rmd160 36346f8d7a50acee20a5b81051af2e<wbr>7fe5f188c1 \<br>
> + sha256 ef797abc51ed8ae27c200f5b71fd0a<wbr>3824d1fa310392dac57067de2e4232<wbr>22ed<br>
> +worksrcdir ${distname}-${version}+dfsg<br>
> +<br>
> +depends_lib port:OpenBLAS \<br>
> + port:lapack \<br>
> + port:gsl \<br>
> + port:fftw-3 \<br>
> + port:pgplot \<br>
> + port:xorg-libX11<br>
> +<br>
> +compilers.choose cxx f77<br>
> +compilers.setup require_fortran<br>
> +<br>
> +configure {<br>
> + file copy ${filespath}/local_settings ${worksrcpath}/<br>
> + reinplace -W ${worksrcpath} "s|@CXX@|${configure.cxx}|g" local_settings<br>
> + reinplace -W ${worksrcpath} "s|@F77@| ${configure.f77} |g" local_settings<br>
> + reinplace -W ${worksrcpath} "s|@CXXFLAGS@|${configure.cxxf<wbr>lags}|g" local_settings<br>
> + reinplace -W ${worksrcpath} "s|@FFLAGS@|${configure.fflags<wbr>}|g" local_settings<br>
> + reinplace -W ${worksrcpath} "s|@LDFLAGS@|${configure.ldfla<wbr>gs}|g" local_settings<br>
> + reinplace -W ${worksrcpath} "s|@LIB_FORTRAN@|${compilers.l<wbr>ibfortran}|g" local_settings<br>
> +}<br>
<br>
I don't see anywhere in this Portfile that arranges for the correct -arch (or, in the case of fortran, -m32/-m64) flags to be used. ([get_canonical_archflags ...])<br>
<br>
The universal variant fails and should probably be disabled because:<br>
<br>
Error: Cannot install LORENE for the archs 'i386 x86_64' because<br>
Error: its dependency pgplot does not build for the required archs by default<br>
Error: and does not have a universal variant.<br>
<br>
<br>
> +build.env-append HOME_LORENE=${worksrcpath}<br>
> +build.target cpp fortran export<br>
> +use_parallel_build no<br>
> +<br>
> +destroot {<br>
> + xinstall -d ${destroot}${prefix}/lib/loren<wbr>e/Lib<br>
> + xinstall {*}[glob ${worksrcpath}/Lib/*.a] ${destroot}${prefix}/lib/loren<wbr>e/Lib/<br>
> + xinstall -d ${destroot}${prefix}/lib/loren<wbr>e/C++/Include<br>
> + xinstall {*}[glob ${worksrcpath}/C++/Include/*.h<wbr>] ${destroot}${prefix}/lib/loren<wbr>e/C++/Include/<br>
> + xinstall -d ${destroot}${prefix}/lib/loren<wbr>e/C++/Include/Template<br>
> + xinstall {*}[glob ${worksrcpath}/C++/Include/Tem<wbr>plate/*] ${destroot}${prefix}/lib/loren<wbr>e/C++/Include/Template/<br>
> + xinstall ${worksrcpath}/local_settings ${destroot}${prefix}/lib/loren<wbr>e/<br>
> + xinstall -d ${destroot}${prefix}/lib/loren<wbr>e/Devel<br>
> + xinstall {*}[glob ${worksrcpath}/Devel/*] ${destroot}${prefix}/lib/loren<wbr>e/Devel/<br>
> + exec cp -a ${worksrcpath}/Codes ${destroot}${prefix}/lib/loren<wbr>e/<br>
> +}<br>
<br>
Why "exec cp -a" instead of "copy"?<br>
<br>
<br>
> --- trunk/dports/science/LORENE/fi<wbr>les/local_settings (rev 0)<br>
> +++ trunk/dports/science/LORENE/fi<wbr>les/local_settings 2016-10-16 17:41:08 UTC (rev 153943)<br>
> @@ -0,0 +1,89 @@<br>
> + #############################<wbr>##############################<wbr>####<br>
> +#<br>
<br>
Should there be this indentation on the first line?<br>
<br>
<br>
> +# Edit the following lines according to your implementation.<br>
> +#<br>
> +# The environment variable HOME_LORENE (root directory for the<br>
> +# Lorene implementation) must be have been already defined.<br>
> +#<br>
> +#############################<wbr>##############################<wbr>####<br>
> +<br>
> +#============================<wbr>===#<br>
> +# COMPILERS #<br>
> +#============================<wbr>===#<br>
> +<br>
> +# C++ compiler:<br>
> +# ------------<br>
> +CXX = @CXX@<br>
> +<br>
> +# Options for the C++ compiler to produce the optimized library:<br>
> +# ------------------------------<wbr>------------------------------<wbr>-<br>
> +CXXFLAGS = @CXXFLAGS@ -DNDEBUG -fPIC<br>
> +<br>
> +# Options for the C++ compiler to produce the library for debugging:<br>
> +# ------------------------------<wbr>------------------------------<wbr>-----<br>
> +CXXFLAGS_G = -g -fPIC<br>
> +<br>
> +# Path for the include files:<br>
> +# --------------------------<br>
> +INC = -I$(HOME_LORENE)/C++/Include<br>
> +<br>
> +# Converting archives to random libraries (if required, otherwise just ls)<br>
> +# ------------------------------<wbr>------------------------------<wbr>------------<br>
> +RANLIB = ls<br>
> +<br>
> +# Fortran 77 compiler:<br>
> +# -------------------<br>
> +F77 = @F77@<br>
> +<br>
> +# Options for the Fortran 77 compiler to produce the optimized library:<br>
> +# ------------------------------<wbr>------------------------------<wbr>---------<br>
> +F77FLAGS = @FFLAGS@ -ffixed-form -ffixed-line-length-none -fPIC<br>
> +<br>
> +# Options for the Fortran 77 compiler to produce the library for debugging:<br>
> +# ------------------------------<wbr>------------------------------<wbr>------------<br>
> +F77FLAGS_G = -ffixed-form -ffixed-line-length-none -g -fPIC<br>
> +<br>
> +#============================<wbr>===#<br>
> +# MAKEDEPEND #<br>
> +#============================<wbr>===#<br>
> +<br>
> +# First line uses the C precompiler (usually called cpp)<br>
> +# if yours does not support the -M option try to figure out<br>
> +# how to output dependencies file, or use makedepend (2nd line)<br>
> +#----------------------------<wbr>------------------------------<wbr>----<br>
> +MAKEDEPEND = @CXX@ $(INC) -M >> $(df).d $<<br>
> +#MAKEDEPEND = touch $(df).d && makedepend $(INC) -f $(df).d $<<br>
> +DEPDIR = .deps<br>
> +<br>
> +#============================<wbr>===#<br>
> +# SYSTEM LIBRARIES #<br>
> +#============================<wbr>===#<br>
> +<br>
> +# FFT library: FFT991 in Fortran coming with Lorene<br>
> +# FFTW3 library (must be installed separately)<br>
> +# ------------------------------<wbr>------------------------------<wbr>-------<br>
> +FFT_DIR = FFTW3<br>
> +<br>
> +# C, C++ library, mathematical library and Fortran library<br>
> +# ------------------------------<wbr>---------------------------<br>
> +ifeq ($(FFT_DIR),FFTW3)<br>
> +LIB_CXX = @LDFLAGS@ -lfftw3 @LIB_FORTRAN@ -lstdc++ -lm<br>
> +else<br>
> +LIB_CXX = @LDFLAGS -lgfortran -lstdc++ -lm<br>
> +endif<br>
<br>
On the second LIB_CXX line, did you mean to use "@LIB_FORTRAN@" again instead of "-lgfortran"? You probably also meant "@LDFLAGS@" instead of "@LDFLAGS".<br>
<br>
<br>
> +<br>
> +# Linear Algebra Package (LAPACK) library<br>
> +# ------------------------------<wbr>---------<br>
> +LIB_LAPACK = -llapack -lblas<br>
> +<br>
> +# Graphical libraries: PGPLOT, PNG and X11<br>
> +# ------------------------------<wbr>----------<br>
> +LIB_PGPLOT = -lcpgplot -lpgplot -lX11<br>
> +<br>
> +# GNU scientific library<br>
> +# ------------------------------<wbr>-----<br>
> +LIB_GSL = -lgsl -lgslcblas<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
macports-dev mailing list<br>
<a href="mailto:macports-dev@lists.macosforge.org" target="_blank">macports-dev@lists.macosforge.<wbr>org</a><br>
<a href="https://lists.macosforge.org/mailman/listinfo/macports-dev" rel="noreferrer" target="_blank">https://lists.macosforge.org/m<wbr>ailman/listinfo/macports-dev</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>