Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What versions of tclsh and sqlite3 should I use to run DRAKONEditor.app on macOS? #6

Open
rraallvv opened this issue Feb 23, 2016 · 35 comments

Comments

@rraallvv
Copy link

I installed Active Tcl as suggested in the read me file, but in my system tclsh and sqlite3 are all over the place with several different versions. If I try to run tclsh drakon_editor.tcl I get a segmentation fault error.

This is how to reproduce the error:

$ which tclsh
/usr/local/bin/tclsh
$ which sqlite3
/Users/user/NVPACK/android-sdk-macosx/platform-tools/sqlite3
$ tclsh
% info patchlevel
8.6.4
% package require sqlite3
3.8.10.2
% sqlite db data.db
Segmentation fault: 11
@rraallvv
Copy link
Author

Edited my PATH environment variable leaving just /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin but I'm still getting the segfault

@mgpld
Copy link

mgpld commented Feb 24, 2016

Confirmed the segfault on: El Captain version 10.11.3 (15D21)

@stepan-mitkin
Copy link
Owner

Looks like it is sqlite which causes the crash under El Capitan.
I submitted a bug report both in Apple and Tcl.
http://core.tcl.tk/tcl/tktview/b9f7093a9e98a8227053c0570e276f8373e6b922

@rraallvv
Copy link
Author

rraallvv commented Feb 25, 2016

I was able to run the editor from the command line by installing the package tcl-tk hosted in homebrew and compiling the tkimg from the sources.

For anyone interested here is how I did it:

Install hombrew.

Install the package tcl-tk from homebrew.
brew install homebrew/dupes/tcl-tk

Install tkimg revision 374 (I took that from this script)

