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

Can't be built from prebuilt binaries #4

Open
magicaltoast opened this issue Nov 15, 2021 · 4 comments
Open

Can't be built from prebuilt binaries #4

magicaltoast opened this issue Nov 15, 2021 · 4 comments

Comments

@magicaltoast
Copy link

magicaltoast commented Nov 15, 2021

Can't get it to compile on Linux without GPU from official binaries

What I've done

  • Downloaded latest .tgz file from onnxruntime releases (onnxruntime-linux-x64-1.9.0.tgz)
  • Created empty folder /opt/onnxruntime
  • Extracted tgz file into that folder
  • I've set up bashrc as described in the instruction

Error

go get -v -tags='nogpu' github.com/c3sr/go-onnxruntime
github.com/c3sr/go-onnxruntime
# github.com/c3sr/go-onnxruntime
In file included from ../go/pkg/mod/github.com/c3sr/[email protected]/device.go:3:
./cbits/predictor.hpp:10:10: fatal error: onnxruntime_c_api.h: No such file or directory
   10 | #include <onnxruntime_c_api.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Bash rc setup

export LIBRARY_PATH=$LIBRARY_PATH:/opt/onnxruntime/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/onnxruntime/lib

Values of variables

echo $LIBRARY_PATH $LD_LIBRARY_PATH
:/opt/onnxruntime/lib :/opt/onnxruntime/lib

How /opt/onnxruntime/ looks

tree /opt/onnxruntime/
/opt/onnxruntime/
├── GIT_COMMIT_ID
├── include
│   ├── cpu_provider_factory.h
│   ├── onnxruntime_c_api.h
│   ├── onnxruntime_cxx_api.h
│   ├── onnxruntime_cxx_inline.h
│   ├── onnxruntime_run_options_config_keys.h
│   ├── onnxruntime_session_options_config_keys.h
│   └── provider_options.h
├── lib
│   ├── libonnxruntime.so -> libonnxruntime.so.1.9.0
│   └── libonnxruntime.so.1.9.0
├── LICENSE
├── Privacy.md
├── README.md
├── ThirdPartyNotices.txt
└── VERSION_NUMBER
@yen-hsiang-chang
Copy link
Collaborator

Could you try the latest version (v1.2.1) pushed just now? I think ONNX Runtime starts to release prebuilt library in recent versions, but the include structure is not the same as the one we built from source from past versions. Please let me know if the latest version helps.

@magicaltoast
Copy link
Author

@yhchang3

go get -v -tags='nogpu' github.com/c3sr/go-onnxruntime
github.com/c3sr/go-onnxruntime
# github.com/c3sr/go-onnxruntime
In file included from error.cpp:1:
../go/pkg/mod/github.com/c3sr/[email protected]/cbits/error.hpp:4:10: fatal error: exceptions.h: No such file or directory
    4 | #include <exceptions.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

@magicaltoast magicaltoast changed the title onnxruntime_c_api.h: No such file or directory Can't be built from prebuilt binaries Nov 16, 2021
@magicaltoast
Copy link
Author

@yhchang3 I've got it to compile by building onnx from scratch. I was following https://github.com/c3sr/go-onnxruntime/blob/master/dockerfiles/Dockerfile.amd64_cpu_onnxruntime1.7.1 but It would be cool to be able to install from official pre-compiled binaires

@nicosuave
Copy link

I had luck with the homebrew-provided binaries FWIW

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

No branches or pull requests

3 participants