diff options
-rw-r--r-- | var/spack/repos/builtin/packages/arpack-ng/package.py | 7 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/cuda/package.py | 47 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/dealii/package.py | 238 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/espresso/package.py | 17 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/hoomd-blue/package.py | 73 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/oce/null.patch | 482 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/oce/package.py | 22 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/vtk/package.py | 18 |
8 files changed, 894 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py index dd86b17a53..6b152f7863 100644 --- a/var/spack/repos/builtin/packages/arpack-ng/package.py +++ b/var/spack/repos/builtin/packages/arpack-ng/package.py @@ -41,10 +41,17 @@ class ArpackNg(Package): depends_on('blas') depends_on('lapack') + depends_on('automake') + depends_on('autoconf') + depends_on('libtool@2.4.2:') + depends_on('mpi', when='+mpi') def install(self, spec, prefix): # Apparently autotools are not bootstrapped + # TODO: switch to use the CMake build in the next version + # rather than bootstrapping. + which('libtoolize')() bootstrap = Executable('./bootstrap') options = ['--prefix=%s' % prefix] diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py new file mode 100644 index 0000000000..ea083d8651 --- /dev/null +++ b/var/spack/repos/builtin/packages/cuda/package.py @@ -0,0 +1,47 @@ +from spack import * +from glob import glob +import os + +class Cuda(Package): + """CUDA is a parallel computing platform and programming model invented by + NVIDIA. It enables dramatic increases in computing performance by harnessing + the power of the graphics processing unit (GPU). + + Note: NVIDIA does not provide a download URL for CUDA so you will need to + download it yourself. Go to https://developer.nvidia.com/cuda-downloads + and select your Operating System, Architecture, Distribution, and Version. + For the Installer Type, select runfile and click Download. Spack will search + your current directory for this file. Alternatively, add this file to a + mirror so that Spack can find it. For instructions on how to set up a mirror, + see http://software.llnl.gov/spack/mirrors.html + + Note: This package does not currently install the drivers necessary to run + CUDA. These will need to be installed manually. See: + http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux for details.""" + + homepage = "http://www.nvidia.com/object/cuda_home_new.html" + + version('7.5.18', '4b3bcecf0dfc35928a0898793cf3e4c6', expand=False, + url="file://%s/cuda_7.5.18_linux.run" % os.getcwd()) + version('6.5.14', '90b1b8f77313600cc294d9271741f4da', expand=False, + url="file://%s/cuda_6.5.14_linux_64.run" % os.getcwd()) + + + def install(self, spec, prefix): + runfile = glob(os.path.join(self.stage.path, 'cuda*.run'))[0] + chmod = which('chmod') + chmod('+x', runfile) + runfile = which(runfile) + + # Note: NVIDIA does not officially support many newer versions of compilers. + # For example, on CentOS 6, you must use GCC 4.4.7 or older. See: + # http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#system-requirements + # for details. + + runfile( + '--silent', # disable interactive prompts + '--verbose', # create verbose log file + '--toolkit', # install CUDA Toolkit + '--toolkitpath=%s' % prefix + ) + diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py new file mode 100644 index 0000000000..0b76db3827 --- /dev/null +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -0,0 +1,238 @@ +from spack import * +import sys + +class Dealii(Package): + """C++ software library providing well-documented tools to build finite element codes for a broad variety of PDEs.""" + homepage = "https://www.dealii.org" + url = "https://github.com/dealii/dealii/releases/download/v8.4.0/dealii-8.4.0.tar.gz" + + version('8.4.0', 'ac5dbf676096ff61e092ce98c80c2b00') + version('dev', git='https://github.com/dealii/dealii.git') + + variant('mpi', default=True, description='Compile with MPI') + variant('arpack', default=True, description='Compile with Arpack and PArpack (only with MPI)') + variant('doc', default=False, description='Compile with documentation') + variant('hdf5', default=True, description='Compile with HDF5 (only with MPI)') + variant('metis', default=True, description='Compile with Metis') + variant('netcdf', default=True, description='Compile with Netcdf (only with MPI)') + variant('oce', default=True, description='Compile with OCE') + variant('p4est', default=True, description='Compile with P4est (only with MPI)') + variant('petsc', default=True, description='Compile with Petsc (only with MPI)') + variant('slepc', default=True, description='Compile with Slepc (only with Petsc and MPI)') + variant('trilinos', default=True, description='Compile with Trilinos (only with MPI)') + + # required dependencies, light version + depends_on ("blas") + depends_on ("boost", when='~mpi') + depends_on ("boost+mpi", when='+mpi') + depends_on ("bzip2") + depends_on ("cmake") + depends_on ("lapack") + depends_on ("muparser") + depends_on ("suite-sparse") + depends_on ("tbb") + depends_on ("zlib") + + # optional dependencies + depends_on ("mpi", when="+mpi") + depends_on ("arpack-ng+mpi", when='+arpack+mpi') + depends_on ("doxygen", when='+doc') + depends_on ("hdf5+mpi~cxx", when='+hdf5+mpi') #FIXME NetCDF declares dependency with ~cxx, why? + depends_on ("metis", when='+metis') + depends_on ("netcdf+mpi", when="+netcdf+mpi") + depends_on ("netcdf-cxx", when='+netcdf+mpi') + depends_on ("oce", when='+oce') + depends_on ("p4est", when='+p4est+mpi') + depends_on ("petsc+mpi", when='+petsc+mpi') + depends_on ("slepc", when='+slepc+petsc+mpi') + depends_on ("trilinos", when='+trilinos+mpi') + + # developer dependnecies + #depends_on ("numdiff") #FIXME + #depends_on ("astyle") #FIXME + + def install(self, spec, prefix): + options = [] + options.extend(std_cmake_args) + + # CMAKE_BUILD_TYPE should be DebugRelease | Debug | Release + for word in options[:]: + if word.startswith('-DCMAKE_BUILD_TYPE'): + options.remove(word) + + dsuf = 'dylib' if sys.platform == 'darwin' else 'so' + options.extend([ + '-DCMAKE_BUILD_TYPE=DebugRelease', + '-DDEAL_II_COMPONENT_EXAMPLES=ON', + '-DDEAL_II_WITH_THREADS:BOOL=ON', + '-DBOOST_DIR=%s' % spec['boost'].prefix, + '-DBZIP2_DIR=%s' % spec['bzip2'].prefix, + # CMake's FindBlas/Lapack may pickup system's blas/lapack instead of Spack's. + # Be more specific to avoid this. + # Note that both lapack and blas are provided in -DLAPACK_XYZ variables + '-DLAPACK_FOUND=true', + '-DLAPACK_INCLUDE_DIRS=%s;%s' % + (spec['lapack'].prefix.include, + spec['blas'].prefix.include), + '-DLAPACK_LIBRARIES=%s;%s' % + (join_path(spec['lapack'].prefix.lib,'liblapack.%s' % dsuf), # FIXME don't hardcode names + join_path(spec['blas'].prefix.lib,'libblas.%s' % dsuf)), # FIXME don't hardcode names + '-DMUPARSER_DIR=%s ' % spec['muparser'].prefix, + '-DP4EST_DIR=%s' % spec['p4est'].prefix, + '-DUMFPACK_DIR=%s' % spec['suite-sparse'].prefix, + '-DTBB_DIR=%s' % spec['tbb'].prefix, + '-DZLIB_DIR=%s' % spec['zlib'].prefix + ]) + + # MPI + if '+mpi' in spec: + options.extend([ + '-DDEAL_II_WITH_MPI:BOOL=ON', + '-DCMAKE_C_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # FIXME: avoid hardcoding mpi wrappers names + '-DCMAKE_CXX_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'), + '-DCMAKE_Fortran_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'), + ]) + else: + options.extend([ + '-DDEAL_II_WITH_MPI:BOOL=OFF', + ]) + + # Optional dependencies for which librariy names are the same as CMake variables + for library in ('hdf5', 'p4est','petsc', 'slepc','trilinos','metis'): + if library in spec: + options.extend([ + '-D{library}_DIR={value}'.format(library=library.upper(), value=spec[library].prefix), + '-DDEAL_II_WITH_{library}:BOOL=ON'.format(library=library.upper()) + ]) + else: + options.extend([ + '-DDEAL_II_WITH_{library}:BOOL=OFF'.format(library=library.upper()) + ]) + + # doxygen + options.extend([ + '-DDEAL_II_COMPONENT_DOCUMENTATION=%s' % ('ON' if '+doc' in spec else 'OFF'), + ]) + + + # arpack + if '+arpack' in spec: + options.extend([ + '-DARPACK_DIR=%s' % spec['arpack-ng'].prefix, + '-DDEAL_II_WITH_ARPACK=ON', + '-DDEAL_II_ARPACK_WITH_PARPACK=ON' + ]) + else: + options.extend([ + '-DDEAL_II_WITH_ARPACK=OFF' + ]) + + # since Netcdf is spread among two, need to do it by hand: + if '+netcdf' in spec: + options.extend([ + '-DNETCDF_FOUND=true', + '-DNETCDF_LIBRARIES=%s;%s' % + (join_path(spec['netcdf-cxx'].prefix.lib,'libnetcdf_c++.%s' % dsuf), + join_path(spec['netcdf'].prefix.lib,'libnetcdf.%s' % dsuf)), + '-DNETCDF_INCLUDE_DIRS=%s;%s' % + (spec['netcdf-cxx'].prefix.include, + spec['netcdf'].prefix.include), + ]) + else: + options.extend([ + '-DDEAL_II_WITH_NETCDF=OFF' + ]) + + # Open Cascade + if '+oce' in spec: + options.extend([ + '-DOPENCASCADE_DIR=%s' % spec['oce'].prefix, + '-DDEAL_II_WITH_OPENCASCADE=ON' + ]) + else: + options.extend([ + '-DDEAL_II_WITH_OPENCASCADE=OFF' + ]) + + cmake('.', *options) + + make() + make("test") + make("install") + + # run some MPI examples with different solvers from PETSc and Trilinos + env['DEAL_II_DIR'] = prefix + print('=====================================') + print('============ EXAMPLES ===============') + print('=====================================') + # take bare-bones step-3 + print('=====================================') + print('============ Step-3 =================') + print('=====================================') + with working_dir('examples/step-3'): + cmake('.') + make('release') + make('run',parallel=False) + + # take step-40 which can use both PETSc and Trilinos + # FIXME: switch step-40 to MPI run + with working_dir('examples/step-40'): + print('=====================================') + print('========== Step-40 PETSc ============') + print('=====================================') + # list the number of cycles to speed up + filter_file(r'(const unsigned int n_cycles = 8;)', ('const unsigned int n_cycles = 2;'), 'step-40.cc') + cmake('.') + if '^petsc' in spec: + make('release') + make('run',parallel=False) + + print('=====================================') + print('========= Step-40 Trilinos ==========') + print('=====================================') + # change Linear Algebra to Trilinos + filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') + if '^trilinos+hypre' in spec: + make('release') + make('run',parallel=False) + + print('=====================================') + print('=== Step-40 Trilinos SuperluDist ====') + print('=====================================') + # change to direct solvers + filter_file(r'(LA::SolverCG solver\(solver_control\);)', ('TrilinosWrappers::SolverDirect::AdditionalData data(false,"Amesos_Superludist"); TrilinosWrappers::SolverDirect solver(solver_control,data);'), 'step-40.cc') + filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)', (''), 'step-40.cc') + filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)', (''), 'step-40.cc') + filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', (''), 'step-40.cc') + filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc') + filter_file(r'(preconditioner\);)', (''), 'step-40.cc') + if '^trilinos+superlu-dist' in spec: + make('release') + make('run',paralle=False) + + print('=====================================') + print('====== Step-40 Trilinos MUMPS =======') + print('=====================================') + # switch to Mumps + filter_file(r'(Amesos_Superludist)', ('Amesos_Mumps'), 'step-40.cc') + if '^trilinos+mumps' in spec: + make('release') + make('run',parallel=False) + + print('=====================================') + print('============ Step-36 ================') + print('=====================================') + with working_dir('examples/step-36'): + if 'slepc' in spec: + cmake('.') + make('release') + make('run',parallel=False) + + print('=====================================') + print('============ Step-54 ================') + print('=====================================') + with working_dir('examples/step-54'): + if 'oce' in spec: + cmake('.') + make('release') + make('run',parallel=False) diff --git a/var/spack/repos/builtin/packages/espresso/package.py b/var/spack/repos/builtin/packages/espresso/package.py index 59f362ab46..0dad57a9f6 100644 --- a/var/spack/repos/builtin/packages/espresso/package.py +++ b/var/spack/repos/builtin/packages/espresso/package.py @@ -24,7 +24,7 @@ class Espresso(Package): depends_on('fftw~mpi', when='~mpi') depends_on('fftw+mpi', when='+mpi') depends_on('scalapack', when='+scalapack+mpi') # TODO : + mpi needed to avoid false dependencies installation - + def check_variants(self, spec): error = 'you cannot ask for \'+{variant}\' when \'+mpi\' is not active' if '+scalapack' in spec and '~mpi' in spec: @@ -32,14 +32,11 @@ class Espresso(Package): if '+elpa' in spec and ('~mpi' in spec or '~scalapack' in spec): raise RuntimeError(error.format(variant='elpa')) - def setup_environment(self, spack_env, run_env): - # Espresso copies every executable in prefix without creating sub-folders - run_env.prepend_path('PATH', self.prefix) - def install(self, spec, prefix): + from glob import glob self.check_variants(spec) - options = ['-prefix=%s' % prefix] + options = ['-prefix=%s' % prefix.bin] if '+mpi' in spec: options.append('--enable-parallel') @@ -65,5 +62,11 @@ class Espresso(Package): configure(*options) make('all') - make('install') + + if spec.architecture.startswith('darwin'): + mkdirp(prefix.bin) + for filename in glob("bin/*.x"): + install(filename, prefix.bin) + else: + make('install') diff --git a/var/spack/repos/builtin/packages/hoomd-blue/package.py b/var/spack/repos/builtin/packages/hoomd-blue/package.py new file mode 100644 index 0000000000..d310b7687a --- /dev/null +++ b/var/spack/repos/builtin/packages/hoomd-blue/package.py @@ -0,0 +1,73 @@ +from spack import * +import os + +class HoomdBlue(Package): + """HOOMD-blue is a general-purpose particle simulation toolkit. It scales + from a single CPU core to thousands of GPUs. + + You define particle initial conditions and interactions in a high-level + python script. Then tell HOOMD-blue how you want to execute the job and it + takes care of the rest. Python job scripts give you unlimited flexibility + to create custom initialization routines, control simulation parameters, + and perform in situ analysis.""" + + homepage = "https://codeblue.umich.edu/hoomd-blue/index.html" + url = "https://bitbucket.org/glotzer/hoomd-blue/get/v1.3.3.tar.bz2" + + version('1.3.3', '1469ef4531dc14b579c0acddbfe6a273') + + variant('mpi', default=True, description='Compile with MPI enabled') + variant('cuda', default=True, description='Compile with CUDA Toolkit') + variant('doc', default=True, description='Generate documentation') + + extends('python') + depends_on('py-numpy') + depends_on('boost+python') + depends_on('cmake') + depends_on('mpi', when='+mpi') + depends_on('cuda', when='+cuda') + depends_on('doxygen', when='+doc') + + def install(self, spec, prefix): + + cmake_args = [ + '-DPYTHON_EXECUTABLE=%s/python' % spec['python'].prefix.bin, + '-DBOOST_ROOT=%s' % spec['boost' ].prefix + ] + + # MPI support + if '+mpi' in spec: + os.environ['MPI_HOME'] = spec['mpi'].prefix + cmake_args.append('-DENABLE_MPI=ON') + else: + cmake_args.append('-DENABLE_MPI=OFF') + + # CUDA support + if '+cuda' in spec: + cmake_args.append('-DENABLE_CUDA=ON') + else: + cmake_args.append('-DENABLE_CUDA=OFF') + + # CUDA-aware MPI library support + #if '+cuda' in spec and '+mpi' in spec: + # cmake_args.append('-DENABLE_MPI_CUDA=ON') + #else: + # cmake_args.append('-DENABLE_MPI_CUDA=OFF') + + # There may be a bug in the MPI-CUDA code. See: + # https://groups.google.com/forum/#!msg/hoomd-users/2griTESmc5I/E69s_M5fDwAJ + # This prevented "make test" from passing for me. + cmake_args.append('-DENABLE_MPI_CUDA=OFF') + + # Documentation + if '+doc' in spec: + cmake_args.append('-DENABLE_DOXYGEN=ON') + else: + cmake_args.append('-DENABLE_DOXYGEN=OFF') + + cmake_args.extend(std_cmake_args) + cmake('.', *cmake_args) + + make() + make("test") + make("install") diff --git a/var/spack/repos/builtin/packages/oce/null.patch b/var/spack/repos/builtin/packages/oce/null.patch new file mode 100644 index 0000000000..42a3f0e44f --- /dev/null +++ b/var/spack/repos/builtin/packages/oce/null.patch @@ -0,0 +1,482 @@ +From 61cb965b9ffeca419005bc15e635e67589c421dd Mon Sep 17 00:00:00 2001 +From: Martin Siggel <martin.siggel@dlr.de> +Date: Thu, 28 Jan 2016 19:05:00 +0100 +Subject: [PATCH] Workaround clang optimizations for null references + +OCCT/OCE includes some evil code that uses NULL references, +which are normally not possible. Clang removes code in +branches like if(&myNullRef==NULL) as it assumes this can +never be true. This fix was inspired from the mantis issue +http://tracker.dev.opencascade.org/view.php?id=26042. This +code will be fixed in OCCT 7, but we might require the fix +for earlier releases as well. + +Fixes issue #576 +--- + inc/PLib.hxx | 2 +- + src/BSplCLib/BSplCLib.cxx | 16 ++++++------- + src/BSplCLib/BSplCLib_2.cxx | 6 ++--- + src/BSplCLib/BSplCLib_CurveComputation.gxx | 26 ++++++++++----------- + src/BSplSLib/BSplSLib.cxx | 36 +++++++++++++++--------------- + src/BSplSLib/BSplSLib_BzSyntaxes.cxx | 2 +- + src/PLib/PLib.cxx | 10 ++++----- + 7 files changed, 49 insertions(+), 49 deletions(-) + +diff --git a/inc/PLib.hxx b/inc/PLib.hxx +index 7513234..52b1f84 100644 +--- a/inc/PLib.hxx ++++ b/inc/PLib.hxx +@@ -343,6 +343,6 @@ friend class PLib_DoubleJacobiPolynomial; + + + +- ++#define IS_NULL_REF(ref) ((reinterpret_cast<size_t>(&ref) & 0xFFFFFF) == 0) + + #endif // _PLib_HeaderFile +diff --git a/src/BSplCLib/BSplCLib.cxx b/src/BSplCLib/BSplCLib.cxx +index 683e4ab..2a2d9ea 100644 +--- a/src/BSplCLib/BSplCLib.cxx ++++ b/src/BSplCLib/BSplCLib.cxx +@@ -298,7 +298,7 @@ void BSplCLib::LocateParameter + Standard_Real& NewU) + { + Standard_Integer first,last; +- if (&Mults) { ++ if (!IS_NULL_REF(Mults)) { + if (Periodic) { + first = Knots.Lower(); + last = Knots.Upper(); +@@ -1434,7 +1434,7 @@ void BSplCLib::BuildKnots(const Standard_Integer Degree, + const Standard_Real * pkn = &Knots(KLower); + pkn -= KLower; + Standard_Real *knot = &LK; +- if (&Mults == NULL) { ++ if (IS_NULL_REF(Mults)) { + switch (Degree) { + case 1 : { + Standard_Integer j = Index ; +@@ -1672,7 +1672,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots + const Standard_Real Tolerance, + const Standard_Boolean Add) + { +- Standard_Boolean addflat = &AddMults == NULL; ++ Standard_Boolean addflat = IS_NULL_REF(AddMults); + + Standard_Integer first,last; + if (Periodic) { +@@ -1856,7 +1856,7 @@ void BSplCLib::InsertKnots + const Standard_Real Tolerance, + const Standard_Boolean Add) + { +- Standard_Boolean addflat = &AddMults == NULL; ++ Standard_Boolean addflat = IS_NULL_REF(AddMults); + + Standard_Integer i,k,mult,firstmult; + Standard_Integer index,kn,curnk,curk; +@@ -3902,7 +3902,7 @@ void BSplCLib::Resolution( Standard_Real& Poles, + num_poles = FlatKnots.Length() - Deg1; + switch (ArrayDimension) { + case 2 : { +- if (&Weights != NULL) { ++ if (!IS_NULL_REF(Weights)) { + const Standard_Real * WG = &Weights(Weights.Lower()); + min_weights = WG[0]; + +@@ -3970,7 +3970,7 @@ void BSplCLib::Resolution( Standard_Real& Poles, + break; + } + case 3 : { +- if (&Weights != NULL) { ++ if (!IS_NULL_REF(Weights)) { + const Standard_Real * WG = &Weights(Weights.Lower()); + min_weights = WG[0]; + +@@ -4047,7 +4047,7 @@ void BSplCLib::Resolution( Standard_Real& Poles, + break; + } + case 4 : { +- if (&Weights != NULL) { ++ if (!IS_NULL_REF(Weights)) { + const Standard_Real * WG = &Weights(Weights.Lower()); + min_weights = WG[0]; + +@@ -4134,7 +4134,7 @@ void BSplCLib::Resolution( Standard_Real& Poles, + } + default : { + Standard_Integer kk; +- if (&Weights != NULL) { ++ if (!IS_NULL_REF(Weights)) { + const Standard_Real * WG = &Weights(Weights.Lower()); + min_weights = WG[0]; + +diff --git a/src/BSplCLib/BSplCLib_2.cxx b/src/BSplCLib/BSplCLib_2.cxx +index 35c4639..653b7cd 100644 +--- a/src/BSplCLib/BSplCLib_2.cxx ++++ b/src/BSplCLib/BSplCLib_2.cxx +@@ -70,7 +70,7 @@ void BSplCLib::BuildEval(const Standard_Integer Degree, + Standard_Integer i; + Standard_Integer ip = PLower + Index - 1; + Standard_Real w, *pole = &LP; +- if (&Weights == NULL) { ++ if (IS_NULL_REF(Weights)) { + + for (i = 0; i <= Degree; i++) { + ip++; +@@ -115,13 +115,13 @@ static void PrepareEval + + // make the knots + BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots); +- if (&Mults == NULL) ++ if (IS_NULL_REF(Mults)) + index -= Knots.Lower() + Degree; + else + index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults); + + // check truly rational +- rational = (&Weights != NULL); ++ rational = (!IS_NULL_REF(Weights)); + if (rational) { + Standard_Integer WLower = Weights.Lower() + index; + rational = BSplCLib::IsRational(Weights, WLower, WLower + Degree); +diff --git a/src/BSplCLib/BSplCLib_CurveComputation.gxx b/src/BSplCLib/BSplCLib_CurveComputation.gxx +index e71b4e0..9d42643 100644 +--- a/src/BSplCLib/BSplCLib_CurveComputation.gxx ++++ b/src/BSplCLib/BSplCLib_CurveComputation.gxx +@@ -92,7 +92,7 @@ Standard_Boolean BSplCLib::RemoveKnot + TColStd_Array1OfInteger& NewMults, + const Standard_Real Tolerance) + { +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim; + dim = Dimension_gen; + if (rational) dim++; +@@ -133,7 +133,7 @@ void BSplCLib::InsertKnots + const Standard_Real Epsilon, + const Standard_Boolean Add) + { +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim; + dim = Dimension_gen; + if (rational) dim++; +@@ -222,7 +222,7 @@ void BSplCLib::IncreaseDegree + TColStd_Array1OfReal& NewKnots, + TColStd_Array1OfInteger& NewMults) + { +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim; + dim = Dimension_gen; + if (rational) dim++; +@@ -256,7 +256,7 @@ void BSplCLib::Unperiodize + Array1OfPoints& NewPoles, + TColStd_Array1OfReal& NewWeights) + { +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim; + dim = Dimension_gen; + if (rational) dim++; +@@ -292,7 +292,7 @@ void BSplCLib::Trimming(const Standard_Integer Degree, + Array1OfPoints& NewPoles, + TColStd_Array1OfReal& NewWeights) + { +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim; + dim = Dimension_gen; + if (rational) dim++; +@@ -339,7 +339,7 @@ void BSplCLib::BuildEval(const Standard_Integer Degree, + Standard_Integer PUpper = Poles.Upper(); + Standard_Integer i; + Standard_Integer ip = PLower + Index - 1; +- if (&Weights == NULL) { ++ if (IS_NULL_REF(Weights)) { + for (i = 0; i <= Degree; i++) { + ip++; + if (ip > PUpper) ip = PLower; +@@ -384,13 +384,13 @@ static void PrepareEval + + // make the knots + BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots); +- if (&Mults == NULL) ++ if (IS_NULL_REF(Mults)) + index -= Knots.Lower() + Degree; + else + index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults); + + // check truly rational +- rational = (&Weights != NULL); ++ rational = (!IS_NULL_REF(Weights)); + if (rational) { + Standard_Integer WLower = Weights.Lower() + index; + rational = BSplCLib::IsRational(Weights, WLower, WLower + Degree); +@@ -741,7 +741,7 @@ void BSplCLib::CacheD0(const Standard_Real Parameter, + Degree * Dimension_gen, + PArray[0], + myPoint[0]) ; +- if (&WeightsArray != NULL) { ++ if (!IS_NULL_REF(WeightsArray)) { + Standard_Real * + WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ; + PLib::NoDerivativeEvalPolynomial(NewParameter, +@@ -798,7 +798,7 @@ void BSplCLib::CacheD1(const Standard_Real Parameter, + + ModifyCoords (LocalPDerivatives + Dimension_gen, /= SpanLenght); + +- if (&WeightsArray != NULL) { ++ if (!IS_NULL_REF(WeightsArray)) { + Standard_Real * + WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ; + PLib::EvalPolynomial(NewParameter, +@@ -878,7 +878,7 @@ void BSplCLib::CacheD2(const Standard_Real Parameter, + Index += Dimension_gen; + } + +- if (&WeightsArray != NULL) { ++ if (!IS_NULL_REF(WeightsArray)) { + Standard_Real * + WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ; + +@@ -971,7 +971,7 @@ void BSplCLib::CacheD3(const Standard_Real Parameter, + Index += Dimension_gen; + } + +- if (&WeightsArray != NULL) { ++ if (!IS_NULL_REF(WeightsArray)) { + Standard_Real * + WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ; + +@@ -1081,7 +1081,7 @@ void BSplCLib::BuildCache + LocalValue *= SpanDomain / (Standard_Real) ii ; + } + +- if (&Weights != NULL) { ++ if (!IS_NULL_REF(Weights)) { + for (ii = 1 ; ii <= Degree + 1 ; ii++) + CacheWeights(ii) = 0.0e0 ; + CacheWeights(1) = 1.0e0 ; +diff --git a/src/BSplSLib/BSplSLib.cxx b/src/BSplSLib/BSplSLib.cxx +index 5ad633c..07040d5 100644 +--- a/src/BSplSLib/BSplSLib.cxx ++++ b/src/BSplSLib/BSplSLib.cxx +@@ -309,12 +309,12 @@ static Standard_Boolean PrepareEval (const Standard_Real U, + BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots1); + BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots2); + +- if (&UMults == NULL) ++ if (IS_NULL_REF(UMults)) + uindex -= UKLower + UDegree; + else + uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,UMults); + +- if (&VMults == NULL) ++ if (IS_NULL_REF(VMults)) + vindex -= VKLower + VDegree; + else + vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,VMults); +@@ -460,12 +460,12 @@ static Standard_Boolean PrepareEval (const Standard_Real U, + BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots2); + BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots1); + +- if (&UMults == NULL) ++ if (IS_NULL_REF(UMults)) + uindex -= UKLower + UDegree; + else + uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,UMults); + +- if (&VMults == NULL) ++ if (IS_NULL_REF(VMults)) + vindex -= VKLower + VDegree; + else + vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,VMults); +@@ -1299,7 +1299,7 @@ void BSplSLib::Iso(const Standard_Real Param, + { + Standard_Integer index = 0; + Standard_Real u = Param; +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim = rational ? 4 : 3; + + // compute local knots +@@ -1307,7 +1307,7 @@ void BSplSLib::Iso(const Standard_Real Param, + NCollection_LocalArray<Standard_Real> locknots1 (2*Degree); + BSplCLib::LocateParameter(Degree,Knots,Mults,u,Periodic,index,u); + BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*locknots1); +- if (&Mults == NULL) ++ if (IS_NULL_REF(Mults)) + index -= Knots.Lower() + Degree; + else + index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults); +@@ -1381,7 +1381,7 @@ void BSplSLib::Iso(const Standard_Real Param, + } + + // if the input is not rational but weights are wanted +- if (!rational && (&CWeights != NULL)) { ++ if (!rational && (!IS_NULL_REF(CWeights))) { + + for (i = CWeights.Lower(); i <= CWeights.Upper(); i++) + CWeights(i) = 1.; +@@ -1741,7 +1741,7 @@ void BSplSLib::InsertKnots(const Standard_Boolean UDirection, + const Standard_Real Epsilon, + const Standard_Boolean Add ) + { +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim = 3; + if (rational) dim++; + +@@ -1787,7 +1787,7 @@ Standard_Boolean BSplSLib::RemoveKnot + TColStd_Array1OfInteger& NewMults, + const Standard_Real Tolerance) + { +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim = 3; + if (rational) dim++; + +@@ -1834,7 +1834,7 @@ void BSplSLib::IncreaseDegree + TColStd_Array1OfReal& NewKnots, + TColStd_Array1OfInteger& NewMults) + { +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim = 3; + if (rational) dim++; + +@@ -1876,7 +1876,7 @@ void BSplSLib::Unperiodize + TColgp_Array2OfPnt& NewPoles, + TColStd_Array2OfReal& NewWeights) + { +- Standard_Boolean rational = &Weights != NULL; ++ Standard_Boolean rational = !IS_NULL_REF(Weights); + Standard_Integer dim = 3; + if (rational) dim++; + +@@ -1929,7 +1929,7 @@ void BSplSLib::BuildCache + Standard_Boolean rational,rational_u,rational_v,flag_u_or_v; + Standard_Integer kk,d1,d1p1,d2,d2p1,ii,jj,iii,jjj,Index; + Standard_Real u1,min_degree_domain,max_degree_domain,f,factor[2],u2; +- if (&Weights != NULL) ++ if (!IS_NULL_REF(Weights)) + rational_u = rational_v = Standard_True; + else + rational_u = rational_v = Standard_False; +@@ -2025,7 +2025,7 @@ void BSplSLib::BuildCache + } + factor[0] *= max_degree_domain / (Standard_Real) (iii) ; + } +- if (&Weights != NULL) { ++ if (!IS_NULL_REF(Weights)) { + // + // means that PrepareEval did found out that the surface was + // locally polynomial but since the surface is constructed +@@ -2110,7 +2110,7 @@ void BSplSLib::CacheD0(const Standard_Real UParameter, + (min_degree << 1) + min_degree, + locpoles[0], + myPoint[0]) ; +- if (&WeightsArray != NULL) { ++ if (!IS_NULL_REF(WeightsArray)) { + dimension = min_degree + 1 ; + Standard_Real * + WArray = (Standard_Real *) +@@ -2190,7 +2190,7 @@ void BSplSLib::CacheD1(const Standard_Real UParameter, + // the coefficients + // + // +- if (&WeightsArray != NULL) { ++ if (!IS_NULL_REF(WeightsArray)) { + + local_poles_array [0][0][0] = 0.0e0 ; + local_poles_array [0][0][1] = 0.0e0 ; +@@ -2275,7 +2275,7 @@ void BSplSLib::CacheD1(const Standard_Real UParameter, + locpoles[dimension], + local_poles_array[1][0][0]) ; + +- if (&WeightsArray != NULL) { ++ if (!IS_NULL_REF(WeightsArray)) { + dimension = min_degree + 1 ; + Standard_Real * + WArray = (Standard_Real *) +@@ -2435,7 +2435,7 @@ void BSplSLib::CacheD2(const Standard_Real UParameter, + // the coefficients + // + // +- if (&WeightsArray != NULL) { ++ if (!IS_NULL_REF(WeightsArray)) { + + local_poles_and_weights_array[0][0][0] = 0.0e0 ; + local_poles_and_weights_array[0][0][1] = 0.0e0 ; +@@ -2564,7 +2564,7 @@ void BSplSLib::CacheD2(const Standard_Real UParameter, + locpoles[dimension + dimension], + local_poles_array[2][0][0]) ; + +- if (&WeightsArray != NULL) { ++ if (!IS_NULL_REF(WeightsArray)) { + dimension = min_degree + 1 ; + Standard_Real * + WArray = (Standard_Real *) +diff --git a/src/BSplSLib/BSplSLib_BzSyntaxes.cxx b/src/BSplSLib/BSplSLib_BzSyntaxes.cxx +index 0faf6b6..f2c0f74 100644 +--- a/src/BSplSLib/BSplSLib_BzSyntaxes.cxx ++++ b/src/BSplSLib/BSplSLib_BzSyntaxes.cxx +@@ -68,7 +68,7 @@ void BSplSLib::PolesCoefficients (const TColgp_Array2OfPnt& Poles, + biduflatknots,bidvflatknots, + Poles,Weights, + CPoles,CWeights); +- if (&Weights == NULL) { ++ if (IS_NULL_REF(Weights)) { + + for (ii = 1; ii <= uclas; ii++) { + +diff --git a/src/PLib/PLib.cxx b/src/PLib/PLib.cxx +index 23fa302..7ee231f 100644 +--- a/src/PLib/PLib.cxx ++++ b/src/PLib/PLib.cxx +@@ -2427,7 +2427,7 @@ void PLib::CoefficientsPoles (const Standard_Integer dim, + TColStd_Array1OfReal& Poles, + TColStd_Array1OfReal& Weights) + { +- Standard_Boolean rat = &WCoefs != NULL; ++ Standard_Boolean rat = !IS_NULL_REF(WCoefs); + Standard_Integer loc = Coefs.Lower(); + Standard_Integer lop = Poles.Lower(); + Standard_Integer lowc=0; +@@ -2550,7 +2550,7 @@ void PLib::Trimming(const Standard_Real U1, + Standard_Integer indc, indw=0; + Standard_Integer upc = Coefs.Upper() - dim + 1, upw=0; + Standard_Integer len = Coefs.Length()/dim; +- Standard_Boolean rat = &WCoefs != NULL; ++ Standard_Boolean rat = !IS_NULL_REF(WCoefs); + + if (rat) { + if(len != WCoefs.Length()) +@@ -2607,7 +2607,7 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs, + TColgp_Array2OfPnt& Poles, + TColStd_Array2OfReal& Weights) + { +- Standard_Boolean rat = (&WCoefs != NULL); ++ Standard_Boolean rat = (!IS_NULL_REF(WCoefs)); + Standard_Integer LowerRow = Poles.LowerRow(); + Standard_Integer UpperRow = Poles.UpperRow(); + Standard_Integer LowerCol = Poles.LowerCol(); +@@ -2701,7 +2701,7 @@ void PLib::UTrimming(const Standard_Real U1, + TColgp_Array2OfPnt& Coeffs, + TColStd_Array2OfReal& WCoeffs) + { +- Standard_Boolean rat = &WCoeffs != NULL; ++ Standard_Boolean rat = !IS_NULL_REF(WCoeffs); + Standard_Integer lr = Coeffs.LowerRow(); + Standard_Integer ur = Coeffs.UpperRow(); + Standard_Integer lc = Coeffs.LowerCol(); +@@ -2735,7 +2735,7 @@ void PLib::VTrimming(const Standard_Real V1, + TColgp_Array2OfPnt& Coeffs, + TColStd_Array2OfReal& WCoeffs) + { +- Standard_Boolean rat = &WCoeffs != NULL; ++ Standard_Boolean rat = !IS_NULL_REF(WCoeffs); + Standard_Integer lr = Coeffs.LowerRow(); + Standard_Integer ur = Coeffs.UpperRow(); + Standard_Integer lc = Coeffs.LowerCol();
\ No newline at end of file diff --git a/var/spack/repos/builtin/packages/oce/package.py b/var/spack/repos/builtin/packages/oce/package.py index 4d5081ac9d..3fe6638e66 100644 --- a/var/spack/repos/builtin/packages/oce/package.py +++ b/var/spack/repos/builtin/packages/oce/package.py @@ -13,9 +13,20 @@ class Oce(Package): version('0.17' , 'f1a89395c4b0d199bea3db62b85f818d') version('0.16.1', '4d591b240c9293e879f50d86a0cb2bb3') version('0.16' , '7a4b4df5a104d75a537e25e7dd387eca') - version('0.15' , '7ec541a1c350ca8a684f74980e48801c') + + variant('tbb', default=True, description='Build with Intel Threading Building Blocks') depends_on('cmake@2.8:') + depends_on('tbb', when='+tbb') + + # There is a bug in OCE which appears with Clang (version?) or GCC 6.0 + # and has to do with compiler optimization, see + # https://github.com/tpaviot/oce/issues/576 + # http://tracker.dev.opencascade.org/view.php?id=26042 + # https://github.com/tpaviot/oce/issues/605 + # https://github.com/tpaviot/oce/commit/61cb965b9ffeca419005bc15e635e67589c421dd.patch + patch('null.patch',when='@0.16:0.17.1') + def install(self, spec, prefix): options = [] @@ -23,12 +34,12 @@ class Oce(Package): options.extend([ '-DOCE_INSTALL_PREFIX=%s' % prefix, '-DOCE_BUILD_SHARED_LIB:BOOL=ON', - '-DOCE_BUILD_TYPE:STRING=Release', + '-DCMAKE_BUILD_TYPE:STRING=Release', '-DOCE_DATAEXCHANGE:BOOL=ON', '-DOCE_DISABLE_X11:BOOL=ON', '-DOCE_DRAW:BOOL=OFF', '-DOCE_MODEL:BOOL=ON', - '-DOCE_MULTITHREAD_LIBRARY:STRING=NONE', # FIXME: add tbb + '-DOCE_MULTITHREAD_LIBRARY:STRING=%s' % ('TBB' if '+tbb' in spec else 'NONE'), '-DOCE_OCAF:BOOL=ON', '-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=OFF', '-DOCE_VISUALISATION:BOOL=OFF', @@ -46,6 +57,11 @@ class Oce(Package): make("install/strip") + # OCE tests build is brocken at least on Darwin. + # Unit tests are linked against libTKernel.10.dylib isntead of /full/path/libTKernel.10.dylib + # see https://github.com/tpaviot/oce/issues/612 + # make("test") + # The shared libraries are not installed correctly on Darwin; correct this if (sys.platform == 'darwin'): fix_darwin_install_name(prefix.lib) diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py index 4a27a8fedb..24382af406 100644 --- a/var/spack/repos/builtin/packages/vtk/package.py +++ b/var/spack/repos/builtin/packages/vtk/package.py @@ -7,11 +7,23 @@ class Vtk(Package): homepage = "http://www.vtk.org" url = "http://www.vtk.org/files/release/6.1/VTK-6.1.0.tar.gz" + version("7.0.0", "5fe35312db5fb2341139b8e4955c367d", url="http://www.vtk.org/files/release/7.0/VTK-7.0.0.tar.gz") + + version("6.3.0", '0231ca4840408e9dd60af48b314c5b6d', url="http://www.vtk.org/files/release/6.3/VTK-6.3.0.tar.gz") + version('6.1.0', '25e4dfb3bad778722dcaec80cd5dab7d') depends_on("qt") + # VTK7 defaults to OpenGL2 rendering backend + variant('opengl2', default=True, description='Build with OpenGL instead of OpenGL2 as rendering backend') + def install(self, spec, prefix): + def feature_to_bool(feature, on='ON', off='OFF'): + if feature in spec: + return on + return off + with working_dir('spack-build', create=True): cmake_args = [ "..", @@ -35,6 +47,12 @@ class Vtk(Package): if spec['qt'].satisfies('@5'): cmake_args.append("-DVTK_QT_VERSION:STRING=5") + if spec.satisfies("@6.1.0"): + cmake_args.append("-DCMAKE_C_FLAGS=-DGLX_GLXEXT_LEGACY") + cmake_args.append("-DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY") + + cmake_args.append('-DVTK_RENDERING_BACKEND:STRING=%s' % feature_to_bool('+opengl2', 'OpenGL2', 'OpenGL')) + cmake(*cmake_args) make() make("install") |