Skip to content
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

Fix cpp ci #2958

Merged
merged 51 commits into from
Mar 6, 2024
Merged

Fix cpp ci #2958

merged 51 commits into from
Mar 6, 2024

Conversation

mreso
Copy link
Collaborator

@mreso mreso commented Feb 22, 2024

Description

Please read our CONTRIBUTING.md prior to creating your first pull request.

Please include a summary of the feature or issue being fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #(issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Feature/Issue validation/testing

Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

  • Test A
    Logs for Test A

  • Test B
    Logs for Test B

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

@chauhang chauhang added this to the v0.10.0 milestone Feb 27, 2024
@mreso mreso marked this pull request as ready for review March 4, 2024 17:29
@mreso mreso requested a review from lxning March 4, 2024 17:29
- name: Install dependencies
run: |
python ts_scripts/install_dependencies.py --environment=dev --cpp
sudo apt update && python ts_scripts/install_dependencies.py --environment=dev --cpp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we check cmake version before we proceed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lxning not sure what you mean? Inside the workflow file? What would be the consequences of the check?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install_dependency with option "cpp" will install cmake (eg. mac, linux). Currently some cmake version can cause cpp compile error. Better to check cmake version before cijob proceed to save debug time.

Comment on lines +30 to +44
include(FetchContent)

FetchContent_Declare(
yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
GIT_TAG 0.8.0 # Can be a tag (yaml-cpp-x.x.x), a commit hash, or a branch name (master)
)
FetchContent_GetProperties(yaml-cpp)

if(NOT yaml-cpp_POPULATED)
message(STATUS "Fetching yaml-cpp...")
FetchContent_Populate(yaml-cpp)
add_subdirectory(${yaml-cpp_SOURCE_DIR} ${yaml-cpp_BINARY_DIR})
endif()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need build yaml-cpp with -DCMAKE_CXX_FLAGS="-fPIC" (see https://github.com/pytorch/serve/blob/master/cpp/build.sh#L133C84-L133C109)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lxning we globally set the flag here

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -fPIC -D_GLIBCXX_USE_CXX11_ABI=1")
so it should be activated.

Comment on lines +29 to +35

### Clean the build directory
To clean the build directory in order to rebuild from scratch simply delete the cpp/_build directory with
```
rm -rf cpp/_build
```

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep this so that cx can clean up env in case of debugging?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lxning Not sure if I understand. This is meant to be executed if you want to rebuild from scratch. Like a make clean. Can make this more clear in the description.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't set clean rule at this moment. We need let cx know how to clean.


mkdir $YAML_CPP_BUILD_DIR
cd $YAML_CPP_BUILD_DIR
cmake $YAML_CPP_SRC_DIR -DYAML_BUILD_SHARED_LIBS=ON -DYAML_CPP_BUILD_TESTS=OFF -DCMAKE_CXX_FLAGS="-fPIC"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need build yaml-cpp with DCMAKE_CXX_FLAGS="-fPIC"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Comment on lines +8 to +9
GIT_REPOSITORY https://github.com/ggerganov/llama.cpp
GIT_TAG b2241
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need build llama cpp with -DCMAKE_CXX_FLAGS="-fPIC"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

@mreso mreso added this pull request to the merge queue Mar 6, 2024
Merged via the queue into master with commit 2e26323 Mar 6, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants