rvianello / chemicalite

An SQLite extension for chemoinformatics applications.
https://chemicalite.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
55 stars 8 forks source link

OSX Yosemite build fails: Undefined symbols for architecture x86_64: "_sqlite3_enable_load_extension" #2

Closed rapodaca closed 3 years ago

rapodaca commented 8 years ago

Build fails with the output below. Attempted building against a copy of RDKit installed from source. Tried installing sqlite3 with brew and from source, but the result was the same.

$ make [ 36%] Built target chemicalite [ 47%] Built target testcommon [ 52%] Linking C executable create_rdtree Undefined symbols for architecture x86_64: "_sqlite3_enable_load_extension", referenced from: _database_setup in libtestcommon.a(testcommon.c.o) "_sqlite3_load_extension", referenced from: _database_setup in libtestcommon.a(testcommon.c.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[2]: * [test/create_rdtree] Error 1 make[1]: * [test/CMakeFiles/create_rdtree.dir/all] Error 2 make: *\ [all] Error 2

rvianello commented 8 years ago

Thank you for the report. Unfortunately I haven't got any osx machine available to try and reproduce the issue.

The simplest cause for this kind of errors could be that sqlite was build with the SQLITE_OMIT_LOAD_EXTENSION flag, but this seems unlikely to be the case for the libraries you built from source code.

'make VERBOSE=1' should display the command line that is failing, and might this way provide some hints about the possibility that cmake is still using the unintended version of sqlite.

I think the overall cmake configuration is actually a bit too basic and it could be improved. I'll try to introduce a few changes intended to make it more robust and easier to troubleshoot. I'll append a message when done.

rvianello commented 8 years ago

I've extended the cmake build files to locate the SQLite resources at configuration time (only tested it on linux). This is not probably solving your problem, but the information collected by cmake might help troubleshooting the built.

In the process, I've realized that pysqlite is not available for python3 (and unlikely to be in the future) and I therefore decided to port the python test code to APSW. The build documentation has been updated and I'll update the tutorials in the next future, in any case python tests may be disabled by passing -DCHEMICALITE_ENABLE_PYTHON_TESTS=OFF on the cmake command line.

rvianello commented 3 years ago

Thanks to GitHub actions, I had a chance to successfully test a build on osx, so I think it should be ok to close this issue (and it's now so old that I'm afraid it would make little sense to keep it open anyway).