Eigenstate / vmd-python

Installable VMD as a python module
Other
129 stars 24 forks source link

problem compiling on MacOS high Sierra 10.13.3 (python 3.6) #11

Closed AlexanderHauser closed 6 years ago

AlexanderHauser commented 6 years ago
$ python3 setup.py build
running build
running build_py
Compiling VMD
Finding libraries...
  Searching /usr/lib /usr/local/lib
   LIB: libtcl8.5.dylib -> /usr/lib
   INC: tcl.h -> /usr/local/include
  Searching /usr/lib /usr/local/lib
   LIB: libsqlite3.dylib -> /usr/lib
   INC: sqlite3.h -> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include
  Searching /usr/lib /usr/local/lib
   LIB: libexpat.dylib -> /usr/lib
   INC: expat.h -> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include
  Searching /usr/lib /usr/local/lib
   LIB: libnetcdf.dylib -> /usr/local/lib
   INC: netcdf.h -> /usr/local/include
  Searching /usr/lib /usr/local/lib
WARNING: Could not find library file 'libpython3.6*.dylib' in standard library directories.
 Defaulting to: '/usr/local/opt/python3/3.6/lib/libpython3.6*.dylib'
   LIB: libpython3.6*.dylib -> /usr/local/opt/python3/3.6/lib
Traceback (most recent call last):
  File "setup.py", line 293, in <module>
    'test': VMDTest,
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 32, in run
    self.execute(self.compile, [], msg="Compiling VMD")
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 335, in execute
    util.execute(func, args, msg, dry_run=self.dry_run)
  File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/util.py", line 301, in execute
    func(*args)
  File "setup.py", line 43, in compile
    self.set_environment_variables(pydir)
  File "setup.py", line 225, in set_environment_variables
    pythonldflag = "-l%s" % os.path.split(libs[-1])[-1][3:] # Remove "lib"
IndexError: list index out of range

compiles on python 2.7. However, when import vmd in python2.7 leads to Segmentation fault: 11

Eigenstate commented 6 years ago

I made the logic for finding libpython a little more robust -- can you try it again? I can't help with the segfault without a stack trace at minimum.

RasmusFonseca commented 6 years ago

How do you get a stack trace of a segfault in a python lib? How would you do that on linux?

I tried running lldb -- python2 -c "import vmd", but mac has this silly SIP that prevented it. Now that I think about it it might have worked if we had put sudo in front. @AlexanderHauser could you also try that?

sudo lldb -- python2 -c "import vmd"
# When its opened, press "r" and then "enter"
AlexanderHauser commented 6 years ago

Hi Robin and Rasmus,

thats the output after doing:

sudo lldb -- python2 -c "import vmd"

(lldb) target create "python2" Current executable set to 'python2' (x86_64). (lldb) settings set -- target.run-args "-c" "import vmd" (lldb) r Process 73985 launched: '/usr/local/bin/python2' (x86_64) Process 73985 stopped

Alex

On 27 January 2018 at 01:51, Rasmus Fonseca notifications@github.com wrote:

How do you get a stack trace of a segfault in a python dir? How would you do that on linux?

I tried running lldb -- python2 -c "import vmd", but mac has this silly SIP https://support.apple.com/en-us/HT204899 that prevented it. Now that I think about it it might have worked id we had put sudo in front. @AlexanderHauser https://github.com/alexanderhauser could you also try that?

sudo lldb -- python2 -c "import vmd"# When its opened, press "r" and then "enter"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Eigenstate/vmd-python/issues/11#issuecomment-360944770, or mute the thread https://github.com/notifications/unsubscribe-auth/AMysdpVcPanVTHd0G_scSdy2bG9k6U-nks5tOnMPgaJpZM4Rufyz .

RasmusFonseca commented 6 years ago

Hm. Thats not super informative unfortunately. Did you try

$ git pull
$ python3 setup.py build
AlexanderHauser commented 6 years ago

Hi,

seems to work now after git pull !

Cheers,

Alex

On 28 January 2018 at 20:10, Rasmus Fonseca notifications@github.com wrote:

Hm. Thats not super informative. Did you try

$ git pull $ python3 setup.py build

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Eigenstate/vmd-python/issues/11#issuecomment-361087321, or mute the thread https://github.com/notifications/unsubscribe-auth/AMysdlOIJ7ccWgtP4XRdSV3sI7s2I7WEks5tPMYYgaJpZM4Rufyz .

RasmusFonseca commented 6 years ago

Awesome. Thanks for testing @AlexanderHauser . Hope you get something interesting