summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/migraphx/0001-Adding-nlohmann-json-include-directory.patch13
-rw-r--r--var/spack/repos/builtin/packages/migraphx/package.py28
2 files changed, 33 insertions, 8 deletions
diff --git a/var/spack/repos/builtin/packages/migraphx/0001-Adding-nlohmann-json-include-directory.patch b/var/spack/repos/builtin/packages/migraphx/0001-Adding-nlohmann-json-include-directory.patch
new file mode 100644
index 0000000000..4554ca9f3b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/migraphx/0001-Adding-nlohmann-json-include-directory.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index eff5ab4..aca4441 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -197,6 +197,8 @@ add_subdirectory(doc)
+ add_subdirectory(test)
+ add_subdirectory(tools)
+
++target_include_directories(migraphx PUBLIC "${NLOHMANN_JSON_INCLUDE}")
++
+ set(DEST_DIR ${CMAKE_BINARY_DIR})
+ file(GLOB backend_files ${CMAKE_SOURCE_DIR}/src/py/backend/*.py)
+ file(MAKE_DIRECTORY ${DEST_DIR}/lib/onnx_migraphx)
diff --git a/var/spack/repos/builtin/packages/migraphx/package.py b/var/spack/repos/builtin/packages/migraphx/package.py
index 90b438dbf0..3800ac9b63 100644
--- a/var/spack/repos/builtin/packages/migraphx/package.py
+++ b/var/spack/repos/builtin/packages/migraphx/package.py
@@ -14,19 +14,25 @@ class Migraphx(CMakePackage):
maintainers = ['srekolam', 'arjun-raj-kuppala']
- def url_for_version(self, version):
- url = "https://github.com/ROCmSoftwarePlatform/AMDMIGraphX/archive/{0}.tar.gz"
- if version > Version('3.5'):
- return url.format(version)
- else:
- return url.format('rocm-' + version)
-
+ version('3.10.0', sha256='eda22b9af286afb7806e6b5d5ebb0d612dce87c9bad64ba5176fda1c2ed9c9b7')
+ version('3.9.0', sha256='7649689e06522302c07b39abb88bdcc3d4de18a7559d4f6a9e238e92b2074032')
version('3.8.0', sha256='08fa991349a2b95364b0a69be7960580c3e3fde2fda0f0c67bc41429ea2d67a0')
version('3.7.0', sha256='697c3c7babaa025eaabec630dbd8a87d10dc4fe35fafa3b0d3463aaf1fc46399')
version('3.5.0', sha256='5766f3b262468c500be5051a056811a8edfa741734a5c08c4ecb0337b7906377')
+ def url_for_version(self, version):
+ url = "https://github.com/ROCmSoftwarePlatform/AMDMIGraphX/archive/"
+ if version <= Version('3.5.0'):
+ url += "{0}.tar.gz".format(version)
+ else:
+ url += "rocm-{0}.tar.gz".format(version)
+
+ return url
+
variant('build_type', default='Release', values=("Release", "Debug"), description='CMake build type')
+ patch('0001-Adding-nlohmann-json-include-directory.patch', when='@3.9.0:')
+
depends_on('cmake@3:', type='build')
depends_on('protobuf', type='link')
depends_on('blaze', type='build')
@@ -34,16 +40,22 @@ class Migraphx(CMakePackage):
depends_on('py-pybind11', type='build')
depends_on('msgpack-c', type='link')
depends_on('half@1.12.0', type='link')
- for ver in ['3.5.0', '3.7.0', '3.8.0']:
+ for ver in ['3.5.0', '3.7.0', '3.8.0', '3.9.0', '3.10.0']:
depends_on('hip@' + ver, type='build', when='@' + ver)
depends_on('rocm-cmake@' + ver, type='build', when='@' + ver)
depends_on('llvm-amdgpu@' + ver, type='build', when='@' + ver)
depends_on('rocblas@' + ver, type='link', when='@' + ver)
depends_on('miopen-hip@' + ver, type='link', when='@' + ver)
+ if ver in ['3.9.0', '3.10.0']:
+ depends_on('nlohmann-json')
def cmake_args(self):
args = [
'-DCMAKE_CXX_COMPILER={0}/bin/clang++'
.format(self.spec['llvm-amdgpu'].prefix)
]
+ if '@3.9.0:' in self.spec:
+ args.append('-DNLOHMANN_JSON_INCLUDE={0}'.format(
+ self.spec['nlohmann-json'].prefix.include))
+
return args