Skip to content

Commit

Permalink
Make out of source build possible
Browse files Browse the repository at this point in the history
  • Loading branch information
dpiparo committed Nov 11, 2016
1 parent cf5f878 commit 616450e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set (SIGGENOPTS " -p")
else()
set (SIGGENOPTS " ")
endif()
EXEC_PROGRAM ("cd src;python signatures_generator.py ${SIGGENOPTS};cd -")
EXEC_PROGRAM ("cd src;python ${CMAKE_SOURCE_DIR}/src/signatures_generator.py ${SIGGENOPTS} -o ${CMAKE_SOURCE_DIR}/src;cd -")

#generare Vc wrapper and config file
if(USE_VC)
Expand Down
16 changes: 11 additions & 5 deletions src/signatures_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
the ones for the preload
"""

from optparse import OptionParser
import os

RESTRICT="__restrict__"

LIBM_FUNCTIONS_LIST=["asin",
Expand Down Expand Up @@ -115,24 +118,27 @@ def get_impl_file():

#------------------------------------------------------------------

def create_impl(preloadSignatures):
ofile=open(VDT_VECTOR_IMPL,'w')
def create_impl(preloadSignatures,outdir):
ofile=open(os.path.join(outdir,VDT_VECTOR_IMPL),'w')
ofile.write(get_impl_file())
if preloadSignatures:
ofile.write(create_preload_signatures())
ofile.close()

#------------------------------------------------------------------

from optparse import OptionParser

if __name__ == "__main__":
parser = OptionParser(usage="usage: %prog [options]")
parser.add_option("-p",
action="store_true",
dest="preload_flag",
default=False,
help="Create symbols for the preload")
parser.add_option("-o",
dest="outdir",
default="./",
help="specify output directory")
(options, args) = parser.parse_args()
create_impl(preloadSignatures=options.preload_flag)
create_impl(preloadSignatures=options.preload_flag,
outdir=options.outdir)

0 comments on commit 616450e

Please sign in to comment.