From marc-andre.dubois at polymtl.ca Wed Mar 9 20:57:56 2016 From: marc-andre.dubois at polymtl.ca (=?iso-8859-1?Q?Marc-Andr=E9_Dubois?=) Date: Wed, 9 Mar 2016 20:57:56 -0500 Subject: [Openchemistry-users] Problem with Avogadro 2 build on OSX Message-ID: <08B47AD5-F617-4910-9043-C2C926489D0A@polymtl.ca> Hi, I am a long time user of Avogadro. I recently saw Open Chemistry with Avogadro 2 and Molequeue and I really want to use the project for my work. However, I had a lot of trouble building the apps. I am currently running osx 10.7.5, osx 10.11.x and Ubuntu (not tested yet). The state of the build is the following: on osx 10.7.5: Molequeue: Built and installed (fully functional) Avogadrolibs: Built and installed Avogadroapp: Build incomplete... I have a linking problem. Here is my output: [100%] Linking CXX executable ../bin/Avogadro2.app/Contents/MacOS/Avogadro2 Undefined symbols for architecture x86_64: "Avogadro::Io::FileFormat::readFile(std::string const&, Avogadro::Core::Molecule&)", referenced from: Avogadro::BackgroundFileFormat::read() in backgroundfileformat.cpp.o "Avogadro::Io::FileFormat::writeFile(std::string const&, Avogadro::Core::Molecule const&)", referenced from: Avogadro::BackgroundFileFormat::write() in backgroundfileformat.cpp.o "Avogadro::Io::CjsonFormat::CjsonFormat()", referenced from: Avogadro::MainWindow::openFile() in mainwindow.cpp.o Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o Avogadro::MainWindow::saveFileAs(bool) in mainwindow.cpp.o "Avogadro::Io::FileFormatManager::registerFormat(Avogadro::Io::FileFormat*)", referenced from: Avogadro::MainWindow::fileFormatsReady() in mainwindow.cpp.o "Avogadro::Io::FileFormatManager::instance()", referenced from: Avogadro::MainWindow::exportGraphics() in mainwindow.cpp.o Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o Avogadro::MainWindow::registerMoleQueue() in mainwindow.cpp.o Avogadro::RpcListener::messageReceived(MoleQueue::Message const&) in rpclistener.cpp.o "Avogadro::Io::CmlFormat::CmlFormat()", referenced from: Avogadro::MainWindow::openFile() in mainwindow.cpp.o Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o Avogadro::MainWindow::saveFileAs(bool) in mainwindow.cpp.o "Avogadro::Core::Molecule::setData(std::string const&, Avogadro::Core::Variant const&)", referenced from: Avogadro::MainWindow::openFile(QString const&, Avogadro::Io::FileFormat*) in mainwindow.cpp.o Avogadro::MainWindow::backgroundReaderFinished() in mainwindow.cpp.o Avogadro::MainWindow::backgroundWriterFinished() in mainwindow.cpp.o "Avogadro::version()", referenced from: Avogadro::AboutDialog::AboutDialog(QWidget*) in aboutdialog.cpp.o "Avogadro::Io::FileFormatManager::readString(Avogadro::Core::Molecule&, std::string const&, std::string const&) const", referenced from: Avogadro::RpcListener::messageReceived(MoleQueue::Message const&) in rpclistener.cpp.o "Avogadro::Io::FileFormatManager::writeString(Avogadro::Core::Molecule const&, std::string&, std::string const&) const", referenced from: Avogadro::MainWindow::exportGraphics() in mainwindow.cpp.o "Avogadro::Io::FileFormatManager::fileExtensions(int) const", referenced from: Avogadro::MainWindow::registerMoleQueue() in mainwindow.cpp.o "Avogadro::Io::FileFormatManager::fileFormatsFromFileExtension(std::string const&, int) const", referenced from: Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o "Avogadro::Io::FileFormatManager::error() const", referenced from: Avogadro::RpcListener::messageReceived(MoleQueue::Message const&) in rpclistener.cpp.o "Avogadro::Io::FileFormatManager::readFile(Avogadro::Core::Molecule&, std::string const&, std::string const&) const", referenced from: Avogadro::RpcListener::messageReceived(MoleQueue::Message const&) in rpclistener.cpp.o "Avogadro::Core::Molecule::hasCustomElements() const", referenced from: Avogadro::MainWindow::reassignCustomElements() in mainwindow.cpp.o "Avogadro::Core::Molecule::data(std::string const&) const", referenced from: Avogadro::MainWindow::updateWindowTitle() in mainwindow.cpp.o Avogadro::MainWindow::exportGraphics() in mainwindow.cpp.o Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o "Avogadro::Core::Molecule::hasData(std::string const&) const", referenced from: Avogadro::MainWindow::updateWindowTitle() in mainwindow.cpp.o Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o "Avogadro::Core::Molecule::atomCount() const", referenced from: Avogadro::MainWindow::setMolecule(Avogadro::QtGui::Molecule*) in mainwindow.cpp.o Avogadro::MainWindow::backgroundReaderFinished() in mainwindow.cpp.o Avogadro::MainWindow::exportGraphics() in mainwindow.cpp.o "Avogadro::Core::Molecule::bondCount() const", referenced from: Avogadro::MainWindow::backgroundReaderFinished() in mainwindow.cpp.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]: *** [bin/Avogadro2.app/Contents/MacOS/Avogadro2] Error 1 make[1]: *** [avogadro/CMakeFiles/avogadro.dir/all] Error 2 make: *** [all] Error 2 As I understand, it look like some libraries are missing. Is there a connection between avogadrolibs and avogadroapp? When I prepare avogadrolibs with cmake, I get this warning: MACOSX_RPATH is not specified for the following targets: AvogadroCore AvogadroIO AvogadroQuantumIO Avogadrolibs build just fine with my setup despite of this message, but is it possible, this could be the source of my linking problem? I tried to use the binaries directly, but those were compiled with a 10.8+ version of OSX so it does not work with my 10.7.5 osx, so I would prefer to build the apps myself instead. Thank you for your help. Marc From marcus.hanwell at kitware.com Thu Mar 10 11:21:07 2016 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Thu, 10 Mar 2016 11:21:07 -0500 Subject: [Openchemistry-users] Problem with Avogadro 2 build on OSX In-Reply-To: <08B47AD5-F617-4910-9043-C2C926489D0A@polymtl.ca> References: <08B47AD5-F617-4910-9043-C2C926489D0A@polymtl.ca> Message-ID: Hi Marc, On Wed, Mar 9, 2016 at 8:57 PM, Marc-Andr? Dubois wrote: > Hi, > I am a long time user of Avogadro. I recently saw Open Chemistry with Avogadro 2 and Molequeue and I really want to use the project for my work. However, I had a lot of trouble building the apps. I am currently running osx 10.7.5, osx 10.11.x and Ubuntu (not tested yet). The state of the build is the following: > > on osx 10.7.5: > Molequeue: Built and installed (fully functional) > Avogadrolibs: Built and installed > Avogadroapp: Build incomplete... I have a linking problem. Here is my output: > > [100%] Linking CXX executable ../bin/Avogadro2.app/Contents/MacOS/Avogadro2 > Undefined symbols for architecture x86_64: > 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]: *** [bin/Avogadro2.app/Contents/MacOS/Avogadro2] Error 1 > make[1]: *** [avogadro/CMakeFiles/avogadro.dir/all] Error 2 > make: *** [all] Error 2 > > > As I understand, it look like some libraries are missing. Is there a connection between avogadrolibs and avogadroapp? When I prepare avogadrolibs with cmake, I get this warning: > > MACOSX_RPATH is not specified for the following targets: > > AvogadroCore > AvogadroIO > AvogadroQuantumIO > Yes, avogadroapp depends on and requires avogadrolibs. If you go to http://www.openchemistry.org/downloads/ you can get a Mac binary I built recently for the 0.9.0 release. The Mac uses an app bundle, and I use the openchemistry superbuild to coordinate building all the dependencies. > > Avogadrolibs build just fine with my setup despite of this message, but is it possible, this could be the source of my linking problem? I tried to use the binaries directly, but those were compiled with a 10.8+ version of OSX so it does not work with my 10.7.5 osx, so I would prefer to build the apps myself instead. Thank you for your help. > Yes, we don't test on 10.7 any longer, and I am not sure if there will be other issues there with Qt 5. The Avogadro application must link to the Avogadro libraries, the linker error you see suggests that it is not able to find the libraries correctly, if you can try, VERBOSE=1 make -j1 It should show you the link line, and that may help me see what the issue is. I can check out whether we could broaden support, but http://doc.qt.io/qt-5/osx.html indicates limited support for OS less recent than 10.8. Thanks, Marcus From marc-andre.dubois at polymtl.ca Fri Mar 11 10:40:30 2016 From: marc-andre.dubois at polymtl.ca (=?iso-8859-1?Q?Marc-Andr=E9_Dubois?=) Date: Fri, 11 Mar 2016 10:40:30 -0500 Subject: [Openchemistry-users] Problem with Avogadro 2 build on OSX In-Reply-To: <08B47AD5-F617-4910-9043-C2C926489D0A@polymtl.ca> References: <08B47AD5-F617-4910-9043-C2C926489D0A@polymtl.ca> Message-ID: <93DE42B7-D487-4C02-A60B-56CF1D0B3AFC@polymtl.ca> I am still working on this problem on osx (See my previous message at the bottom of this one). By modifying the cmake file (adding the libraries in the link target command), I was able to build avogadro2. The problems are now just more complicated... First, it seems some libraries are missing in the Avogadro2.app bundle. I added libGLEW.1.10.dylib manually inside the bundle, but I'm still having a lot of problems with the frameworks of Qt. When I try to run Avogadro2 from the terminal, I get for instance: dyld: Library not loaded: @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets Referenced from: /usr/local/lib/libAvogadroQtOpenGL.dylib Reason: image not found Trace/BPT trap: 5 As I understand, the app is trying to find the Qt frameworks that are supposed to be inside the bundle. Is it the case? Is it supposed to be automatically added when I build Avogadro2.app? Similar problems seem to appear on 10.11 as well, so I think it is not exclusively a problem with osx 10.7.5. Any help would be greatly appreciated since I am not a dedicated computer programming guy. Thank you, Marc > Hi, > I am a long time user of Avogadro. I recently saw Open Chemistry with Avogadro 2 and Molequeue and I really want to use the project for my work. However, I had a lot of trouble building the apps. I am currently running osx 10.7.5, osx 10.11.x and Ubuntu (not tested yet). The state of the build is the following: > > on osx 10.7.5: > Molequeue: Built and installed (fully functional) > Avogadrolibs: Built and installed > Avogadroapp: Build incomplete... I have a linking problem. Here is my output: > > [100%] Linking CXX executable ../bin/Avogadro2.app/Contents/MacOS/Avogadro2 > Undefined symbols for architecture x86_64: > "Avogadro::Io::FileFormat::readFile(std::string const&, Avogadro::Core::Molecule&)", referenced from: > Avogadro::BackgroundFileFormat::read() in backgroundfileformat.cpp.o > "Avogadro::Io::FileFormat::writeFile(std::string const&, Avogadro::Core::Molecule const&)", referenced from: > Avogadro::BackgroundFileFormat::write() in backgroundfileformat.cpp.o > "Avogadro::Io::CjsonFormat::CjsonFormat()", referenced from: > Avogadro::MainWindow::openFile() in mainwindow.cpp.o > Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o > Avogadro::MainWindow::saveFileAs(bool) in mainwindow.cpp.o > "Avogadro::Io::FileFormatManager::registerFormat(Avogadro::Io::FileFormat*)", referenced from: > Avogadro::MainWindow::fileFormatsReady() in mainwindow.cpp.o > "Avogadro::Io::FileFormatManager::instance()", referenced from: > Avogadro::MainWindow::exportGraphics() in mainwindow.cpp.o > Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o > Avogadro::MainWindow::registerMoleQueue() in mainwindow.cpp.o > Avogadro::RpcListener::messageReceived(MoleQueue::Message const&) in rpclistener.cpp.o > "Avogadro::Io::CmlFormat::CmlFormat()", referenced from: > Avogadro::MainWindow::openFile() in mainwindow.cpp.o > Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o > Avogadro::MainWindow::saveFileAs(bool) in mainwindow.cpp.o > "Avogadro::Core::Molecule::setData(std::string const&, Avogadro::Core::Variant const&)", referenced from: > Avogadro::MainWindow::openFile(QString const&, Avogadro::Io::FileFormat*) in mainwindow.cpp.o > Avogadro::MainWindow::backgroundReaderFinished() in mainwindow.cpp.o > Avogadro::MainWindow::backgroundWriterFinished() in mainwindow.cpp.o > "Avogadro::version()", referenced from: > Avogadro::AboutDialog::AboutDialog(QWidget*) in aboutdialog.cpp.o > "Avogadro::Io::FileFormatManager::readString(Avogadro::Core::Molecule&, std::string const&, std::string const&) const", referenced from: > Avogadro::RpcListener::messageReceived(MoleQueue::Message const&) in rpclistener.cpp.o > "Avogadro::Io::FileFormatManager::writeString(Avogadro::Core::Molecule const&, std::string&, std::string const&) const", referenced from: > Avogadro::MainWindow::exportGraphics() in mainwindow.cpp.o > "Avogadro::Io::FileFormatManager::fileExtensions(int) const", referenced from: > Avogadro::MainWindow::registerMoleQueue() in mainwindow.cpp.o > "Avogadro::Io::FileFormatManager::fileFormatsFromFileExtension(std::string const&, int) const", referenced from: > Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o > "Avogadro::Io::FileFormatManager::error() const", referenced from: > Avogadro::RpcListener::messageReceived(MoleQueue::Message const&) in rpclistener.cpp.o > "Avogadro::Io::FileFormatManager::readFile(Avogadro::Core::Molecule&, std::string const&, std::string const&) const", referenced from: > Avogadro::RpcListener::messageReceived(MoleQueue::Message const&) in rpclistener.cpp.o > "Avogadro::Core::Molecule::hasCustomElements() const", referenced from: > Avogadro::MainWindow::reassignCustomElements() in mainwindow.cpp.o > "Avogadro::Core::Molecule::data(std::string const&) const", referenced from: > Avogadro::MainWindow::updateWindowTitle() in mainwindow.cpp.o > Avogadro::MainWindow::exportGraphics() in mainwindow.cpp.o > Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o > "Avogadro::Core::Molecule::hasData(std::string const&) const", referenced from: > Avogadro::MainWindow::updateWindowTitle() in mainwindow.cpp.o > Avogadro::MainWindow::saveFile(bool) in mainwindow.cpp.o > "Avogadro::Core::Molecule::atomCount() const", referenced from: > Avogadro::MainWindow::setMolecule(Avogadro::QtGui::Molecule*) in mainwindow.cpp.o > Avogadro::MainWindow::backgroundReaderFinished() in mainwindow.cpp.o > Avogadro::MainWindow::exportGraphics() in mainwindow.cpp.o > "Avogadro::Core::Molecule::bondCount() const", referenced from: > Avogadro::MainWindow::backgroundReaderFinished() in mainwindow.cpp.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]: *** [bin/Avogadro2.app/Contents/MacOS/Avogadro2] Error 1 > make[1]: *** [avogadro/CMakeFiles/avogadro.dir/all] Error 2 > make: *** [all] Error 2 > > > As I understand, it look like some libraries are missing. Is there a connection between avogadrolibs and avogadroapp? When I prepare avogadrolibs with cmake, I get this warning: > > MACOSX_RPATH is not specified for the following targets: > > AvogadroCore > AvogadroIO > AvogadroQuantumIO > > > Avogadrolibs build just fine with my setup despite of this message, but is it possible, this could be the source of my linking problem? I tried to use the binaries directly, but those were compiled with a 10.8+ version of OSX so it does not work with my 10.7.5 osx, so I would prefer to build the apps myself instead. Thank you for your help. > > Marc > From marcus.hanwell at kitware.com Mon Mar 14 10:48:47 2016 From: marcus.hanwell at kitware.com (Marcus D. Hanwell) Date: Mon, 14 Mar 2016 10:48:47 -0400 Subject: [Openchemistry-users] Problem with Avogadro 2 build on OSX In-Reply-To: <93DE42B7-D487-4C02-A60B-56CF1D0B3AFC@polymtl.ca> References: <08B47AD5-F617-4910-9043-C2C926489D0A@polymtl.ca> <93DE42B7-D487-4C02-A60B-56CF1D0B3AFC@polymtl.ca> Message-ID: On Fri, Mar 11, 2016 at 10:40 AM, Marc-Andr? Dubois wrote: > I am still working on this problem on osx (See my previous message at the bottom of this one). By modifying the cmake file (adding the libraries in the link target command), I was able to build avogadro2. The problems are now just more complicated... First, it seems some libraries are missing in the Avogadro2.app bundle. I added libGLEW.1.10.dylib manually inside the bundle, but I'm still having a lot of problems with the frameworks of Qt. When I try to run Avogadro2 from the terminal, I get for instance: > > dyld: Library not loaded: @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets > Referenced from: /usr/local/lib/libAvogadroQtOpenGL.dylib > Reason: image not found > Trace/BPT trap: 5 > > As I understand, the app is trying to find the Qt frameworks that are supposed to be inside the bundle. Is it the case? Is it supposed to be automatically added when I build Avogadro2.app? Similar problems seem to appear on 10.11 as well, so I think it is not exclusively a problem with osx 10.7.5. Any help would be greatly appreciated since I am not a dedicated computer programming guy. Thank you, > I am not clear on what you did to make the package, but in order to create a valid app bundle on the Mac you should run (from the avogadroapp build directory, make package Before doing that you would want to change some CPACK defaults, and I think we should change these in the source in future. You can use cmake-gui, toggle advanced variables, search for CPACK_BINARY_ and turn everything off, turn CPACK_BINARY_DRAGNDROP on. The Windows and Mac installer generation uses CPACK in order to satisfy the packaging requirements, I have never really liked the fact that make install doesn't behave as expected. You will get a bundle, the same as the one we distribute, in the binary directory, that should contain all dependencies, with the paths fixed up. Marcus