Skip to content
Snippets Groups Projects
Commit 6e7a3f68 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add control of compiler during setup

parent 113e512e
Branches
No related tags found
2 merge requests!21Bugfix/nansampling,!3Bugfix/event manager show html
...@@ -37,6 +37,7 @@ import os ...@@ -37,6 +37,7 @@ import os
hostname = os.getenv('HOSTNAME') hostname = os.getenv('HOSTNAME')
compiler = 'g++'
extra_compile_args = ['-Wall', '-O2', '-g', '-mtune=native', '-ffast-math', '-std=c++11'] extra_compile_args = ['-Wall', '-O2', '-g', '-mtune=native', '-ffast-math', '-std=c++11']
extra_libraries = ['hdf5'] extra_libraries = ['hdf5']
include_dirs = [] include_dirs = []
......
...@@ -52,7 +52,7 @@ if not os.path.exists(os.path.join(bfpsfolder, 'host_information.py')): ...@@ -52,7 +52,7 @@ if not os.path.exists(os.path.join(bfpsfolder, 'host_information.py')):
shutil.copyfile('./machine_settings_py.py', os.path.join(bfpsfolder, 'machine_settings.py')) shutil.copyfile('./machine_settings_py.py', os.path.join(bfpsfolder, 'machine_settings.py'))
sys.path.insert(0, bfpsfolder) sys.path.insert(0, bfpsfolder)
# import stuff required for compilation of static library # import stuff required for compilation of static library
from machine_settings import include_dirs, library_dirs, extra_compile_args, extra_libraries from machine_settings import compiler, include_dirs, library_dirs, extra_compile_args, extra_libraries
### package versioning ### package versioning
...@@ -147,6 +147,8 @@ def compile_bfps_library(): ...@@ -147,6 +147,8 @@ def compile_bfps_library():
if not os.path.isdir('obj'): if not os.path.isdir('obj'):
os.makedirs('obj') os.makedirs('obj')
need_to_compile = True need_to_compile = True
if not os.path.isfile('bfps/libbfps.a'):
need_to_compile = True
else: else:
ofile = 'bfps/libbfps.a' ofile = 'bfps/libbfps.a'
libtime = datetime.datetime.fromtimestamp(os.path.getctime(ofile)) libtime = datetime.datetime.fromtimestamp(os.path.getctime(ofile))
...@@ -165,7 +167,7 @@ def compile_bfps_library(): ...@@ -165,7 +167,7 @@ def compile_bfps_library():
(datetime.datetime.fromtimestamp(os.path.getctime(ofile)) < (datetime.datetime.fromtimestamp(os.path.getctime(ofile)) <
datetime.datetime.fromtimestamp(os.path.getctime(ifile)))) datetime.datetime.fromtimestamp(os.path.getctime(ifile))))
if need_to_compile_file: if need_to_compile_file:
command_strings = ['g++', '-c'] command_strings = [compiler, '-c']
command_strings += ['bfps/cpp/' + fname + '.cpp'] command_strings += ['bfps/cpp/' + fname + '.cpp']
command_strings += ['-o', 'obj/' + fname + '.o'] command_strings += ['-o', 'obj/' + fname + '.o']
command_strings += extra_compile_args command_strings += extra_compile_args
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment