Skip to content

Commit

Permalink
Added Linux workflow on build script file.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Oct 25, 2024
1 parent 3550bb6 commit 8d707e2
Showing 1 changed file with 60 additions and 1 deletion.
61 changes: 60 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,66 @@
'-lcudadevrt',
'-lcudart_static',
'-o'
] + [OUTPUT_EXECUTABLE + "-nvidia"]
] + [OUTPUT_EXECUTABLE + '-nvidia']

print("Executing:")
print(' '.join(exe_build_args))
subprocess.run(exe_build_args)

print("Executing:")
print(' '.join(core_build_args))
subprocess.run(core_build_args)

print("Executing:")
print(' '.join(lib_build_args))
subprocess.run(lib_build_args)

print("Executing:")
print(' '.join(cuda_exe_build_args))
subprocess.run(cuda_exe_build_args)

elif PLATFORM == 'Linux':
exe_build_args= [
'g++', '-Iinclude', '-Wall', '-pedantic', '-Wdisabled-optimization',
'-pedantic-errors', '-Wextra', '-Wcast-align', '-Wcast-qual',
'-Wchar-subscripts', '-Wcomment', '-Wconversion', '-Werror',
'-Wfloat-equal', '-Wformat', '-Wformat=2', '-Wformat-nonliteral',
'-Wformat-security', '-Wformat-y2k', '-Wimport', '-Winit-self',
'-Winvalid-pch', '-Wunsafe-loop-optimizations', '-Wlong-long',
'-Wmissing-braces', '-Wmissing-field-initializers', '-Wmissing-format-attribute',
'-Wmissing-include-dirs', '-Weffc++', '-Wpacked', '-Wparentheses',
'-Wpointer-arith', '-Wredundant-decls', '-Wreturn-type', '-Wsequence-point',
'-Wshadow', '-Wsign-compare', '-Wstack-protector', '-Wstrict-aliasing',
'-Wstrict-aliasing=2', '-Wswitch', '-Wswitch-default', '-Wswitch-enum',
'-Wtrigraphs', '-Wuninitialized', '-Wunknown-pragmas', '-Wunreachable-code',
'-Wunused', '-Wunused-function', '-Wunused-label', '-Wunused-parameter',
'-Wunused-value', '-Wunused-variable', '-Wvariadic-macros',
'-Wvolatile-register-var', '-Wwrite-strings', '-pipe', '-Ofast', '-s',
'-std=c++20', '-fopenmp', '-mmmx', '-msse', '-msse2', '-msse3', '-msse4',
'-msse4.1', '-msse4.2', '-mavx', '-mavx2', '-mfma', '-mfpmath=sse',
'-march=native', '-funroll-loops', '-ffast-math', '-static', '-static-libgcc',
'-static-libstdc++'
] + cpp_files

core_build_args = exe_build_args + [
'-shared',
'-o', OUTPUT_CORE
]
exe_build_args += ['-o', OUTPUT_EXECUTABLE + '-openmp']
lib_build_args = [
'g++', '-Iinclude', '-Ilib', '-shared',
'-o', OUTPUT_LIBRARY + '.so', OUTPUT_CORE
] + cc_files

cuda_exe_build_args = [
'nvcc', '-x=cu', '-std=c++20',
'--compiler-options=-fopenmp',
'-Iinclude'
] + cpp_files + [
'-lcudadevrt',
'-lcudart_static',
'-o'
] + [OUTPUT_EXECUTABLE + '-nvidia']

print("Executing:")
print(' '.join(exe_build_args))
Expand Down

0 comments on commit 8d707e2

Please sign in to comment.