Skip to content

Commit

Permalink
trying to get windows compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewq11 committed Nov 8, 2024
1 parent 49e7105 commit bfd5658
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions graphium/graphium_cpp/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ template<> struct FeatureValues<double> {
static_assert(std::is_floating_point_v<T>);
return double(inputType);
}

static constexpr bool is_finite(double v) {
static bool is_finite(double v) {
return std::isfinite(v);
}

Expand Down
17 changes: 8 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,30 @@
# Base variables required for compilation
path_separator = "/"
lib_folder_name = "lib"
package_compile_args = [
"-O3",
"-Wall",
]
boost_include = "include/boost"
package_compile_args = []

# Updating variables used during compilation based on OS
system = platform.system()
if system == "Darwin" or system == "Linux":
package_compile_args += ["-O3", "-Wall", "-Wmaybe-uninitialized", "-Wuninitialized"]

if system == "Darwin":
package_compile_args += ["-mmacosx-version-min=10.15"]
elif system == "Windows":
path_separator = "\\"
lib_folder_name = "Lib"

if system == "Darwin" or system == "Linux":
package_compile_args += ["-Wmaybe-uninitialized", "-Wuninitialized"]
package_compile_args += ["/Wall"]

# Extracting paths to torch and rdkit dependencies
torch_dir = torch.__path__[0]
print(rdkit.__path__[0].split(path_separator), '***')
rdkit_lib_index = rdkit.__path__[0].split(path_separator).index(lib_folder_name) # breaks on windows
rdkit_prefix = "/".join(rdkit.__path__[0].split(path_separator)[:rdkit_lib_index])

# Windows-specific changed to rdkit path
if system == "Windows":
rdkit_prefix += "/Library"
boost_include = "include"

ext_modules = [
Pybind11Extension(
Expand All @@ -69,7 +68,7 @@
os.path.join(torch_dir, "include"),
os.path.join(torch_dir, "include/torch/csrc/api/include"),
os.path.join(rdkit_prefix, "include/rdkit"),
os.path.join(rdkit_prefix, "include/boost"),
os.path.join(rdkit_prefix, boost_include),
numpy.get_include(),
],
libraries=[
Expand Down

0 comments on commit bfd5658

Please sign in to comment.