Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
easybuild-repository-public-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DEEP-SEA
easybuild-repository-public-release
Commits
cdcf47c8
Commit
cdcf47c8
authored
3 years ago
by
Damian Alvarez
Browse files
Options
Downloads
Patches
Plain Diff
To add pc files to PKGCONFIG_PATH and to have those files also in
version-independent manner
parent
48c299a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Custom_EasyBlocks/cuda.py
+21
-7
21 additions, 7 deletions
Custom_EasyBlocks/cuda.py
with
21 additions
and
7 deletions
Custom_EasyBlocks/cuda.py
+
21
−
7
View file @
cdcf47c8
...
@@ -35,6 +35,7 @@ Ref: https://speakerdeck.com/ajdecon/introduction-to-the-cuda-toolkit-for-buildi
...
@@ -35,6 +35,7 @@ Ref: https://speakerdeck.com/ajdecon/introduction-to-the-cuda-toolkit-for-buildi
@author: Robert Mijakovic (LuxProvide S.A.)
@author: Robert Mijakovic (LuxProvide S.A.)
"""
"""
import
os
import
os
import
re
import
stat
import
stat
from
distutils.version
import
LooseVersion
from
distutils.version
import
LooseVersion
...
@@ -43,8 +44,8 @@ from easybuild.easyblocks.generic.binary import Binary
...
@@ -43,8 +44,8 @@ from easybuild.easyblocks.generic.binary import Binary
from
easybuild.framework.easyconfig
import
CUSTOM
from
easybuild.framework.easyconfig
import
CUSTOM
from
easybuild.tools.build_log
import
EasyBuildError
from
easybuild.tools.build_log
import
EasyBuildError
from
easybuild.tools.config
import
IGNORE
from
easybuild.tools.config
import
IGNORE
from
easybuild.tools.filetools
import
adjust_permissions
,
c
opy_dir
,
patch_perl_script_autoflush
from
easybuild.tools.filetools
import
adjust_permissions
,
c
hange_dir
,
copy_dir
,
expand_glob_paths
from
easybuild.tools.filetools
import
remove_file
,
symlink
,
which
,
write_file
from
easybuild.tools.filetools
import
patch_perl_script_autoflush
,
remove_file
,
symlink
,
which
,
write_file
from
easybuild.tools.run
import
run_cmd
,
run_cmd_qa
from
easybuild.tools.run
import
run_cmd
,
run_cmd_qa
from
easybuild.tools.systemtools
import
AARCH64
,
POWER
,
X86_64
,
get_cpu_architecture
,
get_shared_lib_ext
from
easybuild.tools.systemtools
import
AARCH64
,
POWER
,
X86_64
,
get_cpu_architecture
,
get_shared_lib_ext
import
easybuild.tools.environment
as
env
import
easybuild.tools.environment
as
env
...
@@ -198,11 +199,13 @@ class EB_CUDA(Binary):
...
@@ -198,11 +199,13 @@ class EB_CUDA(Binary):
if
len
(
self
.
src
)
>
1
:
if
len
(
self
.
src
)
>
1
:
for
patch
in
self
.
src
[
1
:]:
for
patch
in
self
.
src
[
1
:]:
self
.
log
.
debug
(
"
Running patch %s
"
,
patch
[
'
name
'
])
self
.
log
.
debug
(
"
Running patch %s
"
,
patch
[
'
name
'
])
run_cmd
(
run_cmd
(
"
/bin/sh
"
+
patch
[
'
path
'
]
+
"
--accept-eula --silent --installdir=
"
+
self
.
installdir
)
"
/bin/sh
"
+
patch
[
'
path
'
]
+
"
--accept-eula --silent --installdir=
"
+
self
.
installdir
)
def
post_install_step
(
self
):
def
post_install_step
(
self
):
"""
Create wrappers for the specified host compilers and generate the appropriate stub symlinks
"""
"""
Create wrappers for the specified host compilers, generate the appropriate stub symlinks and create version
independent pkgconfig files
"""
def
create_wrapper
(
wrapper_name
,
wrapper_comp
):
def
create_wrapper
(
wrapper_name
,
wrapper_comp
):
"""
Create for a particular compiler, with a particular name
"""
"""
Create for a particular compiler, with a particular name
"""
wrapper_f
=
os
.
path
.
join
(
self
.
installdir
,
'
bin
'
,
wrapper_name
)
wrapper_f
=
os
.
path
.
join
(
self
.
installdir
,
'
bin
'
,
wrapper_name
)
...
@@ -242,8 +245,18 @@ class EB_CUDA(Binary):
...
@@ -242,8 +245,18 @@ class EB_CUDA(Binary):
new_stubs_dir
=
os
.
path
.
join
(
self
.
installdir
,
'
stubs
'
)
new_stubs_dir
=
os
.
path
.
join
(
self
.
installdir
,
'
stubs
'
)
copy_dir
(
stubs_dir
,
os
.
path
.
join
(
new_stubs_dir
,
'
lib64
'
))
copy_dir
(
stubs_dir
,
os
.
path
.
join
(
new_stubs_dir
,
'
lib64
'
))
# Also create the lib dir as a symlink
# Also create the lib dir as a symlink
symlink
(
'
lib64
'
,
os
.
path
.
join
(
new_stubs_dir
,
'
lib
'
),
symlink
(
'
lib64
'
,
os
.
path
.
join
(
new_stubs_dir
,
'
lib
'
),
use_abspath_source
=
False
)
use_abspath_source
=
False
)
# Packages like xpra look for version independent pc files.
# See e.g. https://github.com/Xpra-org/xpra/blob/master/setup.py#L206
# Distros provide these files, so let's do it here too
pkgconfig_dir
=
os
.
path
.
join
(
self
.
installdir
,
'
pkgconfig
'
)
pc_files
=
expand_glob_paths
([
os
.
path
.
join
(
pkgconfig_dir
,
'
*.pc
'
)])
change_dir
(
pkgconfig_dir
)
for
f
in
pc_files
:
f
=
os
.
path
.
basename
(
f
)
l
=
re
.
sub
(
'
-[0-9]*.?[0-9]*(.[0-9]*)?.pc
'
,
'
.pc
'
,
f
)
symlink
(
f
,
l
,
use_abspath_source
=
False
)
super
(
EB_CUDA
,
self
).
post_install_step
()
super
(
EB_CUDA
,
self
).
post_install_step
()
...
@@ -315,6 +328,7 @@ class EB_CUDA(Binary):
...
@@ -315,6 +328,7 @@ class EB_CUDA(Binary):
'
LD_LIBRARY_PATH
'
:
lib_path
,
'
LD_LIBRARY_PATH
'
:
lib_path
,
'
LIBRARY_PATH
'
:
[
'
lib64
'
,
os
.
path
.
join
(
'
stubs
'
,
'
lib64
'
)],
'
LIBRARY_PATH
'
:
[
'
lib64
'
,
os
.
path
.
join
(
'
stubs
'
,
'
lib64
'
)],
'
CPATH
'
:
inc_path
,
'
CPATH
'
:
inc_path
,
'
PKG_CONFIG_PATH
'
:
[
'
pkgconfig
'
],
})
})
return
guesses
return
guesses
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment