Added symlinks of lib54 content to lib

This commit is contained in:
Patrick Lipka 2022-09-25 01:07:38 +02:00
parent f2087e6d10
commit 8d266dfb74
2 changed files with 16 additions and 2 deletions

View File

@ -26,6 +26,7 @@ def init():
config_parser.add_argument('--mpi', help='Select compiler (hpcx, intelmpi, openmpi) [hpcx]', default='hpcx') config_parser.add_argument('--mpi', help='Select compiler (hpcx, intelmpi, openmpi) [hpcx]', default='hpcx')
config_parser.add_argument('--threads', help='Number of threads used for make [8]', default='8') config_parser.add_argument('--threads', help='Number of threads used for make [8]', default='8')
config_parser.add_argument('--verbose', help='Print build output to screen instead piping it to logile', action='store_true') config_parser.add_argument('--verbose', help='Print build output to screen instead piping it to logile', action='store_true')
config_parser.add_argument('--separate-lib64', help='Do not create symbolic links of files from lib64 in lib', action='store_true')
parser.add_argument('--config', help='Path to config directory [$pwd/config]', default=os.getcwd()+"/config") parser.add_argument('--config', help='Path to config directory [$pwd/config]', default=os.getcwd()+"/config")
parser.add_argument('--prefix', help='Path where install directory should be generated [$pwd]', default=os.getcwd()) parser.add_argument('--prefix', help='Path where install directory should be generated [$pwd]', default=os.getcwd())
@ -36,6 +37,7 @@ def init():
parser.add_argument('--mpi', help='Select compiler (hpcx, intelmpi, openmpi) [hpcx]', default='hpcx') parser.add_argument('--mpi', help='Select compiler (hpcx, intelmpi, openmpi) [hpcx]', default='hpcx')
parser.add_argument('--threads', help='Number of threads used for make [8]', default='8') parser.add_argument('--threads', help='Number of threads used for make [8]', default='8')
parser.add_argument('--verbose', help='Print build output to screen instead piping it to logile', action='store_true') parser.add_argument('--verbose', help='Print build output to screen instead piping it to logile', action='store_true')
parser.add_argument('--separate-lib64', help='Do not create symbolic links of files from lib64 in lib', action='store_true')
# run config parser and search config/*.json to add a build and version argument for it to the full parser # run config parser and search config/*.json to add a build and version argument for it to the full parser
config_dir = config_parser.parse_known_args()[0].config config_dir = config_parser.parse_known_args()[0].config

View File

@ -2,6 +2,7 @@
import shutil import shutil
import json import json
import os import os
import glob
from lib.ui import progressbar, bordered, underlined, print_welcome from lib.ui import progressbar, bordered, underlined, print_welcome
from lib.shell import get_from_command from lib.shell import get_from_command
from lib.toolchain import get_compiler_version, get_mpi_version, set_toolchain from lib.toolchain import get_compiler_version, get_mpi_version, set_toolchain
@ -27,6 +28,7 @@ compiler = arg_namespace.compiler
mpi = arg_namespace.mpi mpi = arg_namespace.mpi
build_threads = arg_namespace.threads build_threads = arg_namespace.threads
verbose = arg_namespace.verbose verbose = arg_namespace.verbose
separate_lib64 = arg_namespace.separate_lib64
# extract libraries and versions selected for installation # extract libraries and versions selected for installation
selected_libs = [] selected_libs = []
@ -65,6 +67,16 @@ if len(sorted_libs) > 0:
else: else:
print("NO LIBRARIES SELECTED FOR INSTALLATION") print("NO LIBRARIES SELECTED FOR INSTALLATION")
# create symbolic links
if not separate_lib64:
lib_dir = inst_dir + "/lib"
lib64_dir = inst_dir + "/lib64"
if os.path.exists(lib_dir) and os.path.exists(lib64_dir):
print("Creating symbolic links...")
for file in glob.glob(lib64_dir+"/*.*"):
if not os.path.exists(file.replace("lib64","lib")):
os.symlink(file, file.replace("lib64","lib"))
# cleanup # cleanup
if (not keep_work and os.path.exists(work_dir)): if (not keep_work and os.path.exists(work_dir)):
print("Cleaning up work directory...") print("Cleaning up work directory...")