Skip to content

Commit

Permalink
remove unnecessary file
Browse files Browse the repository at this point in the history
  • Loading branch information
victoryang00 committed Feb 13, 2024
1 parent 6a105a3 commit 9915751
Show file tree
Hide file tree
Showing 33 changed files with 479 additions and 39,028 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: sudo xcode-select -s /Applications/Xcode_15.1.app/Contents/Developer

- name: Install Dependency
run: brew install cxxopts fmt llvm@14 google-benchmark ninja libpcap openblas
run: brew install cxxopts fmt llvm@14 ninja spdlog

- name: Checkout
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2

- name: Install Dependency
run: sudo apt install libssl-dev gcc-13 g++-13 libprotobuf-c-dev libprotobuf-dev libgrpc-dev libfmt-dev llvm-14-dev libedit-dev libcxxopts-dev libpfm4-dev liblldb-dev libbenchmark-dev ninja-build libpcap-dev libopenblas-pthread-dev
run: sudo apt install libssl-dev gcc-13 g++-13 libspdlog-dev libfmt-dev llvm-14-dev libedit-dev libcxxopts-dev libpfm4-dev ninja-build libpcap-dev libopenblas-pthread-dev

- name: Checkout
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ jobs:
git clone https://github.com/microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.bat
./vcpkg install fmt:x64-windows cxxopts:x64-windows benchmark:x64-windows
./vcpkg install fmt:x64-windows cxxopts:x64-windows spdlog:x64-windows
echo "C:/tools/msys64/usr/bin/" >> "$GITHUB_PATH"
C:/tools/msys64/usr/bin/pacman.exe --noconfirm -S gcc
- name: Install WASI SDK
run: |
cd D:
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0.m-mingw.tar.gz -O D:/wasi-sdk-20.0.m-mingw.tar.gz
tar -xzf wasi-sdk-20.0.m-mingw.tar.gz
mv wasi-sdk-20.0+m wasi-sdk
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-21/wasi-sdk-21.0.m-mingw.tar.gz -O D:/wasi-sdk-21.0.m-mingw.tar.gz
tar -xzf wasi-sdk-21.0.m-mingw.tar.gz
mv wasi-sdk-21.0+m wasi-sdk
- name: Make WASM LD no check features
run: |
Expand Down
30 changes: 16 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ project(MVVM LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 23)

find_package(fmt REQUIRED)
# find_package(LLVM REQUIRED)
find_package(benchmark REQUIRED)
find_package(spdlog REQUIRED)
find_package(cxxopts REQUIRED)
include(CTest)
if (WIN32)
Expand Down Expand Up @@ -44,6 +43,9 @@ elseif (LINUX)
message(${BLAS_INCLUDE_DIRS})
else ()
set(WAMR_BUILD_PLATFORM "windows")
set(WAMR_BUILD_LIB_PTHREAD 1)
set(WAMR_BUILD_LIB_WASI_THREADS 1)
set(WAMR_BUILD_THREAD_MGR 1)
set(WAMR_BUILD_LIBC_UVWASI 1)
set(CMAKE_MSVC_RUNTIME_LIBRARY "")
set(CMAKE_GENERATOR_PLATFORM "")
Expand Down Expand Up @@ -79,6 +81,12 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif ()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG)
else()
add_definitions(-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_INFO)
endif()

set(WAMR_BUILD_INTERP 1)
set(WAMR_BUILD_AOT 1)
set(WAMR_BUILD_JIT 0)
Expand Down Expand Up @@ -109,7 +117,7 @@ include(${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})

