issue with cairo support / having problem drawing 2D molecules

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

issue with cairo support / having problem drawing 2D molecules

xh s
Hi, 

I am developing with openbabel and trying to draw molecules. I think I am supposed to use the OBDepict class (correct me if I'm wrong). However, in my package (tried installing from homebrew/macports and compiling manually), include/depict/ is not installed. If I copy this folder from the source code, I get some errors like this which I think means I'm missing the libraries. 

sxh% make draw_test
g++ draw_test.cpp -L/Users/sxh/Tools/openbabel-2.4.1/lib -lopenbabel -L/usr/local/Cellar/cairo/1.15.2/lib -lcairo -I/Users/sxh/Tools/openbabel-2.4.1/include/openbabel-2.0 -I/usr/local/Cellar/cairo/1.15.2/include/cairo -I/usr/local/Cellar/glib/2.50.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.50.2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.39/include -I/usr/local/Cellar/pixman/0.34.0/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.12.1_2/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libpng/1.6.28/include/libpng16 -o draw_test.exe
Undefined symbols for architecture x86_64:
  "OpenBabel::CairoPainter::WriteImage(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in draw_test-836365.o
  "OpenBabel::CairoPainter::CairoPainter()", referenced from:
      _main in draw_test-836365.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [draw_test] Error 1


How do I solve this? Thanks in advance! 

Xianghai


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: issue with cairo support / having problem drawing 2D molecules

Geoff Hutchison
> from homebrew/macports and compiling manually), include/depict/ is not installed. If I copy this folder from the source code, I get some errors like this which I think means I'm missing the libraries.


Mac OS X does not use cairo (a Linux drawing library). If you don't have it installed, it won't copy.

Personally, I suggest using SVG, which does not require external libraries.

But if you want to use libcairo (e.g for PNG support) you can make sure it's installed using homebrew:
http://brewformulas.org/Cairo

Hope that helps,
-Geoff
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: issue with cairo support / having problem drawing 2D molecules

Geoff Hutchison
You may have libcairo installed. The question is whether it was found when you compiled Open Babel or not.

"Manually" adding files isn't going to work - either libcairo was found when you ran "cmake" or not.

You can check with "ccmake ." and look for the CAIRO bits.

I'm not sure what you mean by "API" for SVG. Open Babel will output an SVG. There's no API.

-Geoff

On Feb 1, 2017, at 12:27 PM, xh s <[hidden email]> wrote:

But I have cairo installed: 

sxh% brew info cairo
cairo: stable 1.14.8 (bottled), devel 1.15.2, HEAD
Vector graphics library with cross-device output support
/usr/local/Cellar/cairo/1.14.8 (119 files, 5.9M)
  Poured from bottle on 2017-01-27 at 11:59:37
/usr/local/Cellar/cairo/1.15.2 (119 files, 5M) *
  Built from source on 2017-01-31 at 17:23:30

Also, I think the functions that caused error are from cairopainter.cpp, which should be installed in the openbabel library but are missing now. The already installed libraries are dynamic and I don't know how to manually add these missing ones. I don't know what was wrong with my openbabel installation but I just don't seem to be able to get those depict.h related files and libraries installed. 

On another note, I don't mind using SVG. But I can't find the documentation about its API. 

Thanks, 
Xianghai

On Wed, Feb 1, 2017 at 5:44 AM, Geoffrey Hutchison <[hidden email]> wrote:
> from homebrew/macports and compiling manually), include/depict/ is not installed. If I copy this folder from the source code, I get some errors like this which I think means I'm missing the libraries.


Mac OS X does not use cairo (a Linux drawing library). If you don't have it installed, it won't copy.

Personally, I suggest using SVG, which does not require external libraries.

But if you want to use libcairo (e.g for PNG support) you can make sure it's installed using homebrew:
http://brewformulas.org/Cairo

Hope that helps,
-Geoff



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: issue with cairo support / having problem drawing 2D molecules

Noel O'Boyle
Administrator
Re API, SVG is an output file format and so is used via obconversion like smiles, etc.

On 2 Feb 2017 5:54 p.m., "Geoffrey Hutchison" <[hidden email]> wrote:
You may have libcairo installed. The question is whether it was found when you compiled Open Babel or not.

"Manually" adding files isn't going to work - either libcairo was found when you ran "cmake" or not.

You can check with "ccmake ." and look for the CAIRO bits.

I'm not sure what you mean by "API" for SVG. Open Babel will output an SVG. There's no API.

-Geoff

On Feb 1, 2017, at 12:27 PM, xh s <[hidden email]> wrote:

But I have cairo installed: 

sxh% brew info cairo
cairo: stable 1.14.8 (bottled), devel 1.15.2, HEAD
Vector graphics library with cross-device output support
/usr/local/Cellar/cairo/1.14.8 (119 files, 5.9M)
  Poured from bottle on 2017-01-27 at 11:59:37
/usr/local/Cellar/cairo/1.15.2 (119 files, 5M) *
  Built from source on 2017-01-31 at 17:23:30

Also, I think the functions that caused error are from cairopainter.cpp, which should be installed in the openbabel library but are missing now. The already installed libraries are dynamic and I don't know how to manually add these missing ones. I don't know what was wrong with my openbabel installation but I just don't seem to be able to get those depict.h related files and libraries installed. 

On another note, I don't mind using SVG. But I can't find the documentation about its API. 

Thanks, 
Xianghai

On Wed, Feb 1, 2017 at 5:44 AM, Geoffrey Hutchison <[hidden email]> wrote:
> from homebrew/macports and compiling manually), include/depict/ is not installed. If I copy this folder from the source code, I get some errors like this which I think means I'm missing the libraries.


Mac OS X does not use cairo (a Linux drawing library). If you don't have it installed, it won't copy.

Personally, I suggest using SVG, which does not require external libraries.

But if you want to use libcairo (e.g for PNG support) you can make sure it's installed using homebrew:
http://brewformulas.org/Cairo

Hope that helps,
-Geoff



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss