{"action":"created","issue":{"url":"https://api.github.com/repos/Macaulay2/M2/issues/247","labels_url":"https://api.github.com/repos/Macaulay2/M2/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/Macaulay2/M2/issues/247/comments","events_url":"https://api.github.com/repos/Macaulay2/M2/issues/247/events","html_url":"https://github.com/Macaulay2/M2/issues/247","id":78760466,"number":247,"title":"separate run script in environment-setting and M2-binary call:","user":{"login":"jakobkroeker","id":2487128,"avatar_url":"https://avatars.githubusercontent.com/u/2487128?v=3","gravatar_id":"","url":"https://api.github.com/users/jakobkroeker","html_url":"https://github.com/jakobkroeker","followers_url":"https://api.github.com/users/jakobkroeker/followers","following_url":"https://api.github.com/users/jakobkroeker/following{/other_user}","gists_url":"https://api.github.com/users/jakobkroeker/gists{/gist_id}","starred_url":"https://api.github.com/users/jakobkroeker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakobkroeker/subscriptions","organizations_url":"https://api.github.com/users/jakobkroeker/orgs","repos_url":"https://api.github.com/users/jakobkroeker/repos","events_url":"https://api.github.com/users/jakobkroeker/events{/privacy}","received_events_url":"https://api.github.com/users/jakobkroeker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-05-21T00:37:31Z","updated_at":"2015-07-24T18:09:01Z","closed_at":null,"body":"prurpose: set environment without starting M2 (e.g. to check linked libraries with 'ldd')\r\n\r\npossible solution:\r\nfile 'M2':\r\n```\r\nexec /run/media/jakob/TOEXT4/work/home_fc18/Projects/M2-master/M2/BUILD/dan/builds.tmp/fedora32/usr-dist/i686-Linux-Fedora-18/bin/M2.run \"$@\"\r\n```\r\nfile 'M2.sh'\r\n```\r\ncd /run/media/jakob/TOEXT4/work/home_fc18/Projects/M2-master/M2/BUILD/dan/builds.tmp/fedora32/usr-dist/i686-Linux-Fedora-18/bin/ \r\n. M2.sh `pwd`\r\nexec bash\r\n```\r\nfile 'usr-dist/i686-Linux-Fedora-18/bin/M2.run':\r\n```\r\n#! /bin/sh\r\n# We assume that @ pre_bindir @/.. is ${pre_exec_prefix} (see configure.ac)\r\n. `dirname \"$0\"`/M2.sh `dirname \"$0\"`\r\nexec `dirname \"$0\"`/M2-binary \"$@\"\r\n# Local Variables:\r\n# compile-command: \"make -C $M2BUILDDIR/Macaulay2/bin M2 \"\r\n# End:\r\n```\r\nfile  'usr-dist/i686-Linux-Fedora-18/bin/M2.sh':\r\n```\r\n#! /bin/sh\r\n# We assume that @ pre_bindir @/.. is ${pre_exec_prefix} (see configure.ac)\r\ncase \"linux-gnu\" in\r\n   cygwin) export PATH=$1/../lib/Macaulay2/i686-Linux-Fedora-18/lib:$PATH ;;\r\n  darwin*) # Mac OS X:\r\n           export DYLD_LIBRARY_PATH=$1/../lib/Macaulay2/i686-Linux-Fedora-18/lib:$DYLD_LIBRARY_PATH ;;\r\n        *) export   LD_LIBRARY_PATH=$1/../lib/Macaulay2/i686-Linux-Fedora-18/lib:$LD_LIBRARY_PATH ;;\r\nesac\r\n```"},"comment":{"url":"https://api.github.com/repos/Macaulay2/M2/issues/comments/124603188","html_url":"https://github.com/Macaulay2/M2/issues/247#issuecomment-124603188","issue_url":"https://api.github.com/repos/Macaulay2/M2/issues/247","id":124603188,"user":{"login":"jakobkroeker","id":2487128,"avatar_url":"https://avatars.githubusercontent.com/u/2487128?v=3","gravatar_id":"","url":"https://api.github.com/users/jakobkroeker","html_url":"https://github.com/jakobkroeker","followers_url":"https://api.github.com/users/jakobkroeker/followers","following_url":"https://api.github.com/users/jakobkroeker/following{/other_user}","gists_url":"https://api.github.com/users/jakobkroeker/gists{/gist_id}","starred_url":"https://api.github.com/users/jakobkroeker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakobkroeker/subscriptions","organizations_url":"https://api.github.com/users/jakobkroeker/orgs","repos_url":"https://api.github.com/users/jakobkroeker/repos","events_url":"https://api.github.com/users/jakobkroeker/events{/privacy}","received_events_url":"https://api.github.com/users/jakobkroeker/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T18:09:00Z","updated_at":"2015-07-24T18:09:00Z","body":"> that a symbolic link to M2 from another directory will work just as well\r\n\r\ndoes this work for recent Macaulay2?\r\n\r\na fragile approach using `readlink` may work for symbolic links, too:\r\nhttps://github.com/Macaulay2/M2/compare/master...jakobkroeker:separating.adjustEnv.and.runM2\r\nPleas take a look and comment. Thanks!\r\n\r\nCaveat:\r\nthe design is overcompicated by trying to avoid duplicate code:\r\nthe various additional `M2_setenv_tail` `M2_common_setenv_bin` `M2_tail` files \r\nare there only for that purpose.\r\n\r\nmaybe you have a better suggestion how to avoid code duplication?\r\n\r\n\r\n\r\n\r\n"}}