Skip to content

Commit

Permalink
Provide version.hpp instead of generating it.
Browse files Browse the repository at this point in the history
  • Loading branch information
vasole committed Dec 5, 2022
1 parent 6d0ce47 commit 2b9b027
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
23 changes: 3 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# ###########################################################################*/
__authors__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
__date__ = "29/11/2022"
__date__ = "05/12/2022"


from glob import glob
Expand Down Expand Up @@ -876,25 +876,6 @@ def prefix(directory, files):
)

# SZ3 library and its hdf5 filter
# Generate needed version include file.
with open(os.path.join("src", "SZ3", "include", "SZ3", "version.hpp"), 'w') as f:
f.write("//\n")
f.write("// DO NOT MODIFY version.hpp, it is automatically generated by cmake\n")
f.write("// The version is controlled in CMakeLists.txt\n")
f.write("//\n")
f.write("\n")
f.write("#ifndef SZ3_VERSION_HPP\n")
f.write("#define SZ3_VERSION_HPP\n")
f.write("\n")
f.write('#define SZ3_NAME "SZ3"\n')
f.write('#define SZ3_VER "3.1.7"\n')
f.write("#define SZ3_VER_MAJOR 3\n")
f.write("#define SZ3_VER_MINOR 1\n")
f.write("#define SZ3_VER_PATCH 7\n")
f.write("#define SZ3_VER_TWEAK \n")
f.write("\n")
f.write("#endif //SZ3_VERSION_HP\n")

sz3_dir = os.path.join("src", "SZ3")
sz3_sources = [] #glob(os.path.join(sz3_dir, "tools", "sz3", "sz3.*pp"))
sz3_include_dirs = [os.path.join(sz3_dir, "include"),
Expand All @@ -911,6 +892,8 @@ def prefix(directory, files):
os.path.join(sz3_dir, "include", "SZ3", "utils", "inih"),
os.path.join(sz3_dir, "include", "SZ3", "utils", "ska_hash"),
]
#add version.hpp
sz3_include_dirs.append(os.path.join("src", "SZ3_extra"))
if sys.platform.startswith('darwin'):
# provide dummy omp.h
sz3_include_dirs.append(os.path.join("src", "SZ3_extra", "darwin"))
Expand Down
16 changes: 16 additions & 0 deletions src/SZ3_extra/SZ3/version.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// DO NOT MODIFY version.hpp, it is automatically generated by cmake
// The version is controlled in CMakeLists.txt
//

#ifndef SZ3_VERSION_HPP
#define SZ3_VERSION_HPP

#define SZ3_NAME "SZ3"
#define SZ3_VER "3.1.7"
#define SZ3_VER_MAJOR 3
#define SZ3_VER_MINOR 1
#define SZ3_VER_PATCH 7
#define SZ3_VER_TWEAK

#endif //SZ3_VERSION_HP

0 comments on commit 2b9b027

Please sign in to comment.