ShallMate / upsi

2 stars 0 forks source link

Hello, how do I use this repository in linux? #1

Closed programmerpyh closed 1 week ago

ShallMate commented 1 week ago

@programmerpyh You can install the YACL library (https://github.com/secretflow/yacl.git) in Windows. To ensure version consistency, you can choose to install my local version (https://github.com/ShallMate/yacl). Then, create an examples folder in the YACL directory and clone the UPSI repository into it. Go back to the YACL directory and run bazel build --linkopt=-ldl //.... The compiled binary files can be found in bazel-bin/examples/upsi.

P.S. Please install the dependencies for YACL yourself.

ShallMate commented 1 week ago

@programmerpyh The process is similar for Linux. Recently (probably within a week or two), I might upload a Docker image to help users who are not familiar with YACL avoid the hassle of setting up the environment.

programmerpyh commented 1 week ago

Thanks

ShallMate commented 1 week ago

@programmerpyh You can directly execute the compiled binary to reproduce the experiment, as shown in the image below. If you need other input parameters, you will need to modify the input size in main.cc. 2024-11-04 15-05-55屏幕截图

programmerpyh commented 1 week ago

The YACL can not be installed in Windows image

ShallMate commented 1 week ago

emmmm。 All right. I think you can only use Linux The method is as I mentioned earlier

programmerpyh commented 1 week ago

when I install upsi, there is some errors, could you please help me to solve it?

[root@localhost yacl]# bazel build --linkopt=-ldl --experimental_cc_shared_library --cxxopt=-std=c++17 //... INFO: Analyzed 327 targets (0 packages loaded, 0 targets configured). INFO: Found 327 targets... ERROR: /root/yacl/examples/upsi/rr22/okvs/BUILD.bazel:169:16: Compiling examples/upsi/rr22/okvs/simple_index.cc failed: (Exit 1): gcc failed: error executing command (from target //examples/upsi/rr22/okvs:simple_index) /usr/local/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 33 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging examples/upsi/rr22/okvs/simple_index.cc:22:10: fatal error: boost/math/special_functions/binomial.hpp: No such file or directory 22 | #include "boost/math/special_functions/binomial.hpp" | ^~~~~~~~~~~ compilation terminated. INFO: Elapsed time: 6.099s, Critical Path: 5.93s INFO: 15 processes: 14 internal, 1 linux-sandbox. FAILED: Build did NOT complete successfully

programmerpyh commented 1 week ago

image

ShallMate commented 1 week ago

@programmerpyh This is due to the lack of a boost library. You can try installing Boost locally.

programmerpyh commented 1 week ago

I have Boost locally, but which location should I install to?

ShallMate commented 1 week ago

The default directory is fine. When you run b2 install without specifying a location, it will be installed to the default location. For example, the default location is /usr/local/boost_1_xx. You can add export LD_LIBRARY_PATH=/usr/local/boost_1_xx/lib:$LD_LIBRARY_PATH

to your ~/.bashrc. Note that the version number should be changed to your current boost version. @programmerpyh

programmerpyh commented 1 week ago

Thank you

ShallMate commented 1 week ago

Has the compilation been successful? @programmerpyh

programmerpyh commented 1 week ago

I try my best but it still not work,may be I need your docker image later(^_^;)

ShallMate commented 1 week ago

@programmerpyh Emmmm, all right. You can now use "docker pull shallmate/upsi:latest" to try our UPSI using docker. The compiled executable file is under /yacl/bazel-bin/examples/upsi.

p.s. docker pull may require proxy configuration.

programmerpyh commented 1 week ago

Thank you very much