Electrostatics / apbs-pdb2pqr

APBS - software for biomolecular electrostatics and solvation
http://www.poissonboltzmann.org/
127 stars 62 forks source link

MacOS problems #520

Closed mwfranklin closed 5 years ago

mwfranklin commented 5 years ago

I'm trying to get APBS python binding built so that I can use pdb2pka.

cmake . -DENABLE_PYTHON=ON -DBUILD_SHARED_LIBS=ON -DPYTHON_LIBRARY=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib

generates build files with no errors. I have multiple python versions installed so I have to specify the library path. But when I run "make" I end with the following error:

[ 19%] Linking C shared library ../lib/libapbs_routines.dylib cd /Users/meghan/Documents/PhD/GitHubProjects/apbs-pdb2pqr/apbs/src && /usr/local/Cellar/cmake/3.13.2/bin/cmake -E cmake_link_script CMakeFiles/apbs_routines.dir/link.txt --verbose=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -O2 -g -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -dynamiclib -Wl,-headerpad_max_install_names -o ../lib/libapbs_routines.dylib -install_name /Users/meghan/Documents/PhD/GitHubProjects/apbs-pdb2pqr/apbs/lib/libapbs_routines.dylib CMakeFiles/apbs_routines.dir/routines.c.o -L/Users/meghan/Documents/PhD/GitHubProjects/apbs-pdb2pqr/apbs/externals/fetk/maloc/lib -Wl,-rpath,/Users/meghan/Documents/PhD/GitHubProjects/apbs-pdb2pqr/apbs/externals/fetk/maloc/lib -lm -lstdc++ ../externals/fetk/maloc/lib/libmaloc.dylib Undefined symbols for architecture x86_64: "_Vacc_atomSASA", referenced from: _initAPOL in routines.c.o "_Vacc_atomSurf", referenced from: _forceAPOL in routines.c.o "_Vacc_atomdSASA", referenced from: _forceAPOL in routines.c.o "_Vacc_atomdSAV", referenced from: _forceAPOL in routines.c.o "_Vacc_ctor", referenced from: _initAPOL in routines.c.o .......a lot more lines like this... 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]: [lib/libapbs_routines.dylib] Error 1 make[1]: [src/CMakeFiles/apbs_routines.dir/all] Error 2 make: *** [all] Error 2

I really have no idea where to start to fix this. I'm running macOS Mojave, cmake 3.13.2 and swig 3.0.12.

sobolevnrm commented 5 years ago

Hi Meghan –

I’m Cc’ing Juan and others for help with your question.

Thank you,

Nathan

From: Meghan Franklin notifications@github.com Sent: Monday, January 07, 2019 09:17 To: Electrostatics/apbs-pdb2pqr apbs-pdb2pqr@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Electrostatics/apbs-pdb2pqr] MacOS problems (#520)

I'm trying to get APBS python binding built so that I can use pdb2pka.

cmake . -DENABLE_PYTHON=ON -DBUILD_SHARED_LIBS=ON -DPYTHON_LIBRARY=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib

generates build files with no errors. I have multiple python versions installed so I have to specify the library path. But when I run "make" I end with the following error:

[ 19%] Linking C shared library ../lib/libapbs_routines.dylib cd /Users/meghan/Documents/PhD/GitHubProjects/apbs-pdb2pqr/apbs/src && /usr/local/Cellar/cmake/3.13.2/bin/cmake -E cmake_link_script CMakeFiles/apbs_routines.dir/link.txt --verbose=1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -O2 -g -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -dynamiclib -Wl,-headerpad_max_install_names -o ../lib/libapbs_routines.dylib -install_name /Users/meghan/Documents/PhD/GitHubProjects/apbs-pdb2pqr/apbs/lib/libapbs_routines.dylib CMakeFiles/apbs_routines.dir/routines.c.o -L/Users/meghan/Documents/PhD/GitHubProjects/apbs-pdb2pqr/apbs/externals/fetk/maloc/lib -Wl,-rpath,/Users/meghan/Documents/PhD/GitHubProjects/apbs-pdb2pqr/apbs/externals/fetk/maloc/lib -lm -lstdc++ ../externals/fetk/maloc/lib/libmaloc.dylib Undefined symbols for architecture x86_64: "_Vacc_atomSASA", referenced from: _initAPOL in routines.c.o "_Vacc_atomSurf", referenced from: _forceAPOL in routines.c.o "_Vacc_atomdSASA", referenced from: _forceAPOL in routines.c.o "_Vacc_atomdSAV", referenced from: _forceAPOL in routines.c.o "_Vacc_ctor", referenced from: _initAPOL in routines.c.o .......a lot more lines like this... 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]: [lib/libapbs_routines.dylib] Error 1 make[1]: [src/CMakeFiles/apbs_routines.dir/all] Error 2 make: *** [all] Error 2