include(${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/lib/wasm-micro-runtime/core/iwasm/aot ${CMAKE_CURRENT_SOURCE_DIR}/lib/yalantinglibs/include ${LLVM_INCLUDE_DIRS} ${BLAS_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/lib/libcrafter/libcrafter/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/lib/wasm-micro-runtime/core/iwasm/aot ${CMAKE_CURRENT_SOURCE_DIR}/lib/yalantinglibs/include ${BLAS_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/lib/libcrafter/libcrafter/)

if (MVVM_BUILD_BENCH)
add_subdirectory(bench)
Expand All @@ -118,23 +126,17 @@ if (MVVM_BUILD_TEST)
add_definitions(-DMVVM_BUILD_TEST=1)
add_subdirectory(test)
endif()
if (NOT WIN32)
if (LINUX)
add_subdirectory(lib/libcrafter/libcrafter)
if (NOT APPLE)
add_subdirectory(gateway)
endif()
add_subdirectory(gateway)
endif ()

file(GLOB_RECURSE SOURCE_FILES src/logging.cpp src/wamr*.cpp)
add_library(MVVM_export ${SOURCE_FILES} ${UNCOMMON_SHARED_SOURCE})
add_executable(MVVM_restore src/restore.cpp ${UNCOMMON_SHARED_SOURCE})
add_executable(MVVM_checkpoint src/checkpoint.cpp ${UNCOMMON_SHARED_SOURCE})

target_link_libraries(MVVM_export fmt::fmt -lm -ldl -lpthread ${BLAS_LIBRARIES})
target_link_libraries(MVVM_restore fmt::fmt cxxopts::cxxopts -lm -ldl -lpthread ${BLAS_LIBRARIES} MVVM_export vmlib ${WIN_EXTRA_LIBS})
target_link_libraries(MVVM_checkpoint fmt::fmt cxxopts::cxxopts -lm -ldl -lpthread ${BLAS_LIBRARIES} MVVM_export vmlib ${WIN_EXTRA_LIBS})
if (MVVM_BUILD_MPI)
add_executable(MVVM_mpi_test test/mpi.cpp ${UNCOMMON_SHARED_SOURCE})
target_link_libraries(MVVM_mpi_test fmt::fmt cxxopts::cxxopts -lm -ldl -lpthread ${BLAS_LIBRARIES} MVVM_export vmlib ${WIN_EXTRA_LIBS})
endif()
target_link_libraries(MVVM_export fmt::fmt spdlog::spdlog -lm -ldl -lpthread ${BLAS_LIBRARIES})
target_link_libraries(MVVM_restore fmt::fmt spdlog::spdlog cxxopts::cxxopts -lm -ldl -lpthread ${BLAS_LIBRARIES} MVVM_export vmlib ${WIN_EXTRA_LIBS})
target_link_libraries(MVVM_checkpoint fmt::fmt spdlog::spdlog cxxopts::cxxopts -lm -ldl -lpthread ${BLAS_LIBRARIES} MVVM_export vmlib ${WIN_EXTRA_LIBS})
add_definitions(-DCXXOPTS_NO_RTTI=1)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
## To checkpoint and migrate a WAMR nano process
```bash
python3 ../artifact/common_util.py # return $recv is 193
LOGV=1 ./MVVM_checkpoint -t ./test/tcp_client.aot -f 193 -c 0 -x 10 -a "10" -e OMP_NUM_THREADS=1 -i
LOGV=1 ./MVVM_restore -t ./test/tcp_client.aot # All the wasi env will be restored
SPDLOG_LEVEL=debug ./MVVM_checkpoint -t ./test/tcp_client.aot -f 193 -c 0 -x 10 -a "10" -e OMP_NUM_THREADS=1 -i
SPDLOG_LEVEL=debug ./MVVM_restore -t ./test/tcp_client.aot # All the wasi env will be restored
```
1. -t Target: The path to the WASM interpreter or AOT executable
2. -i Debug Mode: Switch on for debugging
Expand Down
4 changes: 3 additions & 1 deletion gateway/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
add_executable(gateway ${SOURCE_FILES} main.cpp)
target_link_libraries(gateway pcap fmt::fmt crafter resolv MVVM_export)
target_link_libraries(gateway pcap spdlog::spdlog fmt::fmt crafter resolv MVVM_export)
add_executable(playground ${SOURCE_FILES} playground.cpp)
target_link_libraries(playground pcap crafter resolv)
Loading

0 comments on commit 9915751

Please sign in to comment.