【Centos】SGX编译之ocamlbuild not found
编译sgx sdk和psw时提示ocamlbuild not found。
遂查,需要安装opam
安装OCaml
先去下载一个opam二进制版本,比如 opam-1.2.2-x86_64-Linux
重命名为opam,放到 /usr/bin/目录下,并给予可执行权限
chmod +x /usr/bin/opam
使用一个版本,如4.03.0初始化opam,安装必须的库,将会生成 ~/.opam/目录
-
opam init --comp=4.03.0 (这里可能会报错- bwrap: Sandboxing tool bwrap was not found. You should install 'bubblewrap',https://github.com/containers/bubblewrap,clone后把completions/bash/里的bwrap赋权mv到/usr/bin/即可)
-
opam install core batteries yojson ocaml-makefile camlp4(
)缺少ocamlbuild直接执行
opam install ocamlbuild即可
将OCaml的bin目录加入当前用户的系统路径
-
cd ~/.opam/
-
rm -f current
-
ln -s 4.03.0 current
-
cd -
-
sed -i '/^PATH=/cPATH=$PATH:$HOME/.opam/current/bin' ~/.bash_profile
-
source ~/.bash_profile最后:将
/root/.opam/4.03.0/bin/ocamlbuild cp 到 /usr/bin/下即可
如果没有:
https://github.com/ocaml/ocamlbuild
make
clone
make configure
make install