svn checkout -r 374 https://svn.code.sf.net/p/tkimg/code/trunk
cd trunk
./configure --prefix=/usr/local/Cellar/tcl-tk/8.6.4
make collate
make install-libraries
cp Img/prefix/include/* /usr/local/Cellar/tcl-tk/8.6.4/include
cp -r Img/exec_prefix/lib/* /usr/local/Cellar/tcl-tk/8.6.4/lib

Add symlinks for tcl-tk

ln -s /usr/local/Cellar/tcl-tk/8.6.4/bin/tclsh8.6 /usr/local/bin/tclsh
ln -s /usr/local/Cellar/tcl-tk/8.6.4/bin/tclsh8.6 /usr/local/bin/tclsh8.6
ln -s /usr/local/Cellar/tcl-tk/8.6.4/bin/wish8.6 /usr/local/bin/wish
ln -s /usr/local/Cellar/tcl-tk/8.6.4/bin/wish8.6 /usr/local/bin/wish8.6

@eyan
Copy link

eyan commented May 2, 2016

@rraallvv: thank you! you just made my night.

@wavetossed
Copy link

Or using MacPorts https://www.macports.org/

sudo port install tk
cd ~/Downloads/drakon_editor1.27
tclsh8.6 drakon_editor.tcl

And it works!!!

@brossi
Copy link

brossi commented Oct 5, 2016

@rraallvv in the compile from source section of your Homebrew instructions there's a typo* on line 3. It should be:

./configure --prefix=/usr/local/Cellar/tcl-tk/8.6.4

Also, for anyone running this later, make sure you're referencing the correct Homebrew version of TCL-TK. As of October 5, 2016, it was 8.6.6. You will need to update the script accordingly.

* This could also be a case where my system configuration was different and both could work, depending on how you're set up. I don't have ./configure aliased to configure.

@rraallvv
Copy link
Author

rraallvv commented Oct 5, 2016

@brossi thanks.

@brossi
Copy link

brossi commented Oct 5, 2016

Troubleshooting help for those who come after me.

When OS X 10.11 (El Capitan) was introduced, Apple put in place a default security-oriented feature called System Integrity Protection. To prevent unauthorized tinkering by malicious apps, /System, /sbin, and /usr (with the exception of /usr/local) are locked down beyond the level accessible to a rooted (or sudo'd) user. In most cases it probably works in your favor, but when you're the one trying to do something on your Mac that the system considers malicious, it won't allow it by default.

make install-libraries is one of those operations.

NOTE: THE FOLLOWING COMMANDS WILL MODIFY IMPORTANT, SECURITY-RELATED SETTINGS ON YOUR MAC. ONLY TAKE THESE STEPS IF YOU ARE AWARE OF THE RISKS.

To temporarily configure your Mac to work around this conflict:

  1. Reboot the Mac and hold down Command + R keys simultaneously after you hear the startup chime, this will boot OS X into Recovery Mode

  2. When the OS X Utilities screen appears, pull down the ‘Utilities’ menu at the top of the screen instead, and choose Terminal

  3. Type the following command into the terminal then hit return:

    csrutil disable; reboot
    
  4. You may see a message saying that System Integrity Protection has been disabled and the Mac needs to restart for changes to take effect (or you may not -- I didn't see it), and the Mac will then reboot itself automatically, just let it boot up as normal

  5. After the reboot, from the terminal, run csrutil status to confirm that your changes have been invoked. The response should be System Integrity Protection status: disabled.

  6. Run the operation that gave us problems previously. Cheer when it works.

  7. After you're done, you'll probably want to re-enable System Integrity Protection. You will need to re-run the process to access the Recovery terminal window (Steps 1 and 2). From the terminal, run the command:

    csrutil enable; reboot
    
  8. After your Mac finishes booting up, you'll be back to where you were before you started.

@ghost
Copy link

ghost commented Oct 30, 2016

I tried all the above approaches in MacOS Sierra with no effect, I still get segmentation error.

@remy-actual
Copy link

@rraallvv's method got this working for me on El Cap.
Using tcl-tk 8.6.6 as @brossi notes.
Omitted the -r 374 flag from the svn command to use current version of tkimg (r410).
Drakon Editor now runs from the command line with tclsh drakon-editor.tcl 😃

@Serenacula
Copy link

Seconding mcevzar here. Even after everything, still getting the same segmentation fault in Mac.

@lelesrc
Copy link

lelesrc commented Mar 29, 2017

Thanks @rraallvv!

This procedure works on osx sierra (10.12) (just some slight changes):

Install homebrew.

Install the package tcl-tk from homebrew:

brew install homebrew/dupes/tcl-tk
important: this will install the latest version of tcl-tk: check your actual install dir right after the installation and take note of the version and the install path (from now on, it will be <TCL_VERSION>). YMMV.

Install tkimg (current version worked for me):

svn checkout  https://svn.code.sf.net/p/tkimg/code/trunk
cd trunk
./configure --prefix=/usr/local/Cellar/tcl-tk/<TCL_VERSION>
make collate
make install-libraries
cp Img/prefix/include/* /usr/local/Cellar/tcl-tk/<TCL_VERSION>/include
cp -r Img/exec_prefix/lib/* /usr/local/Cellar/tcl-tk/<TCL_VERSION>/lib

Add symlinks for tcl-tk:

ln -s /usr/local/Cellar/tcl-tk/<TCL_VERSION>/bin/tclsh8.6 /usr/local/bin/tclsh
ln -s /usr/local/Cellar/tcl-tk/<TCL_VERSION>/bin/tclsh8.6 /usr/local/bin/tclsh8.6
ln -s /usr/local/Cellar/tcl-tk/<TCL_VERSION>/bin/wish8.6 /usr/local/bin/wish
ln -s /usr/local/Cellar/tcl-tk/<TCL_VERSION>/bin/wish8.6 /usr/local/bin/wish8.6

start drakon editor with:

tclsh drakon_editor.tcl

no need for csrutil disable command for me.

@ghost
Copy link

ghost commented Jul 8, 2017

I followed the steps then used: "tclsh drakon_editor.tcl"
I still get an error message: "can't find package snit This script requires snit package. Consider installing tcllib"

I do have a folder containing "tcllib-1.18" How do I go about installing it? Is is even the one to install? Please help

@FlorianHeigl
Copy link

Substituted 8.6.7 for 8.6.4 and finally got it starting!

@vlsi
Copy link

vlsi commented Sep 15, 2017

Just in case, https://github.com/waddella/tkimg.git works for me (see #18 (comment))

@torjevski
Copy link

torjevski commented Dec 25, 2017

hello, @youleaf, can you explain some details please? Where is the folder with drakon_editor1.2* on ur mac? From which folder u executed all commands? Can u please share version of tcl-tk which u are using in present?
I'm using tcl-tk8.6.7
Executing all commands from main DRAKON folder, where drakon_editor.tcl file is, except commands after 'cd trunk'.
still have segmentation fault 11 | MacOS Sierra 10.12.6

I tried everything, disabling System Integrity Protection wasn't successful(after disabling and rebooting SIP-status is still enable), but I still hope that I've done things wrong and it's possible to run DRAKON on my mac someway.

I will be so glad for ur respond!

@torjevski
Copy link

guys, finally it works!!! all that i needed is Tcl reinstallation after OS upgrade.
link to fresh version for people like me: http://drakon-editor.sourceforge.net/editor.html#downloads

@JayBusch
Copy link

This seems to be an issue again in Mojave 10.14.2

#33

@LucianU
Copy link

LucianU commented Jan 28, 2019

I can confirm that I get a segmentation fault when trying to open the editor in Mojave.

@josephfelixbamba
Copy link

Hi, was anyone successful Installing on Mojave please? Thanks in advance

@larkin
Copy link

larkin commented Jun 20, 2019

I have this working on mojave, Here's what I did:

install-tcl-tk.sh

#!/bin/sh
# installs tcl-tk and link to homebrew bin folder.  This should support any tcl 
# version and will also handle custom homebrew prefixes.

brew install tcl-tk

BREW_PREFIX=$(brew --prefix)
TCL_TK_PREFIX=$(brew --prefix tcl-tk)
TCL_TK_TCLSH=$(readlink $TCL_TK_PREFIX/bin/tclsh)
TCL_TK_WISH=$(readlink $TCL_TK_PREFIX/bin/wish)

ln -s "$TCL_TK_PREFIX/bin/tclsh" "$BREW_PREFIX/bin/tclsh"
ln -s "$TCL_TK_PREFIX/bin/$TCL_TK_TCLSH" "$BREW_PREFIX/bin/$TCL_TK_TCLSH"
ln -s "$TCL_TK_PREFIX/bin/wish" "$BREW_PREFIX/bin/wish"
ln -s "$TCL_TK_PREFIX/bin/$TCL_TK_WISH" "$BREW_PREFIX/bin/$TCL_TK_WISH"

And then, for installing tkimg I ran these commands manually:

svn checkout  https://svn.code.sf.net/p/tkimg/code/trunk
cd trunk
./configure --prefix=$(brew --prefix tcl-tk)
make collate
make install-libraries
cp Img/prefix/include/* $(brew --prefix tcl-tk)/include
cp -r Img/exec_prefix/lib/* $(brew --prefix tcl-tk)/lib

@ylluminate
Copy link

Thank you @larkin! a MacPorts version of these instructions would also be very useful to have here since many are moving away from Homebrew. @ylluminarious you might want to chime in on this as I'm sure you've fiddled with this before.

@ylluminarious
Copy link
Contributor

@ylluminate For the most recent version of Drakon Editor, all I have to do to get it working with MacPorts is the following:

$ cd /path/to/drakon_editor1.31
$ sudo port install tk +x11
$ sudo port install tkimg
$ sudo port install sqlite3-tcl
$ ./drakon_editor.tcl

The above commands can be condensed into a one-liner (especially the port install commands), but I separated it out into multiple lines for clarity's sake.

@ylluminate
Copy link

@ylluminarious is this working without the crash from going into Global Settings?

@ylluminarious
Copy link
Contributor

@ylluminate Yes, I can go into Global Settings just fine with this setup. The only caveat is that DRAKON runs as an XQuartz application this way. It is not integrated into the native macOS GUI. However, this is a good thing in my opinion, as I have run DRAKON via the native GUI before and it causes many issues.

The only problem I am seeing with this setup is that some buttons are in Russian rather than English, such as the buttons under Export to PNG.... But perhaps this can be fixed through some kind of configuration option?

@shaunweg
Copy link

shaunweg commented Nov 6, 2019

Tried doing it with MacPorts for Mojave. Getting an error that it can't find package snit on ./drakon_editor.tcl

@wavetossed
Copy link

wavetossed commented Nov 6, 2019 via email

@ylluminarious
Copy link
Contributor

@shaunweg Yes, I'd suggest trying to install tcllib. I forgot to include it in my original instructions. Simply run: sudo port install tcllib

@lelesrc
Copy link

lelesrc commented Feb 11, 2020

For everyone trying to install on osx Catalina: @larkin procedure works perfectly on 10.15.3.

Thank you @larkin!

@rraallvv rraallvv changed the title What versions of tclsh and sqlite3 should I use to run DRAKONEditor.app on OS X El Capitan? What versions of tclsh and sqlite3 should I use to run DRAKONEditor.app on macOS? Feb 12, 2020
@kalyiba
Copy link

kalyiba commented Mar 19, 2020

Well, it didn't work for me, March 2020:

~ brew install tcl-tk
Warning: tcl-tk 8.6.10 is already installed and up-to-date
~ BREW_PREFIX=$(brew --prefix)
~ TCL_TK_PREFIX=$(brew --prefix tcl-tk)
~ TCL_TK_TCLSH=$(readlink $TCL_TK_PREFIX/bin/tclsh)
~ TCL_TK_WISH=$(readlink $TCL_TK_PREFIX/bin/wish)
~ ln -s "$TCL_TK_PREFIX/bin/tclsh" "$BREW_PREFIX/bin/tclsh"
ln: /usr/local/bin/tclsh: File exists
~ ln -s "$TCL_TK_PREFIX/bin/$TCL_TK_TCLSH" "$BREW_PREFIX/bin/$TCL_TK_TCLSH"
ln: /usr/local/bin/tclsh8.6: File exists
~ ln -s "$TCL_TK_PREFIX/bin/wish" "$BREW_PREFIX/bin/wish"
ln: /usr/local/bin/wish: File exists
~ ln -s "$TCL_TK_PREFIX/bin/$TCL_TK_WISH" "$BREW_PREFIX/bin/$TCL_TK_WISH"
ln: /usr/local/bin/wish8.6: File exists
~ svn checkout https://svn.code.sf.net/p/tkimg/code/trunk
Checked out revision 465.
~ cd trunk
~/trunk ./configure --prefix=$(brew --prefix tcl-tk)
…… lots of checking and configuring here ……
checking TEA configuration... ok (TEA 3.13)
configure: loading cache ../config.cache
……
checking TEA configuration... ok (TEA 3.13)
config.status: creating Makefile
……
~/trunk make collate
…… lots of installing and configuring here ……
make[1]: Nothing to be done for all'. Installing header files in /Users/xxx/trunk/Img/prefix/include done …… ~/trunk _**make install-libraries**_ make[1]: Nothing to be done for all'.
Installing header files in /Users/xxx/trunk/Img/prefix/include

~/trunk cp Img/prefix/include/ $(brew --prefix tcl-tk)/include
~/trunk cp -r Img/exec_prefix/lib/ $(brew --prefix tcl-tk)/lib

everything seemed okay, so then I used:
./drakon_editor.tcl
and got:
[1] 47709 segmentation fault ./drakon_editor.tcl

Catalina 10.15.3 (19D76), 3 GHz 6-Core i5, 8 GB DDR4

Sanyi

@lelesrc
Copy link

lelesrc commented Mar 20, 2020

@kalyiba: seems you skipped make install-libraries. Did you?

I run the procedure on a brand new mac (10.15.3) successfully; from your report it seems that you could have some leftovers from previous installations; try cleaning up everything (tcl bins and libs in particular) before giving another try.

good luck!

@kalyiba
Copy link

kalyiba commented Mar 20, 2020

@youleaf: Thank you for prompt response.
Well, I did that step too. It's just that I edited the many pages of verbosity out by hand and didn't notice that one line got left dangling at the end: the "~/trunk make install-libraries " one.
But that still leaves me with a nagging question. How should I proceed?
Okay, I should clean up. But before charging ahead like a knucklehead and mess things up, could you give me some pointers on how to do that?
Thanks a ton

@lelesrc
Copy link

lelesrc commented Mar 21, 2020

@kalyiba: it depends on what you did before the procedure you pasted, so I can't tell you a clean way to solve this; my suggestion is to use the find command on your filesystem, looking for files named "tcl" "tk" to see where they are installed and do a manual cleanup. This is quite dirty and time-consuming, I know, but I don't have a better suggestion.
Another way, if you are in hurry, is to use a linux virtual machine for this purpose.

@brooksg44
Copy link

trying to run dragon editor on M3 Mac. Gotten everything to almost work except when I open c_demo.drn I get errors. See attached c_demo.log for capture. The icons don't show up on the left window.
c_demo.log

Fill like I am so close. Any help would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests