Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
|
7e1dc410b0 | |
|
649b5c39d5 | |
|
c6a4d9f909 | |
|
d3e03daded |
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"name" : "netcdf-c",
|
||||
"default version" : "4.7.4",
|
||||
"dependencies" : "zlib,szip,curl,hdf5",
|
||||
"download" : "git clone --depth 1 --branch v$VERSION https://github.com/Unidata/netcdf-c.git netcdf-c-$VERSION",
|
||||
"configure" : "./configure --prefix=$PREFIX CPPFLAGS=-I$PREFIX/include LDFLAGS=-L$PREFIX/lib $SHARED",
|
||||
"build" : "make -j $BUILDTHREADS",
|
||||
"install" : "make install",
|
||||
"object files" : "435"
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"name" : "netcdf-f",
|
||||
"default version" : "4.5.3",
|
||||
"dependencies" : "zlib,szip,hdf5,curl,netcdf-c",
|
||||
"download" : "git clone --depth 1 --branch v$VERSION https://github.com/Unidata/netcdf-fortran.git netcdf-f-$VERSION",
|
||||
"configure" : "./configure --prefix=$PREFIX CPPFLAGS=-I$PREFIX/include LDFLAGS=-L$PREFIX/lib $SHARED",
|
||||
"build" : "make -j $BUILDTHREADS",
|
||||
"install" : "make install",
|
||||
"object files" : "60"
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import glob
|
||||
from lib.io import load_lib_data
|
||||
|
||||
def topological_sort(source):
|
||||
|
@ -58,7 +59,7 @@ def load_dependencies(library, selected_libs, config_dir):
|
|||
lib_names = []
|
||||
for lib in selected_libs:
|
||||
lib_names.append(lib['name'])
|
||||
|
||||
|
||||
dependencies = library['dependencies'].split(',')
|
||||
for dep in dependencies:
|
||||
if len(dep) > 1:
|
||||
|
@ -78,8 +79,6 @@ def load_selected_libs(config_dir, arg_namespace, args, install_all_libs, ignore
|
|||
if install_all_libs:
|
||||
for config_file in glob.glob(config_dir+"/*.json"):
|
||||
data = load_lib_data(config_file)
|
||||
#with open(cf, 'r') as f:
|
||||
#data = json.load(f)
|
||||
data['version'] = data['default version']
|
||||
selected_libs.append(data)
|
||||
else:
|
||||
|
@ -94,10 +93,10 @@ def load_selected_libs(config_dir, arg_namespace, args, install_all_libs, ignore
|
|||
data = load_lib_data(config_file)
|
||||
data['version'] = version
|
||||
selected_libs.append(data)
|
||||
|
||||
|
||||
if not ignore_deps:
|
||||
# also add all dependencies to the install list
|
||||
for lib in selected_libs:
|
||||
load_dependencies(lib, selected_libs, config_dir)
|
||||
|
||||
|
||||
return selected_libs
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import json
|
||||
|
||||
|
||||
# load library data from json file
|
||||
def load_lib_data(lib_path):
|
||||
with open (lib_path, 'r') as config_file:
|
||||
data = json.load(config_file)
|
||||
return data
|
||||
return data
|
||||
|
|
|
@ -6,11 +6,17 @@ from lib.shell import get_from_command
|
|||
def get_compiler_version(compiler):
|
||||
if compiler == "gnu":
|
||||
cc = "gcc"
|
||||
compstr = get_from_command([cc, "-dumpversion"]).strip()
|
||||
elif compiler == "intel":
|
||||
cc = "icc"
|
||||
compstr = get_from_command([cc, "-dumpversion"]).strip()
|
||||
elif compiler == "aocc":
|
||||
cc = "clang"
|
||||
compstr = get_from_command([cc, "-dumpversion"]).strip()
|
||||
compstr = get_from_command([cc, "-dumpversion"]).strip()
|
||||
elif compiler == "nec":
|
||||
cc = "ncc"
|
||||
rawstr = get_from_command([cc, "--version"])
|
||||
compstr = rawstr.split()[2]
|
||||
return compstr
|
||||
|
||||
|
||||
|
@ -30,6 +36,9 @@ def get_mpi_version(mpi):
|
|||
elif mpi == "mpich":
|
||||
rawstr = get_from_command(["mpirun", "--version"])
|
||||
mpistr = rawstr.split()[4]
|
||||
elif mpi == "necmpi":
|
||||
rawstr = get_from_command(["mpirun", "--version"])
|
||||
mpistr = rawstr.split()[4]
|
||||
return mpistr
|
||||
|
||||
|
||||
|
@ -44,9 +53,9 @@ def set_toolchain(compiler, mpi):
|
|||
cxx = "mpicxx"
|
||||
fc = "mpif90"
|
||||
elif mpi == "necmpi":
|
||||
cc = "\"mpincc -vh\""
|
||||
cxx = "\"mpinc++ -vh\""
|
||||
fc = "\"mpinfort -vh\""
|
||||
cc = "mpincc -vh"
|
||||
cxx = "mpinc++ -vh"
|
||||
fc = "mpinfort -vh"
|
||||
os.environ["NMPI_CC_H"] = "gcc"
|
||||
os.environ["NMPI_CXX_H"] = "g++"
|
||||
os.environ["NMPI_FC_H"] = "gfortran"
|
||||
|
@ -61,13 +70,13 @@ def set_toolchain(compiler, mpi):
|
|||
os.environ["OMPI_MPIF90"] = "flang"
|
||||
os.environ["OMPI_MPIF77"] = "flang"
|
||||
elif (mpi == "intelmpi"):
|
||||
cc = "\"mpicc -cc=clang\""
|
||||
cxx = "\"mpicxx -cxx=clang++\""
|
||||
fc = "\"mpif90 -fc=flang\""
|
||||
cc = "mpicc -cc=clang"
|
||||
cxx = "mpicxx -cxx=clang++"
|
||||
fc = "mpif90 -fc=flang"
|
||||
elif mpi == "necmpi":
|
||||
cc = "\"mpincc -vh\""
|
||||
cc = "mpincc -vh"
|
||||
cxx = "mpic++ -vh"
|
||||
fc = "\"mpinfort -vh\""
|
||||
fc = "mpinfort -vh"
|
||||
os.environ["NMPI_CC_H"] = "clang"
|
||||
os.environ["NMPI_CXX_H"] = "clang++"
|
||||
os.environ["NMPI_FC_H"] = "flang"
|
||||
|
@ -86,9 +95,9 @@ def set_toolchain(compiler, mpi):
|
|||
cxx = "mpiicpc"
|
||||
fc = "mpiifort"
|
||||
elif mpi == "necmpi":
|
||||
cc = "\"mpincc -vh\""
|
||||
cc = "mpincc -vh"
|
||||
cxx = "mpic++ -vh"
|
||||
fc = "\"mpinfort -vh\""
|
||||
fc = "mpinfort -vh"
|
||||
os.environ["NMPI_CC_H"] = "icc"
|
||||
os.environ["NMPI_CXX_H"] = "icpc"
|
||||
os.environ["NMPI_FC_H"] = "ifort"
|
||||
|
@ -97,7 +106,7 @@ def set_toolchain(compiler, mpi):
|
|||
cc = "mpincc"
|
||||
cxx = "mpinc++"
|
||||
fc = "mpinfort"
|
||||
|
||||
|
||||
# set environment variables
|
||||
os.environ["CC"] = cc
|
||||
os.environ["CXX"] = cxx
|
||||
|
|
27
libinstaller
27
libinstaller
|
@ -8,7 +8,7 @@ from lib.dependency import sort_libs_by_dependencies, load_selected_libs
|
|||
from lib.installer import install_lib
|
||||
from lib.init import init, check_python_version
|
||||
|
||||
SCRIPT_VERSION = "v0.9"
|
||||
SCRIPT_VERSION = "v1.0"
|
||||
|
||||
# check if Python >=3.3.0 is used
|
||||
check_python_version()
|
||||
|
@ -33,31 +33,6 @@ ignore_deps = arg_namespace.ignore_deps
|
|||
|
||||
# extract libraries and versions selected for installation
|
||||
selected_libs = load_selected_libs(config_dir, arg_namespace, args, install_all_libs, ignore_deps)
|
||||
'''
|
||||
selected_libs = []
|
||||
if install_all_libs:
|
||||
for config_file in glob.glob(config_dir+"/*.json"):
|
||||
data = load_lib_data(config_file)
|
||||
#with open(cf, 'r') as f:
|
||||
#data = json.load(f)
|
||||
data['version'] = data['default version']
|
||||
selected_libs.append(data)
|
||||
else:
|
||||
ignore_names = ["config", "mpi", "compiler", "prefix", "src", "work", "keep_work", "threads", "verbose", "version", "disable_shared"]
|
||||
for lib_name in args:
|
||||
if lib_name not in ignore_names and "version" not in lib_name:
|
||||
install = getattr(arg_namespace, lib_name)
|
||||
if install:
|
||||
version = getattr(arg_namespace, lib_name+"_version")
|
||||
config_file = config_dir + "/" + lib_name + ".json"
|
||||
data = load_lib_data(config_file)
|
||||
data['version'] = data['default version']
|
||||
selected_libs.append(data)
|
||||
#with open(config_file, 'r') as cf:
|
||||
#data = json.load(cf)
|
||||
#data['version'] = version
|
||||
#selected_libs.append(data)
|
||||
'''
|
||||
|
||||
# set up install directory name
|
||||
compiler_version = get_compiler_version(compiler)
|
||||
|
|
Loading…
Reference in New Issue