[111489] trunk/dports/science
macsforever2000 at macports.org
macsforever2000 at macports.org
Mon Sep 23 13:50:05 PDT 2013
Revision: 111489
https://trac.macports.org/changeset/111489
Author: macsforever2000 at macports.org
Date: 2013-09-23 13:50:05 -0700 (Mon, 23 Sep 2013)
Log Message:
-----------
berkeleygw: New port. (#40309)
Added Paths:
-----------
trunk/dports/science/berkeleygw/
trunk/dports/science/berkeleygw/Portfile
trunk/dports/science/berkeleygw/files/
trunk/dports/science/berkeleygw/files/patch-Common-common-rules.mk.diff
Added: trunk/dports/science/berkeleygw/Portfile
===================================================================
--- trunk/dports/science/berkeleygw/Portfile (rev 0)
+++ trunk/dports/science/berkeleygw/Portfile 2013-09-23 20:50:05 UTC (rev 111489)
@@ -0,0 +1,113 @@
+# -*- 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$
+
+PortSystem 1.0
+
+name berkeleygw
+version 1.0.5
+categories science
+platforms darwin
+license BSD
+maintainers gmail.com:dstrubbe
+
+description GW/Bethe-Salpeter equation
+long_description BerkeleyGW is a set of computer codes that calculate the quasiparticle properties \
+ and the optical responses of a large variety of materials from bulk periodic crystals \
+ to nanostructures such as slabs, wires and molecules, using many-body perturbation theory.
+homepage http://www.berkeleygw.org
+master_sites http://www.berkeleygw.org/releases
+
+checksums rmd160 308826cb7157d368f4d113ae694a9fbc8c46044e \
+ sha256 f5706b2daab66bdc22328695c0fb71f6e62577947db1f7d5706e4e9fd64bf9de
+
+depends_lib port:atlas \
+ port:fftw
+
+distfiles BGW-${version}.tar.gz
+
+configure {
+ system -W ${worksrcpath} "sed 's|/opt/local|${prefix}|' < config/generic.serial.macos.mk > arch.mk"
+}
+
+build.target all-flavors
+use_parallel_build yes
+
+destroot.post_args INSTDIR=${destroot}${prefix}
+
+test.run yes
+test.cmd make
+test.target check
+
+# more options that could be added: threads, openmpi, mpich
+
+# This is from the Fortran recipe, but with some customization
+set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
+set default_fortran_variant +gcc48
+set g95_conflicts {}
+
+foreach ver ${gcc_versions} {
+ set ver_no_dot [join [split ${ver} "."] ""]
+
+ set variant_line {variant gcc${ver_no_dot} description "build with gcc${ver_no_dot}" conflicts g95}
+
+ foreach over ${gcc_versions} {
+ if {${ver} == ${over}} {
+ continue
+ }
+
+ set over_no_dot [join [split ${over} "."] ""]
+ append variant_line " conflicts gcc${over_no_dot}"
+ }
+ append variant_line { {}}
+
+ eval $variant_line
+
+ append g95_conflicts " conflicts gcc${ver_no_dot}"
+
+ if {[variant_isset gcc${ver_no_dot}]} {
+ if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
+ set default_fortran_variant ""
+ }
+ }
+}
+
+eval [concat {variant g95 description {build with clang/g95}} $g95_conflicts {{}}]
+
+if {[variant_isset g95]} {
+ if {${default_fortran_variant} != "+g95"} {
+ set default_fortran_variant ""
+ }
+}
+
+if {${default_fortran_variant} != ""} {
+ default_variants-append "${default_fortran_variant}"
+}
+
+foreach ver ${gcc_versions} {
+ set ver_no_dot [join [split ${ver} "."] ""]
+
+ if {[variant_isset gcc${ver_no_dot}]} {
+ depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
+ depends_build-append port:gcc${ver_no_dot}
+
+ build.args VERSION=-mp-${ver}
+ }
+}
+
+if {[variant_isset g95]} {
+ depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
+ depends_build-append port:g95
+
+ build.args COMPFLAG="-DG95" FCPP="${configure.cc} -P -E -ansi" LINK="${prefix}/bin/g95" \
+ F90free="${prefix}/bin/g95 -ffree-form -ffree-line-length-huge -fno-second-underscore" \
+ MOD_OPT="-fmod=" CC_COMP=${configure.cxx} C_COMP=${configure.cc} C_LINK=${configure.cxx} \
+ LAPACKLIB="-L${prefix}/lib/ -lsatlas"
+ # test, destroot args needed just to avoid trying to build in the test/openmp directory unnecessarily
+ test.args COMPFLAG="-DG95"
+ destroot.args COMPFLAG="-DG95"
+ patchfiles-append patch-Common-common-rules.mk.diff
+}
+
+livecheck.type regex
+livecheck.url ${master_sites}
+livecheck.regex BGW-(\[0-9.\]+).tar
Added: trunk/dports/science/berkeleygw/files/patch-Common-common-rules.mk.diff
===================================================================
--- trunk/dports/science/berkeleygw/files/patch-Common-common-rules.mk.diff (rev 0)
+++ trunk/dports/science/berkeleygw/files/patch-Common-common-rules.mk.diff 2013-09-23 20:50:05 UTC (rev 111489)
@@ -0,0 +1,22 @@
+Index: Common/common-rules.mk
+===================================================================
+--- Common/common-rules.mk (revision 5608)
++++ Common/common-rules.mk (working copy)
+@@ -46,7 +46,16 @@
+ F90_CMD = $(F90free) $(FTNINC) -c $(FOPTS) $(basename $<).p.f -o $(basename $<).o $(MOD_OPT)$(dir $<)
+ F90_CMD_NOOPT = $(F90free) $(FTNINC) -c $(FNOOPTS) $(basename $<).p.f -o $(basename $<).o $(MOD_OPT)$(dir $<)
+ # $(MOD_OPT) directs where to put the resulting *.mod file
+-f90_CPP = $(FCPP) $(INCLUDE) $(CPPOPT) $< > $(basename $<).p.f
++
++#clang on MacOS treats files incorrectly if they have .F90 extension; but MacOS is case-insensitive
++#anyway, so we can refer to the file either way
++ifeq ($(findstring clang,$(FCPP)),clang)
++ f90_name = $(basename $<).F90
++else
++ f90_name = $<
++endif
++
++f90_CPP = $(FCPP) $(INCLUDE) $(CPPOPT) $(f90_name) > $(basename $<).p.f
+ F90_CPP = $(FCPP) -P $(INCLUDE) $(CPPOPT) $< > $(basename $<).p.f
+ ifneq (,$(filter $(COMPFLAG),-DOPEN64 -DPATH -DABSOFT -DCRAY))
+ # these compilers name all modules uppercase
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130923/b67dc533/attachment.html>
More information about the macports-changes
mailing list