Ticket #45617: Portfile-rev0-rev1.diff
File Portfile-rev0-rev1.diff, 12.0 KB (added by cram5431@…, 10 years ago) |
---|
-
(a) Portfile_0 vs. (b) Portfile_1
a b 3 3 4 4 PortSystem 1.0 5 5 PortGroup active_variants 1.1 6 PortGroup mpi 1.0 6 7 7 8 name abinit 8 9 version 7.8.2 10 revision 1 9 11 categories science 10 12 platforms darwin 11 13 license GPL-3 … … 39 41 configure.args --with-linalg-flavor="atlas" --enable-gw-dpc 40 42 configure.optflags -O3 41 43 42 # This is a temporary measure for debugging configure failure on Mountain Lion buildslave. 43 44 #This is a temporary measure for debugging configure failure on Mountain Lion buildslave. 44 45 #checking for gcc... mpicc-mpich-mp 45 46 #checking whether the C compiler works... no 46 47 configure.cmd ./configure || true 48 post-configure { 49 system -W ${worksrcpath} "cat config.log" 50 } 47 #configure.cmd ./configure || true 48 #post-configure { 49 # system -W ${worksrcpath} "cat config.log" 50 #} 51 51 52 52 build.cmd make 53 53 use_parallel_build yes 54 55 54 # We do not need to use ABINIT's own approach to parallel builds, which only is relevant if 56 55 # the "fallbacks" are used, namely if we asked for etsf_io, libxc, wannier90, etc. support 57 56 # but did not provide the libraries. That situation should never happen for this port. 58 57 #build.target multi multi_nprocs=4 59 58 60 59 default_variants +etsf_io +libxc +wannier90 61 if { ![variant_isset gcc46] && ![variant_isset gcc47] && ![variant_isset gcc48] } {62 if { ![variant_isset openmpi] } {63 default_variants +mpich64 } elseif { ![variant_isset mpich] } {65 default_variants +openmpi66 } else {67 default_variants +gcc4868 }69 }70 60 71 # FIXME: use compiler and MPI port groups 72 73 pre-fetch { 74 set fortran unknown 75 set fortrans { gcc42 gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 gcc49 g95 } 76 77 foreach fc_name ${fortrans} { 78 if { [variant_isset ${fc_name}] } { 79 set fortran ${fc_name} 80 } elseif { [variant_isset openmpi] } { 81 if { [_portnameactive openmpi-default] } { 82 if { [active_variants openmpi-default ${fc_name}] } { set fortran ${fc_name} } 83 } elseif { [_portnameactive openmpi-devel-default] } { 84 if { [active_variants openmpi-devel-default ${fc_name}] } { set fortran ${fc_name} } 85 } 86 } elseif { [variant_isset mpich] } { 87 if { [_portnameactive mpich-default] } { 88 if { [active_variants mpich-default ${fc_name}] } { set fortran ${fc_name} } 89 } elseif { [_portnameactive mpich-devel-default] } { 90 if { [active_variants mpich-devel-default ${fc_name}] } { set fortran ${fc_name} } 61 #Restrict to gcc/clang because of dependencies 62 compilers.choose fc cc cxx cpp 63 compilers.setup -clang -dragonegg -llvm 64 mpi.setup 65 66 #Select mpi/gcc default: 67 # If a MPI variant is given, take it 68 # If not, check if there is a selected MPI; if yes, take it 69 # If there is no defaut MPI, take mpich 70 # If "sequential" or "-mpi(default)" variant, take no MPI 71 set current_mpi "none" 72 set mpi_default mpich 73 set sequential [variant_isset sequential] 74 if {!${sequential} } { 75 if { [mpi_variant_isset] } { 76 set current_mpi [mpi_variant_name] 77 } else { 78 if {![catch {set current_mpi [file link ${prefix}/etc/select/mpi/current]}]} { 79 if { ${current_mpi} eq "base" } { set current_mpi "none" } 80 } 81 if { ${current_mpi} eq "none"} { 82 if {[info exists variations(${mpi_default})] && \ 83 $variations(${mpi_default}) eq "-"} { 84 set sequential 1 85 } else { 86 set current_mpi ${mpi_default} 87 default_variants-append +${mpi_default} 91 88 } 92 89 } 93 90 } 94 95 if { ${fortran} eq "unknown" } { 96 if { [variant_isset openmpi] } { 97 ui_error "Variant +openmpi requires openmpi to have been built with Fortran support." 98 return -code error "Variant +openmpi requires openmpi to have been built with Fortran support." 99 } elseif { [variant_isset mpich] } { 100 ui_error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support." 101 return -code error "Variant +mpich requires mpich-default/mpich-devel-default to have been built with Fortran support." 102 } else { 103 ui_error "Internal error: cannot determine Fortran compiler." 104 return -code error "Internal error: cannot determine Fortran compiler." 105 } 91 } 92 if {${sequential}} { 93 if { [gcc_variant_isset] } { 94 default_variants-append +[c_variant_name] 95 } else { 96 default_variants-append +gcc48 106 97 } 98 } 107 99 100 pre-fetch { 108 101 if { [variant_isset libxc] } { 109 if { ![active_variants libxc ${fortran}] } {110 ui_error "libxc must have been built with + ${fortran}."111 return -code error "libxc must have been built with + ${fortran}."102 if { ![active_variants libxc [c_variant_name]] } { 103 ui_error "libxc must have been built with +[c_variant_name]" 104 return -code error "libxc must have been built with +[c_variant_name]" 112 105 } 113 106 } 114 115 107 if { [variant_isset netcdf] } { 116 if {![active_variants netcdf-fortran ${fortran}] } {117 ui_error "netcdf-fortran must have been built with + ${fortran}."118 return -code error "netcdf-fortran must have been built with + ${fortran}."108 if {![active_variants netcdf-fortran [c_variant_name]] } { 109 ui_error "netcdf-fortran must have been built with +[c_variant_name]" 110 return -code error "netcdf-fortran must have been built with +[c_variant_name]" 119 111 } 120 112 } 121 122 113 if { [variant_isset etsf_io] } { 123 if {![active_variants etsf_io ${fortran}] } { 124 ui_error "etsf_io must have been built with +${fortran}." 125 return -code error "etsf_io must have been built with +${fortran}." 114 if {![active_variants etsf_io [fortran_variant_name]] } { 115 ui_error "etsf_io must have been built with +[fortran_variant_name]" 116 return -code error "etsf_io must have been built with +[fortran_variant_name]" 117 } 118 } 119 if { [variant_isset fftw3] } { 120 if {![active_variants fftw-3 gfortran] || \ 121 ![active_variants fftw-3-single gfortran]} { 122 ui_error "fftw-3 and nfftw-3-single must have been built with +gfortran:" 123 ui_error "This can be achieved by : sudo port -f install fftw-3-single +gfortran" 124 return -code error "fftw-3/fftw-3-single must have been built with +gfortran" 126 125 } 127 126 } 128 129 # No need to check compiler for wannier90130 # No need to check compiler for fftw-3131 127 } 132 128 133 # fix unnecessary rejection of libxc 2.1.0 134 patchfiles patch-configure.diff 129 #Fix unnecessary rejection of libxc 2.1.0 130 #Fix a openMP syntax error 131 patchfiles patch-configure.diff \ 132 patch-src-71_bse-haydock.F90.diff 135 133 136 134 pre-configure { 137 135 if { [variant_isset etsf_io] } { … … 141 139 } else { 142 140 configure.args-append --with-trio-flavor="none" 143 141 } 144 145 142 set dft-flavor "none" 146 143 if { [variant_isset libxc] } { 147 144 if { ${dft-flavor} eq "none" } { … … 157 154 set dft-flavor ${dft-flavor}"+wannier90" 158 155 } 159 156 } 160 if { [variant_isset bigdft] } {161 if { ${dft-flavor} eq "none" } {162 set dft-flavor "bigdft"163 } else {164 set dft-flavor ${dft-flavor}"+bigdft"165 }166 }167 157 if { [variant_isset atompaw] } { 168 158 if { ${dft-flavor} eq "none" } { 169 159 set dft-flavor "atompaw" … … 171 161 set dft-flavor ${dft-flavor}"+atompaw" 172 162 } 173 163 } 164 # if { [variant_isset bigdft] } { 165 # if { ${dft-flavor} eq "none" } { 166 # set dft-flavor "bigdft" 167 # } else { 168 # set dft-flavor ${dft-flavor}"+bigdft" 169 # } 170 # } 174 171 configure.args-append --with-dft-flavor="${dft-flavor}" 172 173 configure.args-append FCCPP="${configure.cpp} -ansi" 174 175 if { ${current_mpi} ne "none"} { 176 configure.args-append --enable-mpi="yes" --enable-mpi-io="yes" 177 if {[string match *openmpi* ${current_mpi}]} { 178 configure.args-append --with-mpi-level="1" 179 } 180 if { ![mpi_variant_isset] } { 181 configure.fc ${mpi.fc} 182 configure.cc ${mpi.cc} 183 configure.cxx ${mpi.cxx} 184 } 185 if { ${mpi.exec} ne "" } { 186 configure.args-append MPI_RUNNER=${mpi.exec} 187 test.env-append MPIEXEC=${mpi.exec} 188 } 189 } else { 190 configure.args-append --enable-mpi="no" --enable-mpi-io="no" 191 } 175 192 } 176 193 177 194 destroot { … … 193 210 # test.run yes 194 211 # test.target check-full 195 212 196 variant gcc46 conflicts gcc47 gcc48 openmpi mpich description {Build with GCC 4.6} {197 configure.compiler macports-gcc-4.6198 configure.args-append FCCPP="${configure.cpp} -ansi"199 }200 201 variant gcc47 conflicts gcc46 gcc48 openmpi mpich description {Build with GCC 4.7} {202 configure.compiler macports-gcc-4.7203 configure.args-append FCCPP="${configure.cpp} -ansi"204 }205 206 variant gcc48 conflicts gcc46 gcc47 openmpi mpich description {Build with GCC 4.8} {207 configure.compiler macports-gcc-4.8208 configure.args-append FCCPP="${configure.cpp} -ansi"209 }210 211 variant openmpi conflicts gcc46 gcc47 gcc48 mpich description {Build parallel version with OpenMPI} {212 depends_lib-append path:bin/mpif90-openmpi-mp:openmpi-default213 configure.fc mpif90-openmpi-mp214 configure.cc mpicc-openmpi-mp215 configure.cxx mpicxx-openmpi-mp216 configure.args-append FCCPP="${configure.cc} -E -ansi"217 configure.args-append --enable-mpi="yes" --enable-mpi-io="yes" --with-mpi-level="1"218 configure.args-append MPI_RUNNER=${prefix}/bin/mpiexec-openmpi-mp219 test.env-append MPIEXEC=${prefix}/bin/mpiexec-openmpi-mp220 }221 222 variant mpich conflicts gcc46 gcc47 gcc48 openmpi description {Build parallel version with MPICH} {223 depends_lib-append path:bin/mpif90-mpich-mp:mpich-default224 configure.fc mpif90-mpich-mp225 configure.cc mpicc-mpich-mp226 configure.cxx mpicxx-mpich-mp227 configure.args-append FCCPP="${configure.cc} -E -ansi"228 configure.args-append --enable-mpi="yes" --enable-mpi-io="yes"229 configure.args-append MPI_RUNNER=${prefix}/bin/mpiexec-mpich-mp230 test.env-append MPIEXEC=${prefix}/bin/mpiexec-mpich-mp231 }232 233 213 variant fftw3 description {Build with support for fftw-3 FFT library} { 234 214 depends_lib-append port:fftw-3 215 depends_lib-append port:fftw-3-single 216 # require_active_variants fftw-3 gfortran 217 # require_active_variants fftw-3-single gfortran 235 218 if { [variant_isset threads] } { 236 219 configure.args-append --with-fft-flavor="fftw3-threads" 237 configure.args-append --with-fft-libs="-lfftw3_threads -lfftw3 "220 configure.args-append --with-fft-libs="-lfftw3_threads -lfftw3 -lfftw3f" 238 221 } else { 239 222 configure.args-append --with-fft-flavor="fftw3" 240 configure.args-append --with-fft-libs="-lfftw3 "223 configure.args-append --with-fft-libs="-lfftw3 -lfftw3f" 241 224 } 242 225 } 243 226 … … 270 253 depends_lib-append port:wannier90 271 254 } 272 255 256 variant atompaw description {Build including AtomPAW atomic dataset generator} { 257 } 258 259 variant sequential conflicts mpich mpich_devel openmpi openmpi_devel description {Build without MPI support} { 260 } 261 273 262 # FIXME: the code's build system will download BigDFT itself, which is contrary to the 274 263 # way MacPorts should work. Make a bigdft port to support this. 275 264 # There is an error compiling anyway, which could be fixed with a patch, … … 282 271 # patchfiles-append patch-fallbacks-sources-bigdft-1.7.0.93-src-Makefile.in.diff 283 272 #} 284 273 285 variant atompaw description {Build including AtomPAW atomic dataset generator} {286 }287 288 274 livecheck.type regex 289 275 livecheck.url ${homepage}/downloads/source-packages/abinit-1/releases/index.html 290 276 livecheck.regex ABINIT (\[0-9.\]+) 277