Skip to content

nntrainer subproject changes for static build #3506

@mwlasiuk

Description

@mwlasiuk

Working on nntrainer 25f54ba

For iniparser :

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f7fdba..96ab5fe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 option(
   BUILD_SHARED_LIBS
   "Build using shared libraries"
-  ON)
+  OFF)
 # For packaging by tools like bitbake, shared and static libs should be build at
 # once
 cmake_dependent_option(
@@ -25,12 +25,6 @@ cmake_dependent_option(
   ON
   "BUILD_SHARED_LIBS"
   OFF)
-if(BUILD_SHARED_LIBS)
-  list(
-    APPEND
-    TARGET_TYPES
-    "shared")
-endif()
 if(BUILD_STATIC_LIBS OR NOT BUILD_SHARED_LIBS)
   list(
     APPEND
@@ -48,7 +42,7 @@ foreach(TARGET_TYPE ${TARGET_TYPES})
   message(DEBUG "TARGET_NAME: ${TARGET_NAME}")
   add_library(
     ${TARGET_NAME}
-    ${UPPER_TARGET_TYPE}
+    STATIC #${UPPER_TARGET_TYPE}
     "src/iniparser.c"
     "src/dictionary.c")
   set(PUBLIC_HEADERS "src/iniparser.h" "src/dictionary.h")

For CLBlast :

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a4b92c2..8e6ca41d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@
 cmake_minimum_required(VERSION 2.8.11)
 
 # Overrides for MSVC static runtime
-option(OVERRIDE_MSVC_FLAGS_TO_MT "Override compiler flags for MSVC to build with a static runtime (/MT instead of /MD)" ON)
+option(OVERRIDE_MSVC_FLAGS_TO_MT "Override compiler flags for MSVC to build with a static runtime (/MT instead of /MD)" OFF)
 if(OVERRIDE_MSVC_FLAGS_TO_MT)
   set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/c_flag_overrides.cmake)
   set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_flag_overrides.cmake)
@@ -32,9 +32,9 @@ IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
 ENDIF(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
 
 # Options and their default values
-option(BUILD_SHARED_LIBS "Build a shared (ON) or static library (OFF)" ON)
+option(BUILD_SHARED_LIBS "Build a shared (ON) or static library (OFF)" OFF)
 option(SAMPLES "Enable compilation of the examples" OFF)
-option(TUNERS "Enable compilation of the tuners" ON)
+option(TUNERS "Enable compilation of the tuners" OFF)
 option(CLIENTS "Enable compilation of the clients to test and compare performance" OFF)
 option(TESTS "Enable compilation of the correctness tests" OFF)
 option(CUBLAS "Enables performance comparison against cuBLAS on NVIDIA GPUs" OFF)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions