Skip to content

Commit 87faea9

Browse files
author
Daniel Cooke
committed
Add --architecture option to install.py
Specifies compiler -march argument
1 parent 0c7d06b commit 87faea9

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ configure_file (
4343
include_directories(${CMAKE_BINARY_DIR}/generated)
4444

4545
option(BUILD_SHARED_LIBS "Build the shared library" ON)
46+
option(COMPILER_ARCHITECTURE "Compiler -march argument" "native")
4647

4748
set(CMAKE_COLOR_MAKEFILE ON)
4849

scripts/install.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ def main(args):
372372
cmake_options.append("-DBUILD_SHARED_LIBS=OFF")
373373
if args["verbose"]:
374374
cmake_options.append("-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON")
375+
if args["architecture"]:
376+
cmake_options.append("-DCOMPILER_ARCHITECTURE=" + args["architecture"])
375377
if dependencies_dir is not None:
376378
if args["c_compiler"]:
377379
cmake_options.append("-DCMAKE_C_COMPILER=" + str(args["c_compiler"]))
@@ -506,5 +508,9 @@ def main(args):
506508
default=False,
507509
help='Ouput verbose make information',
508510
action='store_true')
511+
parser.add_argument('--architecture',
512+
required=False,
513+
type=str,
514+
help='The architecture to compile for')
509515
args = vars(parser.parse_args())
510516
main(args)

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ if (NOT BUILD_SHARED_LIBS)
657657
set(HTSlib_USE_STATIC_LIBS ON)
658658
endif()
659659

660-
set(CXX_OPTIMIZATION_FLAGS -ffast-math -march=native)
660+
set(CXX_OPTIMIZATION_FLAGS -ffast-math -march=${COMPILER_ARCHITECTURE})
661661
if (CMAKE_COMPILER_IS_GNUCXX)
662662
set(CXX_OPTIMIZATION_FLAGS ${CXX_OPTIMIZATION_FLAGS} -mfpmath=both)
663663
endif()

0 commit comments

Comments
 (0)