Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
58891c23
Commit
58891c23
authored
Jun 05, 2023
by
zhuwenwen
Browse files
add dcu version and change readme
parent
0607ee4d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
516 additions
and
449 deletions
+516
-449
README.md
README.md
+29
-441
README_HIP.md
README_HIP.md
+3
-3
README_ORIGIN.md
README_ORIGIN.md
+454
-0
setup.py
setup.py
+30
-5
No files found.
README.md
View file @
58891c23
This diff is collapsed.
Click to expand it.
README_HIP.md
View file @
58891c23
...
@@ -31,12 +31,12 @@ pip install setuptools=59.5.0 wheel
...
@@ -31,12 +31,12 @@ pip install setuptools=59.5.0 wheel
```
shell
```
shell
git clone
-b
dtk-23.04_openfold1.0.1 https://developer.hpccube.com/codes/aicomponent/openfold
git clone
-b
dtk-23.04_openfold1.0.1 https://developer.hpccube.com/codes/aicomponent/openfold
cd
openfold
cd
openfold
export
OPENFOLD_BUILD_VERSION
=
abix.dtkxxx
python setup.py bdist_wheel
python setup.py bdist_wheel
pip
install
dist/openfold
*
pip
install
dist/openfold
*
```
```
## Note
## Note
+
若使用 pip install 下载安装过慢,可添加源:-i https://pypi.tuna.tsinghua.edu.cn/simple/
+
若使用 pip install 下载安装过慢,可添加源:-i https://pypi.tuna.tsinghua.edu.cn/simple/
+
OPENFOLD_BUILD_VERSION为编译的版本号设置,版本号为1.0.1+gitxxx.abix.dtkxxx
gitxxx:为代码自动获取;abi0:使用devtools的gcc编译;abi1:使用非devtools的gcc编译; dtkxxx为dtk的版本号:例如:dtk2304
## 参考
\ No newline at end of file
-
[
README_ORIGIN
](
README_ORIGIN.md
)
\ No newline at end of file
README_ORIGIN.md
0 → 100644
View file @
58891c23
This diff is collapsed.
Click to expand it.
setup.py
View file @
58891c23
...
@@ -16,6 +16,7 @@ import os
...
@@ -16,6 +16,7 @@ import os
from
setuptools
import
setup
,
Extension
,
find_packages
from
setuptools
import
setup
,
Extension
,
find_packages
import
subprocess
import
subprocess
import
torch
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDAExtension
,
ROCM_HOME
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDAExtension
,
ROCM_HOME
from
typing
import
Optional
,
Union
from
typing
import
Optional
,
Union
...
@@ -48,6 +49,17 @@ def get_sha(root: Union[str, Path]) -> str:
...
@@ -48,6 +49,17 @@ def get_sha(root: Union[str, Path]) -> str:
return
'Unknown'
return
'Unknown'
def
get_abi
():
try
:
command
=
"echo '#include <string>' | gcc -x c++ -E -dM - | fgrep _GLIBCXX_USE_CXX11_ABI"
result
=
subprocess
.
run
(
command
,
shell
=
True
,
capture_output
=
True
,
text
=
True
)
output
=
result
.
stdout
.
strip
()
abi
=
"abi"
+
output
.
split
(
" "
)[
-
1
]
return
abi
except
Exception
:
return
'abiUnknown'
def
get_version_add
(
sha
:
Optional
[
str
]
=
None
)
->
str
:
def
get_version_add
(
sha
:
Optional
[
str
]
=
None
)
->
str
:
openfold_root
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
openfold_root
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
add_version_path
=
"version.py"
add_version_path
=
"version.py"
...
@@ -56,12 +68,25 @@ def get_version_add(sha: Optional[str] = None) -> str:
...
@@ -56,12 +68,25 @@ def get_version_add(sha: Optional[str] = None) -> str:
sha
=
get_sha
(
openfold_root
)
sha
=
get_sha
(
openfold_root
)
version
=
'git'
+
sha
[:
7
]
version
=
'git'
+
sha
[:
7
]
if
os
.
getenv
(
'OPENFOLD_BUILD_VERSION'
):
# abi version
version_dtk
=
os
.
getenv
(
'OPENFOLD_BUILD_VERSION'
,
""
)
version
+=
"."
+
get_abi
()
version
+=
"."
+
version_dtk
# dtk version
if
os
.
getenv
(
"ROCM_PATH"
):
rocm_path
=
os
.
getenv
(
'ROCM_PATH'
,
""
)
rocm_version_path
=
os
.
path
.
join
(
rocm_path
,
'.info'
,
"rocm_version"
)
with
open
(
rocm_version_path
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
lines
=
file
.
readlines
()
rocm_version
=
lines
[
0
][:
-
2
].
replace
(
"."
,
""
)
version
+=
".dtk"
+
rocm_version
# torch version
version
+=
".torch"
+
torch
.
__version__
[:
4
]
with
open
(
add_version_path
,
encoding
=
"utf-8"
,
mode
=
"w"
)
as
file
:
with
open
(
add_version_path
,
encoding
=
"utf-8"
,
mode
=
"w"
)
as
file
:
file
.
write
(
"__version__='1.0.1'+'+{}'
\n
"
.
format
(
version
))
# file.write("__version__='1.0.1'+'+{}'\n".format(version))
file
.
write
(
"__version__='1.0.1'
\n
"
)
file
.
write
(
"__dcu_version__='1.0.1+{}'
\n
"
.
format
(
version
))
file
.
close
()
file
.
close
()
...
@@ -70,7 +95,7 @@ def get_version():
...
@@ -70,7 +95,7 @@ def get_version():
version_file
=
'version.py'
version_file
=
'version.py'
with
open
(
version_file
,
encoding
=
'utf-8'
)
as
f
:
with
open
(
version_file
,
encoding
=
'utf-8'
)
as
f
:
exec
(
compile
(
f
.
read
(),
version_file
,
'exec'
))
exec
(
compile
(
f
.
read
(),
version_file
,
'exec'
))
return
locals
()[
'__version__'
]
return
locals
()[
'__
dcu_
version__'
]
setup
(
setup
(
name
=
'openfold'
,
name
=
'openfold'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment