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

example: Build + Install on Google Colabratory w/ Python 3.6 #26

Open
cjekel opened this issue Jan 20, 2020 · 2 comments
Open

example: Build + Install on Google Colabratory w/ Python 3.6 #26

cjekel opened this issue Jan 20, 2020 · 2 comments

Comments

@cjekel
Copy link

cjekel commented Jan 20, 2020

Hi Ruben,

Thank you for this very nice Bayesian Optimization library! It works very well, and has some well thought out defaults and features! :-)

I managed to get this running on Google Colaboratory in a Python 3.6 environment (after many wasted hours), and I just wanted to share how I did this. I have a collaborator who is stuck on Windows, and this looks like it could be a possible solution for us.

I'm not sure if this would be worth mentioning in your documentation as an option, but maybe another user would find this information helpful.

This is a fairly ugly, so I'd be interested to hear if anyone has any cleaner ways to get this up and running.

The following are the commands I used to install this within Google Colaboratory notebook:

!apt install libboost-dev cmake cmake-curses-gui g++ python3-dev libboost-dev cmake cmake-curses-gui g++ cython3 freeglut3-dev
rm -rf /usr/include/numpy
!ln -s /usr/local/lib/python3.6/dist-packages/numpy/core/include/numpy /usr/include/numpy
!git clone https://github.com/rmcantin/bayesopt
cd bayesopt/
!cmake -DBAYESOPT_PYTHON_INTERFACE=ON -DPYTHON_LIBRARY=/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.so -DPYTHON_INCLUDE_DIR=$(python-config --prefix)/include/python3.6 -DPYTHON_NUMPY_INCLUDE_DIR=/usr/lib/python3.6/dist-packages/numpy/core/include . && make && make install
cp /usr/lib/python2.7/dist-packages/bayes* /usr/lib/python3.6/
cd python/
%run demo_distance.py

And here is a sample notebook:
https://colab.research.google.com/drive/1ajWJGdrZCdfRML4O6Ltv2NpOE4w_oyFF

Very excited to optimize some functions now!

All the best,
CJ

@rmcantin
Copy link
Owner

rmcantin commented Jul 9, 2020

This is great! Thank you for the contribution!

The only think I can see to clean it up, is that you don't need the first box !apt install... . The minimal dependencies are already installed, and the others can't be used from colab or are for devs only.

I think default colabs are now python3 so it might works with the default numpy library, etc.

But it is great to know that it works!

@patrickherring-TRI
Copy link

Hi,

Thought I would share the snippet that I used to get this installed and running on AWS SageMaker in case it helps out someone else.

!sudo yum install -y boost-devel cmake gcc Cython freeglut-devel libXi-devel libXmu-devel python36-devel.x86_64
!sudo rm /usr/lib64/libGL.so
!sudo ln -s /usr/lib64/libGL.so.1.7.0 /usr/lib64/libGL.so
!git clone https://github.com/rmcantin/bayesopt
!cd bayesopt && cmake -DBAYESOPT_PYTHON_INTERFACE=ON && sudo make && sudo make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants