forked from mindspore-Ecosystem/mindspore
fix compile and debug for mac
This commit is contained in:
parent
e239e26598
commit
1f16862205
|
@ -19,10 +19,9 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O2 -Winconsistent-missing-override -Wno-user-defined-warnings \
|
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O2 -Wno-inconsistent-missing-override \
|
||||||
-Wno-return-std-move -Wno-unused-private-field -Wno-unused-lambda-capture -Wno-sign-compare \
|
-Wno-unused-lambda-capture -Wno-unneeded-internal-declaration -Wno-unused-variable \
|
||||||
-Wno-overloaded-virtual -Wno-unneeded-internal-declaration -Wno-unused-variable -Wno-pessimizing-move \
|
-Wno-return-std-move -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2")
|
||||||
-Wno-inconsistent-missing-override -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2")
|
|
||||||
elseif(ENABLE_SYM_FILE)
|
elseif(ENABLE_SYM_FILE)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O2 -g -ggdb -Wl,--allow-shlib-undefined \
|
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O2 -g -ggdb -Wl,--allow-shlib-undefined \
|
||||||
-DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2")
|
-DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2")
|
||||||
|
@ -35,9 +34,16 @@ if(ENABLE_PYTHON)
|
||||||
add_compile_definitions(ENABLE_PYTHON)
|
add_compile_definitions(ENABLE_PYTHON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer \
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
-Wl,--allow-shlib-undefined -D_LIBCPP_INLINE_VISIBILITY='' -D_LIBCPP_DISABLE_EXTERN_TEMPLATE=1 \
|
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer \
|
||||||
-DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2 -Wno-cpp")
|
-D_LIBCPP_INLINE_VISIBILITY='' -D_LIBCPP_DISABLE_EXTERN_TEMPLATE=1 -DHALF_ENABLE_CPP11_USER_LITERALS=0 \
|
||||||
|
-D_FORTIFY_SOURCE=2 -Wno-cpp -Wno-inconsistent-missing-override -Wno-unused-lambda-capture \
|
||||||
|
-Wno-unneeded-internal-declaration -Wno-unused-variable -Wno-return-std-move")
|
||||||
|
else()
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer \
|
||||||
|
-Wl,--allow-shlib-undefined -D_LIBCPP_INLINE_VISIBILITY='' -D_LIBCPP_DISABLE_EXTERN_TEMPLATE=1 \
|
||||||
|
-DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2 -Wno-cpp")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/include -std=c++17 \
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/include -std=c++17 \
|
||||||
-Werror -Wall -Wno-deprecated-declarations -fPIC")
|
-Werror -Wall -Wno-deprecated-declarations -fPIC")
|
||||||
|
|
|
@ -198,6 +198,7 @@ install(
|
||||||
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/communication
|
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/communication
|
||||||
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/profiler
|
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/profiler
|
||||||
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/compression
|
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/compression
|
||||||
|
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/rewrite
|
||||||
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/run_check
|
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/run_check
|
||||||
DESTINATION ${INSTALL_PY_DIR}
|
DESTINATION ${INSTALL_PY_DIR}
|
||||||
COMPONENT mindspore
|
COMPONENT mindspore
|
||||||
|
|
|
@ -116,8 +116,7 @@ static std::vector<int64_t> GeneratePoolingSequenceRandom(size_t input_length, s
|
||||||
for (size_t i = 0; i < num_random_spot; ++i) {
|
for (size_t i = 0; i < num_random_spot; ++i) {
|
||||||
diff[i] += 1;
|
diff[i] += 1;
|
||||||
}
|
}
|
||||||
std::srand(seed);
|
std::shuffle(diff.begin(), diff.end(), std::default_random_engine(seed));
|
||||||
random_shuffle(diff.begin(), diff.end());
|
|
||||||
return diff;
|
return diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue