Skip to content

Commit

Permalink
Don't compile cuda code if running clean.
Browse files Browse the repository at this point in the history
  • Loading branch information
csarofeen committed May 1, 2018
1 parent 3a08d82 commit 1cea100
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re

import sys
import os
import shutil
import inspect
Expand Down Expand Up @@ -141,18 +142,20 @@ def CompileCudaFiles():

for object_file in object_files:
extra_link_args.append(object_file)

print()
print("Arguments used to build CUDA extension:")
print("extra_compile_args :", extra_compile_args)
print("include_dirs: ", include_dirs)
print("extra_link_args: ", extra_link_args)
print("library_dirs: ", library_dirs)
print("libraries: ", main_libraries)
print()
CompileCudaFiles()

print("Building CUDA extension.")
if 'clean' not in sys.argv:

print()
print("Arguments used to build CUDA extension:")
print("extra_compile_args :", extra_compile_args)
print("include_dirs: ", include_dirs)
print("extra_link_args: ", extra_link_args)
print("library_dirs: ", library_dirs)
print("libraries: ", main_libraries)
print()
CompileCudaFiles()

print("Building CUDA extension.")

cuda_ext = Extension('apex._C',
[os.path.join('csrc', 'Module.cpp')],
extra_compile_args = extra_compile_args,
Expand All @@ -161,9 +164,11 @@ def CompileCudaFiles():
library_dirs=library_dirs,
runtime_library_dirs = library_dirs,
libraries=main_libraries
)
)

print("Building module.")
if 'clean' not in sys.argv:
print("Building module.")

setup(
name='apex', version='0.1',
cmdclass={
Expand Down

0 comments on commit 1cea100

Please sign in to comment.