diff options
author | CoprDistGit <infra@openeuler.org> | 2024-12-12 17:07:49 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-12-12 17:07:49 +0000 |
commit | a1a016977d4085502812d718c6e9c695bfdad04a (patch) | |
tree | 8576481ba05b3c034db547244f5498af3a79ca56 | |
parent | e07de218856bbe699b47b8b6f8044b2593f737ec (diff) |
automatic import of voro++openeuler24.09
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 25 | ||||
-rw-r--r-- | sources | 1 | ||||
-rw-r--r-- | voro++_man.patch | 78 | ||||
-rw-r--r-- | voro++_virtual-destructor.patch | 89 | ||||
-rw-r--r-- | voroplusplus.spec | 89 |
6 files changed, 283 insertions, 0 deletions
@@ -0,0 +1 @@ +/voro++-0.4.6.tar.gz diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..94e140a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,25 @@ +# Set the minimum required version of cmake for a project. +cmake_minimum_required(VERSION 2.6) + +add_library(voro++ SHARED + cell.cc + common.cc + container.cc + unitcell.cc + v_compute.cc + c_loops.cc + v_base.cc wall.cc + pre_container.cc + container_prd.cc +) +set_target_properties(voro++ PROPERTIES VERSION 0.0.0 SOVERSION 0) + +add_executable(voro++-bin cmd_line.cc) +set_target_properties(voro++-bin PROPERTIES OUTPUT_NAME voro++) +target_link_libraries(voro++-bin voro++) + +file(GLOB_RECURSE HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.hh) + +install(TARGETS voro++ LIBRARY DESTINATION lib${LIB_SUFFIX}) +install(FILES ${HDR} DESTINATION include) +install(TARGETS voro++-bin DESTINATION bin) @@ -0,0 +1 @@ +2338b824c3b7b25590e18e8df5d68af9 voro++-0.4.6.tar.gz diff --git a/voro++_man.patch b/voro++_man.patch new file mode 100644 index 0000000..72a927f --- /dev/null +++ b/voro++_man.patch @@ -0,0 +1,78 @@ +diff -rupN voro++-0.4.6/man/voro++.1 voro++-0.4.6-new/man/voro++.1 +--- voro++-0.4.6/man/voro++.1 2013-10-17 20:13:38.000000000 +0200 ++++ voro++-0.4.6-new/man/voro++.1 2014-06-19 22:44:47.215792546 +0200 +@@ -82,7 +82,7 @@ grid size using the \-l and \-n options. + The utility accepts the following basic options: + + .B +-.IP \-c <string> ++.IP "\-c <string>" + This option allows the format of the output file to be customized to hold a + variety of statistics about the computed Voronoi cells. The specified string + can contain regular characters, plus control sequences beginning with +@@ -97,7 +97,7 @@ that can be viewed using gnuplot using t + command. Caution: For large input files, the gnuplot output file will be + extremely large, so this option is best used on smaller systems. + .B +-.IP \-h or \-\-help ++.IP "\-h or \-\-help" + This option prints out a summary of the command syntax and the available + options. + .B +@@ -105,7 +105,7 @@ options. + This option prints out all the available control sequences for the customized + output. + .B +-.IP -l <len> ++.IP "-l <len>" + Manually specify a typical length scale between particles, with which to + configure the internal grid size. For example, if the particles represent + densely-packed hard spheres of diameter d, then d would be an appropriate value +@@ -114,13 +114,13 @@ this option will result in a small perfo + can be set up immediately, and it is not necessary to temporarily store the + input file contents while estimating the grid size. + .B +-.IP -m <mem> ++.IP "-m <mem>" + Manually specify the initial number of particles that can be stored in each + block. By default a value of 8 is used. For any block where this limit is + reached, the code will dynamically allocate more memory as neccessary, so + usually it is not necessary to alter this. + .B +-.IP -n <nx> <ny> <nz> ++.IP "-n <nx> <ny> <nz>" + Manually specify the internal computational grid to have nx, ny, and nz blocks + in the x, y, and z directions respectively, giving nx*ny*nz blocks in total. + Manually specifying the size will result in a small performance boost, since +@@ -178,26 +178,26 @@ are implemented by applying extra plane + process. At present, four wall types are supported: + + .B +-.IP \-wb <x1> <x2> <x3> <x4> <x5> <x6> ++.IP "\-wb <x1> <x2> <x3> <x4> <x5> <x6>" + Add six plane wall objects to make a box containing the space x1<x<x2, x3<y<x4, + and x5<z<z6. This can be useful for embedding a smaller box within a larger + container, in cases when the influence of particles outside the smaller box + still need to be considered. This option is shorthand to avoid using the \-wp + option six times. + .B +-.IP \-wc <x1> <x2> <x3> <x4> <x5> <x6> <x7> ++.IP "\-wc <x1> <x2> <x3> <x4> <x5> <x6> <x7>" + Add a cylindrical wall object, where (x1,x2,x3) is a point on the cylinder + axis, (x4,x5,x6) is a vector along the cylinder axis, and x7 is the cylinder + radius. + .B +-.IP \-wo <x1> <x2> <x3> <x4> <x5> <x6> <x7> ++.IP "\-wo <x1> <x2> <x3> <x4> <x5> <x6> <x7>" + Add a conical wall object, with apex at (x1,x2,x3), axis along (x4,x5,x6), and + half angle x7 (specified in radians). + .B +-.IP \-ws <x1> <x2> <x3> <x4> ++.IP "\-ws <x1> <x2> <x3> <x4>" + Add a spherical wall object, centered on (x1,x2,x3), with radius x4. + .B +-.IP \-wp <x1> <x2> <x3> <x4> ++.IP "\-wp <x1> <x2> <x3> <x4>" + Add a plane wall object, with normal (x1,x2,x3), and displacement x4. + + Each wall is accounted for using a single approximating plane; several of the diff --git a/voro++_virtual-destructor.patch b/voro++_virtual-destructor.patch new file mode 100644 index 0000000..0670def --- /dev/null +++ b/voro++_virtual-destructor.patch @@ -0,0 +1,89 @@ +diff -rupN voro++-0.4.6/src/cell.hh voro++-0.4.6-new/src/cell.hh +--- voro++-0.4.6/src/cell.hh 2013-10-17 19:54:13.000000000 +0200 ++++ voro++-0.4.6-new/src/cell.hh 2014-06-14 13:48:43.119907250 +0200 +@@ -84,7 +84,7 @@ class voronoicell_base { + * the positions of the vertices. */ + double *pts; + voronoicell_base(); +- ~voronoicell_base(); ++ virtual ~voronoicell_base(); + void init_base(double xmin,double xmax,double ymin,double ymax,double zmin,double zmax); + void init_octahedron_base(double l); + void init_tetrahedron_base(double x0,double y0,double z0,double x1,double y1,double z1,double x2,double y2,double z2,double x3,double y3,double z3); +@@ -416,7 +416,7 @@ class voronoicell_neighbor : public voro + * face that is clockwise from the jth edge. */ + int **ne; + voronoicell_neighbor(); +- ~voronoicell_neighbor(); ++ virtual ~voronoicell_neighbor(); + void operator=(voronoicell &c); + void operator=(voronoicell_neighbor &c); + /** Cuts the Voronoi cell by a particle whose center is at a +diff -rupN voro++-0.4.6/src/c_loops.hh voro++-0.4.6-new/src/c_loops.hh +--- voro++-0.4.6/src/c_loops.hh 2013-10-17 20:18:28.000000000 +0200 ++++ voro++-0.4.6-new/src/c_loops.hh 2014-06-14 13:43:40.009916206 +0200 +@@ -124,6 +124,7 @@ class c_loop_base { + c_loop_base(c_class &con) : nx(con.nx), ny(con.ny), nz(con.nz), + nxy(con.nxy), nxyz(con.nxyz), ps(con.ps), + p(con.p), id(con.id), co(con.co) {} ++ virtual ~c_loop_base(){} + /** Returns the position vector of the particle currently being + * considered by the loop. + * \param[out] (x,y,z) the position vector of the particle. */ +diff -rupN voro++-0.4.6/src/container.hh voro++-0.4.6-new/src/container.hh +--- voro++-0.4.6/src/container.hh 2013-10-17 19:54:13.000000000 +0200 ++++ voro++-0.4.6-new/src/container.hh 2014-06-14 13:48:00.484908509 +0200 +@@ -57,7 +57,7 @@ class wall_list { + */ + wall **wep; + wall_list(); +- ~wall_list(); ++ virtual ~wall_list(); + /** Adds a wall to the list. + * \param[in] w the wall to add. */ + inline void add_wall(wall *w) { +@@ -161,7 +161,7 @@ class container_base : public voro_base, + container_base(double ax_,double bx_,double ay_,double by_,double az_,double bz_, + int nx_,int ny_,int nz_,bool xperiodic_,bool yperiodic_,bool zperiodic_, + int init_mem,int ps_); +- ~container_base(); ++ virtual ~container_base(); + bool point_inside(double x,double y,double z); + void region_count(); + /** Initializes the Voronoi cell prior to a compute_cell +diff -rupN voro++-0.4.6/src/container_prd.hh voro++-0.4.6-new/src/container_prd.hh +--- voro++-0.4.6/src/container_prd.hh 2013-10-17 19:54:13.000000000 +0200 ++++ voro++-0.4.6-new/src/container_prd.hh 2014-06-14 13:46:47.345910670 +0200 +@@ -93,7 +93,7 @@ class container_periodic_base : public u + const int ps; + container_periodic_base(double bx_,double bxy_,double by_,double bxz_,double byz_,double bz_, + int nx_,int ny_,int nz_,int init_mem_,int ps); +- ~container_periodic_base(); ++ virtual ~container_periodic_base(); + /** Prints all particles in the container, including those that + * have been constructed in image blocks. */ + inline void print_all_particles() { +diff -rupN voro++-0.4.6/src/pre_container.hh voro++-0.4.6-new/src/pre_container.hh +--- voro++-0.4.6/src/pre_container.hh 2013-10-17 19:54:13.000000000 +0200 ++++ voro++-0.4.6-new/src/pre_container.hh 2014-06-14 13:40:25.604921950 +0200 +@@ -53,7 +53,7 @@ class pre_container_base { + const bool zperiodic; + void guess_optimal(int &nx,int &ny,int &nz); + pre_container_base(double ax_,double bx_,double ay_,double by_,double az_,double bz_,bool xperiodic_,bool yperiodic_,bool zperiodic_,int ps_); +- ~pre_container_base(); ++ virtual ~pre_container_base(); + /** Calculates and returns the total number of particles stored + * within the class. + * \return The number of particles. */ +diff -rupN voro++-0.4.6/src/v_base.hh voro++-0.4.6-new/src/v_base.hh +--- voro++-0.4.6/src/v_base.hh 2013-10-17 19:54:13.000000000 +0200 ++++ voro++-0.4.6-new/src/v_base.hh 2014-06-14 13:40:14.507922277 +0200 +@@ -57,7 +57,7 @@ class voro_base { + static const unsigned int wl[wl_seq_length*wl_hgridcu]; + bool contains_neighbor(const char* format); + voro_base(int nx_,int ny_,int nz_,double boxx_,double boxy_,double boxz_); +- ~voro_base() {delete [] mrad;} ++ virtual ~voro_base() {delete [] mrad;} + protected: + /** A custom int function that returns consistent stepping + * for negative numbers, so that (-1.5, -0.5, 0.5, 1.5) maps diff --git a/voroplusplus.spec b/voroplusplus.spec new file mode 100644 index 0000000..1573f73 --- /dev/null +++ b/voroplusplus.spec @@ -0,0 +1,89 @@ +%undefine __cmake_in_source_build + +Name: voro++ +Version: 0.4.6 +Release: 3 +Summary: Library for 3D computations of the Voronoi tessellation + +License: BSD-3-Clause-LBNL +URL: http://math.lbl.gov/voro++/ +Source0: http://math.lbl.gov/voro++/download/dir/%{name}-%{version}.tar.gz +Source1: CMakeLists.txt +# Make base class destructors virtual +Patch0: voro++_virtual-destructor.patch +# Fix manpage formatting +Patch1: voro++_man.patch + +BuildRequires: cmake gcc-c++ make + +%description +Voro++ is a software library for carrying out three-dimensional computations +of the Voronoi tessellation. A distinguishing feature of the Voro++ library +is that it carries out cell-based calculations, computing the Voronoi cell for +each particle individually. It is particularly well-suited for applications +that rely on cell-based statistics, where features of Voronoi cells (e.g. +volume, centroid, number of faces) can be used to analyze a system of particles. + + +%package devel +Summary: %{name} headers +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Header files for %{name}. + + +%package doc +Summary: %{name} documentation +BuildArch: noarch + +%description doc +Documentation for %{name}. + + +%prep +%autosetup -p1 +install -m 0644 %{SOURCE1} src + + +%build +%cmake -S src +%make_build + +%install +%make_install +install -D -p -m 0644 man/voro++.1 %{buildroot}%{_mandir}/man1/voro++.1 +# Fix path in examples +find examples -name "*.cc" -exec sed -i 's/"voro++.hh"/<voro++\/voro++.hh>/g' '{}' \; +cp config.mk examples/ +find examples -name "Makefile" -exec sed -i 's/..\/..\/config.mk/..\/config.mk/g' '{}' \; + + +%files +%license LICENSE +%doc README NEWS +%{_bindir}/%{name} +%{_mandir}/man1/* +%{_libdir}/lib%{name}.so.* + + +%files devel +%{_includedir}/* +%{_libdir}/lib%{name}.so + +%files doc +%doc LICENSE +%doc html/ +%doc examples/ +%doc scripts/ + + +%changelog +* Mon Nov 18 2024 Funda Wang <fundawang@yeah.net> - 0.4.6-3 +- adopt to new cmake macro + +* Tue Oct 26 2021 chenchen <chen_aka_jan@163.com> - 0.4.6-2 +- change the spec file name to be the same as the repo name + +* Wed Aug 11 2021 herengui <herengui@uniontech.com> - 0.4.6-1 +- Package init |