-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add WITH_GOLANG to control the link of go lib #2530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
go/cmake/golang.cmake
Outdated
if(APPLE) | ||
set(LIB_NAME "lib${NAME}.dylib") | ||
# set(LIB_NAME "lib${NAME}.dylib") | ||
set(LIB_NAME "lib${NAME}.so") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compile library with .so
suffix in Apple system, it will still generate apple arch binary but with .so
suffix, is it runnable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, this is not a problem, we use _swig_paddle.so now, but I will not change this place in this pr, we can discuss it later.
CMakeLists.txt
Outdated
add_subdirectory(go/pserver/cclient) | ||
|
||
if(WITH_Go) | ||
#add_subdirectory(go/pserver/cclient) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's replace comment cmake code with TODO item. thanks
add_simple_unittest(parameter_optimizer_test) | ||
if(WITH_TESTING) | ||
add_simple_unittest(serialization_test) | ||
add_simple_unittest(parameter_optimizer_test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
CMakeLists.txt
Outdated
option(COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF) | ||
option(ON_TRAVIS "Exclude special unit test on Travis CI" OFF) | ||
option(WITH_C_API "Compile PaddlePaddle with C-API(Prediction)" OFF) | ||
option(WITH_Go "Compile PaddlePaddle with Go)" OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
cmake/configure.cmake
Outdated
|
||
if(NOT WITH_Go) | ||
add_definitions(-DPADDLE_WITHOUT_GO) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unified with other macros.
if(WITH_GOLANG)
add_definitions(-DPADDLE_WITH_GOLANG)
endif()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
CMakeLists.txt
Outdated
add_subdirectory(go/pserver/cclient) | ||
|
||
if(WITH_Go) | ||
#add_subdirectory(go/pserver/cclient) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
DEPENDS ${filename} ${external_project_dependencies}) | ||
endforeach() | ||
|
||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/proto) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because this dir is not exist
CMakeLists.txt
Outdated
include_directories("${PROJ_ROOT}") | ||
include_directories("${PROJ_ROOT}/paddle/cuda/include") | ||
include_directories("${CMAKE_CURRENT_BINARY_DIR}/proto") | ||
include_directories("${CMAKE_BINARY_DIR}/go/pserver/cclient") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{CMAKE_BINARY_DIR} -> ${CMAKE_CURRENT_BINARY_DIR}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMAKE_CURRENT_BINARY_DIR是当前便以文件所在目录,CMAKE_BINARY_DIR 是编译根目录,CMAKE_BINARY_DIR是不是更容易保证正确性?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1, add WITH_Go to control build go lib into _swig_paddle.so.
2, temporarily disable go master because of some problem.