diff --git a/machine_settings_py.py b/machine_settings_py.py index 22123e391aa14151e2f1d4b4c8c0b5c8d6a1c435..787f1d5a10b9b0b260b42a1da18d35e67c56dacc 100644 --- a/machine_settings_py.py +++ b/machine_settings_py.py @@ -37,6 +37,7 @@ import os hostname = os.getenv('HOSTNAME') +compiler = 'g++' extra_compile_args = ['-Wall', '-O2', '-g', '-mtune=native', '-ffast-math', '-std=c++11'] extra_libraries = ['hdf5'] include_dirs = [] diff --git a/setup.py b/setup.py index c9bbc9c1d956d4d74d6344e19d1d220b1ff12b0b..4e6de6836b7a667204c1c6687e4ebee36b821a2e 100644 --- a/setup.py +++ b/setup.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')) sys.path.insert(0, bfpsfolder) # 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 @@ -147,6 +147,8 @@ def compile_bfps_library(): if not os.path.isdir('obj'): os.makedirs('obj') need_to_compile = True + if not os.path.isfile('bfps/libbfps.a'): + need_to_compile = True else: ofile = 'bfps/libbfps.a' libtime = datetime.datetime.fromtimestamp(os.path.getctime(ofile)) @@ -165,7 +167,7 @@ def compile_bfps_library(): (datetime.datetime.fromtimestamp(os.path.getctime(ofile)) < datetime.datetime.fromtimestamp(os.path.getctime(ifile)))) if need_to_compile_file: - command_strings = ['g++', '-c'] + command_strings = [compiler, '-c'] command_strings += ['bfps/cpp/' + fname + '.cpp'] command_strings += ['-o', 'obj/' + fname + '.o'] command_strings += extra_compile_args