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

解决install.py脚本安装Protobuf依赖问题 #52

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ubuntu-latest-v9.0.0-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ run-name: CyberRT v9.0.0 build runner on ubuntu latest x86-64🚀

on:
push:
paths:
- '.github/workflows/ubuntu-latest-v9.0.0-build.yaml'

pull_request:
branches:
- v9.0.0

Expand All @@ -22,7 +26,7 @@ jobs:
run: |
apt update
apt install -y lsb-release git wget pkg-config g++ cmake libpoco-dev uuid-dev libncurses5-dev python3-dev
cd /workspace/${{ github.repository }} && ./scripts/install.sh
cd /workspace/${{ github.repository }} && python3 install.py

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu18-arrch64-v9.0.0-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
uname -a
lsb_release -a
echo "-----------------------"
bash -c "./scripts/install.sh && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)"
bash -c "python3 install.py && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)"
7 changes: 6 additions & 1 deletion .github/workflows/ubuntu18-v9.0.0-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
- 'scripts/**'
- '.github/workflows/ubuntu18-v9.0.0-build.yaml'

pull_request:
branches:
- v9.0.0


jobs:
build-amd-ubuntu18:
runs-on: ubuntu-latest
Expand All @@ -27,7 +32,7 @@ jobs:
run: |
apt update
apt install -y lsb-release git wget pkg-config g++ cmake libpoco-dev uuid-dev libncurses5-dev python3-dev
cd /workspace/${{ github.repository }} && ./scripts/install.sh
cd /workspace/${{ github.repository }} && python3 install.py

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu20-arrch64-v9.0.0-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
uname -a
lsb_release -a
echo "-----------------------"
bash -c "./scripts/install.sh && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)"
bash -c "python3 install.py && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)"
6 changes: 5 additions & 1 deletion .github/workflows/ubuntu20-v9.0.0-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ run-name: CyberRT v9.0.0 build runner on ubuntu20 x86-64🚀

on:
push:
paths:
- '.github/workflows/ubuntu20-v9.0.0-build.yaml'

pull_request:
branches:
- v9.0.0

Expand All @@ -22,7 +26,7 @@ jobs:
run: |
apt update
apt install -y lsb-release git wget pkg-config g++ cmake libpoco-dev uuid-dev libncurses5-dev python3-dev
cd /workspace/${{ github.repository }} && ./scripts/install.sh
cd /workspace/${{ github.repository }} && python3 install.py

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu22-arrch64-v9.0.0-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
uname -a
lsb_release -a
echo "-----------------------"
bash -c "./scripts/install.sh && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)"
bash -c "python3 install.py && source install/setup.bash && mkdir -p build && cd build && cmake .. && make -j$(nproc)"
6 changes: 5 additions & 1 deletion .github/workflows/ubuntu22-v9.0.0-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ run-name: CyberRT v9.0.0 build runner on ubuntu22 x86-64🚀

on:
push:
paths:
- '.github/workflows/ubuntu22-v9.0.0-build.yaml'

pull_request:
branches:
- v9.0.0

Expand All @@ -22,7 +26,7 @@ jobs:
run: |
apt update
apt install -y lsb-release git wget pkg-config g++ cmake libpoco-dev uuid-dev libncurses5-dev python3-dev
cd /workspace/${{ github.repository }} && ./scripts/install.sh
cd /workspace/${{ github.repository }} && python3 install.py

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cd CyberRT
> install

```shell
sudo python install.py
sudo python3 install.py
```

> export path
Expand Down
28 changes: 19 additions & 9 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _clone_setup(self):
"--depth=1"
)
os.chdir(os.path.join(self._dowload_path, "setup"))
self._cmd("mkdir -p build && cd build")
self._cmd("mkdir -p build")
os.chdir("build")
self._cmd(
"cmake -DCMAKE_INSTALL_PREFIX={} ..".format(self._install_prefix))
Expand All @@ -62,7 +62,7 @@ def _clone_nlohmann_json(self):
"--depth=1"
)
os.chdir(os.path.join(self._dowload_path, "nlohmann_json"))
self._cmd("mkdir -p build && cd build")
self._cmd("mkdir -p build")
os.chdir("build")
self._cmd(
"cmake -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format(self._install_prefix))
Expand All @@ -78,7 +78,7 @@ def _clone_tinyxml2(self):
"--depth=1"
)
os.chdir(os.path.join(self._dowload_path, "tinyxml2"))
self._cmd("mkdir -p build && cd build")
self._cmd("mkdir -p build")
os.chdir("build")
self._cmd(
"cmake -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format(self._install_prefix))
Expand Down Expand Up @@ -116,16 +116,16 @@ def _clone_gfamily(self):
)

os.chdir(os.path.join(self._dowload_path, "gflags"))
self._cmd("mkdir -p build && cd build")
self._cmd("mkdir -p build")
os.chdir("build")
self._cmd(
"cmake -DCMAKE_CXX_FLAGS='-fPIC' -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format(
self._install_prefix))
self._cmd("sudo make install -j$(nproc)")
self._cmd("make install -j$(nproc)")
os.chdir(self._current_path)

os.chdir(os.path.join(self._dowload_path, "glog"))
self._cmd("mkdir -p build && cd build")
self._cmd("mkdir -p build")
os.chdir("build")
self._cmd(
"cmake -DCMAKE_CXX_FLAGS='-fPIC' -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format(
Expand All @@ -134,7 +134,7 @@ def _clone_gfamily(self):
os.chdir(self._current_path)

os.chdir(os.path.join(self._dowload_path, "googletest"))
self._cmd("mkdir -p build && cd build")
self._cmd("mkdir -p build")
os.chdir("build")
self._cmd(
"cmake -DCMAKE_CXX_FLAGS='-fPIC -w' -DCMAKE_INSTALL_PREFIX={} -DBUILD_SHARED_LIBS=ON ..".format(
Expand All @@ -143,7 +143,17 @@ def _clone_gfamily(self):
os.chdir(self._current_path)

os.chdir(os.path.join(self._dowload_path, "glog"))
self._cmd("mkdir -p build && cd build")
self._cmd("mkdir -p build")
os.chdir("build")
self._cmd(
"cmake -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX={} ..".format(
self._install_prefix))
self._cmd("make install -j$(nproc)")
os.chdir(self._current_path)

os.chdir(os.path.join(self._dowload_path, "protobuf"))
os.chdir("cmake")
self._cmd("mkdir -p build")
os.chdir("build")
self._cmd(
"cmake -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX={} ..".format(
Expand All @@ -163,7 +173,7 @@ def _clone_dds(self):
# self._cmd("git submodule update --init")
# self._cmd("patch -p1 < {}".format(os.path.join(self._current_path,
# "scripts/FastRTPS_1.5.0.patch")))
# self._cmd("mkdir -p build && cd build")
# self._cmd("mkdir -p build")
# self._cmd(
# "cmake -DEPROSIMA_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX={} ..".format(
# self._install_prefix))
Expand Down
Loading