This repository has been archived by the owner on May 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
58 lines (48 loc) · 2.37 KB
/
conanfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from conans import ConanFile, CMake, tools
from conans.tools import os_info, SystemPackageTool
import shutil
import os
# TODO: Add an option to enable Xeon Phi support. See https://github.com/STEllAR-GROUP/hpx#intelr-xeonphi
# TODO: Add an option to set the CMake HPX_WITH_MALLOC variable
# TODO: Remove documentation
# TODO: Add an option to set the CMake HPX_WITH_MORE_THAN_64_THREADS variable to ON as well as HPX_WITH_MAX_CPU_COUNT as HPX documentation in case the user has a system with more then 64 processing units
class HpxConan(ConanFile):
name = "hpx"
version = "1.3.0"
license = "Boost Software License, Version 1.0"
url = "https://github.com/darcamo/conan-hpx"
description = "HPX (High Performance ParalleX) is a general purpose C++ runtime system for parallel and distributed applications of any scale."
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = "shared=False"
generators = "cmake"
requires = "boost/[>=1.70.0]@conan/stable", "hwloc/1.11.13@darcamo/stable"
def system_requirements(self):
if tools.os_info.linux_distro == "arch":
package_names = ["gperftools"]
elif tools.os_info.linux_distro == "ubuntu":
package_names = ["libgoogle-perftools-dev"]
else:
package_names = []
installer = tools.SystemPackageTool()
for name in package_names:
installer.install(name)
def source(self):
tools.get("http://stellar.cct.lsu.edu/files/hpx_{}.zip".format(self.version))
shutil.move("hpx_{}/".format(self.version), "sources")
tools.replace_in_file("sources/CMakeLists.txt", "project(HPX CXX C)",
'''project(HPX CXX C)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()''')
def build(self):
cmake = CMake(self)
cmake.definitions["HPX_WITH_EXAMPLES"] = False
os.mkdir("build")
shutil.move("conanbuildinfo.cmake", "build/")
cmake.configure(source_folder="sources", build_folder="build")
cmake.build()
cmake.install()
# Other variables you could set in CMake: See https://stellar-group.github.io/hpx/docs/sphinx/latest/html/manual/building_hpx.html#cmake-variables
# - HPX_WITH_CUDA:BOOL
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)