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.
On Sun, Oct 16, 2016 at 5:23 PM, David Strubbe <dstru...@macports.org> wrote: > Hi, > > Let me add a few comments. > - 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. > - You are installing a lot of Makefiles and C source files -- is this on > purpose? It is somewhat unusual. > - 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. > - Since there are tests apparently available, you should create a test > phase rather than install their files, so that users can run "port test". > > David > > Index: Portfile > =================================================================== > --- Portfile (revision 153958) > +++ Portfile (working copy) > @@ -3,6 +3,7 @@ > > PortSystem 1.0 > PortGroup compilers 1.0 > +PortGroup linear_algebra 1.0 > > cvs.date 20160908 > > @@ -29,9 +30,7 @@ > sha256 ef797abc51ed8ae27c200f5b71fd0a > 3824d1fa310392dac57067de2e423222ed > worksrcdir ${distname}-${version}+dfsg > > -depends_lib port:OpenBLAS \ > - port:lapack \ > - port:gsl \ > +depends_lib port:gsl \ > port:fftw-3 \ > port:pgplot \ > port:xorg-libX11 > @@ -47,6 +46,7 @@ > reinplace -W ${worksrcpath} "s|@FFLAGS@|${configure.fflags}|g" > local_settings > reinplace -W ${worksrcpath} "s|@LDFLAGS@|${configure.ldflags}|g" > local_settings > reinplace -W ${worksrcpath} "s|@LIB_FORTRAN@|${compilers.libfortran}|g" > local_settings > + reinplace -W ${worksrcpath} "s|@LIB_LAPACK@|${linalglib}|g" > local_settings > } > > build.env-append HOME_LORENE=${worksrcpath} > Index: files/local_settings > =================================================================== > --- files/local_settings (revision 153958) > +++ files/local_settings (working copy) > @@ -74,7 +74,7 @@ > > # Linear Algebra Package (LAPACK) library > # --------------------------------------- > -LIB_LAPACK = -llapack -lblas > +LIB_LAPACK = @LIB_LAPACK > > # Graphical libraries: PGPLOT, PNG and X11 > # ---------------------------------------- > > > On Sun, Oct 16, 2016 at 1:27 PM, Ryan Schmidt <ryandes...@macports.org> > wrote: > >> >> > On Oct 16, 2016, at 12:41 PM, thib...@macports.org wrote: >> > >> > Revision >> > 153943 >> > Author >> > thib...@macports.org >> > Date >> > 2016-10-16 10:41:08 -0700 (Sun, 16 Oct 2016) >> > Log Message >> > >> > New port: LORENE >> > Added Paths >> > >> > • trunk/dports/science/LORENE/ >> > • trunk/dports/science/LORENE/Portfile >> > • trunk/dports/science/LORENE/files/ >> > • trunk/dports/science/LORENE/files/local_settings >> > Diff >> > >> > Added: trunk/dports/science/LORENE/Portfile (0 => 153943) >> > >> > --- trunk/dports/science/LORENE/Portfile >> (rev 0) >> > +++ trunk/dports/science/LORENE/Portfile 2016-10-16 17:41:08 UTC >> (rev 153943) >> > @@ -0,0 +1,67 @@ >> > +# -*- 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:ts=4:sts=4 >> > +# $Id$ >> >> The whitespace of this portfile does not conform to this modeline. Tabs >> should be replaced with spaces. >> >> >> > +PortSystem 1.0 >> > +PortGroup compilers 1.0 >> > + >> > +cvs.date 20160908 >> > + >> > +name LORENE >> > +version 0.0.0~cvs${cvs.date} >> > + >> > +categories science >> > +maintainers thibaut openmaintainer >> > +description Langage Objet pour la RElativité NumériquE >> > +long_description LORENE is a set of C++ classes to solve various >> problems \ >> > + arising in numerical relativity, and more >> generally in \ >> > + computational astrophysics. It provides tools to >> solve \ >> > + partial differential equations by means of >> multi-domain \ >> > + spectral methods. >> > + >> > +license gpl-2+ >> > +platforms darwin >> > + >> > +homepage http://www.lorene.obspm.fr/ >> > +master_sites https://people.debian.org/~th >> ibaut/debian/pool/main/l/lorene/ >> > +distname lorene >> > +distfiles ${distname}_${version}+dfsg.orig.tar.xz >> >> 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.) >> >> >> > +checksums rmd160 36346f8d7a50acee20a5b81051af2e7fe5f188c1 \ >> > + sha256 ef797abc51ed8ae27c200f5b71fd0a >> 3824d1fa310392dac57067de2e423222ed >> > +worksrcdir ${distname}-${version}+dfsg >> > + >> > +depends_lib port:OpenBLAS \ >> > + port:lapack \ >> > + port:gsl \ >> > + port:fftw-3 \ >> > + port:pgplot \ >> > + port:xorg-libX11 >> > + >> > +compilers.choose cxx f77 >> > +compilers.setup require_fortran >> > + >> > +configure { >> > + file copy ${filespath}/local_settings ${worksrcpath}/ >> > + reinplace -W ${worksrcpath} "s|@CXX@|${configure.cxx}|g" >> local_settings >> > + reinplace -W ${worksrcpath} "s|@F77@| ${configure.f77} |g" >> local_settings >> > + reinplace -W ${worksrcpath} "s|@CXXFLAGS@|${configure.cxxflags}|g" >> local_settings >> > + reinplace -W ${worksrcpath} "s|@FFLAGS@|${configure.fflags}|g" >> local_settings >> > + reinplace -W ${worksrcpath} "s|@LDFLAGS@|${configure.ldflags}|g" >> local_settings >> > + reinplace -W ${worksrcpath} >> > "s|@LIB_FORTRAN@|${compilers.libfortran}|g" >> local_settings >> > +} >> >> 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 ...]) >> >> The universal variant fails and should probably be disabled because: >> >> Error: Cannot install LORENE for the archs 'i386 x86_64' because >> Error: its dependency pgplot does not build for the required archs by >> default >> Error: and does not have a universal variant. >> >> >> > +build.env-append HOME_LORENE=${worksrcpath} >> > +build.target cpp fortran export >> > +use_parallel_build no >> > + >> > +destroot { >> > + xinstall -d ${destroot}${prefix}/lib/lorene/Lib >> > + xinstall {*}[glob ${worksrcpath}/Lib/*.a] >> ${destroot}${prefix}/lib/lorene/Lib/ >> > + xinstall -d ${destroot}${prefix}/lib/lorene/C++/Include >> > + xinstall {*}[glob ${worksrcpath}/C++/Include/*.h] >> ${destroot}${prefix}/lib/lorene/C++/Include/ >> > + xinstall -d ${destroot}${prefix}/lib/lorene/C++/Include/Template >> > + xinstall {*}[glob ${worksrcpath}/C++/Include/Template/*] >> ${destroot}${prefix}/lib/lorene/C++/Include/Template/ >> > + xinstall ${worksrcpath}/local_settings >> ${destroot}${prefix}/lib/lorene/ >> > + xinstall -d ${destroot}${prefix}/lib/lorene/Devel >> > + xinstall {*}[glob ${worksrcpath}/Devel/*] >> ${destroot}${prefix}/lib/lorene/Devel/ >> > + exec cp -a ${worksrcpath}/Codes ${destroot}${prefix}/lib/lorene/ >> > +} >> >> Why "exec cp -a" instead of "copy"? >> >> >> > --- trunk/dports/science/LORENE/files/local_settings >> (rev 0) >> > +++ trunk/dports/science/LORENE/files/local_settings 2016-10-16 >> 17:41:08 UTC (rev 153943) >> > @@ -0,0 +1,89 @@ >> > + ############################################################### >> > +# >> >> Should there be this indentation on the first line? >> >> >> > +# Edit the following lines according to your implementation. >> > +# >> > +# The environment variable HOME_LORENE (root directory for the >> > +# Lorene implementation) must be have been already defined. >> > +# >> > +############################################################### >> > + >> > +#===============================# >> > +# COMPILERS # >> > +#===============================# >> > + >> > +# C++ compiler: >> > +# ------------ >> > +CXX = @CXX@ >> > + >> > +# Options for the C++ compiler to produce the optimized library: >> > +# ------------------------------------------------------------- >> > +CXXFLAGS = @CXXFLAGS@ -DNDEBUG -fPIC >> > + >> > +# Options for the C++ compiler to produce the library for debugging: >> > +# ----------------------------------------------------------------- >> > +CXXFLAGS_G = -g -fPIC >> > + >> > +# Path for the include files: >> > +# -------------------------- >> > +INC = -I$(HOME_LORENE)/C++/Include >> > + >> > +# Converting archives to random libraries (if required, otherwise just >> ls) >> > +# ------------------------------------------------------------ >> ------------ >> > +RANLIB = ls >> > + >> > +# Fortran 77 compiler: >> > +# ------------------- >> > +F77 = @F77@ >> > + >> > +# Options for the Fortran 77 compiler to produce the optimized library: >> > +# ------------------------------------------------------------ >> --------- >> > +F77FLAGS = @FFLAGS@ -ffixed-form -ffixed-line-length-none -fPIC >> > + >> > +# Options for the Fortran 77 compiler to produce the library for >> debugging: >> > +# ------------------------------------------------------------ >> ------------ >> > +F77FLAGS_G = -ffixed-form -ffixed-line-length-none -g -fPIC >> > + >> > +#===============================# >> > +# MAKEDEPEND # >> > +#===============================# >> > + >> > +# First line uses the C precompiler (usually called cpp) >> > +# if yours does not support the -M option try to figure out >> > +# how to output dependencies file, or use makedepend (2nd line) >> > +#-------------------------------------------------------------- >> > +MAKEDEPEND = @CXX@ $(INC) -M >> $(df).d $< >> > +#MAKEDEPEND = touch $(df).d && makedepend $(INC) -f $(df).d $< >> > +DEPDIR = .deps >> > + >> > +#===============================# >> > +# SYSTEM LIBRARIES # >> > +#===============================# >> > + >> > +# FFT library: FFT991 in Fortran coming with Lorene >> > +# FFTW3 library (must be installed separately) >> > +# ------------------------------------------------------------------- >> > +FFT_DIR = FFTW3 >> > + >> > +# C, C++ library, mathematical library and Fortran library >> > +# --------------------------------------------------------- >> > +ifeq ($(FFT_DIR),FFTW3) >> > +LIB_CXX = @LDFLAGS@ -lfftw3 @LIB_FORTRAN@ -lstdc++ -lm >> > +else >> > +LIB_CXX = @LDFLAGS -lgfortran -lstdc++ -lm >> > +endif >> >> 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". >> >> >> > + >> > +# Linear Algebra Package (LAPACK) library >> > +# --------------------------------------- >> > +LIB_LAPACK = -llapack -lblas >> > + >> > +# Graphical libraries: PGPLOT, PNG and X11 >> > +# ---------------------------------------- >> > +LIB_PGPLOT = -lcpgplot -lpgplot -lX11 >> > + >> > +# GNU scientific library >> > +# ----------------------------------- >> > +LIB_GSL = -lgsl -lgslcblas >> >> >> >> _______________________________________________ >> macports-dev mailing list >> macports-dev@lists.macosforge.org >> https://lists.macosforge.org/mailman/listinfo/macports-dev >> > >
_______________________________________________ macports-dev mailing list macports-dev@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macports-dev