I really have no idea where to start to fix this. I'm running macOS Mojave, cmake 3.13.2 and swig 3.0.12.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FElectrostatics%2Fapbs-pdb2pqr%2Fissues%2F520&data=02%7C01%7C%7Cbd875000b29049d0e98708d674c3f277%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636824782261977083&sdata=2ZBDypldJMq4mO1KRCtOa%2Bws0pmCc%2B82y%2F6cx6qBRes%3D&reserved=0, or mute the threadhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAB1_2LC38gygwzh5UGQvTYwM6pMU1SZwks5vA4ENgaJpZM4Zz5dp&data=02%7C01%7C%7Cbd875000b29049d0e98708d674c3f277%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636824782261977083&sdata=1%2ByNqca7G47FUhrZlurnXyKKDarCwAZI0gFyVaEDYcM%3D&reserved=0.

kozlac commented 5 years ago

Hello @mwfranklin, usually that error shows up when there's a mismatch of 32 vs 64-bit programs/compilers. Please make sure that all of them agree on the architecture (c/c++ compiler, swig, etc). Please let me know if the problem persists. Thanks!!

mwfranklin commented 5 years ago

Swig and clang and gcc are all 64-bit, and I can't tell about cmake. Is there anything else I should check?

kozlac commented 5 years ago

How about the python library? You can check python's architecture like this. Also, could you attach a text file with all Cmake's output? Thanks!!

mwfranklin commented 5 years ago

Yup, also 64-bit.

The text file includes the output of the cmake command and then make.

On Jan 8, 2019, at 9:53 AM, Juan notifications@github.com wrote:

How about the python library? You can check python's architecture like this https://stackoverflow.com/questions/1405913/how-do-i-determine-if-my-python-shell-is-executing-in-32bit-or-64bit-mode-on-os. Also, could you attached a text file with all the error outptut? Thanks!!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Electrostatics/apbs-pdb2pqr/issues/520#issuecomment-452348781, or mute the thread https://github.com/notifications/unsubscribe-auth/AQXygOElVwbPfUZUiIgMiH37mJlWT6-kks5vBL8RgaJpZM4Zz5dp.

