Library location

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Library location

Post by SHughes_Fusion » Wed Sep 16, 2015 1:39 pm

Can someone please remind me how to change the location of the libraries Swordfish uses? Both default and user libraries.

I've recently found that our network is basically crippling the compiler - something that takes 75 seconds to compile using the standard setup takes less than 8 seconds if I move everything in to a directory on my hard drive, rather than the networked My Documents.

I'm told this is because file reads over the network do not use look-ahead caching and presumably Swordfish will be doing lots of reads and writes to these files which will be the cause of the slow-down.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Library location

Post by Jerry Messina » Wed Sep 16, 2015 2:32 pm

The thread here talks about how to relocate folders and using symbolic links to redirect everything. Is that what you're looking for?

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: Library location

Post by SHughes_Fusion » Wed Sep 16, 2015 2:43 pm

It looks like that doesn't work for me as the My Documents folder is already a symbolic link to a network location...

Now I think about it I remember that David was very unwilling to make this change for some reason so it looks like I'm stuck with excessively long compile times....

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Library location

Post by Jerry Messina » Wed Sep 16, 2015 3:06 pm

Can't you set up another link to just redirect the <users>/Documents/Swordfish directory?
ie mklink /D "C:\Users\Jerry\Documents\Swordfish" "D:\Swordfish"

I don't know if that works or not since "Documents" is already redirected, but worth a shot

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: Library location

Post by SHughes_Fusion » Wed Sep 16, 2015 3:13 pm

I tried that but no joy. I can't actually work out where I should be redirecting to. If I use 'Users\shughes\My Documents\Swordfish' it creates a link but in the wrong place. I try 'Documents' or 'Libraries/Documents' I get a 'no such location' (or similar) error message.

If I navigate to the folder containing Swordfish and the link I get is of the form \\xxxx.yyyyyyyyy.net\Home\shughes\My Documents\Swordfish but when I try to link to that I get an 'Access denied' error.

Personally, I'm surprised that networked drives don't have any form of local caching but I'm told by our IT department there is nothing they can do and I should move the files to a local folder to avoid the access penalty.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Library location

Post by Jerry Messina » Wed Sep 16, 2015 3:26 pm

'Users\shughes\My Documents\Swordfish
That's not right, is it? I'm no expert on this but there's never a real "My Documents" folder... it's a folder under the user name & a symbolic link (or so I thought).

On my system when I did the install I got the following "My Documents" folders:

C:\Users\Jerry\Documents\Swordfish
Samples
UserLibrary

I copied and deleted them, and used mklink to redirect the folders elsewhere.

I don't know if that works if "My Documents" is already pointing somewhere else.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Library location

Post by Jerry Messina » Wed Sep 16, 2015 3:30 pm

Maybe the Junction Link Magic utility would be of some use to sort out what's being mapped where: http://www.rekenwonder.com/linkmagic.htm

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: Library location

Post by SHughes_Fusion » Wed Sep 16, 2015 3:38 pm

I've got a C:\Users\shughes\Documents folder but it doesn't seem to map to My Documents. When I did the link to My Documents it created the Swordfish folder in this directory. (I'm getting confused as to why but believe me that is what happened!) However, it doesn't appear when I navigate to Documents from the start menu.

I'm running Junction Link Magic now to see if I get anywhere.... I think the problem may be that when I do a 'copy location' in the title bar of the explorer windows for my Documents folder it does point to that network address and I can't link to that as access is denied.

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: Library location

Post by SHughes_Fusion » Wed Sep 16, 2015 3:44 pm

What links do I need to be looking for? The only ones I can find appear to be local, not networked links or junctions.

I've got junction points for:
C:\Users\shughes\My Documents which points to C:\Users\shughes\Documents
C:\Documents and Settings points to C:\Users

Also Users\Admin and Users\Default as for shughes.

Nothing else seems relevant...

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Library location

Post by Jerry Messina » Wed Sep 16, 2015 4:51 pm

It might be easier to play around with installing the SwordfishSE version. That way you can see how things are arranged and move them around without screwing up your Swordfish installation.

****DISCLAIMER****
I am NOT recommending anyone set their system up this way. This works for me, and it's the way I like it.
If you try it and screw things up, it's on you. There, you've been warned. Caveat Emptor.
**********************

I HATE the way windows scatters things around all over the place. I use multiple machines and it's just a pain trying to keep them in sync, so I rearrange everything. Also, I don't normally install things into the default 'Program Files' or 'Program Files(x86)' directories. For me, that helps with some UAC issues.

Here's what I did when I installed SwordfishSE into 'D:\Programs\SwordfishSE' (Installing it to the default 'Program files' dir will get you a different structure)

Code: Select all

for SE version (the same applies to standard version, except change SwordfishSE to Swordfish)

program install directory:
	D:\Programs\SwordfishSE

created the following structure:
	D:\Programs\SwordfishSE
		Bin
		Help
		MCLoader
		MPLAB
		Plugin

	C:\ProgramData\Mecanique\SwordfishSE
		Includes
		Library
		Plugin
		Samples
		UserLibrary

	C:\Users\Jerry\Documents\SwordfishSE
		Samples
		UserLibrary

	C:\Users\Jerry\AppData\Roaming\Mecanique\SwordfishSE
		Plugin

To move everything to the drive D install directory:
- move all directories from C:\ProgramData\Mecanique\SwordfishSE to D:\Programs\SwordfishSE
- delete   C:\ProgramData\Mecanique\SwordfishSE
- delete   C:\Users\Jerry\Documents\SwordfishSE (appears in explorer under "My Documents")
- delete   C:\Users\Jerry\AppData\Roaming\Mecanique\SwordfishSE\Plugin

make symbolic links to the new locations:
mklink /D "C:\ProgramData\Mecanique\SwordfishSE" "D:\Programs\SwordfishSE"
mklink /D "C:\Users\Jerry\Documents\SwordfishSE" "D:\Programs\SwordfishSE"
mklink /D "C:\Users\Jerry\AppData\Roaming\Mecanique\SwordfishSE\Plugin" "D:\Programs\SwordfishSE\Plugin"

you will see shortcuts to SwordfishSE under the old locations
That put everything under the folder 'D:\Programs\SwordfishSE'

Post Reply