CB-C02V608QJ1G:apbs meghan$ cmake . -DENABLE_PYTHON=ON -DBUILD_SHARED_LIBS=ON -DPYTHON_LIBRARY=/System/Library/Frameworks/Python.framework/Versions/2.7/lib -- The C compiler identification is AppleClang 10.0.0.10001145 -- The CXX compiler identification is AppleClang 10.0.0.10001145 -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Setting project paths -- Setting lookup paths for headers and libraries -- Computing machine epsilon values -- Floating point epsilon is 2.220446e-16 -- Double precision epsilon is 2.220446e-16 -- Looking for time -- Looking for time - found -- Looking for rand -- Looking for rand - found -- Looking for srand -- Looking for srand - found -- Setting project paths -- Setting lookup paths for headers and libraries -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of mode_t -- Check size of mode_t - done -- Check size of pid_t -- Check size of pid_t - done -- Check size of size_t -- Check size of size_t - done -- Looking for 4 include files stdlib.h, ..., float.h -- Looking for 4 include files stdlib.h, ..., float.h - found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for include file sys/stat.h -- Looking for include file sys/stat.h - found -- Looking for include file sys/socket.h -- Looking for include file sys/socket.h - found -- Looking for include file sys/time.h -- Looking for include file sys/time.h - found -- Looking for include file sys/un.h -- Looking for include file sys/un.h - found -- Looking for include file sys/wait.h -- Looking for include file sys/wait.h - found -- Looking for include file fcntl.h -- Looking for include file fcntl.h - found -- Looking for include file netinet/in.h -- Looking for include file netinet/in.h - found -- Looking for include file arpa/inet.h -- Looking for include file arpa/inet.h - found -- Looking for include file netdb.h -- Looking for include file netdb.h - found -- Looking for include file rpc/rpc.h -- Looking for include file rpc/rpc.h - found -- Looking for getcwd -- Looking for getcwd - found -- Looking for O_NONBLOCK -- Looking for O_NONBLOCK - found -- With sources: base/maloc_base.c;psh/psh.c;psh/vcom.c;psh/vmp.c;psh/vmpi.c;vsh/vlex.c;vsh/vpars.c;vsh/vpup.c;vsh/vsh.c;vsh/vyacc.c;vsys/vio.c;vsys/viofb.c;vsys/vmem.c;vsys/vnm.c;vsys/vnmfb.c;vsys/vpred.c;vsys/vset.c;vsys/ziofb.c -- With external headers: base/maloc/maloc.h;base/maloc/maloc_base.h;psh/maloc/psh.h;psh/maloc/vcom.h;psh/maloc/vmp.h;psh/maloc/vmpi.h;vsh/maloc/vsh.h;vsys/maloc/vio.h;vsys/maloc/vmem.h;vsys/maloc/vnm.h;vsys/maloc/vset.h;vsys/maloc/vsys.h;vsys/maloc/vpred.h -- With internal headers: base/maloc_base_p.h;psh/psh_p.h;psh/vcom_p.h;psh/vmpi_p.h;psh/vmp_p.h;vsh/vpup.h;vsh/vsh_p.h;vsh/vyacc.h;vsys/vio_p.h;vsys/vmem_p.h;vsys/vnm_p.h;vsys/vpred_p.h;vsys/vset_p.h -- Inline functions enabled -- Verbose debugging mode enabled -- Adding apbs_generic -- With source files nosh.c;mgparm.c;femparm.c;pbamparm.c;pbsamparm.c;pbeparm.c;bemparm.c;geoflowparm.c;apolparm.c;vacc.c;valist.c;vatom.c;vpbe.c;vcap.c;vclist.c;vstring.c;vparam.c;vgreen.c -- With external header files nosh.h;mgparm.h;femparm.h;pbamparm.h;pbsamparm.h;pbeparm.h;bemparm.h;geoflowparm.h;apolparm.h;vacc.h;valist.h;vatom.h;vpbe.h;vcap.h;vclist.h;vstring.h;vparam.h;vgreen.h;vmatrix.h;vhal.h;vunit.h -- With internal header files -- With library dependencies m;stdc++;maloc -- Added apbs_generic -- Adding apbs_pmgc -- With source files buildAd.c;buildBd.c;buildGd.c;buildPd.c;cgd.c;gsd.c;matvecd.c;mgcsd.c;mgdrvd.c;mgsubd.c;mikpckd.c;mlinpckd.c;mypdec.c;newtond.c;newdrvd.c;powerd.c;smoothd.c;mgfasd.c -- With external header files buildAd.h;buildBd.h;buildGd.h;buildPd.h;cgd.h;gsd.h;matvecd.h;mgcsd.h;mgdrvd.h;mgsubd.h;mikpckd.h;mlinpckd.h;mypdec.h;newtond.h;newdrvd.h;powerd.h;smoothd.h;mgfasd.h -- With internal header files -- With library dependencies m;stdc++;maloc -- Added apbs_pmgc -- Adding apbs_mg -- With source files vgrid.c;vmgrid.c;vopot.c;vpmg.c;vpmgp.c -- With external header files vgrid.h;vmgrid.h;vopot.h;vpmg.h;vpmgp.h -- With internal header files -- With library dependencies m;stdc++;maloc;apbs_generic;apbs_pmgc -- Added apbs_mg -- Adding apbs_routines -- With source files routines.c -- With external header files -- With internal header files -- With library dependencies m;stdc++;maloc -- Added apbs_routines --


--
-- APBS Libraries: m;stdc++;maloc -- Internal Libraries: apbs_generic;apbs_pmgc;apbs_mg;apbs_routines --


-- -- Supplemental tools enabled -- Building mesh -- libraries: apbs_generic;apbs_mg;apbs_pmgc -- Building manip -- libraries: apbs_generic;apbs_mg;apbs_pmgc -- Found SWIG: /usr/local/bin/swig (found version "3.0.12") -- Found PythonLibs: /System/Library/Frameworks/Python.framework/Versions/2.7/lib (found version "2.7.10") CMake Warning (dev) at /usr/local/Cellar/cmake/3.13.2/share/cmake/Modules/UseSWIG.cmake:564 (message): Policy CMP0078 is not set. Run "cmake --help-policy CMP0078" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): tools/python/CMakeLists.txt:11 (SWIG_ADD_LIBRARY) This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done WARNING: Target "_apbslib" requests linking to directory "/System/Library/Frameworks/Python.framework/Versions/2.7/lib". Targets may link only to libraries. CMake is dropping the item. CMake Warning (dev): Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

apbs_generic apbs_mg apbs_pmgc apbs_routines maloc

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done -- Build files have been written to: /Users/meghan/Documents/PhD/GitHubProjects/apbs-pdb2pqr/apbs CCB-C02V608QJ1G:apbs meghan$ CCB-C02V608QJ1G:apbs meghan$

CCB-C02V608QJ1G:apbs meghan$ make [ 18%] Built target maloc [ 36%] Built target apbs_pmgc [ 54%] Built target apbs_generic [ 60%] Built target apbs_mg [ 61%] Linking C shared library ../lib/libapbs_routines.dylib Undefined symbols for architecture x86_64: "_Vacc_atomSASA", referenced from: _initAPOL in routines.c.o "_Vacc_atomSurf", referenced from: _forceAPOL in routines.c.o "_Vacc_atomdSASA", referenced from: _forceAPOL in routines.c.o "_Vacc_atomdSAV", referenced from: _forceAPOL in routines.c.o "_Vacc_ctor", referenced from: _initAPOL in routines.c.o "_Vacc_dtor", referenced from: _initAPOL in routines.c.o "_Vacc_totalSASA", referenced from: _initAPOL in routines.c.o "_Vacc_totalSAV", referenced from: _initAPOL in routines.c.o "_Vacc_wcaEnergy", referenced from: _initAPOL in routines.c.o "_Vacc_wcaEnergyAtom", referenced from: _initAPOL in routines.c.o "_Vacc_wcaForceAtom", referenced from: _forceAPOL in routines.c.o "_Valist_ctor", referenced from: _loadMolecules in routines.c.o "_Valist_dtor", referenced from: _killMolecules in routines.c.o "_Valist_getAtom", referenced from: _initMG in routines.c.o _energyMG in routines.c.o _storeAtomEnergy in routines.c.o _initAPOL in routines.c.o _forceAPOL in routines.c.o "_Valist_getNumberAtoms", referenced from: _loadMolecules in routines.c.o _initMG in routines.c.o _energyMG in routines.c.o _forceMG in routines.c.o _storeAtomEnergy in routines.c.o _initAPOL in routines.c.o _forceAPOL in routines.c.o ... "_Valist_readPDB", referenced from: _loadMolecules in routines.c.o "_Valist_readPQR", referenced from: _loadMolecules in routines.c.o "_Valist_readXML", referenced from: _loadMolecules in routines.c.o "_Vatom_getCharge", referenced from: _initMG in routines.c.o _initAPOL in routines.c.o "_Vatom_getPosition", referenced from: _initAPOL in routines.c.o "_Vatom_getRadius", referenced from: _initAPOL in routines.c.o "_Vclist_ctor", referenced from: _initAPOL in routines.c.o "_Vclist_dtor", referenced from: _initAPOL in routines.c.o "_Vgrid_ctor", referenced from: _loadDielMaps in routines.c.o _loadKappaMaps in routines.c.o _loadPotMaps in routines.c.o _loadChargeMaps in routines.c.o _writedataMG in routines.c.o "_Vgrid_dtor", referenced from: _killDielMaps in routines.c.o _killKappaMaps in routines.c.o _killPotMaps in routines.c.o _killChargeMaps in routines.c.o _writedataMG in routines.c.o "_Vgrid_readDX", referenced from: _loadDielMaps in routines.c.o _loadKappaMaps in routines.c.o _loadPotMaps in routines.c.o _loadChargeMaps in routines.c.o "_Vgrid_readDXBIN", referenced from: _loadDielMaps in routines.c.o _loadKappaMaps in routines.c.o _loadChargeMaps in routines.c.o "_Vgrid_readGZ", referenced from: _loadDielMaps in routines.c.o _loadKappaMaps in routines.c.o _loadPotMaps in routines.c.o _loadChargeMaps in routines.c.o "_Vgrid_writeDX", referenced from: _writedataMG in routines.c.o "_Vgrid_writeDXBIN", referenced from: _writedataMG in routines.c.o "_Vgrid_writeGZ", referenced from: _writedataMG in routines.c.o "_Vgrid_writeUHBD", referenced from: _writedataMG in routines.c.o "_Vparam_ctor", referenced from: _loadParameter in routines.c.o "_Vparam_getAtomData", referenced from: _initAPOL in routines.c.o "_Vparam_readFlatFile", referenced from: _loadParameter in routines.c.o "_Vparam_readXMLFile", referenced from: _loadParameter in routines.c.o "_Vpbe_ctor", referenced from: _initMG in routines.c.o "_Vpbe_dtor", referenced from: _initMG in routines.c.o _killMG in routines.c.o "_Vpbe_getDeblen", referenced from: _initMG in routines.c.o "_Vpmg_ctor", referenced from: _initMG in routines.c.o "_Vpmg_dbForce", referenced from: _forceMG in routines.c.o "_Vpmg_dielEnergy", referenced from: _energyMG in routines.c.o "_Vpmg_dtor", referenced from: _initMG in routines.c.o _killMG in routines.c.o "_Vpmg_energy", referenced from: _energyMG in routines.c.o "_Vpmg_fillArray", referenced from: _writedataMG in routines.c.o "_Vpmg_fillco", referenced from: _initMG in routines.c.o "_Vpmg_ibForce", referenced from: _forceMG in routines.c.o "_Vpmg_qfAtomEnergy", referenced from: _energyMG in routines.c.o _storeAtomEnergy in routines.c.o "_Vpmg_qfEnergy", referenced from: _energyMG in routines.c.o "_Vpmg_qfForce", referenced from: _forceMG in routines.c.o "_Vpmg_qmEnergy", referenced from: _energyMG in routines.c.o "_Vpmg_setPart", referenced from: _setPartMG in routines.c.o "_Vpmg_solve", referenced from: _solveMG in routines.c.o "_Vpmgp_ctor", referenced from: _initMG in routines.c.o "_Vpmgp_dtor", referenced from: _initMG in routines.c.o _killMG in routines.c.o "_Vstring_strcasecmp", referenced from: _writedataFlat in routines.c.o _writedataXML in routines.c.o _printEnergy in routines.c.o _printElecEnergy in routines.c.o _printApolEnergy in routines.c.o _printForce in routines.c.o _printElecForce in routines.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]: [lib/libapbs_routines.dylib] Error 1 make[1]: [src/CMakeFiles/apbs_routines.dir/all] Error 2 make: *** [all] Error 2

kozlac commented 5 years ago

@mwfranklin could you run CMake again with -DBUILD_SHARED_LIBS=OFF and then make in a clean build folder?

mwfranklin commented 5 years ago

Ha! Success! And pdb2pka successfully built as well. I had thought the -DBUILD_SHARED_LIBS had to be set to on in order for it to properly link to the libraries later. Thanks!

On Jan 8, 2019, at 10:19 AM, Juan notifications@github.com wrote:

@mwfranklin https://github.com/mwfranklin could you run CMake again with -DBUILD_SHARED_LIBS=OFF and then make in a clean build folder?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Electrostatics/apbs-pdb2pqr/issues/520#issuecomment-452358646, or mute the thread https://github.com/notifications/unsubscribe-auth/AQXygItQ27JGVld6wmBPAaBhrS1VoxGDks5vBMUngaJpZM4Zz5dp.

kozlac commented 5 years ago

Yeah, CMake is trying to use the Linux linking system that is different from MacOS X. If you were building in a Unix system you do need the flag on. Glad I could help and I'm closing this issue. Thanks!